pry 0.2.6 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.markdown +2 -0
  2. data/lib/pry.rb +23 -19
  3. data/lib/pry/version.rb +1 -1
  4. metadata +3 -3
@@ -144,6 +144,8 @@ end.
144
144
  * Pry sessions can nest arbitrarily deeply -- to go back one level of nesting type 'exit' or 'quit' or 'back'
145
145
  * Use `_` to recover last result.
146
146
  * Pry has multi-line support built in.
147
+ * Pry has unique commands not found in any other REPL: `show_method`,
148
+ `jump_to`, `ls`, `cd`
147
149
  * Pry gives good control over nested sessions (important when exploring complicated runtime state)
148
150
  * Pry is not based on the IRB codebase.
149
151
  * Pry uses [RubyParser](https://github.com/seattlerb/ruby_parser) to
data/lib/pry.rb CHANGED
@@ -5,7 +5,6 @@ direc = File.dirname(__FILE__)
5
5
 
6
6
  require 'ruby_parser'
7
7
  require 'method_source'
8
- require 'stringio'
9
8
  require "#{direc}/pry/version"
10
9
  require "#{direc}/pry/input"
11
10
  require "#{direc}/pry/output"
@@ -23,35 +22,40 @@ class Pry
23
22
  obj.to_s
24
23
  end
25
24
  end
26
-
25
+
27
26
  # class accessors
28
27
  class << self
29
28
  attr_reader :nesting
30
29
  attr_accessor :last_result
30
+ attr_accessor :default_prompt, :wait_prompt
31
+ end
32
+
33
+ self.default_prompt = proc do |v, nest|
34
+ if nest == 0
35
+ "pry(#{Pry.view(v)})> "
36
+ else
37
+ "pry(#{Pry.view(v)}):#{Pry.view(nest)}> "
38
+ end
39
+ end
40
+
41
+ self.wait_prompt = proc do |v, nest|
42
+ if nest == 0
43
+ "pry(#{Pry.view(v)})* "
44
+ else
45
+ "pry(#{Pry.view(v)}):#{Pry.view(nest)}* "
46
+ end
31
47
  end
32
48
 
33
49
  attr_accessor :input, :output
34
- attr_reader :default_prompt, :wait_prompt, :last_result
50
+ attr_accessor :default_prompt, :wait_prompt
51
+ attr_reader :last_result
35
52
 
36
53
  def initialize(input = Input.new, output = Output.new)
37
54
  @input = input
38
55
  @output = output
39
56
 
40
- @default_prompt = proc do |v, nest|
41
- if nest == 0
42
- "pry(#{Pry.view(v)})> "
43
- else
44
- "pry(#{Pry.view(v)}):#{Pry.view(nest)}> "
45
- end
46
- end
47
-
48
- @wait_prompt = proc do |v, nest|
49
- if nest == 0
50
- "pry(#{Pry.view(v)})* "
51
- else
52
- "pry(#{Pry.view(v)}):#{Pry.view(nest)}* "
53
- end
54
- end
57
+ @default_prompt = Pry.default_prompt
58
+ @wait_prompt = Pry.wait_prompt
55
59
  end
56
60
 
57
61
  @nesting = []
@@ -233,7 +237,7 @@ class Pry
233
237
 
234
238
  module ObjectExtensions
235
239
  def pry(target=self)
236
- Pry.new.repl(target)
240
+ Pry.start(target)
237
241
  end
238
242
  end
239
243
  end
@@ -1,3 +1,3 @@
1
1
  class Pry
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.8"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 6
9
- version: 0.2.6
8
+ - 8
9
+ version: 0.2.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Mair (banisterfiend)
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-17 00:00:00 +13:00
17
+ date: 2010-12-18 00:00:00 +13:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency