railties 4.0.0.rc1 → 4.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37e89dda5a168600b16ced676d5df9369fe7c3a4
4
- data.tar.gz: 53de3cda6db70ee7ad7e39198d8bf0ee2fb9b348
3
+ metadata.gz: c7d0ac66750baeacce6b9e90d84c9b7bcdc71549
4
+ data.tar.gz: 15034548268f38bb3f44103d3e31b79a115f5bfd
5
5
  SHA512:
6
- metadata.gz: 6c1dc30721c0547579a5c877fb2deec2d76895c6e541cc9becaa026b37ab3a8f53112cfc3e1a45ae4acdd46ef8b48a77a0c3693c3fb6bef2b6a4eef950e593a5
7
- data.tar.gz: d049ff1041a82b40557189150497da39423b9016d041d9b8c03575c6d8474929bcb804f26920a927ef07ebaa8171555944b5dee253d98531aac5e9947363b670
6
+ metadata.gz: 95d5ab27dfe050955053d0c139fa25f4dcd69cc3673071fbf62d29f6db12e11a5630c70b4230991560d284690300933c74e3b6818f6ab8bafb87d8fef0f011f0
7
+ data.tar.gz: 1e3a16080403cb1d91df41d2a959bdd0858f13a62cc726574325d68385cfb6eb78a5dee22cfd8e5ece3a6813002c1e6318ba4d67c6b9df635fa9f13d7b75f54c
@@ -1,4 +1,11 @@
1
- ## Rails 4.0.0 (unreleased) ##
1
+ ## Rails 4.0.0.rc2 (June 11, 2013) ##
2
+
3
+ * Clearing autoloaded constants triggers routes reloading [Fixes #10685].
4
+
5
+ *Xavier Noria*
6
+
7
+
8
+ ## Rails 4.0.0.rc1 (April 29, 2013) ##
2
9
 
3
10
  * Move rails.png into a data-uri. One less file to get generated into a new
4
11
  application. This is also consistent with the removal of index.html.
@@ -93,6 +93,7 @@ module Rails
93
93
  # dispatches the request to the underlying middleware stack.
94
94
  def call(env)
95
95
  env["ORIGINAL_FULLPATH"] = build_original_fullpath(env)
96
+ env["ORIGINAL_SCRIPT_NAME"] = env["SCRIPT_NAME"]
96
97
  super(env)
97
98
  end
98
99
 
@@ -62,17 +62,28 @@ module Rails
62
62
  ActiveSupport.run_load_hooks(:after_initialize, self)
63
63
  end
64
64
 
65
- # Set app reload just after the finisher hook to ensure
66
- # routes added in the hook are still loaded.
65
+ # Set routes reload after the finisher hook to ensure routes added in
66
+ # the hook are taken into account.
67
67
  initializer :set_routes_reloader_hook do
68
68
  reloader = routes_reloader
69
69
  reloader.execute_if_updated
70
70
  self.reloaders << reloader
71
- ActionDispatch::Reloader.to_prepare { reloader.execute_if_updated }
71
+ ActionDispatch::Reloader.to_prepare do
72
+ # We configure #execute rather than #execute_if_updated because if
73
+ # autoloaded constants are cleared we need to reload routes also in
74
+ # case any was used there, as in
75
+ #
76
+ # mount MailPreview => 'mail_view'
77
+ #
78
+ # This means routes are also reloaded if i18n is updated, which
79
+ # might not be necessary, but in order to be more precise we need
80
+ # some sort of reloaders dependency support, to be added.
81
+ reloader.execute
82
+ end
72
83
  end
73
84
 
74
- # Set app reload just after the finisher hook to ensure
75
- # paths added in the hook are still loaded.
85
+ # Set clearing dependencies after the finisher hook to ensure paths
86
+ # added in the hook are taken into account.
76
87
  initializer :set_clear_dependencies_hook, group: :all do
77
88
  callback = lambda do
78
89
  ActiveSupport::DescendantsTracker.clear
@@ -82,9 +93,17 @@ module Rails
82
93
  if config.reload_classes_only_on_change
83
94
  reloader = config.file_watcher.new(*watchable_args, &callback)
84
95
  self.reloaders << reloader
85
- # We need to set a to_prepare callback regardless of the reloader result, i.e.
86
- # models should be reloaded if any of the reloaders (i18n, routes) were updated.
87
- ActionDispatch::Reloader.to_prepare(prepend: true){ reloader.execute }
96
+
97
+ # Prepend this callback to have autoloaded constants cleared before
98
+ # any other possible reloading, in case they need to autoload fresh
99
+ # constants.
100
+ ActionDispatch::Reloader.to_prepare(prepend: true) do
101
+ # In addition to changes detected by the file watcher, if routes
102
+ # or i18n have been updated we also need to clear constants,
103
+ # that's why we run #execute rather than #execute_if_updated, this
104
+ # callback has to clear autoloaded constants after any update.
105
+ reloader.execute
106
+ end
88
107
  else
89
108
  ActionDispatch::Reloader.to_cleanup(&callback)
90
109
  end
@@ -116,7 +116,7 @@ module Rails
116
116
 
117
117
  def database_gemfile_entry
118
118
  options[:skip_active_record] ? "" :
119
- <<-GEMFILE.strip_heredoc.chomp
119
+ <<-GEMFILE.strip_heredoc
120
120
  # Use #{options[:database]} as the database for Active Record
121
121
  gem '#{gem_for_database}'
122
122
  GEMFILE
@@ -193,7 +193,7 @@ module Rails
193
193
  else
194
194
  <<-GEMFILE.strip_heredoc
195
195
  # Use SCSS for stylesheets
196
- gem 'sass-rails', '~> 4.0.0.rc1'
196
+ gem 'sass-rails', '~> 4.0.0.rc2'
197
197
 
198
198
  # Use Uglifier as compressor for JavaScript assets
199
199
  gem 'uglifier', '>= 1.3.0'
@@ -56,6 +56,7 @@ module Rails
56
56
  def app
57
57
  directory 'app'
58
58
 
59
+ keep_file 'app/assets/images'
59
60
  keep_file 'app/mailers'
60
61
  keep_file 'app/models'
61
62
 
@@ -4,13 +4,11 @@ source 'https://rubygems.org'
4
4
 
5
5
  <%= database_gemfile_entry -%>
6
6
 
7
- <%= "gem 'jruby-openssl'\n" if defined?(JRUBY_VERSION) -%>
8
-
9
7
  <%= assets_gemfile_entry %>
10
8
  <%= javascript_gemfile_entry -%>
11
9
 
12
10
  # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
13
- gem 'jbuilder', '~> 1.0.1'
11
+ gem 'jbuilder', '~> 1.2'
14
12
 
15
13
  group :doc do
16
14
  # bundle exec rake doc:rails generates the API under doc/api.
@@ -7,8 +7,8 @@
7
7
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
8
  // compiled file.
9
9
  //
10
- // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
- // GO AFTER THE REQUIRES BELOW.
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
12
  //
13
13
  <% unless options[:skip_javascript] -%>
14
14
  //= require <%= options[:javascript] %>
@@ -1,5 +1,5 @@
1
- # Load the rails application.
1
+ # Load the Rails application.
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
- # Initialize the rails application.
4
+ # Initialize the Rails application.
5
5
  <%= app_const %>.initialize!
@@ -7,8 +7,8 @@
7
7
  ActiveSupport.on_load(:action_controller) do
8
8
  wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
9
  end
10
-
11
10
  <%- unless options.skip_active_record? -%>
11
+
12
12
  # To enable root element in JSON for ActiveRecord objects.
13
13
  # ActiveSupport.on_load(:active_record) do
14
14
  # self.include_root_in_json = true
@@ -39,6 +39,13 @@
39
39
  # get 'recent', on: :collection
40
40
  # end
41
41
  # end
42
+
43
+ # Example resource route with concerns:
44
+ # concern :toggleable do
45
+ # post 'toggle'
46
+ # end
47
+ # resources :posts, concerns: :toggleable
48
+ # resources :photos, concerns: :toggleable
42
49
 
43
50
  # Example resource route within a namespace:
44
51
  # namespace :admin do
@@ -1,4 +1,4 @@
1
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
1
+ # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
2
2
 
3
3
  ENGINE_ROOT = File.expand_path('../..', __FILE__)
4
4
  ENGINE_PATH = File.expand_path('../../lib/<%= name -%>/engine', __FILE__)
@@ -7,7 +7,7 @@
7
7
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
8
  // compiled file.
9
9
  //
10
- // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
- // GO AFTER THE REQUIRES BELOW.
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
12
  //
13
13
  //= require_tree .
@@ -1,61 +1,72 @@
1
- require 'rdoc/task'
2
- require 'rails/api/task'
1
+ begin
2
+ require 'rdoc/task'
3
+ rescue LoadError
4
+ # Rubinius installs RDoc as a gem, and for this interpreter "rdoc/task" is
5
+ # available only if the application bundle includes "rdoc" (normally as a
6
+ # dependency of the "sdoc" gem.)
7
+ #
8
+ # If RDoc is not available it is fine that we do not generate the tasks that
9
+ # depend on it. Just be robust to this gotcha and go on.
10
+ else
11
+ require 'rails/api/task'
3
12
 
4
- # Monkey-patch to remove redoc'ing and clobber descriptions to cut down on rake -T noise
5
- class RDocTaskWithoutDescriptions < RDoc::Task
6
- include ::Rake::DSL
13
+ # Monkey-patch to remove redoc'ing and clobber descriptions to cut down on rake -T noise
14
+ class RDocTaskWithoutDescriptions < RDoc::Task
15
+ include ::Rake::DSL
7
16
 
8
- def define
9
- task rdoc_task_name
17
+ def define
18
+ task rdoc_task_name
10
19
 
11
- task rerdoc_task_name => [clobber_task_name, rdoc_task_name]
20
+ task rerdoc_task_name => [clobber_task_name, rdoc_task_name]
12
21
 
13
- task clobber_task_name do
14
- rm_r rdoc_dir rescue nil
15
- end
22
+ task clobber_task_name do
23
+ rm_r rdoc_dir rescue nil
24
+ end
16
25
 
17
- task :clobber => [clobber_task_name]
26
+ task :clobber => [clobber_task_name]
18
27
 
19
- directory @rdoc_dir
20
- task rdoc_task_name => [rdoc_target]
21
- file rdoc_target => @rdoc_files + [Rake.application.rakefile] do
22
- rm_r @rdoc_dir rescue nil
23
- @before_running_rdoc.call if @before_running_rdoc
24
- args = option_list + @rdoc_files
25
- if @external
26
- argstring = args.join(' ')
27
- sh %{ruby -Ivendor vendor/rd #{argstring}}
28
- else
29
- require 'rdoc/rdoc'
30
- RDoc::RDoc.new.document(args)
28
+ directory @rdoc_dir
29
+ task rdoc_task_name => [rdoc_target]
30
+ file rdoc_target => @rdoc_files + [Rake.application.rakefile] do
31
+ rm_r @rdoc_dir rescue nil
32
+ @before_running_rdoc.call if @before_running_rdoc
33
+ args = option_list + @rdoc_files
34
+ if @external
35
+ argstring = args.join(' ')
36
+ sh %{ruby -Ivendor vendor/rd #{argstring}}
37
+ else
38
+ require 'rdoc/rdoc'
39
+ RDoc::RDoc.new.document(args)
40
+ end
31
41
  end
42
+ self
32
43
  end
33
- self
34
44
  end
35
- end
36
45
 
37
- namespace :doc do
38
- def gem_path(gem_name)
39
- path = $LOAD_PATH.grep(/#{gem_name}[\w.-]*\/lib$/).first
40
- yield File.dirname(path) if path
41
- end
46
+ namespace :doc do
47
+ def gem_path(gem_name)
48
+ path = $LOAD_PATH.grep(/#{gem_name}[\w.-]*\/lib$/).first
49
+ yield File.dirname(path) if path
50
+ end
42
51
 
43
- RDocTaskWithoutDescriptions.new("app") { |rdoc|
44
- rdoc.rdoc_dir = 'doc/app'
45
- rdoc.template = ENV['template'] if ENV['template']
46
- rdoc.title = ENV['title'] || "Rails Application Documentation"
47
- rdoc.options << '--line-numbers'
48
- rdoc.options << '--charset' << 'utf-8'
49
- rdoc.rdoc_files.include('README.rdoc')
50
- rdoc.rdoc_files.include('app/**/*.rb')
51
- rdoc.rdoc_files.include('lib/**/*.rb')
52
- }
53
- Rake::Task['doc:app'].comment = "Generate docs for the app -- also available doc:rails, doc:guides (options: TEMPLATE=/rdoc-template.rb, TITLE=\"Custom Title\")"
52
+ RDocTaskWithoutDescriptions.new("app") { |rdoc|
53
+ rdoc.rdoc_dir = 'doc/app'
54
+ rdoc.template = ENV['template'] if ENV['template']
55
+ rdoc.title = ENV['title'] || "Rails Application Documentation"
56
+ rdoc.options << '--line-numbers'
57
+ rdoc.options << '--charset' << 'utf-8'
58
+ rdoc.rdoc_files.include('README.rdoc')
59
+ rdoc.rdoc_files.include('app/**/*.rb')
60
+ rdoc.rdoc_files.include('lib/**/*.rb')
61
+ }
62
+ Rake::Task['doc:app'].comment = "Generate docs for the app -- also available doc:rails, doc:guides (options: TEMPLATE=/rdoc-template.rb, TITLE=\"Custom Title\")"
54
63
 
55
- # desc 'Generate documentation for the Rails framework.'
56
- Rails::API::AppTask.new('rails')
64
+ # desc 'Generate documentation for the Rails framework.'
65
+ Rails::API::AppTask.new('rails')
66
+ end
67
+ end
57
68
 
58
- # desc "Generate Rails Guides"
69
+ namespace :doc do
59
70
  task :guides do
60
71
  # FIXME: Reaching outside lib directory is a bad idea
61
72
  require File.expand_path('../../../../../guides/rails_guides', __FILE__)
@@ -3,7 +3,7 @@ module Rails
3
3
  MAJOR = 4
4
4
  MINOR = 0
5
5
  TINY = 0
6
- PRE = "rc1"
6
+ PRE = "rc2"
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railties
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.rc1
4
+ version: 4.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-29 00:00:00.000000000 Z
11
+ date: 2013-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.0.rc1
19
+ version: 4.0.0.rc2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.0.rc1
26
+ version: 4.0.0.rc2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionpack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 4.0.0.rc1
33
+ version: 4.0.0.rc2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 4.0.0.rc1
40
+ version: 4.0.0.rc2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -300,6 +300,9 @@ files:
300
300
  - lib/rails/version.rb
301
301
  - lib/rails/welcome_controller.rb
302
302
  - lib/rails.rb
303
+ - lib/rails/generators/rails/generator/templates/templates/.empty_directory
304
+ - lib/rails/generators/rails/plugin_new/templates/app/mailers/.empty_directory
305
+ - lib/rails/generators/rails/plugin_new/templates/app/models/.empty_directory
303
306
  homepage: http://www.rubyonrails.org
304
307
  licenses:
305
308
  - MIT
@@ -322,7 +325,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
322
325
  version: 1.3.1
323
326
  requirements: []
324
327
  rubyforge_project:
325
- rubygems_version: 2.0.0
328
+ rubygems_version: 2.0.2
326
329
  signing_key:
327
330
  specification_version: 4
328
331
  summary: Tools for creating, working with, and running Rails applications.