sinatra-asset-pipeline 0.3.0 → 0.3.1
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/lib/sinatra/asset_pipeline.rb +9 -3
- data/lib/sinatra/asset_pipeline/version.rb +1 -1
- metadata +18 -2
@@ -46,9 +46,8 @@ module Sinatra
|
|
46
46
|
app.helpers Sprockets::Helpers
|
47
47
|
|
48
48
|
app.configure :test, :development do
|
49
|
-
app.get '/assets/*' do |
|
50
|
-
|
51
|
-
asset = app.sprockets[key]
|
49
|
+
app.get '/assets/*' do |source|
|
50
|
+
asset = app.find_asset(source)
|
52
51
|
content_type asset.content_type
|
53
52
|
asset.to_s
|
54
53
|
end
|
@@ -58,5 +57,12 @@ module Sinatra
|
|
58
57
|
def set_default(key, default)
|
59
58
|
self.set(key, default) unless self.respond_to? key
|
60
59
|
end
|
60
|
+
|
61
|
+
# Look for asset in Sprockets
|
62
|
+
# If not found try without digest
|
63
|
+
def find_asset(source)
|
64
|
+
sprockets.find_asset(source) ||
|
65
|
+
sprockets.find_asset(source.gsub(/(-\w+)(?!.*-\w+)/, ''))
|
66
|
+
end
|
61
67
|
end
|
62
68
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-asset-pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -139,6 +139,22 @@ dependencies:
|
|
139
139
|
- - ! '>='
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: rack-test
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
142
158
|
description: An asset pipeline implementation for Sinatra based on Sprockets with
|
143
159
|
support for SASS, CoffeeScript and ERB.
|
144
160
|
email:
|