webpacked 0.2.0 → 0.2.1

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: 623cf8bd21b5e752d1528d03eac4748817f5f0c1
4
- data.tar.gz: 5d61c92075ca54a595959ecc34f1dace82b9ab3e
3
+ metadata.gz: 82d8ae7b6dbf8f18a719a897da96f9d1fec6bc15
4
+ data.tar.gz: 472fa0e29f7111b049825b971e22cbcb219f55f6
5
5
  SHA512:
6
- metadata.gz: d624d85f95a371f75875c8d8db78f1a982fe87658d313c435dac1ed8deb4509e171afc225933d203ea3079848ed174fae694e7f14b9ae8de95a1e7c00c94be35
7
- data.tar.gz: cfe2fff9ebed9b9cd250f5c75ecedac4524563544162e80783f045d7c52a1232073f39932bec2fd90fc7da6b53c3e92361f92b09c61a811f5c687173641f4c25
6
+ metadata.gz: c55ea3ab94b83d5eaebf41a4349ec9328ee95256ef15b2a6f75497d55407a7cbdb342be4dc98205d39af663c31be66e895f36fb2d933272f0f7ba2b4bd059b03
7
+ data.tar.gz: 954e07ec3810d4500cf4a894c82705e71cf43b52b18e62aae6b31066c5289229aad42b54f01acf96774dc741a7536a8e19204049bfcd4542fe1ded30b94dbc62
@@ -25,6 +25,8 @@ module Webpacked
25
25
  # Load manifest from file and cache it if +Rails.configuration.webpacked.dev_server+ set to +false+.
26
26
  # Return entry point asset path for +:js+ or +:css+ kind or both if +kind+ skipped
27
27
  def asset_paths(entry, kind = nil)
28
+ return unless Rails.configuration.webpacked.enabled
29
+
28
30
  validate_asset_kind(kind)
29
31
  if Rails.configuration.webpacked.dev_server
30
32
  @manifest = load_manifest!
@@ -41,13 +43,10 @@ module Webpacked
41
43
  def load_manifest!
42
44
  manifest_path = Rails.configuration.webpacked.manifest_path
43
45
  manifest_path = Rails.root.join(manifest_path)
44
- manifest = {}
45
- if File.exist?(manifest_path)
46
- manifest = JSON.parse(File.read manifest_path).with_indifferent_access
47
- clean_asset_paths(manifest)
48
- elsif Rails.configuration.webpacked.enabled
49
- raise LoadError, "File #{manifest_path} not found"
50
- end
46
+ raise LoadError, "File #{manifest_path} not found" unless File.exist?(manifest_path)
47
+
48
+ manifest = JSON.parse(File.read manifest_path).with_indifferent_access
49
+ clean_asset_paths(manifest)
51
50
  manifest
52
51
  end
53
52
 
@@ -1,3 +1,3 @@
1
1
  module Webpacked
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpacked
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Garbuz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-23 00:00:00.000000000 Z
11
+ date: 2016-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubyforge_project:
90
- rubygems_version: 2.6.4
90
+ rubygems_version: 2.6.6
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: Easy webpack and Rails integration