webpacker_lite 2.0.3 → 2.0.4

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: 8ea5e5942f1f281d39534cc47a456e51e2257108
4
- data.tar.gz: 89a00ce6bf138f78f8e381687c69d3932480f08c
3
+ metadata.gz: 64e87e565a455af62c43a863fcf44063208c83fc
4
+ data.tar.gz: d4c5089867ebcdd40cf3c9a274477663f236e54b
5
5
  SHA512:
6
- metadata.gz: d6124cf538517d2af41017c756fdfe95bb362eda73923314a44be3fa92db5016d6a3c212874d486226087fb9d86293fad1c0cab30106192e5872311208d26982
7
- data.tar.gz: 3314e35bd8dc6118b891f4e51e6467c4d17e3a12f059925f8ce736e0dd81136c5c161aa9f82fb8fbd3c19df9e76494066b3d93c28f5201a16475e0dc46a87db6
6
+ metadata.gz: b7f508d5f1c97d0c770f80cb38be7bacae6d78f7c0ac004bcd3ca0ff35f2116fdcf23058f4ea9612d2a53ee1e8c4178aa5c25e51ed8b9fe3f96f2ad948b4cbf0
7
+ data.tar.gz: b5edde0f90ce1b0f89b8a09ccff11397133438464fae475e93d23ad7a4817ba63d46284aaf2439db099c21f4539a42fe5cfcda912856e632c15842614e29c066
data/CONTRIBUTING.md CHANGED
@@ -80,6 +80,6 @@ git checkout master
80
80
  git pull --rebase
81
81
  gem bump --version 2.0.3
82
82
  bundle
83
- git commit -m "Update Gemfile.lock"
84
- gem release --tag --push
83
+ git commit -am "Update Gemfile.lock"
84
+ gem release --tag
85
85
  ```
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- webpacker_lite (2.0.3)
4
+ webpacker_lite (2.0.4)
5
5
  activesupport (>= 4.2)
6
6
  multi_json (~> 1.2)
7
7
  railties (>= 4.2)
@@ -11,7 +11,7 @@ class WebpackerLite::FileLoader
11
11
  # Assume production is 100% cached
12
12
  return if self.instance && # if we have a singleton
13
13
  (env == "production" || # skip if production bc always cached
14
- self.instance.mtime == File.mtime(path)) # skip if mtime not changed
14
+ (File.exist?(path) && self.instance.mtime == File.mtime(path))) # skip if mtime not changed
15
15
 
16
16
  self.instance = new(path)
17
17
  end
@@ -31,7 +31,7 @@ class WebpackerLite::FileLoader
31
31
  private
32
32
  def initialize(path)
33
33
  @path = path
34
- @mtime = File.mtime(path)
34
+ @mtime = File.exist?(path) ? File.mtime(path) : nil
35
35
  @data = load_data
36
36
  end
37
37
 
@@ -1,3 +1,3 @@
1
1
  module WebpackerLite
2
- VERSION = "2.0.3".freeze
2
+ VERSION = "2.0.4".freeze
3
3
  end
@@ -6,6 +6,19 @@ class ManifestTest < Minitest::Test
6
6
  assert_equal WebpackerLite::Manifest.file_path.to_s, file_path
7
7
  end
8
8
 
9
+ def test_file_not_existing
10
+ begin
11
+ file_path = File.join(File.dirname(__FILE__), "test_app/public/webpack/test", "manifest.json")
12
+ temp_path = "#{file_path}.backup"
13
+ FileUtils.mv(file_path, temp_path)
14
+ # Point of this test is to ensure no crash
15
+ WebpackerLite::Manifest.load_instance
16
+ assert_equal({}, WebpackerLite::Manifest.instance.data)
17
+ ensure
18
+ FileUtils.mv(temp_path, file_path)
19
+ end
20
+ end
21
+
9
22
  def test_lookup_exception
10
23
  manifest_path = File.join(File.dirname(__FILE__), "test_app/public/webpack/test", "manifest.json").to_s
11
24
  asset_file = "calendar.js"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpacker_lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson, Justin Gordon