webpack_stats 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/webpack_stats.rb +10 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d8623a3f007c05887c26231a507819042099d024
4
- data.tar.gz: 0c2efbcd0fe7e535efc3c7189f9742b0c0dab9d8
3
+ metadata.gz: f143a050e7ad89683545788fc0ec4d8d586e79da
4
+ data.tar.gz: f54f2173e04c1201ee19fcca80bd7f04d0b49dbe
5
5
  SHA512:
6
- metadata.gz: 96f51cfb98c53704c674df7bef5020c96f3ebcf387ce1263a18d0b384e3b8ff319e26ce983c78921166ba26372b53b33c430221f5dd54a205217cb35ede3e96d
7
- data.tar.gz: 906ec6ebb399977e46bebc2899b16cea08e437cf4b3cce1933d998ba47c78f1c8c747000fa9318ae9ed288691e1f748438d2700f098a8b347de936db9a6a8752
6
+ metadata.gz: 4b99fedf42fe266d4f6d9d377d1198c3513b0a1fcf12b6cecb10e0cdd42678c889de67511767ccc3d651b85c332f80d02670c8671b7dd1a8ba978f4c540a9251
7
+ data.tar.gz: 2a715249af4495cdc74b83fbd2af9a3a9df1a922e4f4653bd75c55b83a80bc8cc976f64996cb8550614e9df8f48d59e0803c1894c85e538a14145b8368233fd6
data/lib/webpack_stats.rb CHANGED
@@ -25,11 +25,16 @@ module WebpackStats
25
25
  end
26
26
 
27
27
  def load!
28
- @stats = JSON.parse File.read @stats_path
29
- @assets = {}
30
- @stats['assets'].each do |asset|
31
- key, value = split_asset_name(@stats, asset['name'])
32
- @assets[key] = value
28
+ if File.exists?(@stats_path)
29
+ @stats = JSON.parse(File.read(@stats_path))
30
+ @assets = {}
31
+ @stats['assets'].each do |asset|
32
+ key, value = split_asset_name(@stats, asset['name'])
33
+ @assets[key] = value
34
+ end
35
+ else
36
+ @stats = {}
37
+ @assets = {}
33
38
  end
34
39
  end
35
40
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpack_stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jian Weihang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-10 00:00:00.000000000 Z
11
+ date: 2016-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler