sewing_kit 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sewing_kit/version.rb +1 -1
- data/lib/sewing_kit/webpack/helper.rb +9 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1efd166431b3a1d8b52f5ea60dc87cbd4a9d72d3
|
4
|
+
data.tar.gz: 3dd41ad124be1a7c738a5627b625d22c864b9d47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e967f28ab973fc50d798506e1b07e639c50bd541548ff462c7ad2c3f39b8705a86a201318da17052f271b70dd85a5ed04f0c450343530aee2fd908c38264fbf
|
7
|
+
data.tar.gz: 0e2d7557ba06403c2feb5bdcb73e3e5f4fa27a2239e3b152344a69c1742103837a57325aeeeca1a1e221aa623dfd4ed24552f62b40b8fa9fade33b3f89915b69
|
data/lib/sewing_kit/version.rb
CHANGED
@@ -7,11 +7,14 @@ module SewingKit
|
|
7
7
|
module Helper
|
8
8
|
include ActionView::Helpers
|
9
9
|
|
10
|
+
class UnknownJavaScriptAssetError < StandardError
|
11
|
+
end
|
12
|
+
|
10
13
|
def sewing_kit_asset_paths(source, extension: 'js')
|
11
14
|
return '' unless source.present?
|
15
|
+
return '' if ['runtime', 'vendor'].include?(source) && !Rails.env.production?
|
12
16
|
|
13
17
|
paths = SewingKit::Webpack::Manifest.asset_paths(source)
|
14
|
-
|
15
18
|
return '' unless paths[extension]
|
16
19
|
|
17
20
|
[paths[extension]].flatten.reject { |path| path =~ /.*\.map$/ }
|
@@ -33,6 +36,11 @@ module SewingKit
|
|
33
36
|
options = paths.extract_options!
|
34
37
|
|
35
38
|
tags = paths.uniq.map { |path|
|
39
|
+
if path == ''
|
40
|
+
next '' unless Rails.env.production?
|
41
|
+
raise UnknownJavaScriptAssetError.new('Empty JavaSscript path passed to sewing_kit')
|
42
|
+
end
|
43
|
+
|
36
44
|
create_asset_tag(:script, path, options)
|
37
45
|
}
|
38
46
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sewing_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Sauve
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|