railties 4.1.0.rc2 → 4.1.0

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: 1be2beeae0c3f636877ae764c0bf1743c168737f
4
- data.tar.gz: 60de602bb82cfc7bfe3c9356d09eae6b65a068e3
3
+ metadata.gz: 844474036d52ee24bd3903bece5a23870e9c8ff8
4
+ data.tar.gz: 82a1cb37eaf47023a553077bef02ce4acca3f597
5
5
  SHA512:
6
- metadata.gz: a63d45e26628f9c094af8c5a615eca427c2279f6dee97a18cefb0e2bb629f6d7544500c6ad66af536d4b565238d204312087f6ab0c715192ff4eb2a10ef1679e
7
- data.tar.gz: 100f2a2475917f2185eb61ecea773e2a1139e5e72396de461f16a02f1df3a3af95d04483f9bc729bc394e10c954dc3b7267697112b4e1d86b8163aa840bec3d7
6
+ metadata.gz: dbdb0f23807967942820b6560623206992e60711e3c3701af22afbf4ba05ad036f02e409e7fffeec14c17b90c9a666efe30048d86a23baf17fe2d3458ca89703
7
+ data.tar.gz: 206be71f0191f6e56e3d8a703b0beed272d1cb10d78dbf9edf7cc593b96d9257b9fb452dfc76e6e288645f0ffd851cf6d06af080866720b443f6edd55a542fcb
@@ -87,7 +87,7 @@ module Rails
87
87
  class << self
88
88
  def inherited(base)
89
89
  super
90
- Rails.application ||= base.instance
90
+ base.instance
91
91
  end
92
92
 
93
93
  # Makes the +new+ method public.
@@ -117,6 +117,8 @@ module Rails
117
117
  @railties = nil
118
118
  @message_verifiers = {}
119
119
 
120
+ Rails.application ||= self
121
+
120
122
  add_lib_to_load_path!
121
123
  ActiveSupport.run_load_hooks(:before_configuration, self)
122
124
 
@@ -332,6 +334,25 @@ module Rails
332
334
  config.helpers_paths
333
335
  end
334
336
 
337
+ console do
338
+ require "pp"
339
+ end
340
+
341
+ console do
342
+ unless ::Kernel.private_method_defined?(:y)
343
+ if RUBY_VERSION >= '2.0'
344
+ require "psych/y"
345
+ else
346
+ module ::Kernel
347
+ def y(*objects)
348
+ puts ::Psych.dump_stream(*objects)
349
+ end
350
+ private :y
351
+ end
352
+ end
353
+ end
354
+ end
355
+
335
356
  protected
336
357
 
337
358
  alias :build_middleware_stack :app
@@ -94,6 +94,7 @@ module Rails
94
94
  yaml = Pathname.new(paths["config/database"].first || "")
95
95
 
96
96
  config = if yaml.exist?
97
+ require "yaml"
97
98
  require "erb"
98
99
  YAML.load(ERB.new(yaml.read).result) || {}
99
100
  elsif ENV['DATABASE_URL']
@@ -429,7 +429,6 @@ module Rails
429
429
  # Load console and invoke the registered hooks.
430
430
  # Check <tt>Rails::Railtie.console</tt> for more info.
431
431
  def load_console(app=self)
432
- require "pp"
433
432
  require "rails/console/app"
434
433
  require "rails/console/helpers"
435
434
  run_console_blocks(app)
@@ -8,7 +8,7 @@ module Rails
8
8
  MAJOR = 4
9
9
  MINOR = 1
10
10
  TINY = 0
11
- PRE = "rc2"
11
+ PRE = nil
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  end
@@ -250,7 +250,7 @@ module Rails
250
250
  'Use SCSS for stylesheets')
251
251
  else
252
252
  gems << GemfileEntry.version('sass-rails',
253
- '~> 4.0.2',
253
+ '~> 4.0.3',
254
254
  'Use SCSS for stylesheets')
255
255
  end
256
256
 
@@ -4,8 +4,8 @@
4
4
  <h2><%%= pluralize(@<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>
5
5
 
6
6
  <ul>
7
- <%% @<%= singular_table_name %>.errors.full_messages.each do |msg| %>
8
- <li><%%= msg %></li>
7
+ <%% @<%= singular_table_name %>.errors.full_messages.each do |message| %>
8
+ <li><%%= message %></li>
9
9
  <%% end %>
10
10
  </ul>
11
11
  </div>
@@ -23,7 +23,27 @@ test:
23
23
  <<: *default
24
24
  database: <%= app_name %>_test
25
25
 
26
- # Do not keep production credentials in the repository,
27
- # instead read the configuration from the environment.
26
+ # As with config/secrets.yml, you never want to store sensitive information,
27
+ # like your database password, in your source code. If your source code is
28
+ # ever seen by anyone, they now have access to your database.
29
+ #
30
+ # Instead, provide the password as a unix environment variable when you boot
31
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
32
+ # for a full rundown on how to provide these environment variables in a
33
+ # production deployment.
34
+ #
35
+ # On Heroku and other platform providers, you may have a full connection URL
36
+ # available as an environment variable. For example:
37
+ #
38
+ # DATABASE_URL="frontbase://myuser:mypass@localhost/somedatabase"
39
+ #
40
+ # You can use this database configuration with:
41
+ #
42
+ # production:
43
+ # url: <%%= ENV['DATABASE_URL'] %>
44
+ #
28
45
  production:
29
- url: <%%= ENV["DATABASE_URL"] %>
46
+ <<: *default
47
+ database: <%= app_name %>_production
48
+ username: <%= app_name %>
49
+ password: <%%= ENV['<%= app_name.upcase %>_DATABASE_PASSWORD'] %>
@@ -61,7 +61,27 @@ test:
61
61
  <<: *default
62
62
  database: <%= app_name[0,4] %>_tst
63
63
 
64
- # Do not keep production credentials in the repository,
65
- # instead read the configuration from the environment.
64
+ # As with config/secrets.yml, you never want to store sensitive information,
65
+ # like your database password, in your source code. If your source code is
66
+ # ever seen by anyone, they now have access to your database.
67
+ #
68
+ # Instead, provide the password as a unix environment variable when you boot
69
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
70
+ # for a full rundown on how to provide these environment variables in a
71
+ # production deployment.
72
+ #
73
+ # On Heroku and other platform providers, you may have a full connection URL
74
+ # available as an environment variable. For example:
75
+ #
76
+ # DATABASE_URL="ibm-db://myuser:mypass@localhost/somedatabase"
77
+ #
78
+ # You can use this database configuration with:
79
+ #
80
+ # production:
81
+ # url: <%%= ENV['DATABASE_URL'] %>
82
+ #
66
83
  production:
67
- url: <%%= ENV["DATABASE_URL"] %>
84
+ <<: *default
85
+ database: <%= app_name %>_production
86
+ username: <%= app_name %>
87
+ password: <%%= ENV['<%= app_name.upcase %>_DATABASE_PASSWORD'] %>
@@ -53,7 +53,16 @@ test:
53
53
  <<: *default
54
54
  url: jdbc:db://localhost/<%= app_name %>_test
55
55
 
56
- # Do not keep production credentials in the repository,
57
- # instead read the configuration from the environment.
56
+ # As with config/secrets.yml, you never want to store sensitive information,
57
+ # like your database password, in your source code. If your source code is
58
+ # ever seen by anyone, they now have access to your database.
59
+ #
60
+ # Instead, provide the password as a unix environment variable when you boot
61
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
62
+ # for a full rundown on how to provide these environment variables in a
63
+ # production deployment.
64
+ #
58
65
  production:
59
- url: <%%= ENV["DATABASE_URL"] %>
66
+ url: jdbc:db://localhost/<%= app_name %>_production
67
+ username: <%= app_name %>
68
+ password: <%%= ENV['<%= app_name.upcase %>_DATABASE_PASSWORD'] %>
@@ -26,6 +26,27 @@ test:
26
26
  <<: *default
27
27
  database: <%= app_name %>_test
28
28
 
29
- # Do not keep production credentials in the repository,
30
- # instead read the configuration from the environment.
31
- production: <%%= ENV["DATABASE_URL"] %>
29
+ # As with config/secrets.yml, you never want to store sensitive information,
30
+ # like your database password, in your source code. If your source code is
31
+ # ever seen by anyone, they now have access to your database.
32
+ #
33
+ # Instead, provide the password as a unix environment variable when you boot
34
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
35
+ # for a full rundown on how to provide these environment variables in a
36
+ # production deployment.
37
+ #
38
+ # On Heroku and other platform providers, you may have a full connection URL
39
+ # available as an environment variable. For example:
40
+ #
41
+ # DATABASE_URL="mysql://myuser:mypass@localhost/somedatabase"
42
+ #
43
+ # You can use this database configuration with:
44
+ #
45
+ # production:
46
+ # url: <%%= ENV['DATABASE_URL'] %>
47
+ #
48
+ production:
49
+ <<: *default
50
+ database: <%= app_name %>_production
51
+ username: <%= app_name %>
52
+ password: <%%= ENV['<%= app_name.upcase %>_DATABASE_PASSWORD'] %>
@@ -42,7 +42,27 @@ test:
42
42
  <<: *default
43
43
  database: <%= app_name %>_test
44
44
 
45
- # Do not keep production credentials in the repository,
46
- # instead read the configuration from the environment.
45
+ # As with config/secrets.yml, you never want to store sensitive information,
46
+ # like your database password, in your source code. If your source code is
47
+ # ever seen by anyone, they now have access to your database.
48
+ #
49
+ # Instead, provide the password as a unix environment variable when you boot
50
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
51
+ # for a full rundown on how to provide these environment variables in a
52
+ # production deployment.
53
+ #
54
+ # On Heroku and other platform providers, you may have a full connection URL
55
+ # available as an environment variable. For example:
56
+ #
57
+ # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
58
+ #
59
+ # You can use this database configuration with:
60
+ #
61
+ # production:
62
+ # url: <%%= ENV['DATABASE_URL'] %>
63
+ #
47
64
  production:
48
- url: <%%= ENV["DATABASE_URL"] %>
65
+ <<: *default
66
+ database: <%= app_name %>_production
67
+ username: <%= app_name %>
68
+ password: <%%= ENV['<%= app_name.upcase %>_DATABASE_PASSWORD'] %>
@@ -18,7 +18,6 @@ test:
18
18
  <<: *default
19
19
  database: db/test.sqlite3
20
20
 
21
- # Do not keep production credentials in the repository,
22
- # instead read the configuration from the environment.
23
21
  production:
24
- url: <%%= ENV["DATABASE_URL"] %>
22
+ <<: *default
23
+ database: db/production.sqlite3
@@ -32,11 +32,27 @@ test:
32
32
  <<: *default
33
33
  database: <%= app_name %>_test
34
34
 
35
- # Avoid production credentials in the repository,
36
- # instead read the configuration from the environment.
35
+ # As with config/secrets.yml, you never want to store sensitive information,
36
+ # like your database password, in your source code. If your source code is
37
+ # ever seen by anyone, they now have access to your database.
37
38
  #
38
- # Example:
39
- # mysql2://myuser:mypass@localhost/somedatabase
39
+ # Instead, provide the password as a unix environment variable when you boot
40
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
41
+ # for a full rundown on how to provide these environment variables in a
42
+ # production deployment.
43
+ #
44
+ # On Heroku and other platform providers, you may have a full connection URL
45
+ # available as an environment variable. For example:
46
+ #
47
+ # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
48
+ #
49
+ # You can use this database configuration with:
50
+ #
51
+ # production:
52
+ # url: <%%= ENV['DATABASE_URL'] %>
40
53
  #
41
54
  production:
42
- url: <%%= ENV["DATABASE_URL"] %>
55
+ <<: *default
56
+ database: <%= app_name %>_production
57
+ username: <%= app_name %>
58
+ password: <%%= ENV['<%= app_name.upcase %>_DATABASE_PASSWORD'] %>
@@ -32,7 +32,27 @@ test:
32
32
  <<: *default
33
33
  database: <%= app_name %>_test
34
34
 
35
- # Do not keep production credentials in the repository,
36
- # instead read the configuration from the environment.
35
+ # As with config/secrets.yml, you never want to store sensitive information,
36
+ # like your database password, in your source code. If your source code is
37
+ # ever seen by anyone, they now have access to your database.
38
+ #
39
+ # Instead, provide the password as a unix environment variable when you boot
40
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
41
+ # for a full rundown on how to provide these environment variables in a
42
+ # production deployment.
43
+ #
44
+ # On Heroku and other platform providers, you may have a full connection URL
45
+ # available as an environment variable. For example:
46
+ #
47
+ # DATABASE_URL="oracle://myuser:mypass@localhost/somedatabase"
48
+ #
49
+ # You can use this database configuration with:
50
+ #
51
+ # production:
52
+ # url: <%%= ENV['DATABASE_URL'] %>
53
+ #
37
54
  production:
38
- url: <%%= ENV["DATABASE_URL"] %>
55
+ <<: *default
56
+ database: <%= app_name %>_production
57
+ username: <%= app_name %>
58
+ password: <%%= ENV['<%= app_name.upcase %>_DATABASE_PASSWORD'] %>
@@ -59,11 +59,27 @@ test:
59
59
  <<: *default
60
60
  database: <%= app_name %>_test
61
61
 
62
- # Do not keep production credentials in the repository,
63
- # instead read the configuration from the environment.
62
+ # As with config/secrets.yml, you never want to store sensitive information,
63
+ # like your database password, in your source code. If your source code is
64
+ # ever seen by anyone, they now have access to your database.
64
65
  #
65
- # Example:
66
- # postgres://myuser:mypass@localhost/somedatabase
66
+ # Instead, provide the password as a unix environment variable when you boot
67
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
68
+ # for a full rundown on how to provide these environment variables in a
69
+ # production deployment.
70
+ #
71
+ # On Heroku and other platform providers, you may have a full connection URL
72
+ # available as an environment variable. For example:
73
+ #
74
+ # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
75
+ #
76
+ # You can use this database configuration with:
77
+ #
78
+ # production:
79
+ # url: <%%= ENV['DATABASE_URL'] %>
67
80
  #
68
81
  production:
69
- url: <%%= ENV["DATABASE_URL"] %>
82
+ <<: *default
83
+ database: <%= app_name %>_production
84
+ username: <%= app_name %>
85
+ password: <%%= ENV['<%= app_name.upcase %>_DATABASE_PASSWORD'] %>
@@ -20,11 +20,6 @@ test:
20
20
  <<: *default
21
21
  database: db/test.sqlite3
22
22
 
23
- # Do not keep production credentials in the repository,
24
- # instead read the configuration from the environment.
25
- #
26
- # Example:
27
- # sqlite3://myuser:mypass@localhost/full/path/to/somedatabase
28
- #
29
23
  production:
30
- url: <%%= ENV["DATABASE_URL"] %>
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -42,7 +42,27 @@ test:
42
42
  <<: *default
43
43
  database: <%= app_name %>_test
44
44
 
45
- # Do not keep production credentials in the repository,
46
- # instead read the configuration from the environment.
45
+ # As with config/secrets.yml, you never want to store sensitive information,
46
+ # like your database password, in your source code. If your source code is
47
+ # ever seen by anyone, they now have access to your database.
48
+ #
49
+ # Instead, provide the password as a unix environment variable when you boot
50
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
51
+ # for a full rundown on how to provide these environment variables in a
52
+ # production deployment.
53
+ #
54
+ # On Heroku and other platform providers, you may have a full connection URL
55
+ # available as an environment variable. For example:
56
+ #
57
+ # DATABASE_URL="sqlserver://myuser:mypass@localhost/somedatabase"
58
+ #
59
+ # You can use this database configuration with:
60
+ #
61
+ # production:
62
+ # url: <%%= ENV['DATABASE_URL'] %>
63
+ #
47
64
  production:
48
- url: <%%= ENV["DATABASE_URL"] %>
65
+ <<: *default
66
+ database: <%= app_name %>_production
67
+ username: <%= app_name %>
68
+ password: <%%= ENV['<%= app_name.upcase %>_DATABASE_PASSWORD'] %>
@@ -2,4 +2,3 @@
2
2
 
3
3
  # Add new mime types for use in respond_to blocks:
4
4
  # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -31,7 +31,7 @@ class <%= controller_class_name %>Controller < ApplicationController
31
31
  if @<%= orm_instance.save %>
32
32
  redirect_to @<%= singular_table_name %>, notice: <%= "'#{human_name} was successfully created.'" %>
33
33
  else
34
- render action: 'new'
34
+ render :new
35
35
  end
36
36
  end
37
37
 
@@ -40,7 +40,7 @@ class <%= controller_class_name %>Controller < ApplicationController
40
40
  if @<%= orm_instance.update("#{singular_table_name}_params") %>
41
41
  redirect_to @<%= singular_table_name %>, notice: <%= "'#{human_name} was successfully updated.'" %>
42
42
  else
43
- render action: 'edit'
43
+ render :edit
44
44
  end
45
45
  end
46
46
 
@@ -221,26 +221,28 @@ module Rails
221
221
  protected
222
222
 
223
223
  def run_console_blocks(app) #:nodoc:
224
- self.class.console.each { |block| block.call(app) }
224
+ each_registered_block(:console) { |block| block.call(app) }
225
225
  end
226
226
 
227
227
  def run_generators_blocks(app) #:nodoc:
228
- self.class.generators.each { |block| block.call(app) }
228
+ each_registered_block(:generators) { |block| block.call(app) }
229
229
  end
230
230
 
231
231
  def run_runner_blocks(app) #:nodoc:
232
- self.class.runner.each { |block| block.call(app) }
232
+ each_registered_block(:runner) { |block| block.call(app) }
233
233
  end
234
234
 
235
235
  def run_tasks_blocks(app) #:nodoc:
236
236
  extend Rake::DSL
237
- self.class.rake_tasks.each { |block| instance_exec(app, &block) }
237
+ each_registered_block(:rake_tasks) { |block| instance_exec(app, &block) }
238
+ end
238
239
 
239
- # Load also tasks from all superclasses
240
- klass = self.class.superclass
240
+ private
241
241
 
242
- while klass.respond_to?(:rake_tasks)
243
- klass.rake_tasks.each { |t| instance_exec(app, &t) }
242
+ def each_registered_block(type, &block)
243
+ klass = self.class
244
+ while klass.respond_to?(type)
245
+ klass.public_send(type).each(&block)
244
246
  klass = klass.superclass
245
247
  end
246
248
  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.1.0.rc2
4
+ version: 4.1.0
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: 2014-03-25 00:00:00.000000000 Z
11
+ date: 2014-04-08 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.1.0.rc2
19
+ version: 4.1.0
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.1.0.rc2
26
+ version: 4.1.0
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.1.0.rc2
33
+ version: 4.1.0
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.1.0.rc2
40
+ version: 4.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - '='
80
80
  - !ruby/object:Gem::Version
81
- version: 4.1.0.rc2
81
+ version: 4.1.0
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - '='
87
87
  - !ruby/object:Gem::Version
88
- version: 4.1.0.rc2
88
+ version: 4.1.0
89
89
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
90
90
  email: david@loudthinking.com
91
91
  executables:
@@ -348,9 +348,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
348
348
  version: 1.9.3
349
349
  required_rubygems_version: !ruby/object:Gem::Requirement
350
350
  requirements:
351
- - - ">"
351
+ - - ">="
352
352
  - !ruby/object:Gem::Version
353
- version: 1.3.1
353
+ version: '0'
354
354
  requirements: []
355
355
  rubyforge_project:
356
356
  rubygems_version: 2.2.0