rails 4.0.0 → 4.2.11.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +30 -23
- data/guides/CHANGELOG.md +108 -6
- data/guides/Rakefile +21 -6
- data/guides/assets/images/akshaysurve.jpg +0 -0
- data/guides/assets/images/edge_badge.png +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/header_tile.gif +0 -0
- data/guides/assets/images/icons/README +1 -1
- 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/15.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/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/vijaydev.jpg +0 -0
- data/guides/assets/javascripts/guides.js +36 -34
- data/guides/assets/stylesheets/main.css +6 -2
- data/guides/assets/stylesheets/print.css +1 -1
- data/guides/bug_report_templates/action_controller_gem.rb +47 -0
- data/guides/bug_report_templates/action_controller_master.rb +54 -0
- data/guides/bug_report_templates/active_record_gem.rb +5 -2
- data/guides/bug_report_templates/active_record_master.rb +3 -2
- data/guides/bug_report_templates/generic_gem.rb +15 -0
- data/guides/bug_report_templates/generic_master.rb +26 -0
- data/guides/rails_guides.rb +23 -4
- data/guides/rails_guides/generator.rb +1 -1
- data/guides/rails_guides/helpers.rb +4 -2
- data/guides/rails_guides/levenshtein.rb +27 -21
- data/guides/rails_guides/markdown.rb +11 -7
- data/guides/rails_guides/markdown/renderer.rb +1 -1
- data/guides/source/2_2_release_notes.md +3 -3
- data/guides/source/2_3_release_notes.md +12 -12
- data/guides/source/3_0_release_notes.md +10 -13
- data/guides/source/3_1_release_notes.md +7 -4
- data/guides/source/3_2_release_notes.md +17 -14
- data/guides/source/4_0_release_notes.md +110 -54
- data/guides/source/4_1_release_notes.md +730 -0
- data/guides/source/4_2_release_notes.md +877 -0
- data/guides/source/_license.html.erb +1 -1
- data/guides/source/_welcome.html.erb +6 -2
- data/guides/source/action_controller_overview.md +223 -57
- data/guides/source/action_mailer_basics.md +129 -76
- data/guides/source/action_view_overview.md +247 -246
- data/guides/source/active_job_basics.md +339 -0
- data/guides/source/active_model_basics.md +374 -20
- data/guides/source/active_record_basics.md +46 -45
- data/guides/source/active_record_callbacks.md +83 -28
- data/guides/source/{migrations.md → active_record_migrations.md} +191 -275
- data/guides/source/active_record_postgresql.md +433 -0
- data/guides/source/active_record_querying.md +382 -300
- data/guides/source/active_record_validations.md +64 -55
- data/guides/source/active_support_core_extensions.md +229 -187
- data/guides/source/active_support_instrumentation.md +23 -22
- data/guides/source/api_documentation_guidelines.md +167 -15
- data/guides/source/asset_pipeline.md +768 -294
- data/guides/source/association_basics.md +188 -96
- data/guides/source/autoloading_and_reloading_constants.md +1311 -0
- data/guides/source/caching_with_rails.md +45 -11
- data/guides/source/command_line.md +96 -65
- data/guides/source/configuring.md +404 -70
- data/guides/source/contributing_to_ruby_on_rails.md +270 -130
- data/guides/source/credits.html.erb +7 -3
- data/guides/source/debugging_rails_applications.md +471 -284
- data/guides/source/development_dependencies_install.md +115 -21
- data/guides/source/documents.yaml +31 -9
- data/guides/source/engines.md +737 -291
- data/guides/source/form_helpers.md +137 -89
- data/guides/source/generators.md +60 -28
- data/guides/source/getting_started.md +1007 -596
- data/guides/source/i18n.md +178 -96
- data/guides/source/index.html.erb +2 -1
- data/guides/source/initialization.md +248 -104
- data/guides/source/kindle/toc.html.erb +1 -1
- data/guides/source/layout.html.erb +14 -22
- data/guides/source/layouts_and_rendering.md +78 -46
- data/guides/source/maintenance_policy.md +78 -0
- data/guides/source/nested_model_forms.md +10 -7
- data/guides/source/plugins.md +66 -57
- data/guides/source/rails_application_templates.md +49 -12
- data/guides/source/rails_on_rack.md +50 -60
- data/guides/source/routing.md +190 -139
- data/guides/source/ruby_on_rails_guides_guidelines.md +12 -13
- data/guides/source/security.md +134 -83
- data/guides/source/testing.md +322 -200
- data/guides/source/upgrading_ruby_on_rails.md +834 -37
- data/guides/source/working_with_javascript_in_rails.md +36 -26
- data/guides/w3c_validator.rb +2 -0
- metadata +93 -116
- data/guides/assets/images/getting_started/forbidden_attributes_for_new_post.png +0 -0
- data/guides/assets/images/getting_started/new_post.png +0 -0
- data/guides/assets/images/getting_started/post_with_comments.png +0 -0
- data/guides/assets/images/getting_started/show_action_for_posts.png +0 -0
- data/guides/assets/images/getting_started/template_is_missing_posts_new.png +0 -0
- data/guides/assets/images/getting_started/undefined_method_post_path.png +0 -0
- data/guides/assets/images/getting_started/unknown_action_create_for_posts.png +0 -0
- data/guides/assets/images/getting_started/unknown_action_new_for_posts.png +0 -0
- data/guides/assets/images/jaimeiniesta.jpg +0 -0
- data/guides/code/getting_started/Gemfile +0 -43
- data/guides/code/getting_started/Gemfile.lock +0 -150
- data/guides/code/getting_started/README.rdoc +0 -28
- data/guides/code/getting_started/Rakefile +0 -6
- data/guides/code/getting_started/app/assets/javascripts/application.js +0 -16
- data/guides/code/getting_started/app/assets/javascripts/comments.js.coffee +0 -3
- data/guides/code/getting_started/app/assets/javascripts/posts.js.coffee +0 -3
- data/guides/code/getting_started/app/assets/javascripts/welcome.js.coffee +0 -3
- data/guides/code/getting_started/app/assets/stylesheets/application.css +0 -13
- data/guides/code/getting_started/app/assets/stylesheets/comments.css.scss +0 -3
- data/guides/code/getting_started/app/assets/stylesheets/posts.css.scss +0 -3
- data/guides/code/getting_started/app/assets/stylesheets/welcome.css.scss +0 -3
- data/guides/code/getting_started/app/controllers/application_controller.rb +0 -5
- data/guides/code/getting_started/app/controllers/comments_controller.rb +0 -17
- data/guides/code/getting_started/app/controllers/posts_controller.rb +0 -47
- data/guides/code/getting_started/app/controllers/welcome_controller.rb +0 -4
- data/guides/code/getting_started/app/helpers/application_helper.rb +0 -2
- data/guides/code/getting_started/app/helpers/comments_helper.rb +0 -2
- data/guides/code/getting_started/app/helpers/posts_helper.rb +0 -2
- data/guides/code/getting_started/app/helpers/welcome_helper.rb +0 -2
- data/guides/code/getting_started/app/models/comment.rb +0 -3
- data/guides/code/getting_started/app/models/post.rb +0 -7
- data/guides/code/getting_started/app/views/comments/_comment.html.erb +0 -15
- data/guides/code/getting_started/app/views/comments/_form.html.erb +0 -13
- data/guides/code/getting_started/app/views/layouts/application.html.erb +0 -14
- data/guides/code/getting_started/app/views/posts/_form.html.erb +0 -27
- data/guides/code/getting_started/app/views/posts/edit.html.erb +0 -5
- data/guides/code/getting_started/app/views/posts/index.html.erb +0 -21
- data/guides/code/getting_started/app/views/posts/new.html.erb +0 -5
- data/guides/code/getting_started/app/views/posts/show.html.erb +0 -18
- data/guides/code/getting_started/app/views/welcome/index.html.erb +0 -3
- data/guides/code/getting_started/bin/bundle +0 -4
- data/guides/code/getting_started/bin/rails +0 -4
- data/guides/code/getting_started/bin/rake +0 -4
- data/guides/code/getting_started/config.ru +0 -4
- data/guides/code/getting_started/config/application.rb +0 -18
- data/guides/code/getting_started/config/boot.rb +0 -4
- data/guides/code/getting_started/config/database.yml +0 -25
- data/guides/code/getting_started/config/environment.rb +0 -5
- data/guides/code/getting_started/config/environments/development.rb +0 -30
- data/guides/code/getting_started/config/environments/production.rb +0 -80
- data/guides/code/getting_started/config/environments/test.rb +0 -36
- data/guides/code/getting_started/config/initializers/backtrace_silencers.rb +0 -7
- data/guides/code/getting_started/config/initializers/filter_parameter_logging.rb +0 -4
- data/guides/code/getting_started/config/initializers/inflections.rb +0 -16
- data/guides/code/getting_started/config/initializers/locale.rb +0 -9
- data/guides/code/getting_started/config/initializers/mime_types.rb +0 -5
- data/guides/code/getting_started/config/initializers/secret_token.rb +0 -12
- data/guides/code/getting_started/config/initializers/session_store.rb +0 -3
- data/guides/code/getting_started/config/initializers/wrap_parameters.rb +0 -14
- data/guides/code/getting_started/config/locales/en.yml +0 -23
- data/guides/code/getting_started/config/routes.rb +0 -7
- data/guides/code/getting_started/db/migrate/20130122042648_create_posts.rb +0 -10
- data/guides/code/getting_started/db/migrate/20130122045842_create_comments.rb +0 -11
- data/guides/code/getting_started/db/schema.rb +0 -33
- data/guides/code/getting_started/db/seeds.rb +0 -7
- data/guides/code/getting_started/public/404.html +0 -58
- data/guides/code/getting_started/public/422.html +0 -58
- data/guides/code/getting_started/public/500.html +0 -57
- data/guides/code/getting_started/public/favicon.ico +0 -0
- data/guides/code/getting_started/public/robots.txt +0 -5
- data/guides/code/getting_started/test/controllers/comments_controller_test.rb +0 -7
- data/guides/code/getting_started/test/controllers/posts_controller_test.rb +0 -7
- data/guides/code/getting_started/test/controllers/welcome_controller_test.rb +0 -9
- data/guides/code/getting_started/test/fixtures/comments.yml +0 -11
- data/guides/code/getting_started/test/fixtures/posts.yml +0 -9
- data/guides/code/getting_started/test/helpers/comments_helper_test.rb +0 -4
- data/guides/code/getting_started/test/helpers/posts_helper_test.rb +0 -4
- data/guides/code/getting_started/test/helpers/welcome_helper_test.rb +0 -4
- data/guides/code/getting_started/test/models/comment_test.rb +0 -7
- data/guides/code/getting_started/test/models/post_test.rb +0 -7
- data/guides/code/getting_started/test/test_helper.rb +0 -15
- data/guides/source/kindle/KINDLE.md +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d4073c294efe444213b93605bd058bdfcfe7fd21df0673d411aaacb8444d6311
|
4
|
+
data.tar.gz: 6ced0776f690d103fd1ae235809fe9244f59538b6153c5f75247e76a35c9f600
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e399f8b1df884ceb451de70d9e0a821f1a0c4621eb7ee8af0e9fdc1a955661aab731e6b9a7b3928f09d2a86d492ec737f5c488709d2ba734cbb9a42a1ef5e829
|
7
|
+
data.tar.gz: d302ab1709953482477f8ca896e45e54d69c8dcc16edf1f49e09ce1c8b451d0a1725baf3d3c7a2b138b97ca0018813e2cf907db01768188a8a025e68c4679b16
|
data/README.md
CHANGED
@@ -2,38 +2,45 @@
|
|
2
2
|
|
3
3
|
Rails is a web-application framework that includes everything needed to
|
4
4
|
create database-backed web applications according to the
|
5
|
-
[Model-View-Controller (MVC)](http://en.wikipedia.org/wiki/Model
|
5
|
+
[Model-View-Controller (MVC)](http://en.wikipedia.org/wiki/Model-view-controller)
|
6
6
|
pattern.
|
7
7
|
|
8
8
|
Understanding the MVC pattern is key to understanding Rails. MVC divides your
|
9
9
|
application into three layers, each with a specific responsibility.
|
10
10
|
|
11
|
-
The _View layer_ is composed of "templates" that are responsible for providing
|
12
|
-
appropriate representations of your application's resources. Templates can
|
13
|
-
come in a variety of formats, but most view templates are HTML with embedded
|
14
|
-
Ruby code (ERB files).
|
15
|
-
|
16
11
|
The _Model layer_ represents your domain model (such as Account, Product,
|
17
12
|
Person, Post, etc.) and encapsulates the business logic that is specific to
|
18
13
|
your application. In Rails, database-backed model classes are derived from
|
19
14
|
`ActiveRecord::Base`. Active Record allows you to present the data from
|
20
15
|
database rows as objects and embellish these data objects with business logic
|
21
|
-
methods.
|
22
|
-
|
23
|
-
|
24
|
-
in its [README](
|
16
|
+
methods. You can read more about Active Record in its [README](activerecord/README.rdoc).
|
17
|
+
Although most Rails models are backed by a database, models can also be ordinary
|
18
|
+
Ruby classes, or Ruby classes that implement a set of interfaces as provided by
|
19
|
+
the Active Model module. You can read more about Active Model in its [README](activemodel/README.rdoc).
|
25
20
|
|
26
21
|
The _Controller layer_ is responsible for handling incoming HTTP requests and
|
27
|
-
providing a suitable response. Usually this means returning HTML, but Rails
|
28
|
-
|
29
|
-
|
30
|
-
|
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).
|
31
29
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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; Active Job ([README](activejob/README.md)), a
|
40
|
+
framework for declaring jobs and making them run on a variety of queueing
|
41
|
+
backends; and Active Support ([README](activesupport/README.rdoc)), a collection
|
42
|
+
of utility classes and standard library extensions that are useful for Rails,
|
43
|
+
and may also be used independently outside Rails.
|
37
44
|
|
38
45
|
## Getting Started
|
39
46
|
|
@@ -54,14 +61,15 @@ can read more about Action Pack in its [README](actionpack/README.rdoc).
|
|
54
61
|
|
55
62
|
Run with `--help` or `-h` for options.
|
56
63
|
|
57
|
-
4.
|
64
|
+
4. Using a browser, go to `http://localhost:3000` and you'll see:
|
65
|
+
"Welcome aboard: You're riding Ruby on Rails!"
|
58
66
|
|
59
67
|
5. Follow the guidelines to start developing your application. You may find
|
60
68
|
the following resources handy:
|
61
69
|
* [Getting Started with Rails](http://guides.rubyonrails.org/getting_started.html)
|
62
70
|
* [Ruby on Rails Guides](http://guides.rubyonrails.org)
|
63
71
|
* [The API Documentation](http://api.rubyonrails.org)
|
64
|
-
* [Ruby on Rails Tutorial](http://
|
72
|
+
* [Ruby on Rails Tutorial](http://www.railstutorial.org/book)
|
65
73
|
|
66
74
|
## Contributing
|
67
75
|
|
@@ -70,8 +78,7 @@ We encourage you to contribute to Ruby on Rails! Please check out the
|
|
70
78
|
|
71
79
|
## Code Status
|
72
80
|
|
73
|
-
* [![Build Status](https://
|
74
|
-
* [![Dependencies](https://gemnasium.com/rails/rails.png?travis)](https://gemnasium.com/rails/rails)
|
81
|
+
* [![Build Status](https://travis-ci.org/rails/rails.svg?branch=4-2-stable)](https://travis-ci.org/rails/rails)
|
75
82
|
|
76
83
|
## License
|
77
84
|
|
data/guides/CHANGELOG.md
CHANGED
@@ -1,11 +1,113 @@
|
|
1
|
-
## Rails 4.
|
1
|
+
## Rails 4.2.11.3 (May 15, 2020) ##
|
2
2
|
|
3
|
-
*
|
3
|
+
* No changes.
|
4
4
|
|
5
|
-
* Split Validations and Callbacks guide into two. *Steve Klabnik*
|
6
5
|
|
7
|
-
|
6
|
+
## Rails 4.2.11.2 (May 15, 2020) ##
|
8
7
|
|
9
|
-
*
|
8
|
+
* No changes.
|
10
9
|
|
11
|
-
|
10
|
+
|
11
|
+
## Rails 4.2.11.1 (March 11, 2019) ##
|
12
|
+
|
13
|
+
* No changes.
|
14
|
+
|
15
|
+
|
16
|
+
## Rails 4.2.11 (November 27, 2018) ##
|
17
|
+
|
18
|
+
* No changes.
|
19
|
+
|
20
|
+
|
21
|
+
## Rails 4.2.10 (September 27, 2017) ##
|
22
|
+
|
23
|
+
* No changes.
|
24
|
+
|
25
|
+
|
26
|
+
## Rails 4.2.9 (June 26, 2017) ##
|
27
|
+
|
28
|
+
* No changes.
|
29
|
+
|
30
|
+
|
31
|
+
## Rails 4.2.8 (February 21, 2017) ##
|
32
|
+
|
33
|
+
* No changes.
|
34
|
+
|
35
|
+
|
36
|
+
## Rails 4.2.7 (July 12, 2016) ##
|
37
|
+
|
38
|
+
* No changes.
|
39
|
+
|
40
|
+
|
41
|
+
## Rails 4.2.6 (March 07, 2016) ##
|
42
|
+
|
43
|
+
* No changes.
|
44
|
+
|
45
|
+
|
46
|
+
## Rails 4.2.5.2 (February 26, 2016) ##
|
47
|
+
|
48
|
+
* No changes.
|
49
|
+
|
50
|
+
|
51
|
+
## Rails 4.2.5.1 (January 25, 2016) ##
|
52
|
+
|
53
|
+
* No changes.
|
54
|
+
|
55
|
+
|
56
|
+
## Rails 4.2.5 (November 12, 2015) ##
|
57
|
+
|
58
|
+
* No changes.
|
59
|
+
|
60
|
+
|
61
|
+
## Rails 4.2.4 (August 24, 2015) ##
|
62
|
+
|
63
|
+
* No Changes *
|
64
|
+
|
65
|
+
|
66
|
+
## Rails 4.2.3 (June 25, 2015) ##
|
67
|
+
|
68
|
+
* No Changes *
|
69
|
+
|
70
|
+
|
71
|
+
## Rails 4.2.2 (June 16, 2015) ##
|
72
|
+
|
73
|
+
* No Changes *
|
74
|
+
|
75
|
+
|
76
|
+
## Rails 4.2.1 (March 19, 2015) ##
|
77
|
+
|
78
|
+
* No changes.
|
79
|
+
|
80
|
+
|
81
|
+
## Rails 4.2.0 (December 20, 2014) ##
|
82
|
+
|
83
|
+
* New guide about constant autoloading and reloading.
|
84
|
+
|
85
|
+
*Xavier Noria*
|
86
|
+
|
87
|
+
* Change Posts to Articles in Getting Started sample application in order to
|
88
|
+
better align with the actual guides.
|
89
|
+
|
90
|
+
*John Kelly Ferguson*
|
91
|
+
|
92
|
+
* Update all Rails 4.1.0 references to 4.1.1 within the guides and code.
|
93
|
+
|
94
|
+
*John Kelly Ferguson*
|
95
|
+
|
96
|
+
* Split up rows in the Explain Queries table of the ActiveRecord Querying section
|
97
|
+
in order to improve readability.
|
98
|
+
|
99
|
+
*John Kelly Ferguson*
|
100
|
+
|
101
|
+
* Change all non-HTTP method 'post' references to 'article'.
|
102
|
+
|
103
|
+
*John Kelly Ferguson*
|
104
|
+
|
105
|
+
* Updates the maintenance policy to match the latest versions of Rails
|
106
|
+
|
107
|
+
*Matias Korhonen*
|
108
|
+
|
109
|
+
* Switched the order of `Applying a default scope` and `Merging of scopes` subsections so default scopes are introduced first.
|
110
|
+
|
111
|
+
*Alex Riabov*
|
112
|
+
|
113
|
+
Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/guides/CHANGELOG.md) for previous changes.
|
data/guides/Rakefile
CHANGED
@@ -3,18 +3,31 @@ namespace :guides do
|
|
3
3
|
desc 'Generate guides (for authors), use ONLY=foo to process just "foo.md"'
|
4
4
|
task :generate => 'generate:html'
|
5
5
|
|
6
|
+
# Guides are written in UTF-8, but the environment may be configured for some
|
7
|
+
# other locale, these tasks are responsible for ensuring the default external
|
8
|
+
# encoding is UTF-8.
|
9
|
+
#
|
10
|
+
# Real use cases: Generation was reported to fail on a machine configured with
|
11
|
+
# GBK (Chinese). The docs server once got misconfigured somehow and had "C",
|
12
|
+
# which broke generation too.
|
13
|
+
task :encoding do
|
14
|
+
%w(LANG LANGUAGE LC_ALL).each do |env_var|
|
15
|
+
ENV[env_var] = "en_US.UTF-8"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
6
19
|
namespace :generate do
|
7
20
|
|
8
21
|
desc "Generate HTML guides"
|
9
|
-
task :html do
|
22
|
+
task :html => :encoding do
|
10
23
|
ENV["WARN_BROKEN_LINKS"] = "1" # authors can't disable this
|
11
24
|
ruby "rails_guides.rb"
|
12
25
|
end
|
13
26
|
|
14
27
|
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`"
|
28
|
+
task :kindle => :encoding do
|
29
|
+
unless `kindlerb -v 2> /dev/null` =~ /kindlerb 0.1.1/
|
30
|
+
abort "Please `gem install kindlerb` and make sure you have `kindlegen` in your PATH"
|
18
31
|
end
|
19
32
|
unless `convert` =~ /convert/
|
20
33
|
abort "Please install ImageMagick`"
|
@@ -26,7 +39,7 @@ namespace :guides do
|
|
26
39
|
|
27
40
|
# Validate guides -------------------------------------------------------------------------
|
28
41
|
desc 'Validate guides, use ONLY=foo to process just "foo.html"'
|
29
|
-
task :validate do
|
42
|
+
task :validate => :encoding do
|
30
43
|
ruby "w3c_validator.rb"
|
31
44
|
end
|
32
45
|
|
@@ -34,10 +47,12 @@ namespace :guides do
|
|
34
47
|
task :help do
|
35
48
|
puts <<-help
|
36
49
|
|
37
|
-
Guides are taken from the source directory, and the
|
50
|
+
Guides are taken from the source directory, and the result goes into the
|
38
51
|
output directory. Assets are stored under files, and copied to output/files as
|
39
52
|
part of the generation process.
|
40
53
|
|
54
|
+
You can generate HTML, Kindle or both formats using the `guides:generate` task.
|
55
|
+
|
41
56
|
All this process is handled via rake tasks, here's a full list of them:
|
42
57
|
|
43
58
|
#{%x[rake -T]}
|
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
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Replaced the plain DocBook XSL admonition icons with Jimmac's DocBook
|
2
2
|
icons (http://jimmac.musichall.cz/ikony.php3). I dropped transparency
|
3
|
-
from the Jimmac icons to get round MS IE and FOP PNG
|
3
|
+
from the Jimmac icons to get round MS IE and FOP PNG incompatibilities.
|
4
4
|
|
5
5
|
Stuart Rackham
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,57 +1,59 @@
|
|
1
|
-
function
|
2
|
-
if (document.getElementById('guides').style.display == "none") {
|
3
|
-
document.getElementById('guides').style.display = "block";
|
4
|
-
} else {
|
5
|
-
document.getElementById('guides').style.display = "none";
|
6
|
-
}
|
7
|
-
}
|
8
|
-
|
9
|
-
$.fn.selectGuide = function(guide){
|
1
|
+
$.fn.selectGuide = function(guide) {
|
10
2
|
$("select", this).val(guide);
|
11
|
-
}
|
3
|
+
};
|
12
4
|
|
13
|
-
guidesIndex = {
|
14
|
-
bind: function(){
|
5
|
+
var guidesIndex = {
|
6
|
+
bind: function() {
|
15
7
|
var currentGuidePath = window.location.pathname;
|
16
8
|
var currentGuide = currentGuidePath.substring(currentGuidePath.lastIndexOf("/")+1);
|
17
9
|
$(".guides-index-small").
|
18
10
|
on("change", "select", guidesIndex.navigate).
|
19
11
|
selectGuide(currentGuide);
|
20
|
-
$(".more-info-button
|
12
|
+
$(document).on("click", ".more-info-button", function(e){
|
21
13
|
e.stopPropagation();
|
22
|
-
if($(".more-info-links").is(":visible")){
|
14
|
+
if ($(".more-info-links").is(":visible")) {
|
23
15
|
$(".more-info-links").addClass("s-hidden").unwrap();
|
24
16
|
} else {
|
25
17
|
$(".more-info-links").wrap("<div class='more-info-container'></div>").removeClass("s-hidden");
|
26
18
|
}
|
27
|
-
|
28
|
-
|
29
|
-
|
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;
|
30
28
|
|
31
|
-
|
32
|
-
|
33
|
-
|
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;
|
34
32
|
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
// Defeat the older Safari bug:
|
34
|
+
// http://www.quirksmode.org/js/events_properties.html
|
35
|
+
if (element.nodeType === 3) element = element.parentNode;
|
38
36
|
|
39
|
-
|
37
|
+
var $element = $(element);
|
40
38
|
|
41
|
-
|
39
|
+
var $container = $element.parents(".more-info-container");
|
42
40
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}
|
49
|
-
});
|
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
|
+
}
|
50
46
|
});
|
51
47
|
},
|
52
48
|
navigate: function(e){
|
53
49
|
var $list = $(e.target);
|
54
|
-
url = $list.val();
|
50
|
+
var url = $list.val();
|
55
51
|
window.location = url;
|
56
52
|
}
|
57
|
-
}
|
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
|
+
});
|