spidy 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/spidy +4 -5
- data/lib/spidy.rb +11 -3
- data/lib/spidy/definition_file.rb +0 -9
- data/lib/spidy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d1d85698519ea7bafd657cb831d712cdab6ebe86e07d49e5ffab54bbf76f36d
|
4
|
+
data.tar.gz: ec3cb1b9a728b03dff7a052f1135a33ef239dd8b80e480d90c7ea3e159658525
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aec9dcaa2f13a9039f1ad1967967ba255394defa888b7c472c42bf46a1e8fce63343b6cb08f4e722832e02f8dfef328a45eb83a6b68090e4b030e83fdb6fc9df
|
7
|
+
data.tar.gz: ab08c7a47158694105a0f059e88bc67b82682b0fd448f2bb6068e9cf0bb09e41982107b9d97dd6c1035ab459c9f8ba5081e61b7508a296fa86b44a04325b6dc8
|
data/exe/spidy
CHANGED
@@ -12,12 +12,11 @@ if ARGV[1].blank?
|
|
12
12
|
STDOUT.puts 'usage: spidy [version console]'
|
13
13
|
end
|
14
14
|
else
|
15
|
-
spidy = Spidy.open(ARGV[1])
|
16
15
|
case ARGV[0]
|
17
|
-
when 'console' then
|
18
|
-
when 'shell' then
|
19
|
-
when 'call' then
|
20
|
-
when 'each' then
|
16
|
+
when 'console' then Spidy.console(ARGV[1])
|
17
|
+
when 'shell' then Spidy.shell(ARGV[1]).function
|
18
|
+
when 'call' then Spidy.shell(ARGV[1]).call(ARGV[2])
|
19
|
+
when 'each' then Spidy.shell(ARGV[1]).each(ARGV[2])
|
21
20
|
else
|
22
21
|
STDOUT.puts 'usage: spidy [call each shell] [file]'
|
23
22
|
end
|
data/lib/spidy.rb
CHANGED
@@ -17,13 +17,21 @@ module Spidy
|
|
17
17
|
autoload :Binder
|
18
18
|
autoload :Connector
|
19
19
|
|
20
|
-
def self.console
|
20
|
+
def self.console(filepath = nil)
|
21
21
|
require 'pry'
|
22
|
-
|
22
|
+
if filepath
|
23
|
+
Pry.start(Spidy::Console.new(Spidy::DefinitionFile.open(filepath)))
|
24
|
+
else
|
25
|
+
Pry.start(Spidy::Console.new)
|
26
|
+
end
|
23
27
|
end
|
24
28
|
|
25
29
|
def self.open(filepath)
|
26
|
-
|
30
|
+
Spidy::DefinitionFile.open(filepath).spidy
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.shell(filepath)
|
34
|
+
Spidy::Shell.new(Spidy::DefinitionFile.open(filepath))
|
27
35
|
end
|
28
36
|
|
29
37
|
def self.define(&block)
|
@@ -19,15 +19,6 @@ class Spidy::DefinitionFile
|
|
19
19
|
end
|
20
20
|
# rubocop:enable Security/Eval
|
21
21
|
|
22
|
-
def shell
|
23
|
-
@shell ||= Spidy::Shell.new(self)
|
24
|
-
end
|
25
|
-
|
26
|
-
def console
|
27
|
-
require 'pry'
|
28
|
-
Pry.start(Spidy::Console.new(self))
|
29
|
-
end
|
30
|
-
|
31
22
|
private
|
32
23
|
|
33
24
|
def initialize(path)
|
data/lib/spidy/version.rb
CHANGED