jekyll-babel 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c04cf95be80e476724ffdd98b0d9a8dee78e98c5
4
- data.tar.gz: 7404c25b9d23c65d6788666ba0fa8dff5f263749
3
+ metadata.gz: 8d61610d05c41af19a523fa6d99bed37d2f6c0f3
4
+ data.tar.gz: 1d3611dee6656c43aa6aff266309a95814483377
5
5
  SHA512:
6
- metadata.gz: 96718bd2d92eb20dd4be709397aba3aa03c64f7a753b99d7ff6fdca2871b217130b9d19c5547271f6f95ef186c4ec84cfb0c122ace87f9301115b5e1d63792a8
7
- data.tar.gz: 5eb2fbc04713fce7a767f0927b05b5a070831dab574bedf4c2c40b7cfb5f5ddf543cd3d4e4c39fc17aeaa5e918d07fa3eeefe40498d18f2360349b2cf8e02f89
6
+ metadata.gz: 9579219ffa13016c80a9e93c8d5d1a6fa766cc0131739707682c5747333837879a77bb42087919e9de018686f2f225c518158ce85568bf983442fd10b978cb14
7
+ data.tar.gz: fc6ce3c2b4d1f05bea43eb03d967d73e100b8c1d1eecc03e8b40319d07e23f518c1266a111a796de97dc5a25475064028ce10f33f8e479e1a47b42ee35a6e3a3
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Babel
3
- VERSION = "1.0.0"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -4,8 +4,16 @@ module Jekyll
4
4
  safe true
5
5
  priority :low
6
6
 
7
+ DEFAULT_CONFIGURATION = {
8
+ 'babel_js_extensions' => 'js, es6, babel, jsx'
9
+ }
10
+
11
+ def initialize(config = {})
12
+ @config = Jekyll::Utils.deep_merge_hashes(DEFAULT_CONFIGURATION, config)
13
+ end
14
+
7
15
  def matches(ext)
8
- ext.downcase == ".babel"
16
+ extname_list.include? ext.downcase
9
17
  end
10
18
 
11
19
  def output_ext(ext)
@@ -15,6 +23,12 @@ module Jekyll
15
23
  def convert(content)
16
24
  ::Babel::Transpiler.transform(content)['code']
17
25
  end
26
+
27
+ private
28
+
29
+ def extname_list
30
+ @extname_list ||= @config['babel_js_extensions'].split(',').map { |e| ".#{e.downcase.strip}" }
31
+ end
18
32
  end
19
33
  end
20
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-babel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Kyle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-31 00:00:00.000000000 Z
11
+ date: 2015-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: babel-transpiler