File tree Expand file tree Collapse file tree 5 files changed +17
-10
lines changed Expand file tree Collapse file tree 5 files changed +17
-10
lines changed Original file line number Diff line number Diff line change
1
+ require 'sprockets/rails/version'
1
2
if defined? Rails ::Railtie
2
3
require 'sprockets/railtie'
3
4
end
Original file line number Diff line number Diff line change
1
+ module Sprockets
2
+ module Rails
3
+ VERSION = "2.1.1"
4
+ end
5
+ end
Original file line number Diff line number Diff line change @@ -69,16 +69,14 @@ def configure(&block)
69
69
70
70
# Configuration options that should invalidate
71
71
# the Sprockets cache when changed.
72
- version_fragments = [
72
+ app . assets . version = [
73
+ app . assets . version ,
73
74
config . assets . version ,
74
75
config . action_controller . relative_url_root ,
75
- config . action_controller . asset_host
76
+ config . action_controller . asset_host ,
77
+ Sprockets ::Rails ::VERSION ,
76
78
] . compact . join ( '-' )
77
79
78
- if version_fragments . present?
79
- app . assets . version += "-#{ version_fragments } "
80
- end
81
-
82
80
# Copy config.assets.paths to Sprockets
83
81
config . assets . paths . each do |path |
84
82
app . assets . append_path path
Original file line number Diff line number Diff line change
1
+ $:. unshift File . expand_path ( "../lib" , __FILE__ )
2
+ require "sprockets/rails/version"
3
+
1
4
Gem ::Specification . new do |s |
2
5
s . name = "sprockets-rails"
3
- s . version = "2.1.1"
6
+ s . version = Sprockets :: Rails :: VERSION
4
7
5
8
s . homepage = "https://github.com/rails/sprockets-rails"
6
9
s . summary = "Sprockets Rails integration"
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ def test_defaults
50
50
assert_kind_of Sprockets ::Environment , env
51
51
52
52
assert_equal ROOT , env . root
53
- assert_equal "test" , env . version
53
+ assert_equal "test-- #{ Sprockets :: Rails :: VERSION } " , env . version
54
54
assert env . cache
55
55
assert_equal [ ] , env . paths
56
56
assert_nil env . js_compressor
@@ -108,7 +108,7 @@ def test_version
108
108
app . initialize!
109
109
110
110
assert env = app . assets
111
- assert_equal "test-v2" , env . version
111
+ assert_equal "test-v2- #{ Sprockets :: Rails :: VERSION } " , env . version
112
112
end
113
113
114
114
def test_version_fragments
@@ -120,7 +120,7 @@ def test_version_fragments
120
120
app . initialize!
121
121
122
122
assert env = app . assets
123
- assert_equal "test-v2-some-path-http://some-cdn.com" , env . version
123
+ assert_equal "test-v2-some-path-http://some-cdn.com- #{ Sprockets :: Rails :: VERSION } " , env . version
124
124
end
125
125
126
126
def test_configure
You can’t perform that action at this time.
0 commit comments