webpack_manifest_plugin 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +10 -0
- data/.rubocop.yml +3 -1
- data/Dockerfile +1 -1
- data/README.md +14 -8
- data/lib/webpack_manifest_plugin/version.rb +1 -1
- data/lib/webpack_manifest_plugin/view_helpers.rb +2 -2
- data/webpack_manifest_plugin.gemspec +6 -5
- metadata +32 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 59c4b6d09d11184004922597d600739321d60a7d20201fe44d6aa0174d4b1d85
|
4
|
+
data.tar.gz: a73866fa195883ad6242945407c494449d63aec704e5cd5566e41cf6a00d7309
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9517b868b975a5d6435eaab100b821382f4ad4bb1ebada5183b8f8e1f29201d8c2d317170169bf0f7be42e76a8daa643869f2eb1eacfdd471321225407f6873
|
7
|
+
data.tar.gz: c6b95e61ba13af6ff07ea18278d32772cd2044f08b033c569b422feaaf53d7a828820299cb5849796d1d7c749a983ce446e7eabae765478c8a35479be9f61082
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
AllCops:
|
2
2
|
Exclude:
|
3
|
-
- 'spec/test_app
|
3
|
+
- 'spec/test_app/**/*'
|
4
4
|
- spec/controllers/main_controller_spec.rb
|
5
5
|
Metrics/LineLength:
|
6
6
|
Max: 120
|
@@ -12,3 +12,5 @@ Metrics/BlockLength:
|
|
12
12
|
- 'spec/**/*'
|
13
13
|
- 'lib/webpack_manifest_plugin/tasks/main.rake'
|
14
14
|
- 'webpack_manifest_plugin.gemspec'
|
15
|
+
Style/FrozenStringLiteralComment:
|
16
|
+
Enabled: false
|
data/Dockerfile
CHANGED
data/README.md
CHANGED
@@ -2,10 +2,6 @@
|
|
2
2
|
|
3
3
|
This Ruby gem provides a way to use assets managed with `webpack` in Rails templates. JavaScript package [webpack-manifest-plugin](https://www.npmjs.com/package/webpack-manifest-plugin) outputs a JSON file that maps assets to file paths. File paths can change depending on a webpack configuration -- a development config usually doesn't version assets while a production config does. Webpack updates CSS and JavaScript files with the file paths it outputs but not Rails templates. This gem provides a view helper for including these assets in Rails views.
|
4
4
|
|
5
|
-
##### Warning
|
6
|
-
|
7
|
-
This has not been used in a production environment - use at your own risk. Rigorous testing has not been done against different versions of Ruby and Rails -- it has been tested against Ruby 2.3.x and Rails 5.x.
|
8
|
-
|
9
5
|
##### Who would use this?
|
10
6
|
|
11
7
|
Those who already have a webpack asset workflow and only need to reference webpack assets in Rails templates. Otherwise, use [webpacker](https://github.com/rails/webpacker).
|
@@ -144,7 +140,7 @@ Specify the hash key in the `webpack_manifest_path` view helper:
|
|
144
140
|
1) Build the docker image:
|
145
141
|
|
146
142
|
```shell
|
147
|
-
docker-compose build
|
143
|
+
docker-compose build --no-cache
|
148
144
|
```
|
149
145
|
|
150
146
|
2) Start docker image with an interactive bash shell:
|
@@ -155,17 +151,27 @@ docker-compose run --rm gem
|
|
155
151
|
|
156
152
|
3) Once in bash session, code, run tests, start console, etc.
|
157
153
|
|
154
|
+
*Run bundle install if binstubs are missing or install only the executables
|
155
|
+
you need. Be sure they are excluded in .gitignore.*
|
156
|
+
|
158
157
|
```shell
|
159
158
|
# run console with gem loaded
|
160
|
-
|
159
|
+
bin/console
|
161
160
|
|
162
161
|
# run tests
|
163
|
-
rspec
|
162
|
+
bin/rspec
|
163
|
+
|
164
|
+
# check for vulnerabilities
|
165
|
+
bin/bundler-audit --update
|
166
|
+
|
167
|
+
# lint
|
168
|
+
#
|
169
|
+
bin/rubocop lib spec
|
164
170
|
```
|
165
171
|
|
166
172
|
## Todo
|
167
173
|
|
168
|
-
- Test with Rails
|
174
|
+
- Test with Rails 6 app.
|
169
175
|
- Test rake tasks.
|
170
176
|
|
171
177
|
## Contributing
|
@@ -22,8 +22,8 @@ module WebpackManifestPlugin
|
|
22
22
|
# it logs the error and returns an empty string.
|
23
23
|
def webpack_manifest_path(key)
|
24
24
|
webpack_manifest_configs[key] || key
|
25
|
-
rescue StandardError =>
|
26
|
-
WebpackManifestPlugin.logger.warn "Error parsing webpack manifest JSON. #{
|
25
|
+
rescue StandardError => e
|
26
|
+
WebpackManifestPlugin.logger.warn "Error parsing webpack manifest JSON. #{e.message}"
|
27
27
|
''
|
28
28
|
end
|
29
29
|
|
@@ -33,16 +33,17 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.bindir = 'exe'
|
34
34
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
35
35
|
spec.require_paths = ['lib']
|
36
|
-
spec.required_ruby_version = '>= 2.
|
36
|
+
spec.required_ruby_version = '>= 2.5'
|
37
37
|
|
38
38
|
spec.add_dependency 'oj', '~> 3.0'
|
39
39
|
spec.add_dependency 'railties', '>= 4.1'
|
40
40
|
spec.add_dependency 'activesupport', '>= 4.1'
|
41
41
|
|
42
|
-
spec.add_development_dependency 'bundler'
|
43
|
-
spec.add_development_dependency 'rake', '~>
|
42
|
+
spec.add_development_dependency 'bundler'
|
43
|
+
spec.add_development_dependency 'rake', '~> 13.0.1'
|
44
44
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
45
|
-
spec.add_development_dependency 'rails', '
|
46
|
-
spec.add_development_dependency 'rspec-rails', '
|
45
|
+
spec.add_development_dependency 'rails', '5.2.4.4'
|
46
|
+
spec.add_development_dependency 'rspec-rails', '4.0.1'
|
47
47
|
spec.add_development_dependency 'rubocop', '>= 0.47'
|
48
|
+
spec.add_development_dependency 'bundler-audit'
|
48
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webpack_manifest_plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ed-mare
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|
@@ -56,30 +56,30 @@ dependencies:
|
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 13.0.1
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 13.0.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,30 +98,30 @@ dependencies:
|
|
98
98
|
name: rails
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - '='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 5.2.4.4
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 5.2.4.4
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rspec-rails
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - '='
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: 4.0.1
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - '='
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: 4.0.1
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rubocop
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0.47'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: bundler-audit
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
139
153
|
description: |-
|
140
154
|
Gem that work with node manifest-webpack-plugin. A view helper
|
141
155
|
for using webpack managed assets in Rails templates.
|
@@ -180,15 +194,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
180
194
|
requirements:
|
181
195
|
- - ">="
|
182
196
|
- !ruby/object:Gem::Version
|
183
|
-
version: '2.
|
197
|
+
version: '2.5'
|
184
198
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
199
|
requirements:
|
186
200
|
- - ">="
|
187
201
|
- !ruby/object:Gem::Version
|
188
202
|
version: '0'
|
189
203
|
requirements: []
|
190
|
-
|
191
|
-
rubygems_version: 2.5.1
|
204
|
+
rubygems_version: 3.0.3
|
192
205
|
signing_key:
|
193
206
|
specification_version: 4
|
194
207
|
summary: Gem that work with node manifest-webpack-plugin.
|