playwright-cli 0.1.12 → 0.1.14

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
  SHA256:
3
- metadata.gz: c829585e7169b44daf51c321a91e70822ef7f50594aead9e0d5f4286a4e8f1db
4
- data.tar.gz: 06ac264cf2137f09b4a8922eabaebbe2c5b990a75f81a6bd2f1a7cb625a501a0
3
+ metadata.gz: 519dc2cf7efa3932f1849ece83e9e546525970f2e745ef7a8e561dafdb87c2ed
4
+ data.tar.gz: b4cb8c9dbbd1b7aaceafcb75152e9e7def086336f7f9a68b027c98af9aaeea41
5
5
  SHA512:
6
- metadata.gz: 3e2a4e06da3077ad368d2358decf172785cd3dc37c4cb3233b7cf25919a2726aae225c4c69fb720e12b2665461c5013cbeeb710832d117026215b6f453163ded
7
- data.tar.gz: 239c20e37e1244f9c30bd249c88017d7f20fb7fcc69a2ad6e44f1275d73f19e93cec64af39fa23473f6e8d7c2165d55eec41526969e4b4671596344503d605a6
6
+ metadata.gz: 589f5fb1130c852c15b4216fd3ece7a16839ac829a196877c756caa693eff3e622930917ac76c1021c317c31a63f1233f0bd9fbf1efbfcb0d5bd7730f95ad3f4
7
+ data.tar.gz: 77c1e3b4431dab8e293e1bdac4fb8fe33c13f8571f5536bac4767cea2c170db6a0c0222cb8864cde2fce4c7fa8e714bc32b2f1a9c0a37868e0fa5e18bd6e258c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- playwright-cli (0.1.12)
4
+ playwright-cli (0.1.14)
5
5
  colorize (~> 0.1)
6
6
  git (~> 1.3)
7
7
  hanami-cli (~> 0.1)
data/README.md CHANGED
@@ -17,7 +17,7 @@ Install this gem with:
17
17
 
18
18
  To check the version:
19
19
  ```shell
20
- $ playwright -v #=> 0.1.4
20
+ $ playwright -v #=> 0.1.14
21
21
  ```
22
22
 
23
23
  ### Create An App
@@ -34,7 +34,11 @@ It will look something like this:
34
34
  ```ruby
35
35
  #!/usr/bin/env ruby
36
36
 
37
- require 'playwright/cli'
37
+ require 'bundler/inline'
38
+ gemfile do
39
+ source 'https://rubygems.org'
40
+ gem 'playwright-cli', require: 'playwright/cli'
41
+ end
38
42
 
39
43
  module MyScript
40
44
  module CLI
@@ -66,14 +70,19 @@ Playwright::CLI.new(MyScript::CLI::Commands).call
66
70
 
67
71
  ```
68
72
 
