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 +4 -4
- data/Gemfile +11 -1
- data/lib/opal/erubi/processor.rb +12 -7
- data/lib/opal/erubi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35e34135f5807bdf36e91274c136327fa1b07b8dc42fc0ccdc6c5e62699dca0a
|
4
|
+
data.tar.gz: 1c2e6408c3e1e3325804be36bf34ee1dedbd390456492f7955765c461979590c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
|
data/lib/opal/erubi/processor.rb
CHANGED
@@ -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.
|
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? :
|
24
|
-
|
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
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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
|
data/lib/opal/erubi/version.rb
CHANGED
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
|
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-
|
11
|
+
date: 2020-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|