Sha256: 64e861aa692e4b86b9dbb459b024566b3a3f757bd82bd018de10d1e494eff459

Contents?: true

Size: 1.09 KB

Versions: 238

Compression:

Stored size: 1.09 KB

Contents

class Pry
  class Command::Stat < Pry::ClassCommand
    match 'stat'
    group 'Introspection'
    description 'View method information and set _file_ and _dir_ locals.'
    command_options :shellwords => false

    banner <<-'BANNER'
        Usage: stat [OPTIONS] [METH]

        Show method information for method METH and set _file_ and _dir_ locals.

        stat hello_method
    BANNER

    def options(opt)
      method_options(opt)
    end

    def process
      meth = method_object
      aliases = meth.aliases

      output.puts unindent <<-EOS
        Method Information:
        --
        Name: #{meth.name}
        Alias#{ "es" if aliases.length > 1 }: #{ aliases.any? ? aliases.join(", ") : "None." }
        Owner: #{meth.owner ? meth.owner : "Unknown"}
        Visibility: #{meth.visibility}
        Type: #{meth.is_a?(::Method) ? "Bound" : "Unbound"}
        Arity: #{meth.arity}
        Method Signature: #{meth.signature}
        Source Location: #{meth.source_location ? meth.source_location.join(":") : "Not found."}
      EOS
    end
  end

  Pry::Commands.add_command(Pry::Command::Stat)
end

Version data entries

238 entries across 231 versions & 39 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/stat.rb