diff options
author | strcmp <28xdb6+fvutuvy4f@grr.la> | 2015-12-11 06:04:54 +0000 |
---|---|---|
committer | strcmp <28xdb6+fvutuvy4f@grr.la> | 2015-12-11 06:04:54 +0000 |
commit | 52d88cdd6bf48ec3f7e47b639e921fe3ea7616b8 (patch) | |
tree | 3e78211b5348e7803ed31b3c6ba96dbdb1f855d0 /lib | |
parent | cab1e094fa7f0d1c6a9485606483916eb2fbed77 (diff) | |
download | pry-52d88cdd6bf48ec3f7e47b639e921fe3ea7616b8.tar.gz |
modify lib/ and spec/ to use Pry::Slop
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pry.rb | 2 | ||||
-rw-r--r-- | lib/pry/cli.rb | 10 | ||||
-rw-r--r-- | lib/pry/command.rb | 14 | ||||
-rw-r--r-- | lib/pry/helpers/options_helpers.rb | 2 | ||||
-rw-r--r-- | lib/pry/pry_instance.rb | 2 |
5 files changed, 15 insertions, 15 deletions
@@ -126,7 +126,7 @@ require 'shellwords' require 'stringio' require 'strscan' require 'coderay' -require 'slop' +require 'pry/slop' require 'rbconfig' require 'tempfile' require 'pathname' diff --git a/lib/pry/cli.rb b/lib/pry/cli.rb index d034f080..c00b48c4 100644 --- a/lib/pry/cli.rb +++ b/lib/pry/cli.rb @@ -19,7 +19,7 @@ class Pry # as CLI options. attr_accessor :input_args - # Add another set of CLI options (a Slop block) + # Add another set of CLI options (a Pry::Slop block) def add_options(&block) if options old_options = options @@ -68,16 +68,16 @@ class Pry self.input_args = args begin - opts = Slop.parse!( + opts = Pry::Slop.parse!( args, :help => true, :multiple_switches => false, :strict => true, &options ) - rescue Slop::InvalidOptionError + rescue Pry::Slop::InvalidOptionError # Display help message on unknown switches and exit. - puts Slop.new(&options) + puts Pry::Slop.new(&options) exit end @@ -124,7 +124,7 @@ end # Bring in options defined by plugins -Slop.new do +Pry::Slop.new do on "no-plugins" do Pry.config.should_load_plugins = false end diff --git a/lib/pry/command.rb b/lib/pry/command.rb index 2971b484..01f6db54 100644 --- a/lib/pry/command.rb +++ b/lib/pry/command.rb @@ -531,7 +531,7 @@ class Pry # subclasses. # # Create subclasses using {Pry::CommandSet#create_command}, and override the - # `options(opt)` method to set up an instance of Slop, and the `process` + # `options(opt)` method to set up an instance of Pry::Slop, and the `process` # method to actually run the command. If necessary, you can also override # `setup` which will be called before `options`, for example to require any # gems your command needs to run, or to set up state. @@ -607,15 +607,15 @@ class Pry end end - # Return the help generated by Slop for this command. + # Return the help generated by Pry::Slop for this command. def help slop.help end - # Return an instance of Slop that can parse either subcommands or the + # Return an instance of Pry::Slop that can parse either subcommands or the # options that this command accepts. def slop - Slop.new do |opt| + Pry::Slop.new do |opt| opt.banner(unindent(self.class.banner)) subcommands(opt) options(opt) @@ -644,7 +644,7 @@ class Pry # end def setup; end - # A method to setup Slop commands so it can parse the subcommands your + # A method to setup Pry::Slop commands so it can parse the subcommands your # command expects. If you need to set up default values, use `setup` # instead. # @@ -679,7 +679,7 @@ class Pry # end def subcommands(cmd); end - # A method to setup Slop so it can parse the options your command expects. + # A method to setup Pry::Slop so it can parse the options your command expects. # # @note Please don't do anything side-effecty in the main part of this # method, as it may be called by Pry at any time for introspection reasons. @@ -696,7 +696,7 @@ class Pry # The actual body of your command should go here. # - # The `opts` mehod can be called to get the options that Slop has passed, + # The `opts` mehod can be called to get the options that Pry::Slop has passed, # and `args` gives the remaining, unparsed arguments. # # The return value of this method is discarded unless the command was diff --git a/lib/pry/helpers/options_helpers.rb b/lib/pry/helpers/options_helpers.rb index e566d3bc..09fd0262 100644 --- a/lib/pry/helpers/options_helpers.rb +++ b/lib/pry/helpers/options_helpers.rb @@ -3,7 +3,7 @@ class Pry module OptionsHelpers module_function - # Add method options to the Slop instance + # Add method options to the Pry::Slop instance def method_options(opt) @method_target = target opt.on :M, "instance-methods", "Operate on instance methods." diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index 90f63c89..134a64ba 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -435,7 +435,7 @@ class Pry # @return [Boolean] `true` if `val` is a command, `false` otherwise def process_command_safely(val) process_command(val) - rescue CommandError, Slop::InvalidOptionError, MethodSource::SourceNotFoundError => e + rescue CommandError, Pry::Slop::InvalidOptionError, MethodSource::SourceNotFoundError => e Pry.last_internal_error = e output.puts "Error: #{e.message}" true |