Sha256: d80380709b76a0e81be40c6722cf9000628692f84e1db1f79cf8d96143b1296e

Contents?: true

Size: 551 Bytes

Versions: 15

Compression:

Stored size: 551 Bytes

Contents

class Pry
  module ExtendedCommands

    UserCommandAPI = Pry::CommandSet.new do

      command "define-command", "Define a command in the session, use same syntax as `command` method for command API" do |arg|
        next output.puts("Provide an arg!") if arg.nil?

        prime_string = "command #{arg_string}\n"
        command_string = Pry.active_instance.r(target, prime_string)

        eval_string.replace <<-HERE
          _pry_.commands.instance_eval do
            #{command_string}
          end
        HERE

      end

    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
pry-0.9.3 lib/pry/extended_commands/user_command_api.rb
pry-0.9.3-i386-mswin32 lib/pry/extended_commands/user_command_api.rb
pry-0.9.3-i386-mingw32 lib/pry/extended_commands/user_command_api.rb
pry-0.9.3pre1 lib/pry/extended_commands/user_command_api.rb
pry-0.9.3pre1-i386-mswin32 lib/pry/extended_commands/user_command_api.rb
pry-0.9.3pre1-i386-mingw32 lib/pry/extended_commands/user_command_api.rb
pry-0.9.2 lib/pry/extended_commands/user_command_api.rb
pry-0.9.2-i386-mswin32 lib/pry/extended_commands/user_command_api.rb
pry-0.9.2-i386-mingw32 lib/pry/extended_commands/user_command_api.rb
pry-0.9.1 lib/pry/extended_commands/user_command_api.rb
pry-0.9.1-i386-mswin32 lib/pry/extended_commands/user_command_api.rb
pry-0.9.1-i386-mingw32 lib/pry/extended_commands/user_command_api.rb
pry-0.9.0 lib/pry/extended_commands/user_command_api.rb
pry-0.9.0-i386-mswin32 lib/pry/extended_commands/user_command_api.rb
pry-0.9.0-i386-mingw32 lib/pry/extended_commands/user_command_api.rb