Skip to content

Commit

Permalink
verson 0.4.7. Fixed 'ls' bug in 1.8.7, oops. Updated some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
banister committed Feb 11, 2011
1 parent 971bba3 commit 788e5d8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/pry/commands.rb
Expand Up @@ -57,10 +57,10 @@ class Commands < CommandBase


case target_self case target_self
when Module when Module
c = with_constants ? target_self.constants : [] c = with_constants ? target_self.constants.inspect : [].inspect
output.puts "#{Pry.view(target.eval("local_variables + instance_variables + #{c}"))}" output.puts "#{Pry.view(target.eval("local_variables + instance_variables + #{c}"))}"
else else
c = with_constants ? target_self.class.constants : [] c = with_constants ? target_self.class.constants.inspect : [].inspect
output.puts "#{Pry.view(target.eval("local_variables + instance_variables + #{c}"))}" output.puts "#{Pry.view(target.eval("local_variables + instance_variables + #{c}"))}"
end end
end end
Expand Down
2 changes: 1 addition & 1 deletion lib/pry/version.rb
@@ -1,3 +1,3 @@
class Pry class Pry
VERSION = "0.4.6" VERSION = "0.4.7"
end end
20 changes: 10 additions & 10 deletions wiki/Customizing-pry.md
Expand Up @@ -18,12 +18,12 @@ are:
Local customization (applied to a single Pry session) is done by Local customization (applied to a single Pry session) is done by
passing config hash options to `Pry.start()` or to `Pry.new()`; also the passing config hash options to `Pry.start()` or to `Pry.new()`; also the
same accessors as described above for the `Pry` class exist for a same accessors as described above for the `Pry` class exist for a
Pry instance so that customization can occur during runtime. Pry instance so that customization can occur at runtime.


### Input ### Input


For input Pry accepts any object that implements the `readline` method. This For input Pry accepts any object that implements the `readline` method. This
includes `IO` objects, `StringIO`, `Readline` and custom objects. Pry includes `IO` objects, `StringIO`, `Readline`, `File` and custom objects. Pry
initially defaults to using `Readline` for input. initially defaults to using `Readline` for input.


#### Example: Setting global input #### Example: Setting global input
Expand Down Expand Up @@ -69,7 +69,7 @@ the current session is nested) like so:
### Output ### Output


For output Pry accepts any object that implements the `puts` method. This For output Pry accepts any object that implements the `puts` method. This
includes `IO` objects, `StringIO` and custom objects. Pry initially includes `IO` objects, `StringIO`, `File` and custom objects. Pry initially
defaults to using `$stdout` for output. defaults to using `$stdout` for output.


#### Example: Setting global output #### Example: Setting global output
Expand Down Expand Up @@ -109,17 +109,17 @@ A valid Pry command object must inherit from
#### Example: Defining a command object and setting it globally #### Example: Defining a command object and setting it globally


class MyCommands < Pry::CommandBase class MyCommands < Pry::CommandBase
command "greet", "Greet the user." do |name| command "greet", "Greet the user." do |name, age|
output.puts "Hello #{name.capitalize}, how are you?" output.puts "Hello #{name.capitalize}, how does it feel being #{age}?"
end end
end end


Pry.commands = MyCommands Pry.commands = MyCommands


Then inside a pry session: Then inside a pry session:


pry(main)> greet john pry(main)> greet john 9
hello John, how are you? Hello John, how does it feel being 9?
=> nil => nil


#### Example: Using a command object in a specific session #### Example: Using a command object in a specific session
Expand Down Expand Up @@ -165,9 +165,9 @@ command.


##### `delete` method ##### `delete` method


The `delete` method deletes a command or a group of a commands; it The `delete` method deletes a command or a group of commands. It
can be useful when inheriting from another command set when you decide can be useful when inheriting from another command set and you wish
to keep only a portion of inherited commands. to keep only a portion of the inherited commands.


class MyCommands < Pry::Commands class MyCommands < Pry::Commands
delete "show_method", "show_imethod" delete "show_method", "show_imethod"
Expand Down

0 comments on commit 788e5d8

Please sign in to comment.