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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1738cd4a6f269618761b769c91cbe11b8f97110d
4
- data.tar.gz: 18b3909fe90e9ceaec850ac85d4ef7eb6ede939d
3
+ metadata.gz: 1efd166431b3a1d8b52f5ea60dc87cbd4a9d72d3
4
+ data.tar.gz: 3dd41ad124be1a7c738a5627b625d22c864b9d47
5
5
  SHA512:
6
- metadata.gz: 0134c5f73a58b687ba8b19d4b50bac75a03c02702a37c9fc9ffc2a485793d85fc7c63d3e73f056a29806a1321e399a805688aa47bd6e529ed6bebc8e3043b367
7
- data.tar.gz: e4d575eeb4be2953a816c5ddc7ca5990baaf666fb903069c3bd34d6f2183c3fd2d480832281e951c5c1e723ca758fd9c75438cf3a9947826abf8c35b0039c928
6
+ metadata.gz: 1e967f28ab973fc50d798506e1b07e639c50bd541548ff462c7ad2c3f39b8705a86a201318da17052f271b70dd85a5ed04f0c450343530aee2fd908c38264fbf
7
+ data.tar.gz: 0e2d7557ba06403c2feb5bdcb73e3e5f4fa27a2239e3b152344a69c1742103837a57325aeeeca1a1e221aa623dfd4ed24552f62b40b8fa9fade33b3f89915b69
@@ -1,3 +1,3 @@
1
1
  module SewingKit
2
- VERSION = "0.5.4"
2
+ VERSION = "0.5.5"
3
3
  end
@@ -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
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-08-13 00:00:00.000000000 Z
11
+ date: 2017-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties