roda-sprocket_assets 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/roda/plugins/sprocket_assets.rb +17 -3
- data/roda-sprocket_assets.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d003a3030c8e881064e8b4225226ddec0defe31
|
4
|
+
data.tar.gz: ad76a9e326fc4c3493b9485198ae8659634f21b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c355a4779567330fe97ae6fea19c45bf4a0f62b93c5b60965624416174bed333fce3cf6635a887cbf3e23b063e1280f303bba1d85e45fca26d77214af8d3a5c
|
7
|
+
data.tar.gz: 1c390effcda4ff6d55a25d6c43c647c053abea11d224577cae712fa61501b2cf05225dac4d1c64e9b11803ede90f39002d8d4834b58baeb929b550a5f4382db8
|
@@ -17,6 +17,7 @@ class Roda
|
|
17
17
|
js_compressor: nil,
|
18
18
|
host: nil,
|
19
19
|
digest: true,
|
20
|
+
opal: false,
|
20
21
|
debug: false
|
21
22
|
}.freeze
|
22
23
|
|
@@ -40,6 +41,16 @@ class Roda
|
|
40
41
|
paths.each { |path| opts[:sprockets].append_path path }
|
41
42
|
end
|
42
43
|
|
44
|
+
if opts[:opal]
|
45
|
+
require 'opal/sprockets/server'
|
46
|
+
require 'opal/sprockets/processor'
|
47
|
+
|
48
|
+
Opal.paths.each do |path|
|
49
|
+
puts path
|
50
|
+
opts[:sprockets].append_path path
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
43
54
|
Sprockets::Helpers.configure do |config|
|
44
55
|
config.environment = opts[:sprockets]
|
45
56
|
config.digest = opts[:digest]
|
@@ -84,9 +95,12 @@ class Roda
|
|
84
95
|
def sprocket_assets
|
85
96
|
scope.class.configure :test, :development do
|
86
97
|
get self.class.sprocket_assets_regexp do |path|
|
87
|
-
|
88
|
-
env_sprockets
|
89
|
-
|
98
|
+
opts = scope.sprocket_assets_opts
|
99
|
+
env_sprockets = scope.request.env.dup
|
100
|
+
env_sprockets['PATH_INFO'] = path
|
101
|
+
|
102
|
+
status, headers, response = opts[:sprockets].call env_sprockets
|
103
|
+
|
90
104
|
scope.response.status = status
|
91
105
|
scope.response.headers.merge! headers
|
92
106
|
response.is_a?(Array) ? response.join('\n') : response.to_s
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "roda-sprocket_assets"
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.3'
|
8
8
|
spec.authors = ["cj"]
|
9
9
|
spec.email = ["cjlazell@gmail.com"]
|
10
10
|
spec.summary = %q{Use sprockets to serve assets in roda.}
|