travis 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/travis/cli/disable.rb +1 -1
- data/lib/travis/cli/encrypt.rb +47 -9
- data/lib/travis/version.rb +1 -1
- data/travis.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cda21789737990f798f8234501d7973bdf75c90f
|
4
|
+
data.tar.gz: 86ea0816fb1f70c7784c4f5628e111639e5bb72f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24524107e5fe9b919e8a40dfb1734780fe06abcefc9342493e56fc300d00a103f1c6fa9b802b22a20597fc8ac09fcf19fb614fa75b5659cfa171dd72bf585f41
|
7
|
+
data.tar.gz: dc95bcb8417bfcbd86a3ed237d214a8546c4a5ea05212cf3f961cfbb74ddfbdd718d3657471e91a39d4695c06db7255cefc7ee5a73f83adbb096aaaefa6c6b4d
|
data/README.md
CHANGED
@@ -888,6 +888,11 @@ If you have the old `travis-cli` gem installed, you should `gem uninstall travis
|
|
888
888
|
|
889
889
|
## Version History
|
890
890
|
|
891
|
+
**v1.2.2** (May 24, 2013)
|
892
|
+
|
893
|
+
* Fixed `travis disable`.
|
894
|
+
* Fix edge cases around `travis encrypt`.
|
895
|
+
|
891
896
|
**v1.2.1** (May 24, 2013)
|
892
897
|
|
893
898
|
* Builds with high build numbers are properly aligned when running `travis history`.
|
data/lib/travis/cli/disable.rb
CHANGED
data/lib/travis/cli/encrypt.rb
CHANGED
@@ -32,15 +32,7 @@ module Travis
|
|
32
32
|
encrypted = data.map { |data| repository.encrypt(data) }
|
33
33
|
|
34
34
|
if config_key
|
35
|
-
|
36
|
-
travis_config = {} if [[], false, nil].include? travis_config
|
37
|
-
keys = config_key.split('.')
|
38
|
-
last_key = keys.pop
|
39
|
-
nested_config = keys.inject(travis_config) { |c,k| c[k] ||= {}}
|
40
|
-
nested_config = nested_config[last_key] ||= []
|
41
|
-
encrypted.each do |encrypted|
|
42
|
-
nested_config << { 'secure' => encrypted }
|
43
|
-
end
|
35
|
+
set_config encrypted.map { |e| { 'secure' => e } }
|
44
36
|
File.write(travis_yaml, travis_config.to_yaml)
|
45
37
|
else
|
46
38
|
list = encrypted.map { |data| format(data.inspect, " secure: %s") }
|
@@ -50,6 +42,52 @@ module Travis
|
|
50
42
|
|
51
43
|
private
|
52
44
|
|
45
|
+
def travis_config
|
46
|
+
@travis_config ||= begin
|
47
|
+
payload = YAML.load_file(travis_yaml)
|
48
|
+
payload.respond_to?(:to_hash) ? payload.to_hash : {}
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def set_config(result)
|
53
|
+
parent_config[last_key] = merge_config(result)
|
54
|
+
end
|
55
|
+
|
56
|
+
def merge_config(result)
|
57
|
+
case subconfig = parent_config[last_key]
|
58
|
+
when nil then result.size == 1 ? result.first : result
|
59
|
+
when Array then subconfig + result
|
60
|
+
else result.unshift(subconfig)
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def subconfig
|
65
|
+
end
|
66
|
+
|
67
|
+
def key_chain
|
68
|
+
@key_chain ||= config_key.split('.')
|
69
|
+
end
|
70
|
+
|
71
|
+
def last_key
|
72
|
+
key_chain.last
|
73
|
+
end
|
74
|
+
|
75
|
+
def parent_config
|
76
|
+
@parent_config ||= traverse_config(travis_config, *key_chain[0..-2])
|
77
|
+
end
|
78
|
+
|
79
|
+
def traverse_config(hash, key = nil, *rest)
|
80
|
+
return hash unless key
|
81
|
+
|
82
|
+
hash[key] = case value = hash[key]
|
83
|
+
when nil then {}
|
84
|
+
when Hash then value
|
85
|
+
else { 'matrix' => Array(value) }
|
86
|
+
end
|
87
|
+
|
88
|
+
traverse_config(hash[key], *rest)
|
89
|
+
end
|
90
|
+
|
53
91
|
def travis_yaml(dir = Dir.pwd)
|
54
92
|
path = File.expand_path('.travis.yml', dir)
|
55
93
|
if File.exist? path
|
data/lib/travis/version.rb
CHANGED
data/travis.gemspec
CHANGED