bower_vendor 0.0.15 → 0.0.16

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
- SHA1:
3
- metadata.gz: 8e716af98bdadfcee4b4f36b69b4237ea4cc7b08
4
- data.tar.gz: c5a5a56fa5c33b06137c1561ab791a40814a3c7d
2
+ SHA256:
3
+ metadata.gz: 27476877f118a83d965b71a0098728d23fb26bbc3d4c94273a3df02730ba9dbf
4
+ data.tar.gz: 79a1eca558c32f4a7316149f3995341ccb14f4ad9b95f59d31991aa9921817d5
5
5
  SHA512:
6
- metadata.gz: 7b4ae3578ff4f9975aec31049dfd56f87df8513f5ec874f8d499d341db6a13bfa198b220da838009ebad7f063b8831997cc3b123a933ea7d9d4313558cb5e2ce
7
- data.tar.gz: e952bdb016279cdc93729100e4292ae84b3336f1c586d3f2d8e7cb97d5c45e9d63beb622aefcdda219a68060659377ab5f742126787da97cc91c5c8ca5dcbea2
6
+ metadata.gz: 74183e4289f806c4f99e0fa3e51134c2a817c89b039f6929f4e5f51db61224834bac3f4be0849e1f51f32ca351e2c1587c4e2b14ebc03249970fe91db9711e74
7
+ data.tar.gz: 6f3be2f50e11e756473e2e27d6c2b7554549ffe4e50c9e583ff98a345f3b3d63f6fb3401c29977400d1608348d5f1b1e1a342e9f1f0b3652fe6d846bbdec91f6
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.3.1
1
+ 2.5.0
@@ -30,8 +30,8 @@ module BowerVendor
30
30
  end
31
31
  end
32
32
 
33
- def base_src_dir
34
- @base_src_dir ||= 'bower_components'
33
+ def full_asset_key_src_dir(asset_key)
34
+ "#{self.work_dir}/bower_components/#{asset_key}"
35
35
  end
36
36
 
37
37
  def work_dir
@@ -2,24 +2,27 @@ module BowerVendor
2
2
  class Copy < Base
3
3
  def execute
4
4
  vendors.each do |asset_key, asset_data|
5
- src_dir = "#{base_src_dir}/#{asset_key}"
5
+ src_dir = full_asset_key_src_dir(asset_key)
6
6
  msg 0, "processing: #{src_dir}"
7
7
 
8
- run_scripts(asset_key, asset_data, 1)
8
+ run_build_scripts(asset_key, asset_data, 1)
9
9
  copy_assets(asset_key, asset_data, 1)
10
10
  end
11
11
  end
12
12
 
13
- def run_scripts(asset_key, asset_data, level)
13
+ def run_build_scripts(asset_key, asset_data, level)
14
14
  scripts = (asset_data['build'] || [])
15
15
  return if scripts.empty?
16
16
 
17
+ src_dir = full_asset_key_src_dir(asset_key)
18
+
17
19
  msg level, "building..."
18
20
  scripts.each do |cmd|
19
- full_cmd ="cd #{src_dir} && #{cmd}"
20
- msg level + 1, full_cmd
21
+ msg level + 1, "cd #{src_dir} && #{cmd}"
22
+
21
23
  pid = fork do
22
- exec full_cmd
24
+ Dir.chdir src_dir
25
+ puts `#{cmd}`
23
26
  end
24
27
  Process.wait pid
25
28
  end
@@ -47,10 +50,8 @@ module BowerVendor
47
50
  version = asset_data['version'].to_s
48
51
  raise "VERSION MISSING: #{asset_data.inspect}" if version.blank?
49
52
 
50
- src_path = asset.gsub("{{VERSION}}", version)
51
-
52
- base_src_dir = "#{work_dir}/bower_components"
53
- src = "#{base_src_dir}/#{asset_key}/#{src_path}"
53
+ asset_path = asset.gsub("{{VERSION}}", version)
54
+ src = "#{full_asset_key_src_dir(asset_key)}/#{asset_path}"
54
55
 
55
56
  files = Dir[src].sort!
56
57
  raise "NOT_FOUND: #{src}" if files.empty?
@@ -71,7 +72,7 @@ module BowerVendor
71
72
  ext = src_file.split('.').last
72
73
  dst_file = src_file
73
74
 
74
- base_dst_dir = dst_dirs[ext]
75
+ base_dst_dir = self.dst_dirs[ext]
75
76
  raise "NOT_FOUND_EXT: #{ext}" unless base_dst_dir
76
77
 
77
78
  dst_dir = "#{base_dst_dir}/#{asset_key}-#{version}"
@@ -1,3 +1,3 @@
1
1
  module BowerVendor
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.16"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bower_vendor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - kari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-13 00:00:00.000000000 Z
11
+ date: 2018-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  requirements: []
101
101
  rubyforge_project:
102
- rubygems_version: 2.5.1
102
+ rubygems_version: 2.7.3
103
103
  signing_key:
104
104
  specification_version: 4
105
105
  summary: Use bower to manage resources for rails application