diff options
author | Xavier Noria <fxn@hashref.com> | 2011-12-25 04:07:49 -0800 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-12-25 04:10:21 -0800 |
commit | d6d561eed9d31e757650bd1440350dd8f892aeda (patch) | |
tree | ca74ce44ce395e1ef9dbd5360635a743b9cd1d89 /railties/guides/rails_guides | |
parent | 4ae1cdd36be6ad2998da2bb58aebba2ed77e853d (diff) | |
download | rails-d6d561eed9d31e757650bd1440350dd8f892aeda.tar.gz rails-d6d561eed9d31e757650bd1440350dd8f892aeda.tar.bz2 rails-d6d561eed9d31e757650bd1440350dd8f892aeda.zip |
download guides for the Kindle and Kindle apps from the home page
Diffstat (limited to 'railties/guides/rails_guides')
-rw-r--r-- | railties/guides/rails_guides/generator.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/railties/guides/rails_guides/generator.rb b/railties/guides/rails_guides/generator.rb index f138a58f16..71c1c49b23 100644 --- a/railties/guides/rails_guides/generator.rb +++ b/railties/guides/rails_guides/generator.rb @@ -117,15 +117,18 @@ module RailsGuides end def generate_mobi - opf = "#{output_dir}/rails_guides.opf" - mobi = "ruby_on_rails_guides_#@version%s.mobi" % (@lang.present? ? ".#@lang" : '') - out = "#{output_dir}/kindlegen.out" + opf = "#{output_dir}/rails_guides.opf" + out = "#{output_dir}/kindlegen.out" system "kindlegen #{opf} -o #{mobi} > #{out} 2>&1" puts "Guides compiled as Kindle book to #{mobi}" puts "(kindlegen log at #{out})." end + def mobi + "ruby_on_rails_guides_#@version%s.mobi" % (@lang.present? ? ".#@lang" : '') + end + def initialize_dirs(output) @guides_dir = File.join(File.dirname(__FILE__), '..') @source_dir = "#@guides_dir/source/#@lang" @@ -196,7 +199,7 @@ module RailsGuides layout = kindle? ? 'kindle/layout' : 'layout' File.open(output_path, 'w') do |f| - view = ActionView::Base.new(source_dir, :version => @version) + view = ActionView::Base.new(source_dir, :version => @version, :mobi => "kindle/#{mobi}") view.extend(Helpers) if guide =~ /\.(\w+)\.erb$/ |