nanoc-webpack.rb 0.5.0 → 0.5.2

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
  SHA256:
3
- metadata.gz: fb4f774661ab8864e181668d80bcbcbc79bdd4b45ec746ebc29fae83828691b2
4
- data.tar.gz: 05adf92c987389b5b1e6fa418b2e83c5d5b1ac7e93c9ddfd12b300ad3421be24
3
+ metadata.gz: 51ae4d18b8017151427e4a4e309b43340c410028fe4f3c4c439d936ed9bae1f0
4
+ data.tar.gz: ad20aeb40452f97f97f1271f0340ccf44a98e10f7e72b21da9aadd61b7245d65
5
5
  SHA512:
6
- metadata.gz: 343e55d3a8557216618eaf5c9956daa9dfc9c08c4a11d54fca4575d021e9ebcff30c11acac5e5602a676abd05e9e50a799f395b60f3b0431f925c6731d12870b
7
- data.tar.gz: abbeaf8c6c482dbe8ccab176970b032d7fecf72d04a8e2e46e3145a1b09bd6a7b5e7a6bccaec8bb62c0e14955dc65105ee324f3307e30e351d15394bc2a2846b
6
+ metadata.gz: 1f3cc7d3ac650928ed0f5328de72ab18f64b33dd79894269d9b723dc2a6378ee490a6a78779b74b0799c08f471e6292f3f981ce69cceea3c0bcf270c3cd96dde
7
+ data.tar.gz: 5404a3781b264975ef4222c019654dc7ef53e1d0d292e4c11745a3d5c6b0b20ddb9000f4b3288d6dc1c4855020c6a4413c2621c2dc6a2d4663c1ea59b9a69c04
data/README.md CHANGED
@@ -98,7 +98,7 @@ are available as sources.
98
98
 
99
99
  ```ruby
100
100
  # Gemfile
101
- gem "nanoc-webpack.rb", github: "0x1eef/nanoc-webpack.rb", tag: "v0.5.0"
101
+ gem "nanoc-webpack.rb", github: "0x1eef/nanoc-webpack.rb", tag: "v0.5.2"
102
102
  ```
103
103
 
104
104
  **Rubygems.org**
@@ -11,22 +11,30 @@ class Nanoc::Webpack::Filter < Nanoc::Filter
11
11
  identifier :webpack
12
12
  type :text
13
13
 
14
+ ##
15
+ # @return [Hash]
16
+ # Returns the default command-line options given
17
+ # to the webpack executable.
18
+ def self.default_options
19
+ @default_options ||= {}
20
+ end
21
+
14
22
  def run(content, options = {})
15
23
  depend_on dependable(paths: options[:depend_on], reject: options[:reject])
16
24
  .map { items[_1] }
17
25
  webpack temporary_file_for(content),
18
- args: options[:args]
26
+ args: self.class.default_options.merge(options[:args])
19
27
  end
20
28
 
21
29
  private
22
30
 
23
- def webpack(file, args: [])
31
+ def webpack(file, args: {})
24
32
  system "node",
25
33
  "./node_modules/webpack/bin/webpack.js",
26
34
  "--entry", File.join(Dir.getwd, item.attributes[:content_filename]),
27
35
  "--output-path", File.dirname(file.path),
28
36
  "--output-filename", File.basename(file.path),
29
- *webpack_args(cli)
37
+ *webpack_args(args)
30
38
  if $?.success?
31
39
  File.read(file.path).tap { file.tap(&:unlink).close }
32
40
  else
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nanoc
4
4
  module Webpack
5
- VERSION = "0.5.0"
5
+ VERSION = "0.5.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-webpack.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - '0x1eef'