ijs-rails 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +45 -50
- data/ijs-rails.gemspec +3 -3
- data/lib/ijs-rails/action_view_helpers.rb +6 -3
- data/lib/ijs-rails/constants.rb +1 -1
- data/spec/ijs-rails/action_view_helpers_spec.rb +3 -1
- data/spec/rails_helper.rb +0 -1
- metadata +20 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53e51e1fbde9f2d0a21cc1d19c09a9d4a901708abb4bbf382b802abf974f74ed
|
4
|
+
data.tar.gz: 242d5c0876bf8face3291c0aa853c999512e4c7bf2969c6658e31b827173163f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5774ad4c4744de08351878b7abdc841a3c0da191f363258c94ee93331bec0336d8ece9ad1666a67153d550240f3cc1c0c7359906b3c42ff5d8ec7fe1e7b9b48c
|
7
|
+
data.tar.gz: c138bb5003b9e5d587eaaffbd82c934ca468dba968712f0e502bc1befb8ee7a019585994459d525e816d4af6754cb69ecc3eb53975b02c563c57a8c70fd5c2bd
|
data/Gemfile.lock
CHANGED
@@ -1,53 +1,48 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ijs-rails (0.
|
5
|
-
|
6
|
-
activesupport (
|
7
|
-
uglifier (
|
4
|
+
ijs-rails (0.2.0)
|
5
|
+
actionview (~> 6.0)
|
6
|
+
activesupport (~> 6.0)
|
7
|
+
uglifier (~> 4.2)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actionpack (6.0.
|
13
|
-
actionview (= 6.0.
|
14
|
-
activesupport (= 6.0.
|
12
|
+
actionpack (6.0.3.4)
|
13
|
+
actionview (= 6.0.3.4)
|
14
|
+
activesupport (= 6.0.3.4)
|
15
15
|
rack (~> 2.0, >= 2.0.8)
|
16
16
|
rack-test (>= 0.6.3)
|
17
17
|
rails-dom-testing (~> 2.0)
|
18
18
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
19
|
-
actionview (6.0.
|
20
|
-
activesupport (= 6.0.
|
19
|
+
actionview (6.0.3.4)
|
20
|
+
activesupport (= 6.0.3.4)
|
21
21
|
builder (~> 3.1)
|
22
22
|
erubi (~> 1.4)
|
23
23
|
rails-dom-testing (~> 2.0)
|
24
24
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
25
|
-
|
26
|
-
activesupport (= 6.0.2.1)
|
27
|
-
activerecord (6.0.2.1)
|
28
|
-
activemodel (= 6.0.2.1)
|
29
|
-
activesupport (= 6.0.2.1)
|
30
|
-
activesupport (6.0.2.1)
|
25
|
+
activesupport (6.0.3.4)
|
31
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
32
27
|
i18n (>= 0.7, < 2)
|
33
28
|
minitest (~> 5.1)
|
34
29
|
tzinfo (~> 1.1)
|
35
|
-
zeitwerk (~> 2.2)
|
36
|
-
ast (2.4.
|
30
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
31
|
+
ast (2.4.1)
|
37
32
|
builder (3.2.4)
|
38
|
-
coderay (1.1.
|
39
|
-
combustion (1.1
|
33
|
+
coderay (1.1.3)
|
34
|
+
combustion (1.3.1)
|
40
35
|
activesupport (>= 3.0.0)
|
41
36
|
railties (>= 3.0.0)
|
42
37
|
thor (>= 0.14.6)
|
43
|
-
concurrent-ruby (1.1.
|
38
|
+
concurrent-ruby (1.1.7)
|
44
39
|
crass (1.0.6)
|
45
|
-
diff-lcs (1.
|
40
|
+
diff-lcs (1.4.4)
|
46
41
|
erubi (1.9.0)
|
47
42
|
execjs (2.7.0)
|
48
|
-
ffi (1.
|
43
|
+
ffi (1.13.1)
|
49
44
|
formatador (0.2.5)
|
50
|
-
guard (2.16.
|
45
|
+
guard (2.16.2)
|
51
46
|
formatador (>= 0.2.4)
|
52
47
|
listen (>= 2.7, < 4.0)
|
53
48
|
lumberjack (>= 1.0.12, < 2.0)
|
@@ -61,32 +56,32 @@ GEM
|
|
61
56
|
guard (~> 2.1)
|
62
57
|
guard-compat (~> 1.1)
|
63
58
|
rspec (>= 2.99.0, < 4.0)
|
64
|
-
i18n (1.8.
|
59
|
+
i18n (1.8.5)
|
65
60
|
concurrent-ruby (~> 1.0)
|
66
61
|
jaro_winkler (1.5.4)
|
67
62
|
listen (3.2.1)
|
68
63
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
69
64
|
rb-inotify (~> 0.9, >= 0.9.10)
|
70
|
-
loofah (2.
|
65
|
+
loofah (2.7.0)
|
71
66
|
crass (~> 1.0.2)
|
72
67
|
nokogiri (>= 1.5.9)
|
73
|
-
lumberjack (1.2.
|
74
|
-
method_source (0.
|
68
|
+
lumberjack (1.2.8)
|
69
|
+
method_source (1.0.0)
|
75
70
|
mini_portile2 (2.4.0)
|
76
|
-
minitest (5.14.
|
71
|
+
minitest (5.14.2)
|
77
72
|
nenv (0.3.0)
|
78
|
-
nokogiri (1.10.
|
73
|
+
nokogiri (1.10.10)
|
79
74
|
mini_portile2 (~> 2.4.0)
|
80
75
|
notiffany (0.1.3)
|
81
76
|
nenv (~> 0.1)
|
82
77
|
shellany (~> 0.0)
|
83
|
-
parallel (1.19.
|
84
|
-
parser (2.7.0
|
85
|
-
ast (~> 2.4.
|
86
|
-
pry (0.
|
87
|
-
coderay (~> 1.1
|
88
|
-
method_source (~>
|
89
|
-
rack (2.2.
|
78
|
+
parallel (1.19.2)
|
79
|
+
parser (2.7.2.0)
|
80
|
+
ast (~> 2.4.1)
|
81
|
+
pry (0.13.1)
|
82
|
+
coderay (~> 1.1)
|
83
|
+
method_source (~> 1.0)
|
84
|
+
rack (2.2.3)
|
90
85
|
rack-test (1.1.0)
|
91
86
|
rack (>= 1.0, < 3)
|
92
87
|
rails-dom-testing (2.0.3)
|
@@ -94,15 +89,15 @@ GEM
|
|
94
89
|
nokogiri (>= 1.6)
|
95
90
|
rails-html-sanitizer (1.3.0)
|
96
91
|
loofah (~> 2.3)
|
97
|
-
railties (6.0.
|
98
|
-
actionpack (= 6.0.
|
99
|
-
activesupport (= 6.0.
|
92
|
+
railties (6.0.3.4)
|
93
|
+
actionpack (= 6.0.3.4)
|
94
|
+
activesupport (= 6.0.3.4)
|
100
95
|
method_source
|
101
96
|
rake (>= 0.8.7)
|
102
97
|
thor (>= 0.20.3, < 2.0)
|
103
98
|
rainbow (3.0.0)
|
104
99
|
rake (13.0.1)
|
105
|
-
rb-fsevent (0.10.
|
100
|
+
rb-fsevent (0.10.4)
|
106
101
|
rb-inotify (0.10.1)
|
107
102
|
ffi (~> 1.0)
|
108
103
|
rexml (3.2.4)
|
@@ -110,18 +105,18 @@ GEM
|
|
110
105
|
rspec-core (~> 3.9.0)
|
111
106
|
rspec-expectations (~> 3.9.0)
|
112
107
|
rspec-mocks (~> 3.9.0)
|
113
|
-
rspec-core (3.9.
|
114
|
-
rspec-support (~> 3.9.
|
115
|
-
rspec-expectations (3.9.
|
108
|
+
rspec-core (3.9.3)
|
109
|
+
rspec-support (~> 3.9.3)
|
110
|
+
rspec-expectations (3.9.4)
|
116
111
|
diff-lcs (>= 1.2.0, < 2.0)
|
117
112
|
rspec-support (~> 3.9.0)
|
118
|
-
rspec-html-matchers (0.9.
|
113
|
+
rspec-html-matchers (0.9.4)
|
119
114
|
nokogiri (~> 1)
|
120
115
|
rspec (>= 3.0.0.a, < 4)
|
121
116
|
rspec-mocks (3.9.1)
|
122
117
|
diff-lcs (>= 1.2.0, < 2.0)
|
123
118
|
rspec-support (~> 3.9.0)
|
124
|
-
rspec-rails (3.9.
|
119
|
+
rspec-rails (3.9.1)
|
125
120
|
actionpack (>= 3.0)
|
126
121
|
activesupport (>= 3.0)
|
127
122
|
railties (>= 3.0)
|
@@ -129,8 +124,8 @@ GEM
|
|
129
124
|
rspec-expectations (~> 3.9.0)
|
130
125
|
rspec-mocks (~> 3.9.0)
|
131
126
|
rspec-support (~> 3.9.0)
|
132
|
-
rspec-support (3.9.
|
133
|
-
rubocop (0.80.
|
127
|
+
rspec-support (3.9.4)
|
128
|
+
rubocop (0.80.1)
|
134
129
|
jaro_winkler (~> 1.5.1)
|
135
130
|
parallel (~> 1.10)
|
136
131
|
parser (>= 2.7.0.1)
|
@@ -142,13 +137,13 @@ GEM
|
|
142
137
|
shellany (0.0.1)
|
143
138
|
thor (1.0.1)
|
144
139
|
thread_safe (0.3.6)
|
145
|
-
tzinfo (1.2.
|
140
|
+
tzinfo (1.2.7)
|
146
141
|
thread_safe (~> 0.1)
|
147
142
|
uglifier (4.2.0)
|
148
143
|
execjs (>= 0.3.0, < 3)
|
149
144
|
unicode-display_width (1.6.1)
|
150
|
-
yard (0.9.
|
151
|
-
zeitwerk (2.
|
145
|
+
yard (0.9.25)
|
146
|
+
zeitwerk (2.4.1)
|
152
147
|
|
153
148
|
PLATFORMS
|
154
149
|
ruby
|
data/ijs-rails.gemspec
CHANGED
@@ -21,9 +21,9 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.metadata['yard.run'] = 'yri'
|
23
23
|
|
24
|
-
spec.add_runtime_dependency '
|
25
|
-
spec.add_runtime_dependency 'activesupport', '
|
26
|
-
spec.add_runtime_dependency 'uglifier', '
|
24
|
+
spec.add_runtime_dependency 'actionview', '~> 6.0'
|
25
|
+
spec.add_runtime_dependency 'activesupport', '~> 6.0'
|
26
|
+
spec.add_runtime_dependency 'uglifier', '~> 4.2'
|
27
27
|
|
28
28
|
spec.add_development_dependency 'bundler', '~> 2.1'
|
29
29
|
spec.add_development_dependency 'combustion', '~> 1.1'
|
@@ -13,9 +13,12 @@ module IJSRails
|
|
13
13
|
# @return [String] An HTML <script> tag containing the compiled script.
|
14
14
|
#
|
15
15
|
def render_ijs(script, options = {})
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
tag_options = options.dup
|
17
|
+
script_options = tag_options.slice!(:async, :defer, :nonce, :type)
|
18
|
+
|
19
|
+
javascript_tag(tag_options) do
|
20
|
+
IJSRails::Script.new(script, script_options).compiled.html_safe
|
21
|
+
end
|
19
22
|
end
|
20
23
|
end
|
21
24
|
end
|
data/lib/ijs-rails/constants.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
Combustion::Application.attr_reader(:content_security_policy_nonce)
|
4
|
+
|
3
5
|
RSpec.describe IJSRails::ActionViewHelpers do
|
4
6
|
subject(:view) { ActionController::Base.new.view_context }
|
5
7
|
|
@@ -9,7 +11,7 @@ RSpec.describe IJSRails::ActionViewHelpers do
|
|
9
11
|
subject { view.render_ijs(name) }
|
10
12
|
|
11
13
|
it 'returns an HTML <script> tag containing the script' do
|
12
|
-
expect(subject).to have_tag(:script, text:
|
14
|
+
expect(subject).to have_tag(:script, text: /alert\("Hello, World!"\);/)
|
13
15
|
end
|
14
16
|
|
15
17
|
context 'when :type is provided' do
|
data/spec/rails_helper.rb
CHANGED
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ijs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nialto Services
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: actionview
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 6.0
|
19
|
+
version: '6.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 6.0
|
26
|
+
version: '6.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 6.0
|
33
|
+
version: '6.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 6.0
|
40
|
+
version: '6.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: uglifier
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '2
|
47
|
+
version: '4.2'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '2
|
54
|
+
version: '4.2'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,7 +178,7 @@ dependencies:
|
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: 0.9.24
|
181
|
-
description:
|
181
|
+
description:
|
182
182
|
email:
|
183
183
|
- support@nialtoservices.co.uk
|
184
184
|
executables: []
|
@@ -220,7 +220,7 @@ licenses:
|
|
220
220
|
- MIT
|
221
221
|
metadata:
|
222
222
|
yard.run: yri
|
223
|
-
post_install_message:
|
223
|
+
post_install_message:
|
224
224
|
rdoc_options: []
|
225
225
|
require_paths:
|
226
226
|
- lib
|
@@ -235,8 +235,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
235
|
- !ruby/object:Gem::Version
|
236
236
|
version: '0'
|
237
237
|
requirements: []
|
238
|
-
rubygems_version: 3.
|
239
|
-
signing_key:
|
238
|
+
rubygems_version: 3.1.2
|
239
|
+
signing_key:
|
240
240
|
specification_version: 4
|
241
241
|
summary: Inline JavaScript helper for Ruby on Rails.
|
242
242
|
test_files:
|