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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9794983b3881a77af1c4f42f13036b0bfe613609
4
- data.tar.gz: 5f54613742dce3e2e63e91fc48a7bbe66716ab7c
3
+ metadata.gz: 7d003a3030c8e881064e8b4225226ddec0defe31
4
+ data.tar.gz: ad76a9e326fc4c3493b9485198ae8659634f21b4
5
5
  SHA512:
6
- metadata.gz: 5ecb9079cf589b687f6ef3196436871624c75de26104d9e636ceba7c39e2efc5d298a7e7f3ceea035acbd5605e7fe42216b2c07a6f20466149bf6dc228d16eb8
7
- data.tar.gz: 0284afa018b622150ae83ae09e026879bf93f18344044b9733504ea9b60002788187535820135b1d66fd4569d128234117b7241ddda129a32f357613a9525c0b
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
- env_sprockets = scope.request.env.dup
88
- env_sprockets['PATH_INFO'] = path
89
- status, headers, response = scope.sprocket_assets_opts[:sprockets].call env_sprockets
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.2'
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.}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-sprocket_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj