appium_console 1.0.4 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/appium_console.gemspec +1 -0
- data/bin/arc +1 -63
- data/lib/appium_console/version.rb +2 -2
- data/lib/appium_console.rb +41 -35
- data/lib/cli.rb +80 -0
- data/readme.md +7 -5
- data/release_notes.md +8 -0
- data/templates/appium.txt.erb +17 -0
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 094cd70d215c9d5df7d99c7d49c9cd7f8fd97b3a
|
4
|
+
data.tar.gz: 9035d22c374df31883b4101d72a73333a93874a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa195f896eda2374774e835e06003fd828d80f3b4212c5664a1ae667a2e926d64d8aa663da5147b2dceb0b658a21e5af6080afe04c1ce686a3a9f55b2d3ae761
|
7
|
+
data.tar.gz: 75cbd6f7d615485ae68a8e9c8667507cea3d2d26b7ba74abc89df4e97056734c35d42a0f869de72c4a7d061d5c87e648023b678ff3abb02b872aebf63404d5df
|
data/appium_console.gemspec
CHANGED
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_runtime_dependency 'pry', '~> 0.10.1'
|
29
29
|
s.add_runtime_dependency 'bond', '~> 0.5.1'
|
30
30
|
s.add_runtime_dependency 'spec', '>= 5.3.4'
|
31
|
+
s.add_runtime_dependency 'thor', '>= 0.19'
|
31
32
|
s.add_development_dependency 'rake', '~> 10.4.2'
|
32
33
|
s.add_development_dependency 'posix-spawn', '~> 0.3.11'
|
33
34
|
|
data/bin/arc
CHANGED
@@ -1,66 +1,4 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# appium ruby console = arc
|
3
|
-
require '
|
4
|
-
|
5
|
-
def print_version
|
6
|
-
require 'appium_console/version'
|
7
|
-
require 'appium_lib/common/version'
|
8
|
-
puts "appium_console: v#{::Appium::Console::VERSION}"
|
9
|
-
puts " appium_lib: v#{::Appium::VERSION}"
|
10
|
-
end
|
11
|
-
|
12
|
-
ARGV.each_index do |idx|
|
13
|
-
a = ARGV[idx]
|
14
|
-
b = ARGV[idx + 1]
|
15
|
-
if a.match /-?-?v/i
|
16
|
-
print_version
|
17
|
-
exit
|
18
|
-
elsif a.match /upgrade/i
|
19
|
-
cmd = [ 'gem uninstall -aIx appium_lib',
|
20
|
-
'gem uninstall -aIx appium_console',
|
21
|
-
'gem install --no-rdoc --no-ri appium_console'
|
22
|
-
].join '; '
|
23
|
-
puts cmd
|
24
|
-
begin; `#{cmd}`; rescue; end
|
25
|
-
puts 'Upgrade complete.'
|
26
|
-
# exit after upgrading
|
27
|
-
exit
|
28
|
-
elsif a.match /setup/i
|
29
|
-
toml = File.join Dir.pwd, 'appium.txt'
|
30
|
-
if !b
|
31
|
-
puts 'setup called without android or ios. exiting.'
|
32
|
-
exit
|
33
|
-
end
|
34
|
-
File.open toml, 'w' do |f|
|
35
|
-
if b && b.match(/android/i)
|
36
|
-
f.puts <<ANDROID
|
37
|
-
[caps]
|
38
|
-
platformName = "android"
|
39
|
-
deviceName = "Nexus 7"
|
40
|
-
app = "./api.apk"
|
41
|
-
appPackage = "io.appium.android.apis"
|
42
|
-
appActivity = ".ApiDemos"
|
43
|
-
|
44
|
-
[appium_lib]
|
45
|
-
sauce_username = ""
|
46
|
-
sauce_access_key = ""
|
47
|
-
ANDROID
|
48
|
-
elsif b && b.match(/ios/i)
|
49
|
-
f.puts <<IOS
|
50
|
-
[caps]
|
51
|
-
platformName = "ios"
|
52
|
-
platformVersion = "8.1"
|
53
|
-
deviceName ="iPhone Simulator"
|
54
|
-
app = "./UICatalog.app"
|
55
|
-
|
56
|
-
[appium_lib]
|
57
|
-
sauce_username = ""
|
58
|
-
sauce_access_key = ""
|
59
|
-
IOS
|
60
|
-
end
|
61
|
-
end
|
62
|
-
exit
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
3
|
+
require 'cli'
|
66
4
|
require 'appium_console'
|
@@ -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 = '
|
6
|
-
DATE = '
|
5
|
+
VERSION = '2.0.0' unless defined? ::Appium::Console::VERSION
|
6
|
+
DATE = '2016-03-18' unless defined? ::Appium::Console::DATE
|
7
7
|
end
|
data/lib/appium_console.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'rubygems'
|
3
|
+
require 'pry'
|
4
|
+
require 'appium_lib'
|
3
5
|
|
4
6
|
# Silence gem warnings
|
5
7
|
Gem::Specification.class_eval do
|
@@ -7,45 +9,49 @@ Gem::Specification.class_eval do
|
|
7
9
|
end
|
8
10
|
end
|
9
11
|
|
10
|
-
require 'pry'
|
11
|
-
|
12
|
-
Pry.send(:define_singleton_method, :pry_load_appium_txt) do |opts={}|
|
13
|
-
verbose = opts.fetch :verbose, false
|
14
|
-
Appium.load_appium_txt file: Dir.pwd + '/appium.txt', verbose: verbose
|
15
|
-
end
|
16
|
-
|
17
|
-
Pry.send(:define_singleton_method, :reload) do
|
18
|
-
parsed = Pry.pry_load_appium_txt
|
19
|
-
return unless parsed && parsed[:appium_lib] && parsed[:appium_lib][:require]
|
20
|
-
requires = parsed[:appium_lib][:require]
|
21
|
-
requires.each do |file|
|
22
|
-
# If a page obj is deleted then load will error.
|
23
|
-
begin
|
24
|
-
load file
|
25
|
-
rescue # LoadError: cannot load such file
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
12
|
module Appium
|
31
13
|
module Console
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
14
|
+
class << self
|
15
|
+
def setup appium_txt_path
|
16
|
+
Pry.send(:define_singleton_method, :pry_load_appium_txt) do |opts = {}|
|
17
|
+
verbose = opts.fetch :verbose, false
|
18
|
+
path = appium_txt_path
|
19
|
+
Appium.load_appium_txt file: path, verbose: verbose
|
20
|
+
end
|
21
|
+
|
22
|
+
Pry.send(:define_singleton_method, :reload) do
|
23
|
+
parsed = Pry.pry_load_appium_txt
|
24
|
+
return unless parsed && parsed[:appium_lib] && parsed[:appium_lib][:require]
|
25
|
+
requires = parsed[:appium_lib][:require]
|
26
|
+
requires.each do |file|
|
27
|
+
# If a page obj is deleted then load will error.
|
28
|
+
begin
|
29
|
+
load file
|
30
|
+
rescue # LoadError: cannot load such file
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
36
35
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
36
|
+
def start
|
37
|
+
AwesomePrint.pry!
|
38
|
+
start = File.expand_path '../start.rb', __FILE__
|
39
|
+
cmd = ['-r', start]
|
41
40
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
41
|
+
parsed = Pry.pry_load_appium_txt verbose: true
|
42
|
+
has_requires = parsed && parsed[:appium_lib] && parsed[:appium_lib][:require]
|
43
|
+
if has_requires
|
44
|
+
requires = parsed[:appium_lib][:require]
|
46
45
|
|
47
|
-
|
46
|
+
if !requires.empty?
|
47
|
+
load_files = requires.map { |f| %(require "#{f}";) }.join "\n"
|
48
|
+
cmd += ['-e', load_files]
|
49
|
+
end
|
50
|
+
|
51
|
+
$stdout.puts "pry #{cmd.join(' ')}"
|
52
|
+
end
|
53
|
+
Pry::CLI.parse_options cmd
|
54
|
+
end
|
48
55
|
end
|
49
|
-
Pry::CLI.parse_options cmd
|
50
56
|
end
|
51
|
-
end
|
57
|
+
end
|
data/lib/cli.rb
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'thor'
|
3
|
+
require 'appium_console/version'
|
4
|
+
require 'appium_lib/common/version'
|
5
|
+
require 'erb'
|
6
|
+
require 'appium_console'
|
7
|
+
|
8
|
+
module Appium::CLI
|
9
|
+
module Config
|
10
|
+
class << self
|
11
|
+
def appium_txt_template_path
|
12
|
+
"templates/appium.txt.erb"
|
13
|
+
end
|
14
|
+
|
15
|
+
def default_appium_txt_path
|
16
|
+
"appium.txt"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class Setup < Thor
|
22
|
+
desc "ios", "Generates toml for ios"
|
23
|
+
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
|
+
platform_name: "iOS",
|
29
|
+
device_name: "iPhone Simulator",
|
30
|
+
platform_version: "9.0",
|
31
|
+
path_to_app: "/path/to/app_bundle"
|
32
|
+
}
|
33
|
+
f.puts template.result(binding)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
desc "android", "Generates toml for android"
|
38
|
+
def android
|
39
|
+
toml = File.join(Dir.pwd, Config.default_appium_txt_path)
|
40
|
+
template = ERB.new(File.new(Config.appium_txt_template_path).read, nil, "-")
|
41
|
+
File.open toml, 'w' do |f|
|
42
|
+
caps = {
|
43
|
+
platform_name: "Android",
|
44
|
+
device_name: "Nexus 5",
|
45
|
+
path_to_app: "/path/to/apk",
|
46
|
+
app_package: "com.package.example",
|
47
|
+
app_activity: ".ExampleActivity"
|
48
|
+
}
|
49
|
+
f.puts template.result(binding)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
class Main < Thor
|
55
|
+
desc "version", "Prints version of appium_lib and appium_console"
|
56
|
+
def version
|
57
|
+
puts "appium_console: v#{::Appium::Console::VERSION}"
|
58
|
+
puts " appium_lib: v#{::Appium::VERSION}"
|
59
|
+
exit
|
60
|
+
end
|
61
|
+
|
62
|
+
desc "toml [FILE]", "Starts appium console session with path to toml file"
|
63
|
+
def toml appium_txt_path = Config.default_appium_txt_path
|
64
|
+
Appium::Console.setup appium_txt_path
|
65
|
+
Appium::Console.start
|
66
|
+
end
|
67
|
+
|
68
|
+
desc "init", "Starts appium console session with defaults settings"
|
69
|
+
def init
|
70
|
+
Appium::Console.setup Config.default_appium_txt_path
|
71
|
+
Appium::Console.start
|
72
|
+
end
|
73
|
+
default_command :init
|
74
|
+
|
75
|
+
desc "setup", "Generates toml file"
|
76
|
+
subcommand "setup", Setup
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
Appium::CLI::Main.start(ARGV)
|
data/readme.md
CHANGED
@@ -1,4 +1,7 @@
|
|
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
|
+
#### Appium Ruby Console [![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)
|
2
5
|
|
3
6
|
- [appium_console on RubyGems](https://rubygems.org/gems/appium_console)
|
4
7
|
|
@@ -30,8 +33,6 @@ gem install --no-rdoc --no-ri appium_console bond
|
|
30
33
|
|
31
34
|
The bond gem is necessary for proper auto complete. Installing it will fix this error `NameError: uninitialized constant Pry::BondCompleter::Bond`
|
32
35
|
|
33
|
-
If `appium_console` is already installed, run `arc upgrade` to automatically update.
|
34
|
-
|
35
36
|
#### Notes
|
36
37
|
|
37
38
|
You should uninstall the `ap` gem because it breaks awesome_print.
|
@@ -42,15 +43,16 @@ You should uninstall the `ap` gem because it breaks awesome_print.
|
|
42
43
|
|
43
44
|
The `arc` command starts Appium Ruby Console.
|
44
45
|
|
46
|
+
- `arc help` prints a description of all available commands
|
45
47
|
- `arc version` prints the current version of appium console and appium lib.
|
46
|
-
- `arc upgrade` upgrades appium_console and appium_lib.
|
47
48
|
- `arc setup android` creates `appium.txt` for android in the current working dir.
|
48
49
|
- `arc setup ios` creates `appium.txt` for ios in the current working dir.
|
50
|
+
- `arc toml FILE` starts arc with toml FILE path
|
49
51
|
|
50
52
|
#### Documentation
|
51
53
|
|
52
54
|
- [Installing Appium on OS X](https://github.com/appium/ruby_console/blob/master/osx.md)
|
53
|
-
- [Overview](https://github.com/appium/ruby_lib/blob/master/docs/docs.md)
|
55
|
+
- [Overview](https://github.com/appium/ruby_lib/blob/master/docs/docs.md)
|
54
56
|
- [Android methods](https://github.com/appium/ruby_lib/blob/master/docs/android_docs.md)
|
55
57
|
- [iOS methods](https://github.com/appium/ruby_lib/blob/master/docs/ios_docs.md)
|
56
58
|
- [Appium docs](https://github.com/appium/appium/tree/master/docs)
|
data/release_notes.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
#### v1.0.3 2014-12-23
|
2
|
+
|
3
|
+
- [7803da9](https://github.com/appium/ruby_console/commit/7803da93f968d86e49af62ca20df910049452101) Release 1.0.4
|
4
|
+
- [228bd34](https://github.com/appium/ruby_console/commit/228bd3441db0f3a42a4a0ffea46486b00cae3e17) Update deps
|
5
|
+
- [4820904](https://github.com/appium/ruby_console/commit/48209043e45868fc1ad790c29e6714725685bdbf) Merge pull request #46 from xsmaster/master
|
6
|
+
- [e5113b3](https://github.com/appium/ruby_console/commit/e5113b3caca6a1355ed0f6fe15f21b748fca42b4) Updated the version of pry used. From 0.9.12.5 -> 0.10.1
|
7
|
+
|
8
|
+
|
1
9
|
#### v1.0.2 2014-12-08
|
2
10
|
|
3
11
|
- [58f7d52](https://github.com/appium/ruby_console/commit/58f7d52b4ef923edf3051df8f145eaf9541bab1d) Release 1.0.3
|
@@ -0,0 +1,17 @@
|
|
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 = ""
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appium_console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- code@bootstraponline.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appium_lib
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 5.3.4
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: thor
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.19'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.19'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: rake
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -113,11 +127,13 @@ files:
|
|
113
127
|
- ios_v_android.md
|
114
128
|
- lib/appium_console.rb
|
115
129
|
- lib/appium_console/version.rb
|
130
|
+
- lib/cli.rb
|
116
131
|
- lib/start.rb
|
117
132
|
- osx.md
|
118
133
|
- osx_install.rake
|
119
134
|
- readme.md
|
120
135
|
- release_notes.md
|
136
|
+
- templates/appium.txt.erb
|
121
137
|
- test/simple.rb
|
122
138
|
homepage: https://github.com/appium/ruby_console
|
123
139
|
licenses:
|
@@ -139,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
155
|
version: '0'
|
140
156
|
requirements: []
|
141
157
|
rubyforge_project:
|
142
|
-
rubygems_version: 2.
|
158
|
+
rubygems_version: 2.6.1
|
143
159
|
signing_key:
|
144
160
|
specification_version: 4
|
145
161
|
summary: Appium Ruby Console
|