railties 3.1.1.rc2 → 3.1.1.rc3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +2 -1
- data/guides/source/asset_pipeline.textile +9 -0
- data/lib/rails/application.rb +1 -1
- data/lib/rails/application/configuration.rb +14 -13
- data/lib/rails/engine.rb +1 -1
- data/lib/rails/generators/app_base.rb +2 -2
- data/lib/rails/initializable.rb +3 -2
- data/lib/rails/version.rb +1 -1
- metadata +10 -10
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
|
-
*
|
|
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>
|
data/lib/rails/application.rb
CHANGED
|
@@ -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
|
|
39
|
-
@assets.paths
|
|
40
|
-
@assets.precompile
|
|
41
|
-
|
|
42
|
-
@assets.prefix
|
|
43
|
-
@assets.version
|
|
44
|
-
@assets.debug
|
|
45
|
-
@assets.compile
|
|
46
|
-
@assets.digest
|
|
47
|
-
@assets.manifest
|
|
48
|
-
@assets.cache_store
|
|
49
|
-
@assets.js_compressor
|
|
50
|
-
@assets.css_compressor
|
|
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
|
data/lib/rails/engine.rb
CHANGED
|
@@ -539,7 +539,7 @@ module Rails
|
|
|
539
539
|
require environment if environment
|
|
540
540
|
end
|
|
541
541
|
|
|
542
|
-
initializer :append_assets_path, :group => :
|
|
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.
|
|
212
|
-
gem 'coffee-rails', #{options.dev? || options.edge? ? ":git => 'git://github.com/rails/coffee-rails.git', :branch => '3-1-stable'" : "'~> 3.1.
|
|
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
|
data/lib/rails/initializable.rb
CHANGED
|
@@ -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
|
|
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
|
|
55
|
+
initializer.run(*args) if initializer.belongs_to?(group)
|
|
55
56
|
end
|
|
56
57
|
@ran = true
|
|
57
58
|
end
|
data/lib/rails/version.rb
CHANGED
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:
|
|
4
|
+
hash: 977940592
|
|
5
5
|
prerelease: true
|
|
6
6
|
segments:
|
|
7
7
|
- 3
|
|
8
8
|
- 1
|
|
9
9
|
- 1
|
|
10
|
-
-
|
|
11
|
-
version: 3.1.1.
|
|
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-
|
|
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:
|
|
93
|
+
hash: 977940592
|
|
94
94
|
segments:
|
|
95
95
|
- 3
|
|
96
96
|
- 1
|
|
97
97
|
- 1
|
|
98
|
-
-
|
|
99
|
-
version: 3.1.1.
|
|
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:
|
|
110
|
+
hash: 977940592
|
|
111
111
|
segments:
|
|
112
112
|
- 3
|
|
113
113
|
- 1
|
|
114
114
|
- 1
|
|
115
|
-
-
|
|
116
|
-
version: 3.1.1.
|
|
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."
|