appium_console 2.9.2 → 2.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6e642a098d138689268455bba709d07e78462be9
4
- data.tar.gz: e60543db1eecdd0e53abdd609c53cd638ca8b384
3
+ metadata.gz: 6f7f3c2ea9dadac7784c21e134154b57cc5d3a52
4
+ data.tar.gz: 0ae3dce72a4ac061483ddf479aa537c4e23e0ad7
5
5
  SHA512:
6
- metadata.gz: fe92a1c7f1527aac0618871c80c1b24ea0769cb5aa201d3cc440b333cb956b98c7cad4902ff930e34b96a78dfc07c31b96425302c57d230fd37261c83db47fb6
7
- data.tar.gz: 2a4e676519aae7ef0f544f49d9689a389fa15587a1173127bfc9667c4a255b2f9496b5698dda1753caea0e69bcffff1417007a2b3977c8012ef00a44e07a327d
6
+ metadata.gz: 549d3c6b7ad263301cfca51f075b34edf0ad001e02196c113ce6705921c8f69b937ca3cc6812037192ecd3222dc29e44cf0e6825748b197108f0fb4766b4af22
7
+ data.tar.gz: 8d6140a70f246a5c376a829258df8f93c1f72a336eb5a8edfeb3718a1ba5d50e22c09bdb656b702953e9a5ebde74c3e7add15168bcf11f53612e244d4ea2a4fe
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  # appium_lib version must match ruby console version.
27
27
  s.add_runtime_dependency 'appium_lib', '~> 9.16'
28
28
  s.add_runtime_dependency 'awesome_print', '~> 1.7'
29
- s.add_runtime_dependency 'pry', '~> 0.11.0'
29
+ s.add_runtime_dependency 'pry', '~> 0.12.0'
30
30
  s.add_runtime_dependency 'bond', '~> 0.5'
31
31
  s.add_runtime_dependency 'spec', '~> 5.3', '>= 5.3.1'
32
32
  s.add_runtime_dependency 'thor', '~> 0.19'
@@ -15,8 +15,8 @@ module Appium
15
15
  class << self
16
16
  def setup appium_txt_path
17
17
  Pry.send(:define_singleton_method, :pry_load_appium_txt) do |opts = {}|
18
- verbose = opts.fetch :verbose, false
19
- path = appium_txt_path
18
+ verbose = opts.fetch :verbose, false
19
+ path = appium_txt_path
20
20
  Appium.load_appium_txt file: path, verbose: verbose
21
21
  end
22
22
 
@@ -36,10 +36,10 @@ module Appium
36
36
 
37
37
  def start
38
38
  AwesomePrint.pry!
39
- start = File.expand_path '../start.rb', __FILE__
40
- cmd = ['-r', start]
39
+ start = File.expand_path 'start.rb', __dir__
40
+ cmd = ['-r', start]
41
41
 
42
- parsed = Pry.pry_load_appium_txt verbose: true
42
+ parsed = Pry.pry_load_appium_txt verbose: true
43
43
  has_requires = parsed && parsed[:appium_lib] && parsed[:appium_lib][:require]
44
44
  if has_requires
45
45
  requires = parsed[:appium_lib][:require]
@@ -52,8 +52,8 @@ module Appium
52
52
  $stdout.puts "pry #{cmd.join(' ')}"
53
53
  end
54
54
 
55
- Pry.hooks.add_hook(:after_session, "Release session hook") do |output, binding, pry|
56
- output.puts "Closing appium session..."
55
+ Pry.hooks.add_hook(:after_session, 'Release session hook') do |output, binding, pry|
56
+ output.puts 'Closing appium session...'
57
57
  $driver.x
58
58
  end
59
59
 
@@ -2,6 +2,6 @@
2
2
  # Define Appium module so version can be required directly.
3
3
  module Appium; end unless defined? Appium
4
4
  module Appium::Console
5
- VERSION = '2.9.2' unless defined? ::Appium::Console::VERSION
6
- DATE = '2018-11-30' unless defined? ::Appium::Console::DATE
5
+ VERSION = '2.10.0' unless defined? ::Appium::Console::VERSION
6
+ DATE = '2018-12-19' unless defined? ::Appium::Console::DATE
7
7
  end
data/lib/cli.rb CHANGED
@@ -8,74 +8,82 @@ require 'appium_console'
8
8
  module Appium::CLI
9
9
  module Config
10
10
  class << self
11
- def appium_txt_template_path
12
- File.join(File.dirname(__FILE__), "..", "templates/appium.txt.erb")
11
+ def default_appium_txt_path
12
+ 'appium.txt'
13
13
  end
14
14
 
15
- def default_appium_txt_path
16
- "appium.txt"
15
+ def template(caps)
16
+ <<-EOS.gsub(/skip\s/, '')
17
+ [caps]
18
+ platformName = "#{caps[:platform_name]}"
19
+ #{ caps[:platform_version] ? "platformVersion = \"#{caps[:platform_version]}\"" : 'skip' }
20
+ #{ caps[:device_name] ? "deviceName = \"#{caps[:device_name]}\"" : 'skip' }
21
+ app = "#{caps[:path_to_app]}"
22
+ #{ caps[:app_package] ? "appPackage = \"#{caps[:app_package]}\"" : 'skip' }
23
+ #{ caps[:app_activity] ? "appActivity = \"#{caps[:app_activity]}\"" : 'skip' }
24
+
25
+ [appium_lib]
26
+ server_url = "http://127.0.0.1:4723/wd/hub"
27
+ sauce_username = ""
28
+ sauce_access_key = ""
29
+ EOS
17
30
  end
18
31
  end
19
32
  end
20
33
 
21
34
  class Setup < Thor
22
- desc "ios", "Generates toml for ios"
35
+ desc 'ios', 'Generates toml for ios'
23
36
  def ios
24
- toml = File.join(Dir.pwd, Config.default_appium_txt_path)
25
- template = ERB.new(File.new(Config.appium_txt_template_path).read, nil, "-")
26
- File.open toml, 'w' do |f|
27
- caps = {
28
- automation_name: "XCUITest",
29
- platform_name: "iOS",
30
- device_name: "iPhone Simulator",
31
- platform_version: "11.4",
32
- path_to_app: "/path/to/app_bundle"
33
- }
34
- f.puts template.result(binding)
35
- end
37
+ toml = File.join(Dir.pwd, Config.default_appium_txt_path)
38
+ template = Config.template(
39
+ automation_name: 'XCUITest',
40
+ platform_name: 'iOS',
41
+ device_name: 'iPhone Simulator',
42
+ platform_version: '12.0',
43
+ path_to_app: '/path/to/app_bundle'
44
+ )
45
+ File.write(toml, template)
36
46
  end
37
47
 
38
- desc "android", "Generates toml for android"
48
+ desc 'android', 'Generates toml for android'
39
49
  def android
40
- toml = File.join(Dir.pwd, Config.default_appium_txt_path)
41
- template = ERB.new(File.new(Config.appium_txt_template_path).read, nil, "-")
42
- File.open toml, 'w' do |f|
43
- caps = {
44
- automation_name: "uiautomator2",
45
- platform_name: "Android",
46
- device_name: "Nexus 5X",
47
- path_to_app: "/path/to/apk",
48
- app_package: "com.package.example",
49
- app_activity: ".ExampleActivity"
50
- }
51
- f.puts template.result(binding)
52
- end
50
+ toml = File.join(Dir.pwd, Config.default_appium_txt_path)
51
+ template = Config.template(
52
+ automation_name: 'uiautomator2',
53
+ platform_name: 'Android',
54
+ device_name: 'Pixel 3',
55
+ path_to_app: '/path/to/apk',
56
+ app_package: 'com.package.example',
57
+ app_activity: 'com.package.example.ExampleActivity'
58
+ )
59
+ File.write(toml, template)
53
60
  end
54
61
  end
55
62
 
56
63
  class Main < Thor
57
- desc "version", "Prints version of appium_lib and appium_console"
64
+ desc 'version', 'Prints version of appium_lib and appium_console'
58
65
  def version
