aboutsummaryrefslogtreecommitdiffstats
path: root/guides/rails_guides/kindle.rb
diff options
context:
space:
mode:
Diffstat (limited to 'guides/rails_guides/kindle.rb')
-rw-r--r--guides/rails_guides/kindle.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/guides/rails_guides/kindle.rb b/guides/rails_guides/kindle.rb
index 4b73ae9518..9536d0bd3b 100644
--- a/guides/rails_guides/kindle.rb
+++ b/guides/rails_guides/kindle.rb
@@ -1,9 +1,6 @@
#!/usr/bin/env ruby
-unless `which kindlerb`
- abort "Please gem install kindlerb"
-end
-
+require "kindlerb"
require "nokogiri"
require "fileutils"
require "yaml"
@@ -28,10 +25,9 @@ module Kindle
generate_document_metadata(mobi_outfile)
puts "Creating MOBI document with kindlegen. This may take a while."
- cmd = "kindlerb . > #{File.absolute_path logfile} 2>&1"
- puts cmd
- system(cmd)
- puts "MOBI document generated at #{File.expand_path(mobi_outfile, output_dir)}"
+ if Kindlerb.run(output_dir)
+ puts "MOBI document generated at #{File.expand_path(mobi_outfile, output_dir)}"
+ end
end
end