pry 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pry/commands.rb +43 -1
- data/lib/pry/pry_class.rb +1 -0
- data/lib/pry/version.rb +1 -1
- metadata +39 -73
data/lib/pry/commands.rb
CHANGED
@@ -439,5 +439,47 @@ e.g: show-method hello_method
|
|
439
439
|
|
440
440
|
alias_command "quit", "exit", ""
|
441
441
|
alias_command "back", "exit", ""
|
442
|
-
|
442
|
+
|
443
|
+
command "game", "" do |highest|
|
444
|
+
highest = highest ? highest.to_i : 100
|
445
|
+
num = rand(highest)
|
446
|
+
output.puts "Guess the number between 0-#{highest}: ('.' to quit)"
|
447
|
+
count = 0
|
448
|
+
while(true)
|
449
|
+
count += 1
|
450
|
+
str = Readline.readline("game > ", true)
|
451
|
+
break if str == "." || !str
|
452
|
+
val = str.to_i
|
453
|
+
output.puts "Too large!" if val > num
|
454
|
+
output.puts "Too small!" if val < num
|
455
|
+
if val == num
|
456
|
+
output.puts "Well done! You guessed right! It took you #{count} guesses."
|
457
|
+
break
|
458
|
+
end
|
459
|
+
end
|
460
|
+
end
|
461
|
+
|
462
|
+
command "cohen-poem", "" do
|
463
|
+
text = %{
|
464
|
+
--
|
465
|
+
When this American woman,
|
466
|
+
whose thighs are bound in casual red cloth,
|
467
|
+
comes thundering past my sitting place
|
468
|
+
like a forest-burning Mongol tribe,
|
469
|
+
the city is ravished
|
470
|
+
and brittle buildings of a hundred years
|
471
|
+
splash into the street;
|
472
|
+
and my eyes are burnt
|
473
|
+
for the embroidered Chinese girls,
|
474
|
+
already old,
|
475
|
+
and so small between the thin pines
|
476
|
+
on these enormous landscapes,
|
477
|
+
that if you turn your head
|
478
|
+
they are lost for hours.
|
479
|
+
-- Leonard Cohen
|
480
|
+
}
|
481
|
+
output.puts text
|
482
|
+
text
|
483
|
+
end
|
484
|
+
end
|
443
485
|
end
|
data/lib/pry/pry_class.rb
CHANGED
@@ -102,6 +102,7 @@ class Pry
|
|
102
102
|
# @param [String] arg_string The Pry command (including arguments,
|
103
103
|
# if any).
|
104
104
|
# @param [Hash] options Optional named parameters.
|
105
|
+
# @return [Object] The return value of the Pry command.
|
105
106
|
# @option options [Object, Binding] :context The object context to run the
|
106
107
|
# command under. Defaults to `TOPLEVEL_BINDING` (main).
|
107
108
|
# @option options [Boolean] :show_output Whether to show command
|
data/lib/pry/version.rb
CHANGED
metadata
CHANGED
@@ -1,80 +1,56 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: pry
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.5.5
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 5
|
9
|
-
- 4
|
10
|
-
version: 0.5.4
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- John Mair (banisterfiend)
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
date: 2011-02-19 00:00:00 +13:00
|
12
|
+
date: 2011-02-19 00:00:00.000000000 +13:00
|
19
13
|
default_executable:
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
22
16
|
name: ruby_parser
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: &17267820 !ruby/object:Gem::Requirement
|
25
18
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 5
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 0
|
33
|
-
- 5
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
34
22
|
version: 2.0.5
|
35
23
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: method_source
|
39
24
|
prerelease: false
|
40
|
-
|
25
|
+
version_requirements: *17267820
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: method_source
|
28
|
+
requirement: &17267508 !ruby/object:Gem::Requirement
|
41
29
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 23
|
46
|
-
segments:
|
47
|
-
- 0
|
48
|
-
- 2
|
49
|
-
- 0
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
50
33
|
version: 0.2.0
|
51
34
|
type: :runtime
|
52
|
-
version_requirements: *id002
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: bacon
|
55
35
|
prerelease: false
|
56
|
-
|
36
|
+
version_requirements: *17267508
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: bacon
|
39
|
+
requirement: &17267196 !ruby/object:Gem::Requirement
|
57
40
|
none: false
|
58
|
-
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
hash: 19
|
62
|
-
segments:
|
63
|
-
- 1
|
64
|
-
- 1
|
65
|
-
- 0
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
66
44
|
version: 1.1.0
|
67
45
|
type: :development
|
68
|
-
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *17267196
|
69
48
|
description: attach an irb-like session to any object at runtime
|
70
49
|
email: jrmair@gmail.com
|
71
50
|
executables: []
|
72
|
-
|
73
51
|
extensions: []
|
74
|
-
|
75
52
|
extra_rdoc_files: []
|
76
|
-
|
77
|
-
files:
|
53
|
+
files:
|
78
54
|
- lib/pry/commands.rb
|
79
55
|
- lib/pry/command_base.rb
|
80
56
|
- lib/pry/completion.rb
|
@@ -106,36 +82,26 @@ files:
|
|
106
82
|
has_rdoc: true
|
107
83
|
homepage: http://banisterfiend.wordpress.com
|
108
84
|
licenses: []
|
109
|
-
|
110
85
|
post_install_message:
|
111
86
|
rdoc_options: []
|
112
|
-
|
113
|
-
require_paths:
|
87
|
+
require_paths:
|
114
88
|
- lib
|
115
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
90
|
none: false
|
117
|
-
requirements:
|
118
|
-
- -
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
|
121
|
-
|
122
|
-
- 0
|
123
|
-
version: "0"
|
124
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
96
|
none: false
|
126
|
-
requirements:
|
127
|
-
- -
|
128
|
-
- !ruby/object:Gem::Version
|
129
|
-
|
130
|
-
segments:
|
131
|
-
- 0
|
132
|
-
version: "0"
|
97
|
+
requirements:
|
98
|
+
- - ! '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
133
101
|
requirements: []
|
134
|
-
|
135
102
|
rubyforge_project:
|
136
103
|
rubygems_version: 1.5.2
|
137
104
|
signing_key:
|
138
105
|
specification_version: 3
|
139
106
|
summary: attach an irb-like session to any object at runtime
|
140
107
|
test_files: []
|
141
|
-
|