webpack_manifest 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
- SHA1:
3
- metadata.gz: 3013414efc1024e5d354d79e7f5fc1a2101550ff
4
- data.tar.gz: 36a6b4a171d94efd5f04f3e7c5dd86ff3e09ef7b
2
+ SHA256:
3
+ metadata.gz: f921dccf167c3824b5b4be27adbbd0dafe54bb7334fc4ca2569d03cd18a6874f
4
+ data.tar.gz: 52cc757897893892813beffd7b41fe69f98392466409cb0f681b23f3e07417db
5
5
  SHA512:
6
- metadata.gz: 7296e015122881f20c785bc7c764c43b87eda0abae490db1a228bb764d90a5626e2e65927d9ffffeecfd534cfa11ddbaa9e029de95cb76cc6adfd4c239b9e370
7
- data.tar.gz: 3e93b85fbd321b7367e347268053d4380e51082199ab55ad8ef7926616c8f00878c9cd6d6a8f4d708fc647ceada2b582da71dcaa95f19ad078fc1cb859d69e12
6
+ metadata.gz: 821d92a75d9f50206124c7f32063bb547b7419f01312355b7493b5b8481bc8dc2df99ec9eb7f939199395814f11f45fc6ca30089bb7e8513ca7ea6953b0aa611
7
+ data.tar.gz: f22f3e0a9b465d6b7b915cd4a5703e1f3877f6085e23e9eada3a1485485acf8ef5f1e7325a4aedb7be343dd865f53ea9acd37c4f77c62fcc0ca08cf1746654f6
@@ -1,3 +1,7 @@
1
+ # 0.2.1 / 2018-10-18
2
+
3
+ * Improve exceptional case handling
4
+
1
5
  # 0.2.0 / 2018-10-18
2
6
 
3
7
  ## Enhancements
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # WebpackManifest
1
+ # WebpackManifest [![Build Status](https://travis-ci.org/nikushi/webpack_manifest.svg?branch=master)](https://travis-ci.org/nikushi/webpack_manifest) [![Gem Version](https://badge.fury.io/rb/webpack_manifest.svg)](https://badge.fury.io/rb/webpack_manifest)
2
2
 
3
3
  WebpackManifest is a gem that integrates Rails with npm's [webpack-manifest-plugin](https://www.npmjs.com/package/webpack-manifest-plugin) without [webpacker](https://github.com/rails/webpacker).
4
4
 
@@ -1,16 +1,18 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'json'
4
+ require 'pathname'
4
5
 
5
6
  module WebpackManifest
6
7
  class Manifest
7
8
  class MissingEntryError < StandardError; end
9
+ class FileNotFoundError < StandardError; end
8
10
 
9
11
  attr_reader :path
10
12
  attr_writer :cache
11
13
 
12
14
  def initialize(path, cache: false)
13
- @path = path
15
+ @path = Pathname.new(path)
14
16
  @cache = cache
15
17
  end
16
18
 
@@ -41,7 +43,8 @@ module WebpackManifest
41
43
  end
42
44
 
43
45
  def load_data
44
- File.exist?(@path) ? JSON.parse(File.read(@path)) : {}
46
+ raise(FileNotFoundError, "#{@path}: no such manifest found") unless File.exist?(@path)
47
+ JSON.parse(File.read(@path))
45
48
  end
46
49
 
47
50
  def handle_missing_entry(name)
@@ -3,6 +3,8 @@
3
3
  module WebpackManifest
4
4
  module Rails
5
5
  class ManifestRepository
6
+ class NotFoundError < StandardError; end
7
+
6
8
  attr_accessor :default
7
9
 
8
10
  def initialize
@@ -23,7 +25,7 @@ module WebpackManifest
23
25
  end
24
26
 
25
27
  def get(key)
26
- @manifests[key.to_sym]
28
+ @manifests[key.to_sym] || raise(NotFoundError, "manifest associated with #{key} not found")
27
29
  end
28
30
  end
29
31
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WebpackManifest
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Nobuhiro Nikushi"]
10
10
  spec.email = ["deneb.ge@gmail.com"]
11
11
 
12
- spec.summary = "A gem to integrate ruby with npm's webpack-manifest-plugin package"
12
+ spec.summary = "WebpackManifest is a gem that integrates Rails with npm's webpack-manifest-plugin without webpacker."
13
13
  spec.description = spec.summary
14
14
  spec.homepage = "https://github.com/nikushi/webpack_manifest"
15
15
  spec.license = "MIT"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpack_manifest
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
  - Nobuhiro Nikushi
@@ -66,7 +66,8 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
- description: A gem to integrate ruby with npm's webpack-manifest-plugin package
69
+ description: WebpackManifest is a gem that integrates Rails with npm's webpack-manifest-plugin
70
+ without webpacker.
70
71
  email:
71
72
  - deneb.ge@gmail.com
72
73
  executables: []
@@ -105,8 +106,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
106
  version: '0'
106
107
  requirements: []
107
108
  rubyforge_project:
108
- rubygems_version: 2.6.8
109
+ rubygems_version: 2.7.7
109
110
  signing_key:
110
111
  specification_version: 4
111
- summary: A gem to integrate ruby with npm's webpack-manifest-plugin package
112
+ summary: WebpackManifest is a gem that integrates Rails with npm's webpack-manifest-plugin
113
+ without webpacker.
112
114
  test_files: []