pry-developer_tools 0.1.0.pre3 → 0.1.0.pre4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  module PryDeveloperTools
2
2
 
3
3
  Commands = Pry::CommandSet.new do
4
- command_class "define-command", "Define a Pry command for this session." do
4
+ create_command "define-command", "Define a Pry command for this session." do
5
5
  banner <<-BANNER
6
6
  Usage: define-command "name", "my description" do
7
7
  p "I do something"
@@ -26,7 +26,7 @@ module PryDeveloperTools
26
26
  end
27
27
  end
28
28
 
29
- command_class "reload-command", "Reload a Pry command." do
29
+ create_command "reload-command", "Reload a Pry command." do
30
30
  banner <<-BANNER
31
31
  Usage: reload-command command
32
32
  Reload a Pry command.
@@ -51,7 +51,7 @@ module PryDeveloperTools
51
51
  end
52
52
  end
53
53
 
54
- command_class "edit-command", "Edit a Pry command." do
54
+ create_command "edit-command", "Edit a Pry command." do
55
55
  banner <<-BANNER
56
56
  Usage: edit-command [options] command
57
57
  Edit a Pry command.
@@ -62,12 +62,12 @@ module PryDeveloperTools
62
62
  end
63
63
 
64
64
  def process
65
- @command, @_target = find_command_and_target
66
-
67
- if @command.nil?
68
- raise Pry::CommandError, 'Command not found.'
65
+ if args.empty?
66
+ raise Pry::CommandError, "No command given."
69
67
  end
70
68
 
69
+ @command, @_target = find_command_and_target
70
+
71
71
  case
72
72
  when opts.present?(:patch)
73
73
  edit_temporarily
@@ -82,10 +82,18 @@ module PryDeveloperTools
82
82
  if raw.include?('#')
83
83
  command, method = raw.split('#', 2)
84
84
  command = _pry_.commands.find_command(command)
85
- target = command.instance_method(method)
85
+ target = command.instance_method(method) rescue nil
86
86
  else
87
- command = _pry_.commands.find_command(str)
88
- target = command.block
87
+ command = _pry_.commands.find_command(raw)
88
+ target = command.block rescue nil
89
+ end
90
+
91
+ if command.nil?
92
+ raise Pry::CommandError, "No command found."
93
+ end
94
+
95
+ if target.nil?
96
+ raise Pry::CommandError, "Method '#{method}' could not be found."
89
97
  end
90
98
 
91
99
  [command, target]
@@ -121,7 +129,7 @@ module PryDeveloperTools
121
129
  modified_code = File.read(f.path)
122
130
  end
123
131
 
124
- command_set = CommandSet.new do
132
+ command_set = Pry::CommandSet.new do
125
133
  silence_warnings do
126
134
  pry = Pry.new :input => StringIO.new(modified_code)
127
135
  pry.rep(binding)
@@ -1,3 +1,3 @@
1
1
  module PryDeveloperTools
2
- VERSION = '0.1.0.pre3'
2
+ VERSION = '0.1.0.pre4'
3
3
  end
metadata CHANGED
@@ -1,44 +1,48 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: pry-developer_tools
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre3
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease: 6
5
+ version: 0.1.0.pre4
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - The Pry Team
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-21 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
12
+
13
+ date: 2012-01-22 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
15
16
  name: pry
16
- requirement: &70129170439620 !ruby/object:Gem::Requirement
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
17
19
  none: false
18
- requirements:
20
+ requirements:
19
21
  - - ~>
20
- - !ruby/object:Gem::Version
22
+ - !ruby/object:Gem::Version
21
23
  version: 0.9.8.pre
22
24
  type: :runtime
23
- prerelease: false
24
- version_requirements: *70129170439620
25
- - !ruby/object:Gem::Dependency
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
26
27
  name: rake
27
- requirement: &70129170438700 !ruby/object:Gem::Requirement
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
28
30
  none: false
29
- requirements:
31
+ requirements:
30
32
  - - ~>
31
- - !ruby/object:Gem::Version
33
+ - !ruby/object:Gem::Version
32
34
  version: 0.9.2
33
35
  type: :development
34
- prerelease: false
35
- version_requirements: *70129170438700
36
+ version_requirements: *id002
36
37
  description: A collection of developer tools for Pry users
37
38
  email: rob@flowof.info
38
39
  executables: []
40
+
39
41
  extensions: []
42
+
40
43
  extra_rdoc_files: []
41
- files:
44
+
45
+ files:
42
46
  - Gemfile
43
47
  - LICENSE.txt
44
48
  - README.md
@@ -49,29 +53,30 @@ files:
49
53
  - pry-developer_tools.gemspec
50
54
  homepage: https://github.com/pry/pry-developer_tools
51
55
  licenses: []
56
+
52
57
  post_install_message:
53
58
  rdoc_options: []
54
- require_paths:
59
+
60
+ require_paths:
55
61
  - lib
56
- required_ruby_version: !ruby/object:Gem::Requirement
62
+ required_ruby_version: !ruby/object:Gem::Requirement
57
63
  none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- segments:
63
- - 0
64
- hash: -1266989099645572674
65
- required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
69
  none: false
67
- requirements:
68
- - - ! '>='
69
- - !ruby/object:Gem::Version
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
70
73
  version: 1.3.6
71
74
  requirements: []
72
- rubyforge_project: ! '[none]'
73
- rubygems_version: 1.8.15
75
+
76
+ rubyforge_project: "[none]"
77
+ rubygems_version: 1.8.11
74
78
  signing_key:
75
79
  specification_version: 3
76
80
  summary: A collection of developer tools for Pry users
77
81
  test_files: []
82
+