aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/rails_guides/generator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/guides/rails_guides/generator.rb')
-rw-r--r--railties/guides/rails_guides/generator.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/railties/guides/rails_guides/generator.rb b/railties/guides/rails_guides/generator.rb
index 71b3240585..b5f1a471ef 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$/