bower_vendor 0.0.13 → 0.0.15

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: e685ebf7820b97812bae22b23c8f1e1226247307
4
- data.tar.gz: 60e8f9a0468899f07585ab5280def92ddd3c19df
3
+ metadata.gz: 8e716af98bdadfcee4b4f36b69b4237ea4cc7b08
4
+ data.tar.gz: c5a5a56fa5c33b06137c1561ab791a40814a3c7d
5
5
  SHA512:
6
- metadata.gz: 9c03d825a41c9140cc7c180bf4948398d0c708b4d50ff62d0d0ebc8802e0c2c63ffa9fdda732e94c0363a7be0c65a8384971bfbbcc7b83dca49e1010acc2c4f3
7
- data.tar.gz: e2fdbafa048a08cdf05cd6c7133adc7dbcf1a92d5d7bdfca5d8be93ff1fb7e1382adf83a2b2e02c0c889f922af96b23add11914742fea7370698425203f11b08
6
+ metadata.gz: 7b4ae3578ff4f9975aec31049dfd56f87df8513f5ec874f8d499d341db6a13bfa198b220da838009ebad7f063b8831997cc3b123a933ea7d9d4313558cb5e2ce
7
+ data.tar.gz: e952bdb016279cdc93729100e4292ae84b3336f1c586d3f2d8e7cb97d5c45e9d63beb622aefcdda219a68060659377ab5f742126787da97cc91c5c8ca5dcbea2
@@ -4,7 +4,7 @@ module BowerVendor
4
4
  end
5
5
 
6
6
  def vendors
7
- @vendors ||= YAML.load_file('vendor.yml')
7
+ @vendors ||= load_vendors
8
8
  validate_vendors
9
9
  @vendors
10
10
  end
@@ -12,8 +12,8 @@ module BowerVendor
12
12
  def validate_vendors
13
13
  # validate resources
14
14
  @vendors.each do |vendor_key, vendor|
15
- raise "VERSION MISSING: #{vendor.inspect}" unless vendor['version']
16
- raise "ASSETS MISSING: #{vendor.inspect}" unless vendor['assets']
15
+ raise "VERSION MISSING: #{vendor_key}: #{vendor.inspect}" unless vendor['version']
16
+ puts "WARN: ASSETS MISSING: #{vendor_key}: #{vendor.inspect}" unless vendor['assets']
17
17
  end
18
18
  end
19
19
 
@@ -45,5 +45,12 @@ module BowerVendor
45
45
  def local_node_bin
46
46
  "#{Rails.root}/node_modules/.bin"
47
47
  end
48
+
49
+ def load_vendors
50
+ vendors = YAML.load_file('vendor.yml')
51
+ vendors.sort do |a, b|
52
+ a[0] <=> b[0]
53
+ end.to_h
54
+ end
48
55
  end
49
56
  end
@@ -12,16 +12,16 @@ module BowerVendor
12
12
 
13
13
  def run_scripts(asset_key, asset_data, level)
14
14
  scripts = (asset_data['build'] || [])
15
- if !scripts.empty?
16
- msg level, "building..."
17
- scripts.each do |cmd|
18
- full_cmd ="cd #{src_dir} && #{cmd}"
19
- msg level + 1, full_cmd
20
- pid = fork do
21
- exec full_cmd
22
- end
23
- Process.wait pid
15
+ return if scripts.empty?
16
+
17
+ msg level, "building..."
18
+ scripts.each do |cmd|
19
+ full_cmd ="cd #{src_dir} && #{cmd}"
20
+ msg level + 1, full_cmd
21
+ pid = fork do
22
+ exec full_cmd
24
23
  end
24
+ Process.wait pid
25
25
  end
26
26
  end
27
27
 
@@ -31,6 +31,11 @@ module BowerVendor
31
31
  end
32
32
 
33
33
  def copy_asset(asset_key, asset_data, assets, target_path = '', level)
34
+ assets ||= []
35
+ if assets.empty?
36
+ msg level, "WARN: ASSETS MISSING"
37
+ end
38
+
34
39
  assets.each do |asset|
35
40
  if asset.is_a? Hash
36
41
  sub_asset = asset.keys.first
@@ -24,7 +24,7 @@ module BowerVendor
24
24
  end
25
25
 
26
26
  data[:dependencies][vendor_key] = tag_version
27
- data[:resolutions][vendor_key] = tag_version
27
+ data[:resolutions][vendor_key] = version
28
28
  end
29
29
 
30
30
  target_file = "#{work_dir}/bower.json"
@@ -1,3 +1,3 @@
1
1
  module BowerVendor
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.15"
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.13
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - kari
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-20 00:00:00.000000000 Z
11
+ date: 2017-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler