yi_appium_caps_util 1.0.2 → 1.0.3

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: 72bba2b9024a00731c2f8ba7801aff37c10ac658
4
- data.tar.gz: 5e545673c084036afc87dd2409e46ff90aaca437
3
+ metadata.gz: 5fb12cb7658ebd449dbbe75ce97ccb7dd901db3e
4
+ data.tar.gz: b78cce6d47b71cd0747d5fbbe010cd328de351ed
5
5
  SHA512:
6
- metadata.gz: 4d61e95dcfc18d62f88428e373c09a98b5da863c742fa424dcffd9b560c3fd63155248abee792791bfb0a62db87830a86d429a5c7b0a6231d6bf3646063ccdac
7
- data.tar.gz: 8e3ef4174b446773ac5d9195b1b26d9832a7c7e8a281c0123077f585430386c2cfd0985de54d9b84da1697e2398b003dcfae2a3f365138369942932c789eec13
6
+ metadata.gz: 9479725215d0ae8792895a27f918a2806cd600c6df3e8eca8d29b8a2bf83c597291f15faef535de3fe10657375a4a2a96baa87a2b7db92e3ba698a933d43f344
7
+ data.tar.gz: 8e3c5546f12202a76503684dbb8898b5cdb6e5c77a053201698532fd4ac1b3129e4b98864647e61395d12e945af775ec82dad8623c8a02627f99e38e64664629
@@ -11,10 +11,11 @@ OptionParser.new do |opts|
11
11
  opts.banner = "You.i Utility for appium.txt capabilities"
12
12
  puts opts.banner
13
13
 
14
- opts.on("-u", "--update", "update device ID and IP address") do
14
+ opts.on("-u", "--update [PLATFORM]", "update device ID and IP address") do |p|
15
15
  options[:update] = true
16
+ options[:platform] = p
16
17
  end
17
- opts.on("-cPLATFORM", "--create PLATFORM", "creates the appium.txt file for specefied platform") do |c|
18
+ opts.on("-cPLATFORM", "--create PLATFORM", "creates the appium.txt file for specified platform") do |c|
18
19
  options[:create_caps] = c
19
20
  end
20
21
  opts.on("-fFILE", "--file FILE", "capabilities path and file name (default: ./appium.txt)") do |f|
@@ -29,10 +30,7 @@ end.parse!
29
30
  raise "You should pass -u or -c PLATFORM as an input argument. Type -h for help" if options[:update] == nil and options[:create_caps] == nil
30
31
 
31
32
  if options[:update]
32
- if options[:file]
33
- YiAppiumCapsUtil.update(options[:file])
34
- else
35
- YiAppiumCapsUtil.update
33
+ YiAppiumCapsUtil.update(caps_file_name: options[:file], platformName_value: options[:platform])
36
34
  end
37
35
  end
38
36
 
@@ -6,14 +6,14 @@ require 'shellwords'
6
6
  class YiAppiumCapsUtil
7
7
  class << self
8
8
  public
9
- def update (caps_file_name = './appium.txt')
9
+ def update (caps_file_name: './appium.txt', platformName_value: nil)
10
10
  raise "appium.txt file is missing" if not File.file?(caps_file_name)
11
11
 
12
12
  #Read capability file
13
13
  parsed_data = TOML.load_file(caps_file_name)
14
14
 
15
15
  #Update caps
16
- output_data = run_update(parsed_data)
16
+ output_data = run_update(parsed_data, platformName_value: platformName_value)
17
17
 
18
18
  #Save the file if caps have changed
19
19
  if (output_data != parsed_data)
@@ -55,28 +55,31 @@ class YiAppiumCapsUtil
55
55
  end
56
56
  end
57
57
 
58
- def run_update(parsed_data)
58
+ def run_update(parsed_data, platformName_value: nil)
59
59
  #Make a copy of the parsed data
60
60
  output_data = Marshal.load(Marshal.dump(parsed_data))
61
61
 
62
62
  if parsed_data['caps'] == nil
63
63
  raise '[caps] is missing form appium.txt'
64
- else
64
+ end
65
+
66
+ if platformName_value == nil
67
+ #If platformName_value was not passed as a parameter,
68
+ # we'll try to extract it from the caps
65
69
  platformName_value = parsed_data['caps']['platformName']
66
-
67
70
  if platformName_value == nil
68
71
  raise 'platformName is missing from appium.txt'
69
- else
70
- case platformName_value.downcase
71
- when 'android'
72
- update_android_caps (output_data)
73
- when 'ios'
74
- update_ios_caps (output_data)
75
- else
76
- raise 'platformName: ' + platformName_value + ' is not supported'
77
- end
78
72
  end
79
73
  end
74
+
75
+ case platformName_value.downcase
76
+ when 'android'
77
+ update_android_caps (output_data)
78
+ when 'ios'
79
+ update_ios_caps (output_data)
80
+ else
81
+ raise 'platformName: ' + platformName_value + ' is not supported'
82
+ end
80
83
  return output_data
81
84
  end
82
85
 
@@ -171,8 +174,6 @@ class YiAppiumCapsUtil
171
174
  # Add the xcodeConfigFile in the caps if dealing with iOS 10+
172
175
  if (platformVersion.to_f>=10) then
173
176
  output_data['caps']['xcodeOrgId'] = getTeamID()
174
- # NewWDA: Forces uninstall of any existing WebDriverAgent app on device. This provides stability.
175
- output_data['caps']['useNewWDA'] = true
176
177
  # Confirm xcode command line tools > xcode 7
177
178
  if (xcodeBuildVersion.to_f<8) then
178
179
  puts "Change to xcode version higher than xcode 7! Current version is: "+xcodeBuildVersion
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yi_appium_caps_util
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Granger
@@ -10,8 +10,36 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-02-10 00:00:00.000000000 Z
14
- dependencies: []
13
+ date: 2017-10-05 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: ipaddress
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - "~>"
20
+ - !ruby/object:Gem::Version
21
+ version: 0.8.3
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: 0.8.3
29
+ - !ruby/object:Gem::Dependency
30
+ name: toml
31
+ requirement: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: 0.1.2
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: 0.1.2
15
43
  description: This utility updates the caps for iOS and Android devices. Please refer
16
44
  to homepage for ruther details on usage
17
45
  email: simon.granger@youi.tv
@@ -43,8 +71,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
71
  version: '0'
44
72
  requirements: []
45
73
  rubyforge_project:
46
- rubygems_version: 2.4.5.1
74
+ rubygems_version: 2.5.1
47
75
  signing_key:
48
76
  specification_version: 4
49
77
  summary: Updates your appium.txt capabilities for iOS and Android
50
78
  test_files: []
79
+ has_rdoc: