From 1acdecf6234b6a8d6dc01d1ada1b8e153c7c60fb Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Sun, 25 Dec 2011 20:42:20 +0530 Subject: Some fixes in rails guides generation * Passing edge information to the views fixes the lack of the edge badge and sets the appropriate welcome page on edgeguides.rubyonrails.org. * Changes in the welcome message to hyper link the rails tree based on the version. * Mention the Amazon url from where kindlegen can be downloaded. --- railties/guides/rails_guides/generator.rb | 6 +++--- railties/guides/source/_welcome.html.erb | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/railties/guides/rails_guides/generator.rb b/railties/guides/rails_guides/generator.rb index b5f1a471ef..49ad8f7769 100644 --- a/railties/guides/rails_guides/generator.rb +++ b/railties/guides/rails_guides/generator.rb @@ -49,8 +49,8 @@ # # KINDLE # Set to "1" to generate the .mobi with all the guides. The kindlegen -# executable must be in your PATH. Google for it if you do not have it -# locally, it is available from Amazon for free. +# executable must be in your PATH. You can get it for free from +# http://www.amazon.com/kindlepublishing # # --------------------------------------------------------------------------- @@ -199,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, :mobi => "kindle/#{mobi}") + view = ActionView::Base.new(source_dir, :edge => @edge, :version => @version, :mobi => "kindle/#{mobi}") view.extend(Helpers) if guide =~ /\.(\w+)\.erb$/ diff --git a/railties/guides/source/_welcome.html.erb b/railties/guides/source/_welcome.html.erb index a5ceeee5f2..e5373ebca0 100644 --- a/railties/guides/source/_welcome.html.erb +++ b/railties/guides/source/_welcome.html.erb @@ -1,21 +1,19 @@ -

Ruby on Rails Guides (<%= @version %>)

+

Ruby on Rails Guides

<% if @edge %>

- These are Edge Guides, based on the current - master branch. + These are Edge Guides, based on the current master branch.

- If you are looking for the ones for the stable version please check + If you are looking for the ones for the stable version, please check http://guides.rubyonrails.org instead.

<% else %>

- These are the new guides for Rails 3. The guides for Rails 2.3 are still available - at http://guides.rubyonrails.org/v2.3.11/. + These are the new guides for Rails 3.1 based on <%= @version %>. + These guides are designed to make you immediately productive with Rails, and to help you understand how all of the pieces fit together.

<% end %>

- These guides are designed to make you immediately productive with Rails, - and to help you understand how all of the pieces fit together. + The guides for Rails 2.3.x are available at http://guides.rubyonrails.org/v2.3.11/.

-- cgit v1.2.3