version 0.5.5, improved docs, added a couple of easter eggs for kicks

This commit is contained in:
John Mair 2011-02-19 07:01:02 +13:00
parent 5cda6865d4
commit df4e19edb3
3 changed files with 45 additions and 2 deletions

View File

@ -439,5 +439,47 @@ e.g: show-method hello_method
alias_command "quit", "exit", "" alias_command "quit", "exit", ""
alias_command "back", "exit", "" alias_command "back", "exit", ""
end
command "game", "" do |highest|
highest = highest ? highest.to_i : 100
num = rand(highest)
output.puts "Guess the number between 0-#{highest}: ('.' to quit)"
count = 0
while(true)
count += 1
str = Readline.readline("game > ", true).chomp
break if str == "."
val = str.to_i
output.puts "Too large!" if val > num
output.puts "Too small!" if val < num
if val == num
output.puts "Well done! You guessed right! It took you #{count} guesses."
break
end
end
end
command "cohen-poem", "" do
text = %{
--
When this American woman,
whose thighs are bound in casual red cloth,
comes thundering past my sitting place
like a forest-burning Mongol tribe,
the city is ravished
and brittle buildings of a hundred years
splash into the street;
and my eyes are burnt
for the embroidered Chinese girls,
already old,
and so small between the thin pines
on these enormous landscapes,
that if you turn your head
they are lost for hours.
-- Leonard Cohen
}
output.puts text
text
end
end
end end

View File

@ -102,6 +102,7 @@ class Pry
# @param [String] arg_string The Pry command (including arguments, # @param [String] arg_string The Pry command (including arguments,
# if any). # if any).
# @param [Hash] options Optional named parameters. # @param [Hash] options Optional named parameters.
# @return [Object] The return value of the Pry command.
# @option options [Object, Binding] :context The object context to run the # @option options [Object, Binding] :context The object context to run the
# command under. Defaults to `TOPLEVEL_BINDING` (main). # command under. Defaults to `TOPLEVEL_BINDING` (main).
# @option options [Boolean] :show_output Whether to show command # @option options [Boolean] :show_output Whether to show command

View File

@ -1,3 +1,3 @@
class Pry class Pry
VERSION = "0.5.4" VERSION = "0.5.5"
end end