jekyll-js-converter 1.0.1 → 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
  SHA256:
3
- metadata.gz: 1a7d061dea9f28995d3038724a26ed29c6c6cdae0656d105ce6a36c68fde5b52
4
- data.tar.gz: 2f76e7e429cc3dcc1bc31e055f8a3112f846c8929b74e34ed5cabc74a0cd900b
3
+ metadata.gz: 46e4f09c7076cad7fb5dfc7c811e826cce1ad8358db66f3bb3e99a85577ca4ab
4
+ data.tar.gz: cc313145326fd00006785f91df5f3fd7277c5f97b5fba35e2fe8e66edc50ce97
5
5
  SHA512:
6
- metadata.gz: 8f50bfb3976bfdd1fb284586dd337694794294861a8fae62c357161c7ba90b7355696e2c9697fe969a99b65deda085b5db685756bcd7af6d6464d4a8334fa8e1
7
- data.tar.gz: 3502b12bcd960b6dbc0fa090e303c5cabc695700d171740148179051bcd5cd2002c59f9971e703d020532e36d98105e0e3acd6a0f23e4b7478e3b25623b706c7
6
+ metadata.gz: f3c7dfac1fd68634f4e0a6ade3a6429127e9e183a752e2f06a0cec311c989fecb82d14c6d4c0a3df5840131000e4ca68b51f672d2acbe5f082e66cc51aeb66ef
7
+ data.tar.gz: fe2e8bd2d8a2b7cbccfbd7d2f03d3ed38951268fafc5131d18a4688f284cdce9e87e030920660fb23ff2722788e888443a0f0aca42eb4e39ec21dccaee26f20a
@@ -1,5 +1,6 @@
1
1
  require 'uglifier'
2
2
  require 'jekyll/js_source_map_page'
3
+ require 'jekyll/core_ext/hash'
3
4
 
4
5
  module Jekyll
5
6
  module Converters
@@ -21,17 +22,17 @@ module Jekyll
21
22
  end
22
23
 
23
24
  def javascript_config
24
- @javascript_config ||= @config['javascript'] || {}
25
+ @javascript_config ||= @config['javascript'].deep_symbolize_keys || {}
25
26
  end
26
27
 
27
28
  def javascript_dir
28
- javascript_config['javascript_dir'].to_s.empty? ? '_javascript' : javascript_config['javascript_dir']
29
+ javascript_config[:javascript_dir].to_s.empty? ? '_javascript' : javascript_config[:javascript_dir]
29
30
  end
30
31
 
31
32
  def load_paths
32
33
  @load_paths ||= begin
33
34
  paths = [Jekyll.sanitized_path(site.source, javascript_dir)]
34
- paths += javascript_config['load_paths'].map { |load_path| File.expand_path(load_path, site.source) } rescue []
35
+ paths += javascript_config[:load_paths].map { |load_path| File.expand_path(load_path, site.source) } rescue []
35
36
 
36
37
  if safe?
37
38
  paths.map! { |path| Jekyll.sanitized_path(site.source, path) }
@@ -155,7 +156,7 @@ module Jekyll
155
156
  end
156
157
 
157
158
  def source_map_option
158
- javascript_config.fetch('source_map', :always).to_sym
159
+ javascript_config.fetch(:source_map, :always).to_sym
159
160
  end
160
161
  end
161
162
  end
@@ -0,0 +1,12 @@
1
+ class Hash
2
+ def deep_symbolize_keys(object = self)
3
+ case object
4
+ when Hash
5
+ object.each_with_object(Hash.new) do |(key, value), result|
6
+ result[key.to_sym] = deep_symbolize_keys(value)
7
+ end
8
+ else
9
+ object
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module JekyllJsConverter
2
- VERSION = '1.0.1'
2
+ VERSION = '1.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-js-converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Susco
@@ -89,6 +89,7 @@ files:
89
89
  - lib/jekyll-js-converter.rb
90
90
  - lib/jekyll-js-converter/version.rb
91
91
  - lib/jekyll/converters/js.rb
92
+ - lib/jekyll/core_ext/hash.rb
92
93
  - lib/jekyll/js_source_map_page.rb
93
94
  homepage: https://github.com/dsusco/jekyll-js-converter
94
95
  licenses:
@@ -102,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
102
103
  requirements:
103
104
  - - ">="
104
105
  - !ruby/object:Gem::Version
105
- version: 2.4.0
106
+ version: 2.5.0
106
107
  required_rubygems_version: !ruby/object:Gem::Requirement
107
108
  requirements:
108
109
  - - ">="