69
- Most of this code is simply wrapping [Hanami::CLI](https://github.com/hanami/cli), so their documentation
70
- will be the best source of information for you in handling arguments and options.
71
-
72
- So far, only `#register_root` here is a playwright feature. It allows you to
73
- overwrite the root command. In this case that means:
74
73
  ```shell
75
74
  $ my-script tom #=> Why, hello tom!
76
75
  ```
76
+ Most of this code is simply wrapping [Hanami::CLI](https://github.com/hanami/cli), so their documentation
77
+ will be the best source of information for you in handling arguments and options.
78
+
79
+ You can list any gems you want inside the gemfile block as you would any gemfile.
80
+ You won't have to worry about running `bundle`.
81
+
82
+ All commands must implement a `#call` method and must be registered, either using
83
+ `#register` (as in the example below) or `#register_root`. `#register_root` is
84
+ for registering the base command. All subcommands are registered with `#register`,
85
+ as in the example below.
77
86
 
78
87
  Hanami::CLI is built for more intricate command line apps, so playwright allows
79
88
  you to generate that as well.
@@ -85,7 +94,12 @@ This will give you a mostly similar main class:
85
94
  ```ruby
86
95
  #!/usr/bin/env ruby
87
96
 
88
- require 'playwright/cli'
97
+ require 'bundler/inline'
98
+ gemfile do
99
+ source 'https://rubygems.org'
100
+ gem 'playwright-cli', require: 'playwright/cli'
101
+ end
102
+
89
103
  require_relative 'lib/version'
90
104
 
91
105
  module MyScript
data/bin/console CHANGED
@@ -1,13 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "hanami/cli"
5
4
  require "playwright/cli"
6
5
  require "pry"
7
6
 
8
7
  # You can add fixtures and/or initialization code here to make experimenting
9
8
  # with your gem easier. You can also use a different console, if you like.
10
9
 
11
- @cli = Hanami::CLI.new(Playwright::CLI::Commands)
10
+ @cli = Playwright::CLI.new(Playwright::CLI::Commands)
12
11
 
13
12
  Pry.start
data/exe/playwright CHANGED
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "hanami/cli"
5
4
  require "playwright/cli"
6
5
 
7
6
  Playwright::CLI.call
@@ -1,6 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'playwright/cli'
3
+ require 'bundler/inline'
4
+ gemfile do
5
+ source 'https://rubygems.org'
6
+ gem 'playwright-cli', require: 'playwright/cli'
7
+ end
8
+
4
9
  require_relative 'lib/version'
5
10
 
6
11
  module <%= klass_name %>
@@ -1,6 +1,10 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'playwright/cli'
3
+ require 'bundler/inline'
4
+ gemfile do
5
+ source 'https://rubygems.org'
6
+ gem 'playwright-cli', require: 'playwright/cli'
7
+ end
4
8
 
5
9
  module <%= klass_name %>
6
10
  module CLI
@@ -6,7 +6,7 @@ module Playwright
6
6
  extend Hanami::CLI::Registry
7
7
 
8
8
  class Destroy < Hanami::CLI::Command
9
- desc "Delets a playwright command."
9
+ desc "Deletes a playwright command."
10
10
 
11
11
  argument :name, required: true, desc: 'Script name'
12
12
 
@@ -1,7 +1,9 @@
1
+ require 'playwright/cli/registry'
2
+
1
3
  module Playwright
2
4
  class CLI < Hanami::CLI
3
5
  module Commands
4
- extend Hanami::CLI::Registry
6
+ extend Playwright::CLI::Registry
5
7
  require 'playwright/cli/commands/destroy'
6
8
  require 'playwright/cli/commands/edit'
7
9
  require 'playwright/cli/commands/generate'
@@ -18,7 +18,7 @@ module Playwright
18
18
  ERROR_COLOR = :red
19
19
 
20
20
  def error msg, msg2 = nil
21
- print msg, color: :red
21
+ print msg, color: ERROR_COLOR
22
22
  print "Action Cancelled.", color: ERROR_COLOR
23
23
  print msg2, color: ERROR_COLOR if msg2
24
24
  exit 1
@@ -1,5 +1,7 @@
1
+ require 'hanami/cli'
2
+
1
3
  module Playwright
2
4
  class CLI < Hanami::CLI
3
- VERSION = "0.1.12"
5
+ VERSION = "0.1.14"
4
6
  end
5
7
  end
@@ -8,9 +8,6 @@ require 'os'
8
8
  require 'uri'
9
9
  require 'pathname'
10
10
 
11
- # TODO: Remove this
12
- require 'pry'
13
-
14
11
  module Playwright
15
12
  class CLI < Hanami::CLI
16
13
  ROOT_PATH = Pathname.new(File.expand_path('../..', File.dirname(__FILE__)))
@@ -1,7 +1,6 @@
1
1
 
2
2
  lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'hanami/cli'
5
4
  require "playwright/cli/version"
6
5
 
7
6
  Gem::Specification.new do |spec|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playwright-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Gregory
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-30 00:00:00.000000000 Z
11
+ date: 2018-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler