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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ae14a8a6cbc86db550ccf136917b95ef6e7cd7a046c09e3003b403977977d67
4
- data.tar.gz: 45af21220281fc65a2cafc967987a8133afbdbd7b5b50919f1c4e453d38c1cd5
3
+ metadata.gz: 2d1d85698519ea7bafd657cb831d712cdab6ebe86e07d49e5ffab54bbf76f36d
4
+ data.tar.gz: ec3cb1b9a728b03dff7a052f1135a33ef239dd8b80e480d90c7ea3e159658525
5
5
  SHA512:
6
- metadata.gz: c41b0b853aad93d46194ab8219892005439c1f87f532f5bc4b1740d55e8bcc7ac59a05c08e0bf9bc93f4a4ef75379eafaf1dd375a88e4d54245c623508414f98
7
- data.tar.gz: 647d34ba5248821be5f31123455fd2536e0a8a325997efeedb0dc60fa0537c3f052394b10532568b8263ba63f3331a1fd17bb4078b8d7e22fe0f2cb0e297d89f
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 spidy.console
18
- when 'shell' then spidy.shell.function
19
- when 'call' then spidy.shell.call(ARGV[2])
20
- when 'each' then spidy.shell.each(ARGV[2])
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
- Pry.start(Spidy::Console.new)
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
- ::Spidy::DefinitionFile.open(filepath)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spidy
4
- VERSION = '0.0.13'
4
+ VERSION = '0.0.14'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spidy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - aileron