jekyll-browserify 0.1.0 → 0.2.0

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: 59dbc88ab62e7a149be0de41a712dbcf6d466e16
4
- data.tar.gz: 8e0bc3ceedb4643428f4926d816b0ef7cca520cb
3
+ metadata.gz: 2d00d5fd0dadbc112e748de843c10645bda4f053
4
+ data.tar.gz: 210e2febf42e45bb0ef29f97ba9dde1bf5f63d84
5
5
  SHA512:
6
- metadata.gz: 90fa64ceeaffc78fb3fe6a331c9fa58c72009958a78133e96e10320e2932d50ac291c4be83865690a8a9a8ebae0d9d1070369e8d031e62abf50a6ecbb5961a16
7
- data.tar.gz: a19afe4a7f3f963fa646f3d3ed9037016982c22c9e06c56614c55ef4f799436122ca30fde16f3c45aeceaa897658f05ccb3355274d9163b44ad81c06d18e29c5
6
+ metadata.gz: 518c885e8f1a041cfdefcf54ef5d5c6e980592ad5a465fda0d479a04613d27d128e6bc5dd337ac93bfee0b0b83aefe34ed1b94ff51313a0c04ab933118f37957
7
+ data.tar.gz: e9a98cdb40aa554a36066becec04f780a4e763ad8e0fbf311f496e2ca00466f65772bf7f0d0e065cedf89b1e928beda25f04d30d5ddaf1e6a8744808bf113415
data/README.md CHANGED
@@ -9,7 +9,9 @@ The runtime for `browserify` is installed automatically.
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'jekyll-browserify'
12
+ group :jekyll_plugins do
13
+ gem 'jekyll-browserify'
14
+ end
13
15
  ```
14
16
 
15
17
  And then execute:
@@ -42,6 +44,16 @@ browserify:
42
44
  option: "-t [ babelify --presets es2015 ]"
43
45
  ~~~~~~~~~~~~~~~~~~~~~~~~~~
44
46
 
47
+ ### Confing items and Default Values
48
+
49
+ ~~~~~~~~~~~~~~~~~~~~~~~~~yaml
50
+ # _config.yaml
51
+ browserify:
52
+ modules: [] # required modules
53
+ option: "" # browserify option string
54
+ exts: [".js"] # target exts to convert
55
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
56
+
45
57
  [babel]: https://github.com/babel/babelify
46
58
 
47
59
  ## Development
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_runtime_dependency "browserify_rb", "~> 0.2.0"
29
+ spec.add_runtime_dependency "browserify_rb", "~> 0.3.0"
30
30
 
31
31
  spec.add_development_dependency "jekyll", ENV['JEKYLL_VERSION'] ? "~> #{ENV['JEKYLL_VERSION']}" : ">= 2.0"
32
32
  spec.add_development_dependency "bundler", "~> 1.10"
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Browserify
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -4,6 +4,11 @@ module Jekyll
4
4
  safe true
5
5
  priority :low
6
6
 
7
+ def initialize config
8
+ super
9
+ @browserify = nil
10
+ end
11
+
7
12
  def matches ext
8
13
  exts.include? ext.downcase
9
14
  end
@@ -13,7 +18,7 @@ module Jekyll
13
18
  end
14
19
 
15
20
  def convert content
16
- setup unless @setup
21
+ setup unless @browserify
17
22
  @browserify.compile(content)
18
23
  end
19
24
 
@@ -22,9 +27,9 @@ module Jekyll
22
27
  @browserify = BrowserifyRb.new(
23
28
  required_modules: modules,
24
29
  browserify_opts: option,
25
- nvm_dir: File.join(ENV["PWD"], ".nvm")
30
+ nvm_dir: File.join(ENV["PWD"], ".nvm"),
31
+ node_ver: node_ver
26
32
  )
27
- @setup = true
28
33
  end
29
34
 
30
35
  def exts
@@ -39,6 +44,10 @@ module Jekyll
39
44
  config("browserify", "option") || ""
40
45
  end
41
46
 
47
+ def node_ver
48
+ config("browserify", "node_version")
49
+ end
50
+
42
51
  def config *path
43
52
  path.inject(@config) {|c, k| c and c[k] }
44
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-browserify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keiichiro Ui
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-26 00:00:00.000000000 Z
11
+ date: 2015-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: browserify_rb
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.0
19
+ version: 0.3.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.0
26
+ version: 0.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jekyll
29
29
  requirement: !ruby/object:Gem::Requirement