opal-erubi 0.0.1 → 1.0.0

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
  SHA256:
3
- metadata.gz: 28b2ec7bf06d7c568035145132abedf54f6f76544fbeb73f9b7316bf5f158fba
4
- data.tar.gz: db14ec171666f0d1c7b27b5c078b29f385b862dbc1f1bb81cdb88d113d9f64d1
3
+ metadata.gz: 35e34135f5807bdf36e91274c136327fa1b07b8dc42fc0ccdc6c5e62699dca0a
4
+ data.tar.gz: 1c2e6408c3e1e3325804be36bf34ee1dedbd390456492f7955765c461979590c
5
5
  SHA512:
6
- metadata.gz: a5d0e3dc8d048df7554e58fb248b1e384843011d7bc63ee9514fa96b148c6dca1152f6d2bafbd4ba426cb22436d02abe6cac3ce4679a9dcd95577c0e20b68f96
7
- data.tar.gz: bedbde578f02ede63013a17b0357870b11db4da00596807d7108d89febe87701813de7f53e1940010f3001800ec9b4397054a23783c086d1fbc189405adc12d1
6
+ metadata.gz: 98cc6019078284497b51bcf856efe1bf579a90f8b72350f4abd96699f099ba317d8a1e0fd09e88ce951e19fc22c3390402c7efac8f5af4d4bc44ec3b82dabbaf
7
+ data.tar.gz: dc4a8744f13a87b6f56f598144c4a880e1963521c87570fa9e0e230a5208860e4bc4319d2c28af765377dc868d888565f0457e05d9305d9eaa76d6aa9fd48afa
data/Gemfile CHANGED
@@ -3,6 +3,16 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  gem "opal-rspec", "> 0.6.2"
6
- gem "opal"
6
+
7
+ if File.exist? "../opal"
8
+ gem "opal", path: "../opal"
9
+ else
10
+ gem "opal"
11
+ end
12
+
13
+ if File.exist? "../opal-sprockets"
14
+ gem "opal-sprockets", path: "../opal-sprockets"
15
+ end
16
+
7
17
  gem "erubi"
8
18
 
@@ -8,7 +8,7 @@ module Opal
8
8
  self.default_mime_type = 'application/javascript'
9
9
 
10
10
  def evaluate(context, locals, &block)
11
- @data = Opal::Erubi.compile_erubi @data, context.logical_path.sub(/^templates\//, '')
11
+ @data = Opal::Erubi.compile_erubi @data, context.logical_path.gsub(/\Atemplates\//, '')
12
12
  super
13
13
  end
14
14
 
@@ -20,10 +20,15 @@ module Opal
20
20
  end
21
21
  end
22
22
 
23
- if Sprockets.respond_to? :register_transformer
24
- extra_args = [{mime_type: 'application/javascript', silence_deprecation: true}]
23
+ if Opal::Sprockets.respond_to? :register_mime_type # Sprockets 4.0 support
24
+ Sprockets.register_mime_type 'application/html+erubi', extensions: ['.erubi']
25
+ Sprockets.register_transformer 'application/html+erubi', 'application/javascript', Opal::Erubi::Processor
26
+ Opal::Sprockets.register_mime_type 'application/html+erubi'
25
27
  else
26
- extra_args = []
27
- end
28
-
29
- Sprockets.register_engine '.erubi', Opal::Erubi::Processor, *extra_args
28
+ if Sprockets.respond_to? :register_transformer
29
+ extra_args = [{mime_type: 'application/javascript', silence_deprecation: true}]
30
+ else
31
+ extra_args = []
32
+ end
33
+ Sprockets.register_engine '.erubi', Opal::Erubi::Processor, *extra_args
34
+ end
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module Erubi
3
- VERSION = '0.0.1'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-erubi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - hmdne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-19 00:00:00.000000000 Z
11
+ date: 2020-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal