railties 3.1.1.rc2 → 3.1.1.rc3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  * Add jquery-rails to Gemfile of plugins, test/dummy app needs it. Closes #3091. [Santiago Pastorino]
4
4
 
5
- * `rake assets:precompile` loads the application but does not initialize it.
5
+ * Add config.assets.initialize_on_precompile which, when set to false, forces
6
+ `rake assets:precompile` to load the application but does not initialize it.
6
7
 
7
8
  To the app developer, this means configuration add in
8
9
  config/initializers/* will not be executed.
@@ -346,6 +346,15 @@ The rake task is:
346
346
  bundle exec rake assets:precompile
347
347
  </plain>
348
348
 
349
+ For faster asset precompiles, you can partially load your application by setting
350
+ +config.assets.initialize_on_precompile+ to false, though in that case templates
351
+ cannot see application objects or methods. *Heroku requires this to be false.*
352
+
353
+ WARNING: If you set +config.assets.initialize_on_precompile+ to false, be sure to
354
+ test +rake assets:precompile+ locally before deploying. It may expose bugs where
355
+ your assets reference application objects or methods, since those are still
356
+ in scope in development mode regardless of the value of this flag.
357
+
349
358
  Capistrano (v2.8.0 and above) has a recipe to handle this in deployment. Add the following line to +Capfile+:
350
359
 
351
360
  <erb>
@@ -91,7 +91,7 @@ module Rails
91
91
  @routes_reloader ||= RoutesReloader.new
92
92
  end
93
93
 
94
- def initialize!(group=nil)
94
+ def initialize!(group=:default)
95
95
  raise "Application has been already initialized." if @initialized
96
96
  run_initializers(group, self)
97
97
  @initialized = true
@@ -35,19 +35,20 @@ module Rails
35
35
  @cache_store = [ :file_store, "#{root}/tmp/cache/" ]
36
36
 
37
37
  @assets = ActiveSupport::OrderedOptions.new
38
- @assets.enabled = false
39
- @assets.paths = []
40
- @assets.precompile = [ Proc.new{ |path| !File.extname(path).in?(['.js', '.css']) },
41
- /(?:\/|\\|\A)application\.(css|js)$/ ]
42
- @assets.prefix = "/assets"
43
- @assets.version = ''
44
- @assets.debug = false
45
- @assets.compile = true
46
- @assets.digest = false
47
- @assets.manifest = nil
48
- @assets.cache_store = [ :file_store, "#{root}/tmp/cache/assets/" ]
49
- @assets.js_compressor = nil
50
- @assets.css_compressor = nil
38
+ @assets.enabled = false
39
+ @assets.paths = []
40
+ @assets.precompile = [ Proc.new{ |path| !File.extname(path).in?(['.js', '.css']) },
41
+ /(?:\/|\\|\A)application\.(css|js)$/ ]
42
+ @assets.prefix = "/assets"
43
+ @assets.version = ''
44
+ @assets.debug = false
45
+ @assets.compile = true
46
+ @assets.digest = false
47
+ @assets.manifest = nil
48
+ @assets.cache_store = [ :file_store, "#{root}/tmp/cache/assets/" ]
49
+ @assets.js_compressor = nil
50
+ @assets.css_compressor = nil
51
+ @assets.initialize_on_precompile = true
51
52
  end
52
53
 
53
54
  def compiled_asset_path
@@ -539,7 +539,7 @@ module Rails
539
539
  require environment if environment
540
540
  end
541
541
 
542
- initializer :append_assets_path, :group => :assets do |app|
542
+ initializer :append_assets_path, :group => :all do |app|
543
543
  app.config.assets.paths.unshift(*paths["vendor/assets"].existent_directories)
544
544
  app.config.assets.paths.unshift(*paths["lib/assets"].existent_directories)
545
545
  app.config.assets.paths.unshift(*paths["app/assets"].existent_directories)
@@ -208,8 +208,8 @@ module Rails
208
208
  # Gems used only for assets and not required
209
209
  # in production environments by default.
210
210
  group :assets do
211
- gem 'sass-rails', #{options.dev? || options.edge? ? " :git => 'git://github.com/rails/sass-rails.git', :branch => '3-1-stable'" : " '~> 3.1.0'"}
212
- gem 'coffee-rails', #{options.dev? || options.edge? ? ":git => 'git://github.com/rails/coffee-rails.git', :branch => '3-1-stable'" : "'~> 3.1.0'"}
211
+ gem 'sass-rails', #{options.dev? || options.edge? ? " :git => 'git://github.com/rails/sass-rails.git', :branch => '3-1-stable'" : " '~> 3.1.4'"}
212
+ gem 'coffee-rails', #{options.dev? || options.edge? ? ":git => 'git://github.com/rails/coffee-rails.git', :branch => '3-1-stable'" : "'~> 3.1.1'"}
213
213
  gem 'uglifier', '>= 1.0.3'
214
214
  end
215
215
  GEMFILE
@@ -10,6 +10,7 @@ module Rails
10
10
  attr_reader :name, :block
11
11
 
12
12
  def initialize(name, context, options, &block)
13
+ options[:group] ||= :default
13
14
  @name, @context, @options, @block = name, context, options, block
14
15
  end
15
16
 
@@ -48,10 +49,10 @@ module Rails
48
49
  end
49
50
  end
50
51
 
51
- def run_initializers(group=nil, *args)
52
+ def run_initializers(group=:default, *args)
52
53
  return if instance_variable_defined?(:@ran)
53
54
  initializers.tsort.each do |initializer|
54
- initializer.run(*args) if group.nil? || initializer.belongs_to?(group)
55
+ initializer.run(*args) if initializer.belongs_to?(group)
55
56
  end
56
57
  @ran = true
57
58
  end
@@ -3,7 +3,7 @@ module Rails
3
3
  MAJOR = 3
4
4
  MINOR = 1
5
5
  TINY = 1
6
- PRE = "rc2"
6
+ PRE = "rc3"
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
- hash: 977940595
4
+ hash: 977940592
5
5
  prerelease: true
6
6
  segments:
7
7
  - 3
8
8
  - 1
9
9
  - 1
10
- - rc2
11
- version: 3.1.1.rc2
10
+ - rc3
11
+ version: 3.1.1.rc3
12
12
  platform: ruby
13
13
  authors:
14
14
  - David Heinemeier Hansson
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-09-29 00:00:00 -03:00
19
+ date: 2011-10-05 00:00:00 -02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -90,13 +90,13 @@ dependencies:
90
90
  requirements:
91
91
  - - "="
92
92
  - !ruby/object:Gem::Version
93
- hash: 977940595
93
+ hash: 977940592
94
94
  segments:
95
95
  - 3
96
96
  - 1
97
97
  - 1
98
- - rc2
99
- version: 3.1.1.rc2
98
+ - rc3
99
+ version: 3.1.1.rc3
100
100
  type: :runtime
101
101
  version_requirements: *id005
102
102
  - !ruby/object:Gem::Dependency
@@ -107,13 +107,13 @@ dependencies:
107
107
  requirements:
108
108
  - - "="
109
109
  - !ruby/object:Gem::Version
110
- hash: 977940595
110
+ hash: 977940592
111
111
  segments:
112
112
  - 3
113
113
  - 1
114
114
  - 1
115
- - rc2
116
- version: 3.1.1.rc2
115
+ - rc3
116
+ version: 3.1.1.rc3
117
117
  type: :runtime
118
118
  version_requirements: *id006
119
119
  description: "Rails internals: application bootup, plugins, generators, and rake tasks."