Skip to content

Commit ab77e8d

Browse files
committed
Replace rails guides source to v5.0.1
1 parent 1e5cb09 commit ab77e8d

File tree

199 files changed

+8207
-47880
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

199 files changed

+8207
-47880
lines changed

BASE_PATH.example

-1
This file was deleted.

CC-BY-SA.png

-17.2 KB
Binary file not shown.

CHANGELOG.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## Rails 5.0.1 (December 21, 2016) ##
2+
3+
* No changes.
4+
5+
6+
## Rails 5.0.1.rc2 (December 10, 2016) ##
7+
8+
* No changes.
9+
10+
11+
## Rails 5.0.1.rc1 (December 01, 2016) ##
12+
13+
* No changes.
14+
15+
16+
## Rails 5.0.0 (June 30, 2016) ##
17+
18+
* Update example of passing a proc to `:message` option for validating records.
19+
20+
This behavior was recently changed in [Pull Request #24199](https://github.com/rails/rails/pull/24119) to
21+
pass the object being validated as first argument to the `:message` proc,
22+
instead of the key of the field being validated.
23+
24+
*Prathamesh Sonpatki*
25+
26+
* Added new guide: Action Cable Overview.
27+
28+
*David Kuhta*
29+
30+
* Add code of conduct to contributing guide.
31+
32+
*Jon Moss*
33+
34+
* New section in Configuring: Configuring Active Job.
35+
36+
*Eliot Sykes*
37+
38+
* New section in Active Record Association Basics: Single Table Inheritance.
39+
40+
*Andrey Nering*
41+
42+
* New section in Active Record Querying: Understanding The Method Chaining.
43+
44+
*Andrey Nering*
45+
46+
* New section in Configuring: Search Engines Indexing.
47+
48+
*Andrey Nering*
49+
50+
Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/guides/CHANGELOG.md) for previous changes.

CONTRIBUTING.md

-20
This file was deleted.

Gemfile

-14
This file was deleted.

README.md

-158
This file was deleted.

Rakefile

+25-76
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,46 @@
1-
require 'pathname'
2-
3-
BASE_PATH = Pathname(IO.readlines('./BASE_PATH').first.chomp)
4-
5-
RAILS_PATH = BASE_PATH + 'rails'
6-
GUIDES_PATH = BASE_PATH + 'guides'
7-
PAGES_PATH = BASE_PATH + 'ruby-china.github.io'
8-
9-
RAILS_GUIDE_SOURCE_PATH = RAILS_PATH + 'guides/source/'
10-
11-
def update_rails_repo!
12-
FileUtils.cd(RAILS_PATH.expand_path) { `git pull origin master` }
13-
end
14-
15-
def get_rails_latest_sha1
16-
sha1 = nil
17-
FileUtils.cd(RAILS_PATH.expand_path) { sha1 = `git rev-parse HEAD` }
18-
sha1[0, 7]
19-
end
20-
21-
task :sanity_checks do
22-
abort("Abort. please clone the rails/rails repo under #{BASE_PATH}") if !File.exist? RAILS_PATH.expand_path
23-
abort("Abort. please clone the ruby-china/guides repo under #{BASE_PATH}") if !File.exist? GUIDES_PATH.expand_path
24-
end
25-
261
namespace :guides do
2+
273
desc 'Generate guides (for authors), use ONLY=foo to process just "foo.md"'
284
task :generate => 'generate:html'
295

30-
desc 'Deploy generated guides to github pages repository'
31-
task :deploy => :sanity_checks do
32-
ENV['RAILS_VERSION'] = get_rails_latest_sha1
33-
ENV['ALL'] = '1'
34-
ENV['GUIDES_LANGUAGE'] = 'zh-CN'
35-
Rake::Task['guides:generate:html'].invoke
36-
37-
# the dot will copy contents under a folder, instead of copy the folder.
38-
FileUtils.cp_r("#{GUIDES_PATH.expand_path}/output/zh-CN/.", PAGES_PATH.expand_path)
6+
namespace :generate do
397

