Skip to content

Commit e18cce1

Browse files
committed
Restore config.assets.manifest option
1 parent 8bf70f6 commit e18cce1

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
### Master
22

3+
* Restore `config.assets.manifest` option, which was removed in Rails 4.0.0.
4+
This change does not affect existing behavior if the option is not set.
5+
6+
*Johnny Shields*
7+
38
* Assets not in the precompile list can be checked for errors by setting
49
`config.assets.raise_runtime_errors = true` in any environment
510

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ config.assets.version = 'v2'
8383

8484
Defaults to `/assets`. Changes the directory to compile assets to.
8585

86+
**`config.assets.manifest`**
87+
88+
Defines the full path to be used for the asset precompiler's manifest file. Defaults to using the `config.assets.prefix` directory within the public folder.
89+
8690
**`config.assets.digest`**
8791

8892
Link to undigest asset filenames. This option will eventually go away. Unless when `compile` is disabled.

lib/sprockets/railtie.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def configure(&block)
5050
config.assets._blocks = []
5151
config.assets.paths = []
5252
config.assets.prefix = "/assets"
53+
config.assets.manifest = false
5354
config.assets.precompile = [LOOSE_APP_ASSETS, /(?:\/|\\|\A)application\.(css|js)$/]
5455
config.assets.version = ""
5556
config.assets.debug = false
@@ -64,7 +65,7 @@ def configure(&block)
6465
config.after_initialize do |app|
6566
config = app.config
6667

67-
manifest_path = File.join(app.root, 'public', config.assets.prefix)
68+
manifest_path = config.assets.manifest || File.join(app.root, 'public', config.assets.prefix)
6869

6970
# Configuration options that should invalidate
7071
# the Sprockets cache when changed.

test/test_railtie.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,13 @@ def test_sprockets_context_helper
174174
assert_equal false, env.context_class.digest_assets
175175
assert_equal nil, env.context_class.config.asset_host
176176
end
177+
178+
def test_manifest_path
179+
app.configure do
180+
config.assets.manifest = Rails.root.join('config','foo')
181+
end
182+
app.initialize!
183+
184+
assert_match %r{config/foo/manifest-.*.json}, ActionView::Base.assets_manifest.path
185+
end
177186
end

0 commit comments

Comments
 (0)