rails_test 4.2.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +83 -0
- data/guides/CHANGELOG.md +27 -0
- data/guides/Rakefile +77 -0
- data/guides/assets/images/akshaysurve.jpg +0 -0
- data/guides/assets/images/belongs_to.png +0 -0
- data/guides/assets/images/book_icon.gif +0 -0
- data/guides/assets/images/bullet.gif +0 -0
- data/guides/assets/images/chapters_icon.gif +0 -0
- data/guides/assets/images/check_bullet.gif +0 -0
- data/guides/assets/images/credits_pic_blank.gif +0 -0
- data/guides/assets/images/csrf.png +0 -0
- data/guides/assets/images/edge_badge.png +0 -0
- data/guides/assets/images/favicon.ico +0 -0
- data/guides/assets/images/feature_tile.gif +0 -0
- data/guides/assets/images/footer_tile.gif +0 -0
- data/guides/assets/images/fxn.png +0 -0
- data/guides/assets/images/getting_started/article_with_comments.png +0 -0
- data/guides/assets/images/getting_started/challenge.png +0 -0
- data/guides/assets/images/getting_started/confirm_dialog.png +0 -0
- data/guides/assets/images/getting_started/forbidden_attributes_for_new_article.png +0 -0
- data/guides/assets/images/getting_started/form_with_errors.png +0 -0
- data/guides/assets/images/getting_started/index_action_with_edit_link.png +0 -0
- data/guides/assets/images/getting_started/new_article.png +0 -0
- data/guides/assets/images/getting_started/rails_welcome.png +0 -0
- data/guides/assets/images/getting_started/routing_error_no_controller.png +0 -0
- data/guides/assets/images/getting_started/routing_error_no_route_matches.png +0 -0
- data/guides/assets/images/getting_started/show_action_for_articles.png +0 -0
- data/guides/assets/images/getting_started/template_is_missing_articles_new.png +0 -0
- data/guides/assets/images/getting_started/unknown_action_create_for_articles.png +0 -0
- data/guides/assets/images/getting_started/unknown_action_new_for_articles.png +0 -0
- data/guides/assets/images/grey_bullet.gif +0 -0
- data/guides/assets/images/habtm.png +0 -0
- data/guides/assets/images/has_many.png +0 -0
- data/guides/assets/images/has_many_through.png +0 -0
- data/guides/assets/images/has_one.png +0 -0
- data/guides/assets/images/has_one_through.png +0 -0
- data/guides/assets/images/header_backdrop.png +0 -0
- data/guides/assets/images/header_tile.gif +0 -0
- data/guides/assets/images/i18n/demo_html_safe.png +0 -0
- data/guides/assets/images/i18n/demo_localized_pirate.png +0 -0
- data/guides/assets/images/i18n/demo_translated_en.png +0 -0
- data/guides/assets/images/i18n/demo_translated_pirate.png +0 -0
- data/guides/assets/images/i18n/demo_translation_missing.png +0 -0
- data/guides/assets/images/i18n/demo_untranslated.png +0 -0
- data/guides/assets/images/icons/README +5 -0
- data/guides/assets/images/icons/callouts/1.png +0 -0
- data/guides/assets/images/icons/callouts/10.png +0 -0
- data/guides/assets/images/icons/callouts/11.png +0 -0
- data/guides/assets/images/icons/callouts/12.png +0 -0
- data/guides/assets/images/icons/callouts/13.png +0 -0
- data/guides/assets/images/icons/callouts/14.png +0 -0
- data/guides/assets/images/icons/callouts/15.png +0 -0
- data/guides/assets/images/icons/callouts/2.png +0 -0
- data/guides/assets/images/icons/callouts/3.png +0 -0
- data/guides/assets/images/icons/callouts/4.png +0 -0
- data/guides/assets/images/icons/callouts/5.png +0 -0
- data/guides/assets/images/icons/callouts/6.png +0 -0
- data/guides/assets/images/icons/callouts/7.png +0 -0
- data/guides/assets/images/icons/callouts/8.png +0 -0
- data/guides/assets/images/icons/callouts/9.png +0 -0
- data/guides/assets/images/icons/caution.png +0 -0
- data/guides/assets/images/icons/example.png +0 -0
- data/guides/assets/images/icons/home.png +0 -0
- data/guides/assets/images/icons/important.png +0 -0
- data/guides/assets/images/icons/next.png +0 -0
- data/guides/assets/images/icons/note.png +0 -0
- data/guides/assets/images/icons/prev.png +0 -0
- data/guides/assets/images/icons/tip.png +0 -0
- data/guides/assets/images/icons/up.png +0 -0
- data/guides/assets/images/icons/warning.png +0 -0
- data/guides/assets/images/nav_arrow.gif +0 -0
- data/guides/assets/images/oscardelben.jpg +0 -0
- data/guides/assets/images/polymorphic.png +0 -0
- data/guides/assets/images/radar.png +0 -0
- data/guides/assets/images/rails4_features.png +0 -0
- data/guides/assets/images/rails_guides_kindle_cover.jpg +0 -0
- data/guides/assets/images/rails_guides_logo.gif +0 -0
- data/guides/assets/images/rails_logo_remix.gif +0 -0
- data/guides/assets/images/session_fixation.png +0 -0
- data/guides/assets/images/tab_grey.gif +0 -0
- data/guides/assets/images/tab_info.gif +0 -0
- data/guides/assets/images/tab_note.gif +0 -0
- data/guides/assets/images/tab_red.gif +0 -0
- data/guides/assets/images/tab_yellow.gif +0 -0
- data/guides/assets/images/tab_yellow.png +0 -0
- data/guides/assets/images/vijaydev.jpg +0 -0
- data/guides/assets/javascripts/guides.js +59 -0
- data/guides/assets/javascripts/jquery.min.js +4 -0
- data/guides/assets/javascripts/responsive-tables.js +43 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushAS3.js +59 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushAppleScript.js +75 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushBash.js +59 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushCSharp.js +65 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushColdFusion.js +100 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushCpp.js +97 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushCss.js +91 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushDelphi.js +55 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushDiff.js +41 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushErlang.js +52 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushGroovy.js +67 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushJScript.js +52 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushJava.js +57 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushJavaFX.js +58 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushPerl.js +72 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushPhp.js +88 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushPlain.js +33 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushPowerShell.js +74 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushPython.js +64 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushRuby.js +55 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushSass.js +94 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushScala.js +51 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushSql.js +66 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushVb.js +56 -0
- data/guides/assets/javascripts/syntaxhighlighter/shBrushXml.js +69 -0
- data/guides/assets/javascripts/syntaxhighlighter/shCore.js +17 -0
- data/guides/assets/stylesheets/fixes.css +16 -0
- data/guides/assets/stylesheets/kindle.css +11 -0
- data/guides/assets/stylesheets/main.css +713 -0
- data/guides/assets/stylesheets/print.css +52 -0
- data/guides/assets/stylesheets/reset.css +43 -0
- data/guides/assets/stylesheets/responsive-tables.css +50 -0
- data/guides/assets/stylesheets/style.css +13 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shCore.css +226 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreDefault.css +328 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreDjango.css +331 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreEclipse.css +339 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreEmacs.css +324 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreFadeToGrey.css +328 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreMDUltra.css +324 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreMidnight.css +324 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shCoreRDark.css +324 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeDefault.css +117 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeDjango.css +120 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeEclipse.css +128 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeEmacs.css +113 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeFadeToGrey.css +117 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeMDUltra.css +113 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeMidnight.css +113 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeRDark.css +113 -0
- data/guides/assets/stylesheets/syntaxhighlighter/shThemeRailsGuides.css +116 -0
- data/guides/bug_report_templates/action_controller_gem.rb +47 -0
- data/guides/bug_report_templates/action_controller_master.rb +56 -0
- data/guides/bug_report_templates/active_record_gem.rb +40 -0
- data/guides/bug_report_templates/active_record_master.rb +51 -0
- data/guides/rails_guides.rb +63 -0
- data/guides/rails_guides/generator.rb +248 -0
- data/guides/rails_guides/helpers.rb +53 -0
- data/guides/rails_guides/indexer.rb +68 -0
- data/guides/rails_guides/kindle.rb +119 -0
- data/guides/rails_guides/levenshtein.rb +39 -0
- data/guides/rails_guides/markdown.rb +167 -0
- data/guides/rails_guides/markdown/renderer.rb +82 -0
- data/guides/source/2_2_release_notes.md +435 -0
- data/guides/source/2_3_release_notes.md +621 -0
- data/guides/source/3_0_release_notes.md +611 -0
- data/guides/source/3_1_release_notes.md +559 -0
- data/guides/source/3_2_release_notes.md +568 -0
- data/guides/source/4_0_release_notes.md +279 -0
- data/guides/source/4_1_release_notes.md +730 -0
- data/guides/source/4_2_release_notes.md +736 -0
- data/guides/source/_license.html.erb +2 -0
- data/guides/source/_welcome.html.erb +19 -0
- data/guides/source/action_controller_overview.md +1247 -0
- data/guides/source/action_mailer_basics.md +738 -0
- data/guides/source/action_view_overview.md +1621 -0
- data/guides/source/active_job_basics.md +285 -0
- data/guides/source/active_model_basics.md +223 -0
- data/guides/source/active_record_basics.md +374 -0
- data/guides/source/active_record_callbacks.md +413 -0
- data/guides/source/active_record_migrations.md +1016 -0
- data/guides/source/active_record_postgresql.md +438 -0
- data/guides/source/active_record_querying.md +1785 -0
- data/guides/source/active_record_validations.md +1169 -0
- data/guides/source/active_support_core_extensions.md +3924 -0
- data/guides/source/active_support_instrumentation.md +497 -0
- data/guides/source/api_documentation_guidelines.md +361 -0
- data/guides/source/asset_pipeline.md +1361 -0
- data/guides/source/association_basics.md +2238 -0
- data/guides/source/caching_with_rails.md +379 -0
- data/guides/source/command_line.md +634 -0
- data/guides/source/configuring.md +1019 -0
- data/guides/source/contributing_to_ruby_on_rails.md +607 -0
- data/guides/source/credits.html.erb +80 -0
- data/guides/source/debugging_rails_applications.md +861 -0
- data/guides/source/development_dependencies_install.md +289 -0
- data/guides/source/documents.yaml +197 -0
- data/guides/source/engines.md +1401 -0
- data/guides/source/form_helpers.md +1010 -0
- data/guides/source/generators.md +676 -0
- data/guides/source/getting_started.md +2085 -0
- data/guides/source/i18n.md +1073 -0
- data/guides/source/index.html.erb +28 -0
- data/guides/source/initialization.md +704 -0
- data/guides/source/kindle/copyright.html.erb +1 -0
- data/guides/source/kindle/layout.html.erb +27 -0
- data/guides/source/kindle/rails_guides.opf.erb +52 -0
- data/guides/source/kindle/toc.html.erb +24 -0
- data/guides/source/kindle/toc.ncx.erb +64 -0
- data/guides/source/kindle/welcome.html.erb +5 -0
- data/guides/source/layout.html.erb +143 -0
- data/guides/source/layouts_and_rendering.md +1227 -0
- data/guides/source/maintenance_policy.md +75 -0
- data/guides/source/nested_model_forms.md +228 -0
- data/guides/source/plugins.md +444 -0
- data/guides/source/rails_application_templates.md +266 -0
- data/guides/source/rails_on_rack.md +332 -0
- data/guides/source/routing.md +1141 -0
- data/guides/source/ruby_on_rails_guides_guidelines.md +126 -0
- data/guides/source/security.md +1024 -0
- data/guides/source/testing.md +1055 -0
- data/guides/source/upgrading_ruby_on_rails.md +1046 -0
- data/guides/source/working_with_javascript_in_rails.md +407 -0
- data/guides/w3c_validator.rb +97 -0
- metadata +404 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 7287810cc0d9c6fd1a8c9a833b1a4fa552404d7f
|
|
4
|
+
data.tar.gz: b2c6f149f6bb9fcf45e93c5ec969866a86ad5304
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 5294ade89acae6a89c277f0bb905137f51175f10c1b7636c77d58f1645546b04337f5fd5d2a84c9fd9ca54ace9fe6fd4b65a1b2e3e28708e8105b6e7672e7ea4
|
|
7
|
+
data.tar.gz: dd6cb8345a548024d6dad17fd32c96fcccb1215bd276a5f76fb7da00d9f894e26a08ebe8b897010c0c1f4c7ef5d0373d222a7dd299b828f671b4a812d2882283
|
data/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
## Welcome to Rails
|
|
2
|
+
|
|
3
|
+
Rails is a web-application framework that includes everything needed to
|
|
4
|
+
create database-backed web applications according to the
|
|
5
|
+
[Model-View-Controller (MVC)](http://en.wikipedia.org/wiki/Model-view-controller)
|
|
6
|
+
pattern.
|
|
7
|
+
|
|
8
|
+
Understanding the MVC pattern is key to understanding Rails. MVC divides your
|
|
9
|
+
application into three layers, each with a specific responsibility.
|
|
10
|
+
|
|
11
|
+
The _Model layer_ represents your domain model (such as Account, Product,
|
|
12
|
+
Person, Post, etc.) and encapsulates the business logic that is specific to
|
|
13
|
+
your application. In Rails, database-backed model classes are derived from
|
|
14
|
+
`ActiveRecord::Base`. Active Record allows you to present the data from
|
|
15
|
+
database rows as objects and embellish these data objects with business logic
|
|
16
|
+
methods. Although most Rails models are backed by a database, models can also
|
|
17
|
+
be ordinary Ruby classes, or Ruby classes that implement a set of interfaces
|
|
18
|
+
as provided by the Active Model module. You can read more about Active Record
|
|
19
|
+
in its [README](activerecord/README.rdoc).
|
|
20
|
+
|
|
21
|
+
The _Controller layer_ is responsible for handling incoming HTTP requests and
|
|
22
|
+
providing a suitable response. Usually this means returning HTML, but Rails controllers
|
|
23
|
+
can also generate XML, JSON, PDFs, mobile-specific views, and more. Controllers load and
|
|
24
|
+
manipulate models, and render view templates in order to generate the appropriate HTTP response.
|
|
25
|
+
In Rails, incoming requests are routed by Action Dispatch to an appropriate controller, and
|
|
26
|
+
controller classes are derived from `ActionController::Base`. Action Dispatch and Action Controller
|
|
27
|
+
are bundled together in Action Pack. You can read more about Action Pack in its
|
|
28
|
+
[README](actionpack/README.rdoc).
|
|
29
|
+
|
|
30
|
+
The _View layer_ is composed of "templates" that are responsible for providing
|
|
31
|
+
appropriate representations of your application's resources. Templates can
|
|
32
|
+
come in a variety of formats, but most view templates are HTML with embedded
|
|
33
|
+
Ruby code (ERB files). Views are typically rendered to generate a controller response,
|
|
34
|
+
or to generate the body of an email. In Rails, View generation is handled by Action View.
|
|
35
|
+
You can read more about Action View in its [README](actionview/README.rdoc).
|
|
36
|
+
|
|
37
|
+
Active Record, Action Pack, and Action View can each be used independently outside Rails.
|
|
38
|
+
In addition to them, Rails also comes with Action Mailer ([README](actionmailer/README.rdoc)), a library
|
|
39
|
+
to generate and send emails; and Active Support ([README](activesupport/README.rdoc)), a collection of
|
|
40
|
+
utility classes and standard library extensions that are useful for Rails, and may also be used
|
|
41
|
+
independently outside Rails.
|
|
42
|
+
|
|
43
|
+
## Getting Started
|
|
44
|
+
|
|
45
|
+
1. Install Rails at the command prompt if you haven't yet:
|
|
46
|
+
|
|
47
|
+
gem install rails
|
|
48
|
+
|
|
49
|
+
2. At the command prompt, create a new Rails application:
|
|
50
|
+
|
|
51
|
+
rails new myapp
|
|
52
|
+
|
|
53
|
+
where "myapp" is the application name.
|
|
54
|
+
|
|
55
|
+
3. Change directory to `myapp` and start the web server:
|
|
56
|
+
|
|
57
|
+
cd myapp
|
|
58
|
+
rails server
|
|
59
|
+
|
|
60
|
+
Run with `--help` or `-h` for options.
|
|
61
|
+
|
|
62
|
+
4. Using a browser, go to `http://localhost:3000` and you'll see:
|
|
63
|
+
"Welcome aboard: You're riding Ruby on Rails!"
|
|
64
|
+
|
|
65
|
+
5. Follow the guidelines to start developing your application. You may find
|
|
66
|
+
the following resources handy:
|
|
67
|
+
* [Getting Started with Rails](http://guides.rubyonrails.org/getting_started.html)
|
|
68
|
+
* [Ruby on Rails Guides](http://guides.rubyonrails.org)
|
|
69
|
+
* [The API Documentation](http://api.rubyonrails.org)
|
|
70
|
+
* [Ruby on Rails Tutorial](http://www.railstutorial.org/book)
|
|
71
|
+
|
|
72
|
+
## Contributing
|
|
73
|
+
|
|
74
|
+
We encourage you to contribute to Ruby on Rails! Please check out the
|
|
75
|
+
[Contributing to Ruby on Rails guide](http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html) for guidelines about how to proceed. [Join us!](http://contributors.rubyonrails.org)
|
|
76
|
+
|
|
77
|
+
## Code Status
|
|
78
|
+
|
|
79
|
+
* [](https://travis-ci.org/rails/rails)
|
|
80
|
+
|
|
81
|
+
## License
|
|
82
|
+
|
|
83
|
+
Ruby on Rails is released under the [MIT License](http://www.opensource.org/licenses/MIT).
|
data/guides/CHANGELOG.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
* Change Posts to Articles in Getting Started sample application in order to
|
|
2
|
+
better align with the actual guides.
|
|
3
|
+
|
|
4
|
+
*John Kelly Ferguson*
|
|
5
|
+
|
|
6
|
+
* Update all Rails 4.1.0 references to 4.1.1 within the guides and code.
|
|
7
|
+
|
|
8
|
+
*John Kelly Ferguson*
|
|
9
|
+
|
|
10
|
+
* Split up rows in the Explain Queries table of the ActiveRecord Querying section
|
|
11
|
+
in order to improve readability.
|
|
12
|
+
|
|
13
|
+
*John Kelly Ferguson*
|
|
14
|
+
|
|
15
|
+
* Change all non-HTTP method 'post' references to 'article'.
|
|
16
|
+
|
|
17
|
+
*John Kelly Ferguson*
|
|
18
|
+
|
|
19
|
+
* Updates the maintenance policy to match the latest versions of Rails
|
|
20
|
+
|
|
21
|
+
*Matias Korhonen*
|
|
22
|
+
|
|
23
|
+
* Switched the order of `Applying a default scope` and `Merging of scopes` subsections so default scopes are introduced first.
|
|
24
|
+
|
|
25
|
+
*Alex Riabov*
|
|
26
|
+
|
|
27
|
+
Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/guides/CHANGELOG.md) for previous changes.
|
data/guides/Rakefile
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
namespace :guides do
|
|
2
|
+
|
|
3
|
+
desc 'Generate guides (for authors), use ONLY=foo to process just "foo.md"'
|
|
4
|
+
task :generate => 'generate:html'
|
|
5
|
+
|
|
6
|
+
namespace :generate do
|
|
7
|
+
|
|
8
|
+
desc "Generate HTML guides"
|
|
9
|
+
task :html do
|
|
10
|
+
ENV["WARN_BROKEN_LINKS"] = "1" # authors can't disable this
|
|
11
|
+
ruby "rails_guides.rb"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
desc "Generate .mobi file. The kindlegen executable must be in your PATH. You can get it for free from http://www.amazon.com/kindlepublishing"
|
|
15
|
+
task :kindle do
|
|
16
|
+
unless `kindlerb -v 2> /dev/null` =~ /kindlerb 0.1.1/
|
|
17
|
+
abort "Please `gem install kindlerb` and make sure you have `kindlegen` in your PATH"
|
|
18
|
+
end
|
|
19
|
+
unless `convert` =~ /convert/
|
|
20
|
+
abort "Please install ImageMagick`"
|
|
21
|
+
end
|
|
22
|
+
ENV['KINDLE'] = '1'
|
|
23
|
+
Rake::Task['guides:generate:html'].invoke
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Validate guides -------------------------------------------------------------------------
|
|
28
|
+
desc 'Validate guides, use ONLY=foo to process just "foo.html"'
|
|
29
|
+
task :validate do
|
|
30
|
+
ruby "w3c_validator.rb"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
desc "Show help"
|
|
34
|
+
task :help do
|
|
35
|
+
puts <<-help
|
|
36
|
+
|
|
37
|
+
Guides are taken from the source directory, and the resulting HTML goes into the
|
|
38
|
+
output directory. Assets are stored under files, and copied to output/files as
|
|
39
|
+
part of the generation process.
|
|
40
|
+
|
|
41
|
+
All this process is handled via rake tasks, here's a full list of them:
|
|
42
|
+
|
|
43
|
+
#{%x[rake -T]}
|
|
44
|
+
Some arguments may be passed via environment variables:
|
|
45
|
+
|
|
46
|
+
WARNINGS=1
|
|
47
|
+
Internal links (anchors) are checked, also detects duplicated IDs.
|
|
48
|
+
|
|
49
|
+
ALL=1
|
|
50
|
+
Force generation of all guides.
|
|
51
|
+
|
|
52
|
+
ONLY=name
|
|
53
|
+
Useful if you want to generate only one or a set of guides.
|
|
54
|
+
|
|
55
|
+
Generate only association_basics.html:
|
|
56
|
+
ONLY=assoc
|
|
57
|
+
|
|
58
|
+
Separate many using commas:
|
|
59
|
+
ONLY=assoc,migrations
|
|
60
|
+
|
|
61
|
+
GUIDES_LANGUAGE
|
|
62
|
+
Use it when you want to generate translated guides in
|
|
63
|
+
source/<GUIDES_LANGUAGE> folder (such as source/es)
|
|
64
|
+
|
|
65
|
+
EDGE=1
|
|
66
|
+
Indicate generated guides should be marked as edge.
|
|
67
|
+
|
|
68
|
+
Examples:
|
|
69
|
+
$ rake guides:generate ALL=1
|
|
70
|
+
$ rake guides:generate EDGE=1
|
|
71
|
+
$ rake guides:generate:kindle EDGE=1
|
|
72
|
+
$ rake guides:generate GUIDES_LANGUAGE=es
|
|
73
|
+
help
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
task :default => 'guides:help'
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
$.fn.selectGuide = function(guide) {
|
|
2
|
+
$("select", this).val(guide);
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
var guidesIndex = {
|
|
6
|
+
bind: function() {
|
|
7
|
+
var currentGuidePath = window.location.pathname;
|
|
8
|
+
var currentGuide = currentGuidePath.substring(currentGuidePath.lastIndexOf("/")+1);
|
|
9
|
+
$(".guides-index-small").
|
|
10
|
+
on("change", "select", guidesIndex.navigate).
|
|
11
|
+
selectGuide(currentGuide);
|
|
12
|
+
$(document).on("click", ".more-info-button", function(e){
|
|
13
|
+
e.stopPropagation();
|
|
14
|
+
if ($(".more-info-links").is(":visible")) {
|
|
15
|
+
$(".more-info-links").addClass("s-hidden").unwrap();
|
|
16
|
+
} else {
|
|
17
|
+
$(".more-info-links").wrap("<div class='more-info-container'></div>").removeClass("s-hidden");
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
$("#guidesMenu").on("click", function(e) {
|
|
21
|
+
$("#guides").toggle();
|
|
22
|
+
return false;
|
|
23
|
+
});
|
|
24
|
+
$(document).on("click", function(e){
|
|
25
|
+
e.stopPropagation();
|
|
26
|
+
var $button = $(".more-info-button");
|
|
27
|
+
var element;
|
|
28
|
+
|
|
29
|
+
// Cross browser find the element that had the event
|
|
30
|
+
if (e.target) element = e.target;
|
|
31
|
+
else if (e.srcElement) element = e.srcElement;
|
|
32
|
+
|
|
33
|
+
// Defeat the older Safari bug:
|
|
34
|
+
// http://www.quirksmode.org/js/events_properties.html
|
|
35
|
+
if (element.nodeType === 3) element = element.parentNode;
|
|
36
|
+
|
|
37
|
+
var $element = $(element);
|
|
38
|
+
|
|
39
|
+
var $container = $element.parents(".more-info-container");
|
|
40
|
+
|
|
41
|
+
// We've captured a click outside the popup
|
|
42
|
+
if($container.length === 0){
|
|
43
|
+
$container = $button.next(".more-info-container");
|
|
44
|
+
$container.find(".more-info-links").addClass("s-hidden").unwrap();
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
navigate: function(e){
|
|
49
|
+
var $list = $(e.target);
|
|
50
|
+
var url = $list.val();
|
|
51
|
+
window.location = url;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Disable autolink inside example code blocks of guides.
|
|
56
|
+
$(document).ready(function() {
|
|
57
|
+
SyntaxHighlighter.defaults['auto-links'] = false;
|
|
58
|
+
SyntaxHighlighter.all();
|
|
59
|
+
});
|