#!/usr/bin/env ruby

begin
  require 'redcloth'
  directory "html"

  desc "Display the README file"
  task :readme => "html/README.html" do
    sh "open html/README.html"
  end

  desc "format the README file"
  task "html/README.html" => ['html', 'README.textile'] do
    open("README.textile") do |source|
      open('html/README.html', 'w') do |out|
        out.write(RedCloth.new(source.read).to_html)
      end
    end
  end
rescue LoadError => ex
  task :readme do
    fail "Install RedCloth to generate the README"
  end
end


#!/usr/bin/env ruby

require 'redcloth'

directory "html"

desc "Display the README file"
task :readme => "html/README.html" do
  sh "open html/README.html"
end

desc "format the README file"
task "html/README.html" => ['html', 'README.textile'] do
  open("README.textile") do |source|
    open('html/README.html', 'w') do |out|
      out.write(RedCloth.new(source.read).to_html)
    end
  end
end

--- 
+++ 
@@ -1,19 +1,25 @@
 #!/usr/bin/env ruby
 
-require 'redcloth'
+begin
+  require 'redcloth'
+  directory "html"
 
-directory "html"
+  desc "Display the README file"
+  task :readme => "html/README.html" do
+    sh "open html/README.html"
+  end
 
-desc "Display the README file"
-task :readme => "html/README.html" do
-  sh "open html/README.html"
+  desc "format the README file"
+  task "html/README.html" => ['html', 'README.textile'] do
+    open("README.textile") do |source|
+      open('html/README.html', 'w') do |out|
+        out.write(RedCloth.new(source.read).to_html)
+      end
+    end
+  end
+rescue LoadError => ex
+  task :readme do
+    fail "Install RedCloth to generate the README"
+  end
 end
 
-desc "format the README file"
-task "html/README.html" => ['html', 'README.textile'] do
-  open("README.textile") do |source|
-    open('html/README.html', 'w') do |out|
-      out.write(RedCloth.new(source.read).to_html)
-    end
-  end
-end
Allow rakefile to run w/o RedCloth.

Only complain about missing redcloth if we try to run the readme task.
