Skip to content
This repository
Browse code

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.
  • Loading branch information...
commit 1acdecf6234b6a8d6dc01d1ada1b8e153c7c60fb 1 parent 54e522a
Vijay Dev authored December 25, 2011
6  railties/guides/rails_guides/generator.rb
@@ -49,8 +49,8 @@
49 49
 #
50 50
 #   KINDLE
51 51
 #     Set to "1" to generate the .mobi with all the guides. The kindlegen
52  
-#     executable must be in your PATH. Google for it if you do not have it
53  
-#     locally, it is available from Amazon for free.
  52
+#     executable must be in your PATH. You can get it for free from
  53
+#     http://www.amazon.com/kindlepublishing
54 54
 #
55 55
 # ---------------------------------------------------------------------------
56 56
 
@@ -199,7 +199,7 @@ def generate_guide(guide, output_file)
199 199
       layout = kindle? ? 'kindle/layout' : 'layout'
200 200
 
201 201
       File.open(output_path, 'w') do |f|
202  
-        view = ActionView::Base.new(source_dir, :version => @version, :mobi => "kindle/#{mobi}")
  202
+        view = ActionView::Base.new(source_dir, :edge => @edge, :version => @version, :mobi => "kindle/#{mobi}")
203 203
         view.extend(Helpers)
204 204
 
205 205
         if guide =~ /\.(\w+)\.erb$/
14  railties/guides/source/_welcome.html.erb
... ...
@@ -1,21 +1,19 @@
1  
-<h2>Ruby on Rails Guides (<%= @version %>)</h2>
  1
+<h2>Ruby on Rails Guides</h2>
2 2
 
3 3
 <% if @edge %>
4 4
 <p>
5  
-  These are <b>Edge Guides</b>, based on the current
6  
-  <a href="https://github.com/rails/rails/tree/master">master branch</a>.
  5
+  These are <b>Edge Guides</b>, based on the current <a href="https://github.com/rails/rails/tree/<%= @version %>">master</a> branch.
7 6
 </p>
8 7
 <p>
9  
-  If you are looking for the ones for the stable version please check
  8
+  If you are looking for the ones for the stable version, please check
10 9
   <a href="http://guides.rubyonrails.org">http://guides.rubyonrails.org</a> instead.
11 10
 </p>
12 11
 <% else %>
13 12
 <p>
14  
-  These are the new guides for Rails 3. The guides for Rails 2.3 are still available
15  
-  at <a href="http://guides.rubyonrails.org/v2.3.11/">http://guides.rubyonrails.org/v2.3.11/</a>.
  13
+  These are the new guides for Rails 3.1 based on <a href="https://github.com/rails/rails/tree/<%= @version %>"><%= @version %></a>.
  14
+  These guides are designed to make you immediately productive with Rails, and to help you understand how all of the pieces fit together.
16 15
 </p>
17 16
 <% end %>
18 17
 <p>
19  
-  These guides are designed to make you immediately productive with Rails,
20  
-  and to help you understand how all of the pieces fit together.
  18
+  The guides for Rails 2.3.x are available at <a href="http://guides.rubyonrails.org/v2.3.11/">http://guides.rubyonrails.org/v2.3.11/</a>.
21 19
 </p>

1 note on commit 1acdecf

Xavier Noria
Owner

Thanks!

Vijay Dev

Edge was already having a link to GH master tree: "based on the current master". Added a similar text to the stable version too (Line 13 below) and added a link there. For the sake of being consistent.

Xavier Noria

Ahh, yeah the wording is better, but I think it is good no see the exact version you are looking at in the very title. It's what we have in the stable version now. And with edge we had (edge) before these commits and I changed it to the short sha1 of HEAD to know exactly what are you looking at.

In the case of stable versions it also helps to know what you are looking at when looking at a past release via symlink.

Guides dor Kindle also have the version in the title and file name.

Vijay Dev

Alright, I'll add it back.

Please sign in to comment.
Something went wrong with that request. Please try again.