rake-xpi 0.0.37 → 0.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac39c43b20ac853a847c5a488a259471dc86caf9
4
- data.tar.gz: b41799ce5044775ae6f9b3223f93f4a95b554d1f
3
+ metadata.gz: a460c4e48abf36806dd929705990b586bbaa1d19
4
+ data.tar.gz: b42a72652f3055d3e84b2b932f85a831d1e36404
5
5
  SHA512:
6
- metadata.gz: 6acff378405892ae419c99d5c54a40f068ea27ff4a2c7720116564c1c48ec55a444996d8e66d9057b217b5bc900d08d9bcccf1dfad572858541aaec1dcb5034c
7
- data.tar.gz: a27b6858ff7e2081e2c46a94cf20ff8368f136fea65ddb27e0047b8a9c4717157b28b22bc499229ba95ed213522db6601f9f94100bed10fe61281af81825243f
6
+ metadata.gz: 258d3c5e77a9088e378230fb53b52921719971306d13ab89b5e1130c24e8afbbfcf6164cd102a7593addbaff3ec876fdbe2b667c00ba702298a49d892d242c5f
7
+ data.tar.gz: a245c340fbcdb1c37376ccb22343cd844f6d5069e48c9b51949e8ccd49951379c1b7c1d99dedb520de8d4b5dc923b29a440c972a16ac1c75edd6c5c258c9be70
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake-xpi (0.0.37)
4
+ rake-xpi (0.0.38)
5
5
  aws-sdk
6
6
  faraday-http-cache
7
7
  jwt
@@ -237,27 +237,29 @@ module Rake
237
237
  FileUtils.mkdir_p(dir)
238
238
  installed = Dir["#{dir}/*.xpi"].collect{|f| File.basename(f) }
239
239
 
240
- sources = []
241
- default = []
242
- (@config.test.xpis.download || []).each{|source|
243
- if source.is_a?(Hash) || source.is_a?(RecursiveOpenStruct)
244
- source = source.to_h.collect{|k, v| [k.to_s, v]}.to_h
245
- default = default.concat(source.select{|env, url| env == 'default'}.values) if default
246
- source = source.select{|env, url| env != 'default' && ENV[env.upcase] == 'true'}.values
247
- default = nil if source.length > 0
248
- elsif source.is_a?(String)
249
- source = [source]
240
+ xpis = []
241
+ optional = {}
242
+ (@config.test.xpis.download || []).each{|xpi|
243
+ if xpi.is_a?(Hash) || xpi.is_a?(RecursiveOpenStruct)
244
+ xpi.each_pair{|env, link|
245
+ next unless ENV[env.upcase] == 'true' || env == 'default'
246
+ optional[env] ||= []
247
+ optional[env] << link
248
+ }
249
+ else
250
+ xpis << xpi
250
251
  end
251
- sources = sources.concat(source)
252
252
  }
253
- sources = sources.concat(default) if default
254
- sources = sources.collect{|url| resolvexpi(url)}
253
+ optional.delete('default') if optional.keys.length > 1
254
+ xpis << optional.values
255
+ xpis.flatten!
256
+ xpis = xpis.collect{|url| resolvexpi(url)}
255
257
 
256
- (installed - sources.collect{|s| s.xpi}).each{|xpi|
258
+ (installed - xpis.collect{|s| s.xpi}).each{|xpi|
257
259
  STDERR.puts "Removing #{xpi}" unless ENV['VERBOSE'] == 'false'
258
260
  File.unlink("#{dir}/#{xpi}")
259
261
  }
260
- sources.reject{|s| installed.include?(s.xpi) && s.url !~ /^file:/ }.each{|s|
262
+ xpis.reject{|s| installed.include?(s.xpi) && s.url !~ /^file:/ }.each{|s|
261
263
  # https://github.com/zotero/zotero/zipball/master for zotero master
262
264
  if s.xpi =~ /(.*)-master-.*.xpi$/
263
265
  src = $1
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "rake-xpi"
7
- spec.version = '0.0.37'
7
+ spec.version = '0.0.38'
8
8
  spec.authors = ["Emiliano Heyns"]
9
9
  spec.email = ["Emiliano.Heyns@iris-advies.com"]
10
10
  spec.description = %q{rake helper to build XPI files}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake-xpi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.37
4
+ version: 0.0.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emiliano Heyns
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-05 00:00:00.000000000 Z
11
+ date: 2016-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler