jekyll-js-converter 0.0.4 → 0.0.5

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: 051f3d84b072c90751778f6a6745bd2e7128db20b9df638606a18b5d6d9282e3
4
- data.tar.gz: 172c2a570d6d604c89501a51efcdc23e08ad4fc3746f20872065cd46cf44245a
3
+ metadata.gz: 1dbb1d9c51749616f197d23c0210a5f9cca4e46235a9ef8f0d64528903090d08
4
+ data.tar.gz: 9d79b25157ea3579e0338fe6d9f74149ae5be2769b3d0a15f4c2cfc1e379205e
5
5
  SHA512:
6
- metadata.gz: 94d976d8474c9c12a7e0f4876999da602c88bad14bd9203899e202cd49b20c88c0978d534e04d17a8de63e453679f58c65e4f5178bffb4f485de61cb10edae2b
7
- data.tar.gz: fffe093d63fb6206a7d5d8396171156bfa9e14a0ed817f6fa94d8d11db59d9ab553dc57cd33599ecfaa4309ab5672a839c32052caf77bc787f1a98fda7adc080
6
+ metadata.gz: f4d31d5caff7f8eb48e6b1653ee6ffbcabaf853f6202355fd51370cdf53e0c634b5cc75972782b3348f10986c57483555ef662da6e0317491419d2febd171389
7
+ data.tar.gz: 38a3249861d2afad8e7e0284812c647fc4b67f59e79c6d37d2c7b8b89ef6e9d2d4c8b2615d4a48f01bf6cb57960d27a7190578e7c57b952c88a917452c70ccd7
@@ -1,3 +1,3 @@
1
1
  module JekyllJsConverter
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
@@ -74,7 +74,7 @@ module Jekyll
74
74
  private
75
75
 
76
76
  def insert_imports(content)
77
- content.enum_for(:scan, /^\W*=\s*(\w+)\W+([\w\/\\\-\.]+)\W*$/).map {
77
+ content.enum_for(:scan, /^\W*=\s*(\w+)\W+([\w\/\\\-\.:]+)\W*$/).map {
78
78
  { directive: Regexp.last_match[1],
79
79
  path: Regexp.last_match[2],
80
80
  insert_at: Regexp.last_match.end(0) }
@@ -86,17 +86,21 @@ module Jekyll
86
86
  import_content = load_paths.reduce([]) { |files, load_path|
87
87
  glob = case match[:directive]
88
88
  when 'import'
89
- match[:path] += '.js' unless match[:path].end_with?('.js')
90
- File.join(load_path, '**', match[:path])
89
+ if (match[:path] =~ URI::regexp).nil?
90
+ match[:path] += '.js' unless match[:path].end_with?('.js')
91
+ Dir.glob(File.join(load_path, '**', match[:path]))
92
+ else
93
+ [match[:path]]
94
+ end
91
95
  when 'import_directory'
92
- File.join(load_path, '**', match[:path], '*.js')
96
+ Dir.glob(File.join(load_path, '**', match[:path], '*.js'))
93
97
  when 'import_tree'
94
- File.join(load_path, '**', match[:path], '**', '*.js')
98
+ Dir.glob(File.join(load_path, '**', match[:path], '**', '*.js'))
95
99
  end
96
100
 
97
- files + Dir.glob(glob)
101
+ files + glob
98
102
  }.uniq.reduce('') { |import_content, file|
99
- import_content += File.read(file)
103
+ import_content += (file =~ URI::regexp).nil? ? File.read(file) : Net::HTTP.get(URI(file))
100
104
  }
101
105
 
102
106
  content.insert(match[:insert_at], "\n#{insert_imports(import_content)}")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-js-converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Susco
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-24 00:00:00.000000000 Z
11
+ date: 2021-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  requirements: []
125
- rubygems_version: 3.1.4
125
+ rubygems_version: 3.0.8
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: A JavaScript converter for Jekyll.