mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
updating docs, and added --private flag to .yardopts to include private methods in documentation
This commit is contained in:
parent
548b4f82d8
commit
0f028ff7bc
4 changed files with 5 additions and 11 deletions
|
@ -1 +1 @@
|
||||||
--markup markdown
|
--markup markdown --private
|
||||||
|
|
|
@ -354,7 +354,7 @@ 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|
|
||||||
output.puts "Hello #{name.capitalize}, how are you?"
|
output.puts "Hello #{name.capitalize}, how are you?"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class Pry
|
class Pry
|
||||||
|
|
||||||
# The default prompt; includes the target
|
# The default prompt; includes the target and nesting level
|
||||||
DEFAULT_PROMPT = [
|
DEFAULT_PROMPT = [
|
||||||
proc do |target_self, nest_level|
|
proc do |target_self, nest_level|
|
||||||
if nest_level == 0
|
if nest_level == 0
|
||||||
|
|
|
@ -192,10 +192,8 @@ class Pry
|
||||||
action = data[:action]
|
action = data[:action]
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
:captures => args_string,
|
|
||||||
:eval_string => eval_string,
|
|
||||||
:target => target,
|
|
||||||
:val => val,
|
:val => val,
|
||||||
|
:eval_string => eval_string,
|
||||||
:nesting => nesting,
|
:nesting => nesting,
|
||||||
:output => output,
|
:output => output,
|
||||||
:commands => commands.commands
|
:commands => commands.commands
|
||||||
|
@ -211,9 +209,6 @@ class Pry
|
||||||
case action.arity <=> 0
|
case action.arity <=> 0
|
||||||
when -1
|
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)
|
commands.instance_exec(*args, &action)
|
||||||
when 1, 0
|
when 1, 0
|
||||||
|
|
||||||
|
@ -223,8 +218,7 @@ class Pry
|
||||||
# doesn't care)
|
# doesn't care)
|
||||||
args_with_corrected_arity = args.values_at *0..(action.arity - 1)
|
args_with_corrected_arity = args.values_at *0..(action.arity - 1)
|
||||||
|
|
||||||
# Use instance_exec() to make the opts, target, output, etc methods
|
# Use instance_exec() to make the `opts` method, etc available
|
||||||
# available
|
|
||||||
commands.instance_exec(*args_with_corrected_arity, &action)
|
commands.instance_exec(*args_with_corrected_arity, &action)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue