playwright-cli 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 +14 -0
- data/.rspec +3 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +57 -0
- data/LICENSE.txt +21 -0
- data/README.md +39 -0
- data/Rakefile +6 -0
- data/bin/console +13 -0
- data/bin/setup +9 -0
- data/exe/playwright +7 -0
- data/lib/assets/templates/new_script.erb +32 -0
- data/lib/playwright/cli/commands/destroy/command.rb +43 -0
- data/lib/playwright/cli/commands/destroy.rb +24 -0
- data/lib/playwright/cli/commands/generate/command.rb +87 -0
- data/lib/playwright/cli/commands/generate.rb +24 -0
- data/lib/playwright/cli/commands/version.rb +16 -0
- data/lib/playwright/cli/commands.rb +14 -0
- data/lib/playwright/cli/template.rb +26 -0
- data/lib/playwright/cli/utils/ask.rb +35 -0
- data/lib/playwright/cli/utils/display.rb +48 -0
- data/lib/playwright/cli/utils/script_files.rb +40 -0
- data/lib/playwright/cli/utils.rb +10 -0
- data/lib/playwright/cli/version.rb +5 -0
- data/lib/playwright/cli.rb +26 -0
- data/playwright-cli.gemspec +41 -0
- metadata +170 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 806ad5eff604cf39f4c5566ba019761a12df693d15d27cdfc578dd9351920eb8
|
4
|
+
data.tar.gz: 3c43f28c41a540151a2626662256fa0165acd2376209058df0edfa8e839df982
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: aa56f0328a6efcfaf7bf3ed10e68038d0f8d3ddf582c4aea99a95fa00bed7b948c8dfa362c51e9b7ac97b837a32ed5d9a325c081b053384d4dcfcb9b1538658e
|
7
|
+
data.tar.gz: 04fb36eed9299571cce88ae1bdd996013dba46f19a231d87486e02f6bebda8b09eb617e9b1686755a63294225887eb7aff51177a5e181c9a70b3e68f7538e8fb
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
playwright-cli (0.0.7)
|
5
|
+
colorize (~> 0.1)
|
6
|
+
hanami-cli (~> 0.1)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
coderay (1.1.2)
|
12
|
+
colorize (0.8.1)
|
13
|
+
concurrent-ruby (1.0.5)
|
14
|
+
diff-lcs (1.3)
|
15
|
+
hanami-cli (0.1.1)
|
16
|
+
concurrent-ruby (~> 1.0)
|
17
|
+
hanami-utils (~> 1.1)
|
18
|
+
hanami-utils (1.1.2)
|
19
|
+
concurrent-ruby (~> 1.0)
|
20
|
+
transproc (~> 1.0)
|
21
|
+
method_source (0.9.0)
|
22
|
+
pry (0.9.12.6)
|
23
|
+
coderay (~> 1.0)
|
24
|
+
method_source (~> 0.8)
|
25
|
+
slop (~> 3.4)
|
26
|
+
pry-nav (0.2.4)
|
27
|
+
pry (>= 0.9.10, < 0.11.0)
|
28
|
+
rake (10.5.0)
|
29
|
+
rspec (3.7.0)
|
30
|
+
rspec-core (~> 3.7.0)
|
31
|
+
rspec-expectations (~> 3.7.0)
|
32
|
+
rspec-mocks (~> 3.7.0)
|
33
|
+
rspec-core (3.7.1)
|
34
|
+
rspec-support (~> 3.7.0)
|
35
|
+
rspec-expectations (3.7.0)
|
36
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
+
rspec-support (~> 3.7.0)
|
38
|
+
rspec-mocks (3.7.0)
|
39
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
+
rspec-support (~> 3.7.0)
|
41
|
+
rspec-support (3.7.1)
|
42
|
+
slop (3.6.0)
|
43
|
+
transproc (1.0.2)
|
44
|
+
|
45
|
+
PLATFORMS
|
46
|
+
ruby
|
47
|
+
|
48
|
+
DEPENDENCIES
|
49
|
+
bundler (~> 1.16)
|
50
|
+
playwright-cli!
|
51
|
+
pry (~> 0.9.0)
|
52
|
+
pry-nav (~> 0.2.4)
|
53
|
+
rake (~> 10.0)
|
54
|
+
rspec (~> 3.0)
|
55
|
+
|
56
|
+
BUNDLED WITH
|
57
|
+
1.16.1
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Mike Gregory
|
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
|
+
# Playwright::CLI
|
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/playwright/cli`. 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 'playwright-cli'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install playwright-cli
|
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]/playwright-cli.
|
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,13 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "hanami/cli"
|
5
|
+
require "playwright/cli"
|
6
|
+
require "pry"
|
7
|
+
|
8
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
9
|
+
# with your gem easier. You can also use a different console, if you like.
|
10
|
+
|
11
|
+
@cli = Hanami::CLI.new(Playwright::CLI::Commands)
|
12
|
+
|
13
|
+
Pry.start
|
data/bin/setup
ADDED
data/exe/playwright
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'hanami/cli'
|
4
|
+
|
5
|
+
module <%= klass_name %>
|
6
|
+
module CLI
|
7
|
+
module Commands
|
8
|
+
extend Hanami::CLI::Registry
|
9
|
+
|
10
|
+
class Greet < Hanami::CLI::Command
|
11
|
+
desc "Says a greeting to the name given. This is an example."
|
12
|
+
|
13
|
+
argument :name, required: true, desc: 'Whom shall I greet?'
|
14
|
+
|
15
|
+
example [
|
16
|
+
"$ <%= script_name %> greet \"Johnny Boy\"",
|
17
|
+
"#=> Why, hello Johnny Boy!"
|
18
|
+
]
|
19
|
+
|
20
|
+
def call(name:, **)
|
21
|
+
puts "Why, hello #{name}"
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
register 'greet', Greet
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
Hanami::CLI.new(<%= klass_name %>::CLI::Commands).call
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Playwright
|
2
|
+
module CLI
|
3
|
+
module Commands
|
4
|
+
extend Hanami::CLI::Registry
|
5
|
+
|
6
|
+
class Destroy < Hanami::CLI::Command
|
7
|
+
class Command
|
8
|
+
include Utils::Display
|
9
|
+
include Utils::ScriptFiles
|
10
|
+
|
11
|
+
TEMPLATE_FILE = 'new_script.erb'.freeze
|
12
|
+
PATH_BIN_DIR = File.join('/', 'usr', 'local', 'bin').freeze
|
13
|
+
DEFAULT_COLOR = :green
|
14
|
+
|
15
|
+
def self.run(name)
|
16
|
+
new(name).run
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize(name)
|
20
|
+
@name = name
|
21
|
+
end
|
22
|
+
|
23
|
+
def run
|
24
|
+
validate!
|
25
|
+
destroy_script
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def validate!
|
31
|
+
script_path_and_file?
|
32
|
+
end
|
33
|
+
|
34
|
+
def destroy_script
|
35
|
+
delete_playwright_script
|
36
|
+
display.color_print "Playwright script \"#{@name}\" destroyed!"
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'playwright/cli/commands/destroy/command'
|
2
|
+
|
3
|
+
module Playwright
|
4
|
+
module CLI
|
5
|
+
module Commands
|
6
|
+
extend Hanami::CLI::Registry
|
7
|
+
|
8
|
+
class Destroy < Hanami::CLI::Command
|
9
|
+
desc "Delets a playwright command."
|
10
|
+
|
11
|
+
argument :name, required: true, desc: 'Script name'
|
12
|
+
|
13
|
+
example [
|
14
|
+
"my-new-script\n# deletes the script with that name"
|
15
|
+
]
|
16
|
+
|
17
|
+
def call(name: nil, **)
|
18
|
+
Command.run(name)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
module Playwright
|
2
|
+
module CLI
|
3
|
+
module Commands
|
4
|
+
extend Hanami::CLI::Registry
|
5
|
+
|
6
|
+
class Generate < Hanami::CLI::Command
|
7
|
+
class Command
|
8
|
+
include Utils::Display
|
9
|
+
include Utils::Ask
|
10
|
+
include Utils::ScriptFiles
|
11
|
+
|
12
|
+
TEMPLATE_FILE = 'new_script.erb'.freeze
|
13
|
+
PATH_BIN_DIR = File.join('/', 'usr', 'local', 'bin').freeze
|
14
|
+
|
15
|
+
def self.run(name)
|
16
|
+
new(name).run
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize(name)
|
20
|
+
@template = Playwright::CLI::Template.new(file: TEMPLATE_FILE, script_name: name)
|
21
|
+
@name = name
|
22
|
+
end
|
23
|
+
|
24
|
+
def run
|
25
|
+
valid? do
|
26
|
+
create_script
|
27
|
+
set_permissions
|
28
|
+
symlink_into_path
|
29
|
+
open_editor
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def valid?
|
36
|
+
validate!
|
37
|
+
yield
|
38
|
+
end
|
39
|
+
|
40
|
+
def validate!
|
41
|
+
if symlink_path_and_file? && !script_path_and_file?
|
42
|
+
display.error "There is already a script in your #{PATH_BIN_DIR} with that name!"
|
43
|
+
elsif script_path_and_file?
|
44
|
+
if ask.boolean_question "This playwright script already exists! Overwrite it?"
|
45
|
+
delete_playwright_script
|
46
|
+
else
|
47
|
+
display.abort "Aborting Operation."
|
48
|
+
end
|
49
|
+
end
|
50
|
+
true
|
51
|
+
end
|
52
|
+
|
53
|
+
def create_script
|
54
|
+
if script_path_and_file?
|
55
|
+
display.error "This script already exists!"
|
56
|
+
end
|
57
|
+
FileUtils.mkdir_p(Playwright::CLI::PLAYS_BIN_PATH)
|
58
|
+
FileUtils.touch(script_path_and_file)
|
59
|
+
File.write(script_path_and_file, @template.render)
|
60
|
+
display.color_print "New File Created: #{script_path_and_file}"
|
61
|
+
end
|
62
|
+
|
63
|
+
def set_permissions
|
64
|
+
FileUtils.chmod "u+x", script_path_and_file
|
65
|
+
display.color_print "Executable Permissions Set!"
|
66
|
+
end
|
67
|
+
|
68
|
+
def symlink_into_path
|
69
|
+
delete_symlink_path_file
|
70
|
+
FileUtils.symlink(script_path_and_file, symlink_path_and_file)
|
71
|
+
display.color_print "Symlink Created!"
|
72
|
+
end
|
73
|
+
|
74
|
+
def open_editor
|
75
|
+
`$EDITOR #{script_path_and_file}`
|
76
|
+
if $?.success?
|
77
|
+
display.color_print "Opening script in your editor..."
|
78
|
+
else
|
79
|
+
display.error "Could not open Editor!"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'playwright/cli/commands/generate/command'
|
2
|
+
|
3
|
+
module Playwright
|
4
|
+
module CLI
|
5
|
+
module Commands
|
6
|
+
extend Hanami::CLI::Registry
|
7
|
+
|
8
|
+
class Generate < Hanami::CLI::Command
|
9
|
+
desc "Builds a template for a new playwright command."
|
10
|
+
|
11
|
+
argument :name, required: true, desc: 'Script name'
|
12
|
+
|
13
|
+
example [
|
14
|
+
"my-new-script\n# script will be called with my-new-script\n# class will be called MyNewScript"
|
15
|
+
]
|
16
|
+
|
17
|
+
def call(name: nil, **)
|
18
|
+
Command.run(name)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Playwright
|
2
|
+
module CLI
|
3
|
+
module Commands
|
4
|
+
extend Hanami::CLI::Registry
|
5
|
+
require 'playwright/cli/commands/version'
|
6
|
+
require 'playwright/cli/commands/generate'
|
7
|
+
require 'playwright/cli/commands/destroy'
|
8
|
+
|
9
|
+
register "version", Version, aliases: ['v', '-v', '--version']
|
10
|
+
register "generate", Generate, aliases: ['g', 'new']
|
11
|
+
register "destroy", Destroy, aliases: ['delete', 'd']
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Playwright
|
2
|
+
module CLI
|
3
|
+
class Template
|
4
|
+
|
5
|
+
attr_reader :script_name
|
6
|
+
|
7
|
+
def initialize(file:, script_name:)
|
8
|
+
@script_name = script_name
|
9
|
+
@file = File.join(Playwright::CLI::TEMPLATES_PATH, file)
|
10
|
+
end
|
11
|
+
|
12
|
+
def klass_name
|
13
|
+
@script_name.split(/[A-Z\-\_\/]/).map(&:capitalize).join
|
14
|
+
end
|
15
|
+
|
16
|
+
def contents
|
17
|
+
File.read @file
|
18
|
+
end
|
19
|
+
|
20
|
+
def render
|
21
|
+
ERB.new(contents).result(binding)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'playwright/cli/utils/display'
|
2
|
+
|
3
|
+
module Playwright
|
4
|
+
module CLI
|
5
|
+
module Utils
|
6
|
+
module Ask
|
7
|
+
|
8
|
+
def ask
|
9
|
+
@ask ||= Ask.new
|
10
|
+
end
|
11
|
+
|
12
|
+
class Ask
|
13
|
+
include Display
|
14
|
+
|
15
|
+
DEFAULT_COLOR = :blue
|
16
|
+
TRUE_RESPONSE = :y
|
17
|
+
FALSE_RESPONSE = :n
|
18
|
+
|
19
|
+
def boolean_question question
|
20
|
+
display.color_print "#{question} [yn]", color: DEFAULT_COLOR
|
21
|
+
response = STDIN.gets.chomp.strip.downcase.to_sym
|
22
|
+
boolean_response_map[response]
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def boolean_response_map
|
28
|
+
{ TRUE_RESPONSE => true, FALSE_RESPONSE => false }
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Playwright
|
2
|
+
module CLI
|
3
|
+
module Utils
|
4
|
+
module Display
|
5
|
+
|
6
|
+
def display
|
7
|
+
@display ||= Display.new
|
8
|
+
end
|
9
|
+
|
10
|
+
class Display
|
11
|
+
|
12
|
+
InvalidPrintMethod = Class.new StandardError
|
13
|
+
|
14
|
+
VALID_PRINT_METHODS = [:p, :puts, :print]
|
15
|
+
DEFAULT_COLOR = :green
|
16
|
+
WARNING_COLOR = :yellow
|
17
|
+
ERROR_COLOR = :red
|
18
|
+
|
19
|
+
def error msg, msg2 = nil
|
20
|
+
color_print msg, color: :red
|
21
|
+
color_print "Action Cancelled.", color: ERROR_COLOR
|
22
|
+
color_print msg2, color: ERROR_COLOR if msg2
|
23
|
+
exit
|
24
|
+
end
|
25
|
+
|
26
|
+
def abort msg = nil
|
27
|
+
color_print msg, color: WARNING_COLOR if msg
|
28
|
+
color_print "Action Cancelled.", color: WARNING_COLOR
|
29
|
+
exit
|
30
|
+
end
|
31
|
+
|
32
|
+
def color_print msg, method: :puts, color: DEFAULT_COLOR
|
33
|
+
validate_print_method!(method)
|
34
|
+
msg = msg.send(color) if defined?(Colorize)
|
35
|
+
send(method, msg)
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def validate_print_method!(method)
|
41
|
+
raise InvalidPrintMethod unless VALID_PRINT_METHODS.include? method.to_sym
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Playwright
|
2
|
+
module CLI
|
3
|
+
module Utils
|
4
|
+
module ScriptFiles
|
5
|
+
|
6
|
+
PATH_BIN_DIR = File.join('/', 'usr', 'local', 'bin').freeze
|
7
|
+
|
8
|
+
def script_path_and_file
|
9
|
+
File.join Playwright::CLI::PLAYS_BIN_PATH, @name
|
10
|
+
end
|
11
|
+
|
12
|
+
def script_path_and_file?
|
13
|
+
File.exists? script_path_and_file
|
14
|
+
end
|
15
|
+
|
16
|
+
def symlink_path_and_file
|
17
|
+
File.join PATH_BIN_DIR, @name
|
18
|
+
end
|
19
|
+
|
20
|
+
def symlink_path_and_file?
|
21
|
+
File.exists? symlink_path_and_file
|
22
|
+
end
|
23
|
+
|
24
|
+
def delete_playwright_script
|
25
|
+
delete_script_file
|
26
|
+
delete_symlink_path_file
|
27
|
+
end
|
28
|
+
|
29
|
+
def delete_script_file
|
30
|
+
FileUtils.rm script_path_and_file if script_path_and_file?
|
31
|
+
end
|
32
|
+
|
33
|
+
def delete_symlink_path_file
|
34
|
+
FileUtils.rm symlink_path_and_file if symlink_path_and_file?
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'hanami/cli'
|
2
|
+
require 'colorize'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'erb'
|
5
|
+
|
6
|
+
# TODO: Remove this
|
7
|
+
require 'pry'
|
8
|
+
|
9
|
+
module Playwright
|
10
|
+
module CLI
|
11
|
+
ROOT_PATH = File.expand_path('../..', File.dirname(__FILE__))
|
12
|
+
PLAYS_PATH = File.join(ROOT_PATH, 'plays')
|
13
|
+
PLAYS_BIN_PATH = File.join(PLAYS_PATH, 'bin')
|
14
|
+
TEMPLATES_PATH = File.join(ROOT_PATH, 'lib', 'assets', 'templates')
|
15
|
+
|
16
|
+
require "playwright/cli/utils"
|
17
|
+
require "playwright/cli/commands"
|
18
|
+
require "playwright/cli/template"
|
19
|
+
require "playwright/cli/version"
|
20
|
+
|
21
|
+
def self.call(*args)
|
22
|
+
Hanami::CLI.new(Commands).call(*args)
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "playwright/cli/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "playwright-cli"
|
8
|
+
spec.version = Playwright::CLI::VERSION
|
9
|
+
spec.authors = ["Mike Gregory"]
|
10
|
+
spec.email = ["mgregory8219@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Playwright is tool for quickly building command line apps in ruby.}
|
13
|
+
# spec.description = %q{}
|
14
|
+
spec.homepage = "https://github.com/mgreg90/playwright-cli"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
spec.metadata["documentation_uri"] = "https://github.com/mgreg90/playwright-cli"
|
21
|
+
else
|
22
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
23
|
+
"public gem pushes."
|
24
|
+
end
|
25
|
+
|
26
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
f.match(%r{^(test|spec|features)/})
|
28
|
+
end
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ["lib"]
|
32
|
+
|
33
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
34
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
35
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
36
|
+
spec.add_development_dependency "pry", "~> 0.9.0"
|
37
|
+
spec.add_development_dependency "pry-nav", "~> 0.2.4"
|
38
|
+
|
39
|
+
spec.add_runtime_dependency "hanami-cli", "~>0.1"
|
40
|
+
spec.add_runtime_dependency "colorize", "~>0.1"
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: playwright-cli
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mike Gregory
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-03-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.9.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.9.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry-nav
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.2.4
|
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.4
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: hanami-cli
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.1'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.1'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: colorize
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.1'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.1'
|
111
|
+
description:
|
112
|
+
email:
|
113
|
+
- mgregory8219@gmail.com
|
114
|
+
executables:
|
115
|
+
- playwright
|
116
|
+
extensions: []
|
117
|
+
extra_rdoc_files: []
|
118
|
+
files:
|
119
|
+
- ".gitignore"
|
120
|
+
- ".rspec"
|
121
|
+
- ".travis.yml"
|
122
|
+
- Gemfile
|
123
|
+
- Gemfile.lock
|
124
|
+
- LICENSE.txt
|
125
|
+
- README.md
|
126
|
+
- Rakefile
|
127
|
+
- bin/console
|
128
|
+
- bin/setup
|
129
|
+
- exe/playwright
|
130
|
+
- lib/assets/templates/new_script.erb
|
131
|
+
- lib/playwright/cli.rb
|
132
|
+
- lib/playwright/cli/commands.rb
|
133
|
+
- lib/playwright/cli/commands/destroy.rb
|
134
|
+
- lib/playwright/cli/commands/destroy/command.rb
|
135
|
+
- lib/playwright/cli/commands/generate.rb
|
136
|
+
- lib/playwright/cli/commands/generate/command.rb
|
137
|
+
- lib/playwright/cli/commands/version.rb
|
138
|
+
- lib/playwright/cli/template.rb
|
139
|
+
- lib/playwright/cli/utils.rb
|
140
|
+
- lib/playwright/cli/utils/ask.rb
|
141
|
+
- lib/playwright/cli/utils/display.rb
|
142
|
+
- lib/playwright/cli/utils/script_files.rb
|
143
|
+
- lib/playwright/cli/version.rb
|
144
|
+
- playwright-cli.gemspec
|
145
|
+
homepage: https://github.com/mgreg90/playwright-cli
|
146
|
+
licenses:
|
147
|
+
- MIT
|
148
|
+
metadata:
|
149
|
+
documentation_uri: https://github.com/mgreg90/playwright-cli
|
150
|
+
post_install_message:
|
151
|
+
rdoc_options: []
|
152
|
+
require_paths:
|
153
|
+
- lib
|
154
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
requirements: []
|
165
|
+
rubyforge_project:
|
166
|
+
rubygems_version: 2.7.3
|
167
|
+
signing_key:
|
168
|
+
specification_version: 4
|
169
|
+
summary: Playwright is tool for quickly building command line apps in ruby.
|
170
|
+
test_files: []
|