credentials_manager 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/credentials_manager/appfile_config.rb +57 -4
- data/lib/credentials_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6bf495bb403fc526d4b3f141e80fecd2a6641ee
|
4
|
+
data.tar.gz: 3062b0ab03c44edd797486fd36736c0875c46a52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0110c3d38f696b317edc6b28e5375c893d33543cd64ce04f868be1579f4586b845cff524b144fb09576b77edf5e4a9c053c50c3e9feaf3f07322ebac2a63916d
|
7
|
+
data.tar.gz: 1abffce1a58dd7c89401a0bf1496b586e249c52928f3f10686ae470cb998311a05440c3b34845abaabf37f6a2b6dd99e9db336dc1bd16a2e9e56cc444f0a06eb
|
@@ -27,7 +27,28 @@ module CredentialsManager
|
|
27
27
|
end
|
28
28
|
|
29
29
|
# If necessary override per lane configuration
|
30
|
-
|
30
|
+
#
|
31
|
+
# Appfile can specify different rules per:
|
32
|
+
# - Platform
|
33
|
+
# - Lane
|
34
|
+
#
|
35
|
+
# It is forbidden to specify multiple configuration for the same platform. It will raise an exception.
|
36
|
+
|
37
|
+
# Plaform specified.
|
38
|
+
if for_platform_configuration?(blocks)
|
39
|
+
blocks[ENV["FASTLANE_PLATFORM_NAME"]].call
|
40
|
+
inner_block = blocks[ENV["FASTLANE_PLATFORM_NAME"]]
|
41
|
+
if for_lane_configuration?(inner_block)
|
42
|
+
# .. Lane specified
|
43
|
+
inner_block[ENV["FASTLANE_LANE_NAME"]].call
|
44
|
+
end
|
45
|
+
else
|
46
|
+
# Platform not specified
|
47
|
+
if for_lane_configuration?(blocks)
|
48
|
+
# .. Lane specified
|
49
|
+
blocks[ENV["FASTLANE_LANE_NAME"]].call
|
50
|
+
end
|
51
|
+
end
|
31
52
|
end
|
32
53
|
|
33
54
|
def blocks
|
@@ -68,8 +89,40 @@ module CredentialsManager
|
|
68
89
|
# Discussion If received lane name does not match the lane name available as environment variable, no changes will
|
69
90
|
# be applied.
|
70
91
|
def for_lane(lane_name, &block)
|
71
|
-
raise "Configuration for lane '#{lane_name}'
|
72
|
-
|
92
|
+
raise "Configuration for lane '#{lane_name}' is defined multiple times!".red if blocks[lane_name]
|
93
|
+
if ENV["FASTLANE_PLATFORM_NAME"].nil?
|
94
|
+
# No platform specified, assigned configuration by lane name
|
95
|
+
blocks[lane_name.to_s] = block
|
96
|
+
else
|
97
|
+
if ENV["FASTLANE_LANE_NAME"]
|
98
|
+
# Platform and lane name specified, assigned lane configuration per different platforms
|
99
|
+
blocks[ENV["FASTLANE_PLATFORM_NAME"]] = {lane_name.to_s => block } if lane_name.to_s == ENV["FASTLANE_LANE_NAME"]
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
# Override Appfile configuration for a specific platform.
|
105
|
+
#
|
106
|
+
# platform_name - Symbol representing a platform name.
|
107
|
+
# block - Block to execute to override configuration values.
|
108
|
+
#
|
109
|
+
# Discussion If received paltform name does not match the platform name available as environment variable, no changes will
|
110
|
+
# be applied.
|
111
|
+
def for_platform(platform_name, &block)
|
112
|
+
raise "Configuration for platform '#{platform_name}' is defined multiple times!".red if blocks[platform_name]
|
113
|
+
blocks[platform_name.to_s] = block
|
114
|
+
end
|
115
|
+
|
116
|
+
# Private helpers
|
117
|
+
|
118
|
+
def for_lane_configuration?(block)
|
119
|
+
return block[ENV["FASTLANE_LANE_NAME"].to_s] if ENV["FASTLANE_LANE_NAME"]
|
120
|
+
false
|
121
|
+
end
|
122
|
+
|
123
|
+
def for_platform_configuration?(block)
|
124
|
+
return block[ENV["FASTLANE_PLATFORM_NAME"].to_s] if ENV["FASTLANE_PLATFORM_NAME"]
|
125
|
+
false
|
73
126
|
end
|
74
127
|
end
|
75
|
-
end
|
128
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: credentials_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Krause
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|