superbot-runner 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +97 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/superbot/runner/cli/root_command.rb +51 -0
- data/lib/superbot/runner/cli.rb +8 -0
- data/lib/superbot/runner/version.rb +5 -0
- data/lib/superbot/runner.rb +10 -0
- data/superbot-runner.gemspec +30 -0
- metadata +129 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9ac9c924e896373d402e03cc8e4233fba4b3d6bec40d33a57cda74f479246966
|
4
|
+
data.tar.gz: d8148d8eef0f8232554f3057d8ddaabd8e8cc76d6069a190b4bf0dca771c7eef
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 721a79289683a0706b62688f776101b9de8048a0bfd6a3b286348a164c4fd45f8351e45a60b06a03d851fe29514b3acff4f446000344dafdc5d2039eb30dae2a
|
7
|
+
data.tar.gz: a249e0e54b823a774f9c3aa0e6b90578af6de8995742cf750860ec55a7c4251a799d1754aa503b009391c45cdd258f029bd938a1a977ef0b06a7de8e09cd26e1
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.1
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in superbot-runner.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
unless ENV['SUPERBOT_USE_RUBYGEMS'] == "yes"
|
9
|
+
gem "superbot-runner-side", path: "../superbot-runner-side"
|
10
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
superbot-runner (0.1.0)
|
5
|
+
superbot-runner-side
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
addressable (2.5.2)
|
11
|
+
public_suffix (>= 2.0.2, < 4.0)
|
12
|
+
archive-zip (0.11.0)
|
13
|
+
io-like (~> 0.3.0)
|
14
|
+
childprocess (0.9.0)
|
15
|
+
ffi (~> 1.0, >= 1.0.11)
|
16
|
+
chromedriver-helper (2.1.0)
|
17
|
+
archive-zip (~> 0.10)
|
18
|
+
nokogiri (~> 1.8)
|
19
|
+
clamp (1.2.1)
|
20
|
+
diff-lcs (1.3)
|
21
|
+
excon (0.62.0)
|
22
|
+
ffi (1.9.25)
|
23
|
+
io-like (0.3.0)
|
24
|
+
kommando (0.1.2)
|
25
|
+
launchy (2.4.3)
|
26
|
+
addressable (~> 2.3)
|
27
|
+
marcel (0.3.3)
|
28
|
+
mimemagic (~> 0.3.2)
|
29
|
+
mimemagic (0.3.2)
|
30
|
+
mini_portile2 (2.4.0)
|
31
|
+
multipart-post (2.0.0)
|
32
|
+
mustermann (1.0.3)
|
33
|
+
nokogiri (1.9.1)
|
34
|
+
mini_portile2 (~> 2.4.0)
|
35
|
+
public_suffix (3.0.3)
|
36
|
+
rack (2.0.6)
|
37
|
+
rack-protection (2.0.4)
|
38
|
+
rack
|
39
|
+
rake (10.5.0)
|
40
|
+
rspec (3.8.0)
|
41
|
+
rspec-core (~> 3.8.0)
|
42
|
+
rspec-expectations (~> 3.8.0)
|
43
|
+
rspec-mocks (~> 3.8.0)
|
44
|
+
rspec-core (3.8.0)
|
45
|
+
rspec-support (~> 3.8.0)
|
46
|
+
rspec-expectations (3.8.2)
|
47
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
+
rspec-support (~> 3.8.0)
|
49
|
+
rspec-mocks (3.8.0)
|
50
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
+
rspec-support (~> 3.8.0)
|
52
|
+
rspec-support (3.8.0)
|
53
|
+
rubyzip (1.2.2)
|
54
|
+
selenium-webdriver (3.141.0)
|
55
|
+
childprocess (~> 0.5)
|
56
|
+
rubyzip (~> 1.2, >= 1.2.2)
|
57
|
+
sinatra (2.0.4)
|
58
|
+
mustermann (~> 1.0)
|
59
|
+
rack (~> 2.0)
|
60
|
+
rack-protection (= 2.0.4)
|
61
|
+
tilt (~> 2.0)
|
62
|
+
sinatra-silent (0.0.1)
|
63
|
+
superbot (0.2.0)
|
64
|
+
clamp (= 1.2.1)
|
65
|
+
kommando (~> 0.1)
|
66
|
+
launchy (= 2.4.3)
|
67
|
+
sinatra (= 2.0.4)
|
68
|
+
sinatra-silent (= 0.0.1)
|
69
|
+
superbot-cloud (~> 0.1.22)
|
70
|
+
superbot-runner
|
71
|
+
superbot-selenium-webdriver (~> 1.0.5)
|
72
|
+
superbot-teleport (~> 0.2.3)
|
73
|
+
zaru (= 0.2.0)
|
74
|
+
superbot-cloud (0.1.22)
|
75
|
+
marcel (= 0.3.3)
|
76
|
+
multipart-post (= 2.0.0)
|
77
|
+
superbot-runner-side (0.1.0)
|
78
|
+
superbot-selenium-webdriver (1.0.5)
|
79
|
+
chromedriver-helper (= 2.1.0)
|
80
|
+
selenium-webdriver (= 3.141.0)
|
81
|
+
superbot-teleport (0.2.3)
|
82
|
+
excon
|
83
|
+
tilt (2.0.9)
|
84
|
+
zaru (0.2.0)
|
85
|
+
|
86
|
+
PLATFORMS
|
87
|
+
ruby
|
88
|
+
|
89
|
+
DEPENDENCIES
|
90
|
+
bundler (~> 1.17)
|
91
|
+
rake (~> 10.0)
|
92
|
+
rspec (~> 3.0)
|
93
|
+
superbot (~> 0.2.0)
|
94
|
+
superbot-runner!
|
95
|
+
|
96
|
+
BUNDLED WITH
|
97
|
+
1.17.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 DeeMak13
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Superbot::Runner
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/superbot/runner`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'superbot-runner'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install superbot-runner
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/superbot-runner.
|
36
|
+
|
37
|
+
## License
|
38
|
+
|
39
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "superbot/runner"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
module Superbot
|
2
|
+
module Runner
|
3
|
+
module CLI
|
4
|
+
class RootCommand < Clamp::Command
|
5
|
+
include Superbot::Validations
|
6
|
+
include Superbot::Cloud::Validations
|
7
|
+
|
8
|
+
parameter "RECORDING", "recording"
|
9
|
+
|
10
|
+
option ['--browser'], 'BROWSER', "Browser type to use. Can be either local or cloud", default: 'local' do |browser|
|
11
|
+
validates_browser_type browser
|
12
|
+
require_login unless browser == 'cloud'
|
13
|
+
browser
|
14
|
+
end
|
15
|
+
option ['--region'], 'REGION', 'Region for remote webdriver'
|
16
|
+
|
17
|
+
def execute
|
18
|
+
open_teleport
|
19
|
+
|
20
|
+
file_extension = File.extname(recording)
|
21
|
+
case file_extension
|
22
|
+
when '.side' then Superbot::Runner::Side.run(recording)
|
23
|
+
else abort "#{file_extension} scripts are not supported yet"
|
24
|
+
end
|
25
|
+
ensure
|
26
|
+
close_teleport
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def open_teleport
|
32
|
+
@teleport = Thread.new do
|
33
|
+
Superbot::Web.run!(webdriver_type: browser, region: region)
|
34
|
+
end
|
35
|
+
|
36
|
+
if browser == 'local'
|
37
|
+
chromedriver_path = Chromedriver::Helper.new.binary_path
|
38
|
+
@chromedriver = Kommando.new "#{chromedriver_path} --silent --port=9515 --url-base=wd/hub"
|
39
|
+
@chromedriver.run_async
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def close_teleport
|
44
|
+
sleep 1
|
45
|
+
@chromedriver&.kill
|
46
|
+
@teleport&.kill
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "superbot/runner/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "superbot-runner"
|
8
|
+
spec.version = Superbot::Runner::VERSION
|
9
|
+
spec.authors = ["Superbt HQ"]
|
10
|
+
|
11
|
+
spec.summary = "superbot-runner"
|
12
|
+
spec.homepage = "https://github.com/superbothq/superbot-runner"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
# Specify which files should be added to the gem when it is released.
|
16
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
17
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
18
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_runtime_dependency "superbot-runner-side"
|
25
|
+
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.17"
|
27
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
28
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
29
|
+
spec.add_development_dependency "superbot", "~> 0.2.0"
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: superbot-runner
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Superbt HQ
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-12-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: superbot-runner-side
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.17'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.17'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: superbot
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.2.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.2.0
|
83
|
+
description:
|
84
|
+
email:
|
85
|
+
executables: []
|
86
|
+
extensions: []
|
87
|
+
extra_rdoc_files: []
|
88
|
+
files:
|
89
|
+
- ".gitignore"
|
90
|
+
- ".rspec"
|
91
|
+
- ".ruby-version"
|
92
|
+
- ".travis.yml"
|
93
|
+
- Gemfile
|
94
|
+
- Gemfile.lock
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- bin/console
|
99
|
+
- bin/setup
|
100
|
+
- lib/superbot/runner.rb
|
101
|
+
- lib/superbot/runner/cli.rb
|
102
|
+
- lib/superbot/runner/cli/root_command.rb
|
103
|
+
- lib/superbot/runner/version.rb
|
104
|
+
- superbot-runner.gemspec
|
105
|
+
homepage: https://github.com/superbothq/superbot-runner
|
106
|
+
licenses:
|
107
|
+
- MIT
|
108
|
+
metadata: {}
|
109
|
+
post_install_message:
|
110
|
+
rdoc_options: []
|
111
|
+
require_paths:
|
112
|
+
- lib
|
113
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - ">="
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
123
|
+
requirements: []
|
124
|
+
rubyforge_project:
|
125
|
+
rubygems_version: 2.7.6
|
126
|
+
signing_key:
|
127
|
+
specification_version: 4
|
128
|
+
summary: superbot-runner
|
129
|
+
test_files: []
|