credentials_manager 0.7.3 → 0.7.4

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: 97431490785318228eea05f8bf2e3089a348b5a1
4
- data.tar.gz: 800e2b37b97a60c7ac89ead4cabbc68b11b282ef
3
+ metadata.gz: 5d6ff9dc2af11593ae49731751920d7a7afce656
4
+ data.tar.gz: 977a5df300bc4b5432a057faadf28f2610101cb3
5
5
  SHA512:
6
- metadata.gz: ca4ddee3bc9b8a7df5ec9ef6295a3ff6f95c5b1e9b56d5ab0bf4a6ee2e1841bc3537c8d07a5d1c1befd0f21e9965a0d829901fd83a8887dd4970515261919095
7
- data.tar.gz: 2dbc8450ad76febbd15440f47a0d466fea0c6be0dc718d63d89950f986db9b7b4c7cdf2efb29adea813654df2abb0b5bc49fb34a67452eb70f7ff40318cdd399
6
+ metadata.gz: b834015d4b6264222aa4a24298d96ed674ad4c210ca81a431a1ef1d36b74dc2fb3da1338b7f78864571060e49b36f2f460f6311a16961a63944d6cac290bdd36
7
+ data.tar.gz: 786be1a4dadf3eeea22ec908fcd9edd620ec3e8ee8a9b56cb67da3c27deaef4aed48740c446b95161d2251359e3c67a74269f4601916b6d4efac1c2b8aaff1e1
@@ -30,34 +30,6 @@ module CredentialsManager
30
30
  Dir.chdir(File.expand_path('..', path)) do
31
31
  eval(File.read(full_path))
32
32
  end
33
-
34
- # If necessary override per lane configuration
35
- #
36
- # Appfile can specify different rules per:
37
- # - Platform
38
- # - Lane
39
- #
40
- # It is forbidden to specify multiple configuration for the same platform. It will raise an exception.
41
-
42
- if for_platform_configuration?(blocks)
43
- # Plaform specified.
44
- blocks[ENV["FASTLANE_PLATFORM_NAME"]].call
45
- inner_block = blocks[ENV["FASTLANE_PLATFORM_NAME"]]
46
- if for_lane_configuration?(inner_block)
47
- # .. Lane specified
48
- inner_block[ENV["FASTLANE_LANE_NAME"]].call
49
- end
50
- else
51
- # Platform not specified
52
- if for_lane_configuration?(blocks)
53
- # .. Lane specified
54
- blocks[ENV["FASTLANE_LANE_NAME"]].call
55
- end
56
- end
57
- end
58
-
59
- def blocks
60
- @blocks ||= {}
61
33
  end
62
34
 
63
35
  def data
@@ -104,27 +76,24 @@ module CredentialsManager
104
76
 
105
77
  # Override Appfile configuration for a specific lane.
106
78
  #
107
- # lane_name - Symbol representing a lane name.
79
+ # lane_name - Symbol representing a lane name. (Can be either :name, 'name' or 'platform name')
108
80
  # block - Block to execute to override configuration values.
109
81
  #
110
82
  # Discussion If received lane name does not match the lane name available as environment variable, no changes will
111
83
  # be applied.
112
84
  def for_lane(lane_name, &block)
113
- raise "Configuration for lane '#{lane_name}' is defined multiple times!".red if blocks[lane_name]
114
- if ENV["FASTLANE_PLATFORM_NAME"].to_s.strip.empty?
115
- # No platform specified, assigned configuration by lane name
116
- blocks[lane_name.to_s] = block
117
- else
118
- if ENV["FASTLANE_LANE_NAME"]
119
- # The for_lane could be formatted as:
120
- # - only {lane_name} (i.e. 'for_lane beta ...')
121
- # - {platform_name} {lane_name} (i.e. 'for_lane "ios beta" ...')
122
- #
123
- # Either case it is a valid configuration to run the overwriting of the settings.
124
- if lane_name.to_s == "#{ENV["FASTLANE_PLATFORM_NAME"]} #{ENV["FASTLANE_LANE_NAME"]}" || lane_name.to_s == ENV["FASTLANE_LANE_NAME"]
125
- blocks[ENV["FASTLANE_LANE_NAME"]] = block
126
- end
127
- end
85
+ if lane_name.to_s.split(" ").count > 1
86
+ # That's the legacy syntax 'platform name'
87
+ puts "You use deprecated syntax '#{lane_name}' in your Appfile.".yellow
88
+ puts "Please follow the Appfile guide: https://github.com/KrauseFx/fastlane/blob/master/docs/Appfile.md".yellow
89
+ platform, lane_name = lane_name.split(" ")
90
+
91
+ return unless platform == ENV["FASTLANE_PLATFORM_NAME"]
92
+ # the lane name will be verified below
93
+ end
94
+
95
+ if ENV["FASTLANE_LANE_NAME"] == lane_name.to_s
96
+ block.call
128
97
  end
129
98
  end
130
99
 
@@ -136,20 +105,9 @@ module CredentialsManager
136
105
  # Discussion If received paltform name does not match the platform name available as environment variable, no changes will
137
106
  # be applied.
138
107
  def for_platform(platform_name, &block)
139
- raise "Configuration for platform '#{platform_name}' is defined multiple times!".red if blocks[platform_name]
140
- blocks[platform_name.to_s] = block
141
- end
142
-
143
- # Private helpers
144
-
145
- def for_lane_configuration?(block)
146
- return block[ENV["FASTLANE_LANE_NAME"].to_s] if ENV["FASTLANE_LANE_NAME"]
147
- false
148
- end
149
-
150
- def for_platform_configuration?(block)
151
- return block[ENV["FASTLANE_PLATFORM_NAME"].to_s] if ENV["FASTLANE_PLATFORM_NAME"]
152
- false
108
+ if ENV["FASTLANE_PLATFORM_NAME"] == platform_name.to_s
109
+ block.call
110
+ end
153
111
  end
154
112
  end
155
113
  end
@@ -10,7 +10,7 @@ module CredentialsManager
10
10
  # @return [String] The password of the currently logged in user
11
11
  attr_accessor :password
12
12
 
13
- HOST = "deliver" # there might be a string appended, if user has multiple accounts
13
+ HOST = "deliver" # there *is* a string appended
14
14
  private_constant :HOST
15
15
 
16
16
  # A singleton object, which also makes sure, to use the correct Apple ID
@@ -1,3 +1,3 @@
1
1
  module CredentialsManager
2
- VERSION = "0.7.3"
2
+ VERSION = "0.7.4"
3
3
  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.7.3
4
+ version: 0.7.4
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-08-13 00:00:00.000000000 Z
11
+ date: 2015-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  version: '0'
142
142
  requirements: []
143
143
  rubyforge_project:
144
- rubygems_version: 2.4.8
144
+ rubygems_version: 2.4.6
145
145
  signing_key:
146
146
  specification_version: 4
147
147
  summary: Password manager used in fastlane.tools