opal-erubi 1.0.0 → 2.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 +1 -0
- data/Rakefile +1 -1
- data/lib/opal/erubi.rb +2 -2
- data/lib/opal/erubi/builder.rb +1 -4
- data/lib/opal/erubi/processor.rb +6 -22
- data/lib/opal/erubi/version.rb +1 -1
- data/opal-erubi.gemspec +1 -0
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75eeff701dbdbeb5ebfa3e95ea4024156388950684edcf229583f7eb6ca5225b
|
4
|
+
data.tar.gz: 940fb4ab0c30107d355dbacd7cc97a74f8fc207d1d776c58ae26351e70ff0f6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdeeed7022e26ebf41702434c351753ebb35a974e6fbc685ac96c559877f92c07a02bf4cc5861b70eff4f23b3672023416d4730d7e03f8f6c589ce4094285c2e
|
7
|
+
data.tar.gz: 42049e8d1edd8ea05afecfdb209454af257061a0e924892cf5b4207f0034e12449988a85f0709925108067b19611670a5d604d625c39767acdcd98ad07f916f3
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/opal/erubi.rb
CHANGED
@@ -10,7 +10,7 @@ Opal.append_path File.expand_path('../../../lib-opal', __FILE__).untaint
|
|
10
10
|
module Opal
|
11
11
|
module Erubi
|
12
12
|
def self.compile_erubi(source, path)
|
13
|
-
::Erubi::Engine.new(source.to_s,
|
13
|
+
::Erubi::Engine.new(source.to_s,
|
14
14
|
bufval: "__buf",
|
15
15
|
postamble: "_buf.join }",
|
16
16
|
escape: true,
|
@@ -18,4 +18,4 @@ module Opal
|
|
18
18
|
filename: path).src.dup
|
19
19
|
end
|
20
20
|
end
|
21
|
-
end
|
21
|
+
end
|
data/lib/opal/erubi/builder.rb
CHANGED
@@ -7,6 +7,7 @@ module Opal
|
|
7
7
|
|
8
8
|
def initialize(*args)
|
9
9
|
super
|
10
|
+
@filename = ::Opal::Compiler.module_name(@filename)
|
10
11
|
@source = prepare(@source, @filename)
|
11
12
|
end
|
12
13
|
|
@@ -21,8 +22,4 @@ module Opal
|
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
24
|
-
|
25
|
-
# You could do this if you wanted to reclaim "erb" extension but I'm afraid
|
26
|
-
# it may cause some problems. ERB is used for preprocessing (Opal) Ruby code.
|
27
|
-
#Builder.processors.delete(BuilderProcessors::ERBProcessor)
|
28
25
|
end
|
data/lib/opal/erubi/processor.rb
CHANGED
@@ -4,31 +4,15 @@ require 'opal-sprockets'
|
|
4
4
|
|
5
5
|
module Opal
|
6
6
|
module Erubi
|
7
|
-
class Processor <
|
8
|
-
|
9
|
-
|
10
|
-
def evaluate(context, locals, &block)
|
11
|
-
@data = Opal::Erubi.compile_erubi @data, context.logical_path.gsub(/\Atemplates\//, '')
|
7
|
+
class Processor < Opal::Sprockets::Processor
|
8
|
+
def call
|
9
|
+
@data = Opal::Erubi.compile_erubi @data, context.logical_path.sub(/#{Opal::REGEXP_START}templates\//, '')
|
12
10
|
super
|
13
11
|
end
|
14
|
-
|
15
|
-
def self.compiler_options
|
16
|
-
# otherwise would check current class `attr_accessor`s
|
17
|
-
::Opal::Processor.compiler_options
|
18
|
-
end
|
19
12
|
end
|
20
13
|
end
|
21
14
|
end
|
22
15
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
Opal::Sprockets.register_mime_type 'application/html+erubi'
|
27
|
-
else
|
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
|
16
|
+
Sprockets.register_mime_type 'application/html+erubi', extensions: ['.erubi']
|
17
|
+
Sprockets.register_transformer 'application/html+erubi', 'application/javascript', Opal::Erubi::Processor
|
18
|
+
Opal::Sprockets.register_mime_type 'application/html+erubi'
|
data/lib/opal/erubi/version.rb
CHANGED
data/opal-erubi.gemspec
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:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hmdne
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -30,6 +30,20 @@ dependencies:
|
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '2'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: opal-sprockets
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 0.5.0
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.5.0
|
33
47
|
- !ruby/object:Gem::Dependency
|
34
48
|
name: erubi
|
35
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,7 +129,7 @@ homepage: https://github.com/hmdne/opal-erubi
|
|
115
129
|
licenses:
|
116
130
|
- MIT
|
117
131
|
metadata: {}
|
118
|
-
post_install_message:
|
132
|
+
post_install_message:
|
119
133
|
rdoc_options: []
|
120
134
|
require_paths:
|
121
135
|
- lib
|
@@ -130,8 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
144
|
- !ruby/object:Gem::Version
|
131
145
|
version: '0'
|
132
146
|
requirements: []
|
133
|
-
rubygems_version: 3.
|
134
|
-
signing_key:
|
147
|
+
rubygems_version: 3.2.3
|
148
|
+
signing_key:
|
135
149
|
specification_version: 4
|
136
150
|
summary: Run Erubi templates client-side with Opal
|
137
151
|
test_files: []
|