59
- puts "appium_console: v#{::Appium::Console::VERSION}"
60
- puts " appium_lib: v#{::Appium::VERSION}"
61
- exit
66
+ puts <<-VERSION
67
+ appium_console: v#{::Appium::Console::VERSION}
68
+ appium_lib: v#{::Appium::VERSION}
69
+ VERSION
62
70
  end
63
71
 
64
- desc "toml [FILE]", "Starts appium console session with path to toml file"
72
+ desc 'toml [FILE]', 'Starts appium console session with path to toml file'
65
73
  def toml(appium_txt_path = Config.default_appium_txt_path)
66
74
  Appium::Console.setup appium_txt_path
67
75
  Appium::Console.start
68
76
  end
69
77
 
70
- desc "init", "Starts appium console session with defaults settings"
78
+ desc 'init', 'Starts appium console session with defaults settings'
71
79
  def init
72
80
  Appium::Console.setup Config.default_appium_txt_path
73
81
  Appium::Console.start
74
82
  end
75
83
  default_command :init
76
84
 
77
- desc "setup", "Generates toml file"
78
- subcommand "setup", Setup
85
+ desc 'setup', 'Generates toml file'
86
+ subcommand 'setup', Setup
79
87
  end
80
88
  end
81
89
 
data/readme.md CHANGED
@@ -1,7 +1,4 @@
1
1
  [![Downloads](https://img.shields.io/gem/dt/appium_console.svg)](https://rubygems.org/gems/appium_console)
2
- [![Pull Requests](http://issuestats.com/github/appium/ruby_console/badge/pr?style=flat)](http://issuestats.com/github/appium/ruby_console)
3
- [![Issues](http://issuestats.com/github/appium/ruby_console/badge/issue?style=flat)](http://issuestats.com/github/appium/ruby_console)
4
- [![Gem Version](https://badge.fury.io/rb/appium_console.svg)](http://badge.fury.io/rb/appium_console)[![Dependency Status](https://gemnasium.com/appium/ruby_console.svg)](https://gemnasium.com/appium/ruby_console)
5
2
 
6
3
  # Appium Ruby Console
7
4
 
@@ -1,3 +1,9 @@
1
+ #### v2.10.0 2018-12-19
2
+
3
+ - [6b12201](https://github.com/appium/ruby_console/commit/6b12201e65333d27cf30006f19a8d793844834c4) Release 2.10.0
4
+ - [ded6f78](https://github.com/appium/ruby_console/commit/ded6f786ec143e6b4abd50c1c5553fd5171c886f) Clean, use heredoc (#96)
5
+
6
+
1
7
  #### v2.9.2 2018-11-30
2
8
 
3
9
  - [510438c](https://github.com/appium/ruby_console/commit/510438cbf0dca2747923150e60c61e8f2e91e7ad) Release 2.9.2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_console
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.2
4
+ version: 2.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - code@bootstraponline.com
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-11-30 00:00:00.000000000 Z
12
+ date: 2018-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: appium_lib
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 0.11.0
48
+ version: 0.12.0
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: 0.11.0
55
+ version: 0.12.0
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: bond
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -172,7 +172,6 @@ files:
172
172
  - lib/start.rb
173
173
  - readme.md
174
174
  - release_notes.md
175
- - templates/appium.txt.erb
176
175
  - test/simple.rb
177
176
  homepage: https://github.com/appium/ruby_console
178
177
  licenses:
@@ -1,17 +0,0 @@
1
- [caps]
2
- platformName = "<%= caps[:platform_name] %>"
3
- <% if !caps[:platform_version].nil? -%>
4
- platformVersion = "<%= caps[:platform_version] %>"
5
- <% end -%>
6
- deviceName = "<%= caps[:device_name] %>"
7
- app = "<%= caps[:path_to_app] %>"
8
- <% if !caps[:app_package].nil? -%>
9
- appPackage = "<%= caps[:app_package] %>"
10
- <% end -%>
11
- <% if !caps[:app_activity].nil? -%>
12
- appActivity = "<%= caps[:app_activity] %>"
13
- <% end -%>
14
-
15
- [appium_lib]
16
- sauce_username = ""
17
- sauce_access_key = ""