From 0f028ff7bc05297fb8f8a16eea901a310c1fab12 Mon Sep 17 00:00:00 2001 From: John Mair Date: Fri, 21 Jan 2011 14:15:25 +1300 Subject: [PATCH] updating docs, and added --private flag to .yardopts to include private methods in documentation --- .yardopts | 2 +- README.markdown | 2 +- lib/pry/prompts.rb | 2 +- lib/pry/pry_instance.rb | 10 ++-------- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.yardopts b/.yardopts index 29c933bc..afb2022e 100644 --- a/.yardopts +++ b/.yardopts @@ -1 +1 @@ ---markup markdown +--markup markdown --private diff --git a/README.markdown b/README.markdown index a92a5a3c..47a31e8e 100644 --- a/README.markdown +++ b/README.markdown @@ -354,7 +354,7 @@ A valid Pry command object must inherit from #### Example: Defining a command object and setting it globally class MyCommands < Pry::CommandBase - command greet", "Greet the user." do |name| + command "greet", "Greet the user." do |name| output.puts "Hello #{name.capitalize}, how are you?" end end diff --git a/lib/pry/prompts.rb b/lib/pry/prompts.rb index 9bcf01c2..fe67c7da 100644 --- a/lib/pry/prompts.rb +++ b/lib/pry/prompts.rb @@ -1,6 +1,6 @@ class Pry - # The default prompt; includes the target + # The default prompt; includes the target and nesting level DEFAULT_PROMPT = [ proc do |target_self, nest_level| if nest_level == 0 diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index 3923aa9f..b49ac096 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -192,10 +192,8 @@ class Pry action = data[:action] options = { - :captures => args_string, - :eval_string => eval_string, - :target => target, :val => val, + :eval_string => eval_string, :nesting => nesting, :output => output, :commands => commands.commands @@ -211,9 +209,6 @@ class Pry case action.arity <=> 0 when -1 - # if arity is negative then we have a *args in 1.8.7. - # In 1.9 we have default values or *args - # Use instance_exec() to make the opts, target, output, etc methods available commands.instance_exec(*args, &action) when 1, 0 @@ -223,8 +218,7 @@ class Pry # doesn't care) args_with_corrected_arity = args.values_at *0..(action.arity - 1) - # Use instance_exec() to make the opts, target, output, etc methods - # available + # Use instance_exec() to make the `opts` method, etc available commands.instance_exec(*args_with_corrected_arity, &action) end