40-
Dir.chdir(PAGES_PATH.expand_path) do
41-
`git add -A .`
42-
`git commit -m '#{%Q[Site updated @ #{Time.now.strftime("%a %b %-d %H:%M:%S %Z %Y")}]}'`
43-
`git push origin master`
8+
desc "Generate HTML guides"
9+
task :html do
10+
ENV["WARNINGS"] = "1" # authors can't disable this
11+
ruby "rails_guides.rb"
4412
end
4513

46-
puts 'Deploy Complete. : )'
47-
end
48-
49-
desc 'Update a given English guide'
50-
task :update_guide => :sanity_checks do
51-
update_rails_repo!
52-
53-
guide_to_be_updated = ARGV.last
54-
guide_path = (RAILS_GUIDE_SOURCE_PATH + guide_to_be_updated).expand_path
55-
56-
if File.exist? guide_path
57-
FileUtils.cp(guide_path, "#{GUIDES_PATH.expand_path}/source/")
58-
puts "Update: #{guide_path} Complete. : )"
59-
else
60-
`ls #{guide_path}`
14+
desc "Generate .mobi file. The kindlegen executable must be in your PATH. You can get it for free from http://www.amazon.com/gp/feature.html?docId=1000765211"
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
6124
end
62-
63-
# trick rake that ARGV.last is a task :P
64-
task guide_to_be_updated.to_sym do; end
65-
end
66-
67-
desc 'Update all English guides'
68-
task :update_guides => :sanity_checks do
69-
update_rails_repo!
70-
71-
FileUtils.cp_r(Pathname.glob("#{RAILS_GUIDE_SOURCE_PATH.expand_path}/*.md"), "#{GUIDES_PATH.expand_path}/source")
72-
73-
puts 'Update all English Guides. : D'
7425
end
7526

76-
namespace :generate do
77-
desc "Generate HTML guides"
78-
task :html do
79-
ENV["WARN_BROKEN_LINKS"] = "1" # authors can't disable this
80-
ruby "rails_guides.rb"
81-
end
27+
# Validate guides -------------------------------------------------------------------------
28+
desc 'Validate guides, use ONLY=foo to process just "foo.html"'
29+
task :validate do
30+
ruby "w3c_validator.rb"
8231
end
8332

8433
desc "Show help"
8534
task :help do
8635
puts <<-help
8736
88-
Guides are taken from the source directory, and the resulting HTML goes into the
37+
Guides are taken from the source directory, and the result goes into the
8938
output directory. Assets are stored under files, and copied to output/files as
9039
part of the generation process.
9140
92-
All this process is handled via rake tasks, here's a full list of them:
41+
You can generate HTML, Kindle or both formats using the `guides:generate` task.
42+
43+
All of these processes are handled via rake tasks, here's a full list of them:
9344
9445
#{%x[rake -T]}
9546
Some arguments may be passed via environment variables:
@@ -125,6 +76,4 @@ Examples:
12576
end
12677
end
12778

128-
task :default do
129-
Rake::Task['guides:generate'].invoke
130-
end
79+
task :default => 'guides:help'

assets/images/belongs_to.png

-273 Bytes
Loading

assets/images/favicon.ico

15.4 KB
Binary file not shown.
Loading
Loading
Loading

assets/images/has_many.png

-69 Bytes
Loading

assets/images/rails_guides_logo.gif

-1.3 KB
Loading

assets/javascripts/guides.js

-6
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,3 @@ var guidesIndex = {
5151
window.location = url;
5252
}
5353
};
54-
55-
// Disable autolink inside example code blocks of guides.
56-
$(document).ready(function() {
57-
SyntaxHighlighter.defaults['auto-links'] = false;
58-
SyntaxHighlighter.all();
59-
});

assets/javascripts/responsive-tables.js

100755100644
File mode changed.

0 commit comments

Comments
 (0)