pry 0.8.4pre1-java → 0.9.0pre1-java
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.markdown +1 -1
- data/Rakefile +11 -5
- data/TODO +28 -2
- data/bin/pry +5 -9
- data/examples/example_basic.rb +2 -4
- data/examples/example_command_override.rb +2 -5
- data/examples/example_commands.rb +1 -4
- data/examples/example_hooks.rb +2 -5
- data/examples/example_image_edit.rb +4 -8
- data/examples/example_input.rb +1 -4
- data/examples/example_input2.rb +1 -4
- data/examples/example_output.rb +1 -4
- data/examples/example_print.rb +2 -5
- data/examples/example_prompt.rb +2 -5
- data/examples/helper.rb +6 -0
- data/lib/pry.rb +61 -4
- data/lib/pry/command_context.rb +10 -9
- data/lib/pry/command_processor.rb +29 -68
- data/lib/pry/command_set.rb +79 -28
- data/lib/pry/commands.rb +10 -121
- data/lib/pry/completion.rb +30 -29
- data/lib/pry/config.rb +93 -0
- data/lib/pry/default_commands/basic.rb +37 -0
- data/lib/pry/default_commands/context.rb +15 -15
- data/lib/pry/default_commands/documentation.rb +49 -48
- data/lib/pry/default_commands/easter_eggs.rb +1 -20
- data/lib/pry/default_commands/gems.rb +32 -41
- data/lib/pry/default_commands/input.rb +95 -19
- data/lib/pry/default_commands/introspection.rb +54 -60
- data/lib/pry/default_commands/ls.rb +2 -2
- data/lib/pry/default_commands/shell.rb +29 -39
- data/lib/pry/extended_commands/experimental.rb +48 -0
- data/lib/pry/extended_commands/user_command_api.rb +22 -0
- data/lib/pry/helpers.rb +1 -0
- data/lib/pry/helpers/base_helpers.rb +9 -106
- data/lib/pry/helpers/command_helpers.rb +96 -59
- data/lib/pry/helpers/text.rb +83 -0
- data/lib/pry/plugins.rb +79 -0
- data/lib/pry/pry_class.rb +96 -111
- data/lib/pry/pry_instance.rb +87 -55
- data/lib/pry/version.rb +1 -1
- data/test/helper.rb +56 -7
- data/test/test_command_processor.rb +99 -0
- data/test/{test_commandset.rb → test_command_set.rb} +18 -12
- data/test/test_default_commands.rb +59 -0
- data/test/test_default_commands/test_context.rb +64 -0
- data/test/test_default_commands/test_documentation.rb +31 -0
- data/test/test_default_commands/test_input.rb +157 -0
- data/test/test_default_commands/test_introspection.rb +146 -0
- data/test/test_pry.rb +430 -313
- metadata +25 -9
- data/lib/pry/hooks.rb +0 -17
- data/lib/pry/print.rb +0 -16
- data/lib/pry/prompts.rb +0 -31
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: pry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: 5
|
5
|
-
version: 0.
|
5
|
+
version: 0.9.0pre1
|
6
6
|
platform: java
|
7
7
|
authors:
|
8
8
|
- John Mair (banisterfiend)
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-06-04 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: ruby_parser
|
@@ -40,9 +40,9 @@ dependencies:
|
|
40
40
|
requirement: &id003 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.
|
45
|
+
version: 1.6.0
|
46
46
|
type: :runtime
|
47
47
|
version_requirements: *id003
|
48
48
|
- !ruby/object:Gem::Dependency
|
@@ -96,14 +96,17 @@ files:
|
|
96
96
|
- examples/example_output.rb
|
97
97
|
- examples/example_print.rb
|
98
98
|
- examples/example_prompt.rb
|
99
|
+
- examples/helper.rb
|
99
100
|
- lib/pry.rb
|
100
101
|
- lib/pry/command_context.rb
|
101
102
|
- lib/pry/command_processor.rb
|
102
103
|
- lib/pry/command_set.rb
|
103
104
|
- lib/pry/commands.rb
|
104
105
|
- lib/pry/completion.rb
|
106
|
+
- lib/pry/config.rb
|
105
107
|
- lib/pry/core_extensions.rb
|
106
108
|
- lib/pry/custom_completions.rb
|
109
|
+
- lib/pry/default_commands/basic.rb
|
107
110
|
- lib/pry/default_commands/context.rb
|
108
111
|
- lib/pry/default_commands/documentation.rb
|
109
112
|
- lib/pry/default_commands/easter_eggs.rb
|
@@ -112,18 +115,25 @@ files:
|
|
112
115
|
- lib/pry/default_commands/introspection.rb
|
113
116
|
- lib/pry/default_commands/ls.rb
|
114
117
|
- lib/pry/default_commands/shell.rb
|
118
|
+
- lib/pry/extended_commands/experimental.rb
|
119
|
+
- lib/pry/extended_commands/user_command_api.rb
|
115
120
|
- lib/pry/helpers.rb
|
116
121
|
- lib/pry/helpers/base_helpers.rb
|
117
122
|
- lib/pry/helpers/command_helpers.rb
|
118
|
-
- lib/pry/
|
119
|
-
- lib/pry/
|
120
|
-
- lib/pry/prompts.rb
|
123
|
+
- lib/pry/helpers/text.rb
|
124
|
+
- lib/pry/plugins.rb
|
121
125
|
- lib/pry/pry_class.rb
|
122
126
|
- lib/pry/pry_instance.rb
|
123
127
|
- lib/pry/version.rb
|
124
128
|
- test/helper.rb
|
125
129
|
- test/test_command_helpers.rb
|
126
|
-
- test/
|
130
|
+
- test/test_command_processor.rb
|
131
|
+
- test/test_command_set.rb
|
132
|
+
- test/test_default_commands.rb
|
133
|
+
- test/test_default_commands/test_context.rb
|
134
|
+
- test/test_default_commands/test_documentation.rb
|
135
|
+
- test/test_default_commands/test_input.rb
|
136
|
+
- test/test_default_commands/test_introspection.rb
|
127
137
|
- test/test_pry.rb
|
128
138
|
- test/testrc
|
129
139
|
- wiki/Customizing-pry.md
|
@@ -158,6 +168,12 @@ summary: an IRB alternative and runtime developer console
|
|
158
168
|
test_files:
|
159
169
|
- test/helper.rb
|
160
170
|
- test/test_command_helpers.rb
|
161
|
-
- test/
|
171
|
+
- test/test_command_processor.rb
|
172
|
+
- test/test_command_set.rb
|
173
|
+
- test/test_default_commands.rb
|
174
|
+
- test/test_default_commands/test_context.rb
|
175
|
+
- test/test_default_commands/test_documentation.rb
|
176
|
+
- test/test_default_commands/test_input.rb
|
177
|
+
- test/test_default_commands/test_introspection.rb
|
162
178
|
- test/test_pry.rb
|
163
179
|
- test/testrc
|
data/lib/pry/hooks.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
class Pry
|
2
|
-
|
3
|
-
# The default hooks - display messages when beginning and ending Pry sessions.
|
4
|
-
DEFAULT_HOOKS = {
|
5
|
-
|
6
|
-
:before_session => proc do |out, target|
|
7
|
-
# ensure we're actually in a method
|
8
|
-
meth_name = target.eval('__method__')
|
9
|
-
file = target.eval('__FILE__')
|
10
|
-
|
11
|
-
# /unknown/ for rbx
|
12
|
-
if file !~ /(\(.*\))|<.*>/ && file !~ /__unknown__/ && file != "" && file != "-e"
|
13
|
-
Pry.run_command "whereami 5", :output => out, :show_output => true, :context => target, :commands => Pry::Commands
|
14
|
-
end
|
15
|
-
end,
|
16
|
-
}
|
17
|
-
end
|
data/lib/pry/print.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
class Pry
|
2
|
-
DEFAULT_PRINT = proc do |output, value|
|
3
|
-
if Pry.color
|
4
|
-
output.puts "=> #{CodeRay.scan(Pry.view(value), :ruby).term}"
|
5
|
-
else
|
6
|
-
output.puts "=> #{Pry.view(value)}"
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
# Will only show the first line of the backtrace
|
11
|
-
DEFAULT_EXCEPTION_HANDLER = proc do |output, exception|
|
12
|
-
output.puts "#{exception.class}: #{exception.message}"
|
13
|
-
output.puts "from #{exception.backtrace.first}"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
data/lib/pry/prompts.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
class Pry
|
2
|
-
|
3
|
-
|
4
|
-
# The default prompt; includes the target and nesting level
|
5
|
-
DEFAULT_PROMPT = [
|
6
|
-
proc do |target_self, nest_level|
|
7
|
-
|
8
|
-
if nest_level == 0
|
9
|
-
"pry(#{Pry.view_clip(target_self)})> "
|
10
|
-
else
|
11
|
-
"pry(#{Pry.view_clip(target_self)}):#{Pry.view_clip(nest_level)}> "
|
12
|
-
end
|
13
|
-
end,
|
14
|
-
|
15
|
-
proc do |target_self, nest_level|
|
16
|
-
if nest_level == 0
|
17
|
-
"pry(#{Pry.view_clip(target_self)})* "
|
18
|
-
else
|
19
|
-
"pry(#{Pry.view_clip(target_self)}):#{Pry.view_clip(nest_level)}* "
|
20
|
-
end
|
21
|
-
end
|
22
|
-
]
|
23
|
-
|
24
|
-
# A simple prompt - doesn't display target or nesting level
|
25
|
-
SIMPLE_PROMPT = [proc { ">> " }, proc { ">* " }]
|
26
|
-
|
27
|
-
SHELL_PROMPT = [
|
28
|
-
proc { |target_self, _| "pry #{Pry.view_clip(target_self)}:#{Dir.pwd} $ " },
|
29
|
-
proc { |target_self, _| "pry #{Pry.view_clip(target_self)}:#{Dir.pwd} * " }
|
30
|
-
]
|
31
|
-
end
|