looksee 3.0.0-universal-java-1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG +66 -0
- data/LICENSE +22 -0
- data/README.markdown +175 -0
- data/Rakefile +13 -0
- data/ext/extconf.rb +19 -0
- data/ext/mri/1.9.2/debug.h +36 -0
- data/ext/mri/1.9.2/id.h +170 -0
- data/ext/mri/1.9.2/method.h +103 -0
- data/ext/mri/1.9.2/node.h +483 -0
- data/ext/mri/1.9.2/thread_pthread.h +27 -0
- data/ext/mri/1.9.2/vm_core.h +707 -0
- data/ext/mri/1.9.2/vm_opts.h +51 -0
- data/ext/mri/1.9.3/atomic.h +56 -0
- data/ext/mri/1.9.3/debug.h +41 -0
- data/ext/mri/1.9.3/id.h +175 -0
- data/ext/mri/1.9.3/internal.h +227 -0
- data/ext/mri/1.9.3/internal_falcon.h +248 -0
- data/ext/mri/1.9.3/method.h +105 -0
- data/ext/mri/1.9.3/node.h +503 -0
- data/ext/mri/1.9.3/thread_pthread.h +51 -0
- data/ext/mri/1.9.3/vm_core.h +755 -0
- data/ext/mri/1.9.3/vm_opts.h +51 -0
- data/ext/mri/2.0.0/internal.h +378 -0
- data/ext/mri/2.0.0/method.h +138 -0
- data/ext/mri/2.1.0/internal.h +889 -0
- data/ext/mri/2.1.0/method.h +142 -0
- data/ext/mri/2.2.0/internal.h +1182 -0
- data/ext/mri/2.2.0/method.h +141 -0
- data/ext/mri/env-1.8.h +27 -0
- data/ext/mri/eval_c-1.8.h +27 -0
- data/ext/mri/mri.c +309 -0
- data/ext/mri/node-1.9.h +35 -0
- data/ext/rbx/rbx.c +13 -0
- data/lib/looksee.rb +2 -0
- data/lib/looksee/JRuby.jar +0 -0
- data/lib/looksee/adapter.rb +8 -0
- data/lib/looksee/adapter/base.rb +105 -0
- data/lib/looksee/adapter/rubinius.rb +84 -0
- data/lib/looksee/clean.rb +169 -0
- data/lib/looksee/columnizer.rb +73 -0
- data/lib/looksee/core_ext.rb +48 -0
- data/lib/looksee/editor.rb +64 -0
- data/lib/looksee/help.rb +54 -0
- data/lib/looksee/inspector.rb +70 -0
- data/lib/looksee/lookup_path.rb +95 -0
- data/lib/looksee/rbx.bundle +0 -0
- data/lib/looksee/version.rb +11 -0
- data/spec/looksee/adapter_spec.rb +588 -0
- data/spec/looksee/clean_spec.rb +41 -0
- data/spec/looksee/columnizer_spec.rb +52 -0
- data/spec/looksee/core_ext_spec.rb +17 -0
- data/spec/looksee/editor_spec.rb +107 -0
- data/spec/looksee/inspector_spec.rb +179 -0
- data/spec/looksee/lookup_path_spec.rb +87 -0
- data/spec/spec_helper.rb +29 -0
- data/spec/support/core_ext.rb +25 -0
- data/spec/support/temporary_classes.rb +78 -0
- data/spec/support/test_adapter.rb +83 -0
- metadata +116 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
$:.unshift File.expand_path('..', File.dirname(__FILE__))
|
2
|
+
ENV['LOOKSEE_METHOD'] = nil
|
3
|
+
|
4
|
+
require 'rspec'
|
5
|
+
require 'looksee'
|
6
|
+
|
7
|
+
require 'rbconfig'
|
8
|
+
require 'set'
|
9
|
+
require 'fileutils'
|
10
|
+
|
11
|
+
ROOT = File.expand_path('..', File.dirname(__FILE__))
|
12
|
+
|
13
|
+
Dir['spec/support/*.rb'].each do |path|
|
14
|
+
require path
|
15
|
+
end
|
16
|
+
|
17
|
+
NATIVE_ADAPTER = Looksee.adapter
|
18
|
+
|
19
|
+
RSpec.configure do |config|
|
20
|
+
config.extend TestAdapter::Mixin
|
21
|
+
|
22
|
+
config.expect_with :rspec do |c|
|
23
|
+
c.syntax = [:should, :expect]
|
24
|
+
end
|
25
|
+
|
26
|
+
config.mock_with :rspec do |c|
|
27
|
+
c.syntax = [:should, :expect]
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class Object
|
2
|
+
#
|
3
|
+
# Return this object's singleton class.
|
4
|
+
#
|
5
|
+
def singleton_class
|
6
|
+
class << self; self; end
|
7
|
+
end
|
8
|
+
|
9
|
+
#
|
10
|
+
# Return true if the given object include?-s this object.
|
11
|
+
#
|
12
|
+
def in?(object)
|
13
|
+
object.include?(self)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
class String
|
18
|
+
#
|
19
|
+
# Remove a left margin delimited by '|'-characters. Useful for
|
20
|
+
# heredocs:
|
21
|
+
#
|
22
|
+
def demargin
|
23
|
+
gsub(/^ *\|/, '')
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
#
|
2
|
+
# Include these in example groups to add facilities to create
|
3
|
+
# temporary classes and modules, which are swept up at the end of each
|
4
|
+
# example.
|
5
|
+
#
|
6
|
+
# Call make_class('ClassName') or make_module('ModuleName') to create
|
7
|
+
# a temporary class, then access them with plain constants (ClassName,
|
8
|
+
# ModuleName).
|
9
|
+
#
|
10
|
+
module TemporaryClasses
|
11
|
+
def self.included(mod)
|
12
|
+
mod.before do
|
13
|
+
@temporary_modules = []
|
14
|
+
end
|
15
|
+
|
16
|
+
mod.after do
|
17
|
+
@temporary_modules.each do |mod|
|
18
|
+
Object.send :remove_const, mod.name
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
#
|
24
|
+
# Create a temporary class with the given name and superclass.
|
25
|
+
#
|
26
|
+
def temporary_class(name, options={}, &block)
|
27
|
+
klass = Class.new(options[:superclass] || Object)
|
28
|
+
Object.const_set(name, klass)
|
29
|
+
klass.class_eval(&block) if block
|
30
|
+
@temporary_modules << klass
|
31
|
+
klass
|
32
|
+
end
|
33
|
+
|
34
|
+
#
|
35
|
+
# Create a temporary module with the given name.
|
36
|
+
#
|
37
|
+
def temporary_module(name, &block)
|
38
|
+
mod = Module.new
|
39
|
+
Object.const_set(name, mod)
|
40
|
+
mod.class_eval(&block) if block
|
41
|
+
@temporary_modules << mod
|
42
|
+
mod
|
43
|
+
end
|
44
|
+
|
45
|
+
#
|
46
|
+
# Replace the methods of the given module with those named.
|
47
|
+
#
|
48
|
+
# +methods+ is a hash of visibilities to names.
|
49
|
+
#
|
50
|
+
# As Ruby's reflection on singleton classes of classes isn't quite
|
51
|
+
# adequate, you need to provide a :class_singleton option when such
|
52
|
+
# a class is given.
|
53
|
+
#
|
54
|
+
# e.g.:
|
55
|
+
#
|
56
|
+
# replace_methods MyClass, :public => [:a, :b]
|
57
|
+
#
|
58
|
+
def add_methods(mod, options={})
|
59
|
+
mod.module_eval do
|
60
|
+
[:public, :protected, :private].each do |visibility|
|
61
|
+
Array(options[visibility]).each do |name|
|
62
|
+
define_method(name){}
|
63
|
+
send visibility, name
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
private # ---------------------------------------------------------
|
70
|
+
|
71
|
+
def all_instance_methods(mod)
|
72
|
+
names =
|
73
|
+
mod.public_instance_methods(false) +
|
74
|
+
mod.protected_instance_methods(false) +
|
75
|
+
mod.private_instance_methods(false)
|
76
|
+
names.map{|name| name.to_sym} # they're strings in ruby <1.9
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
class TestAdapter < Looksee::Adapter::Base
|
2
|
+
module Mixin
|
3
|
+
def use_test_adapter
|
4
|
+
before { Looksee.adapter = TestAdapter.new }
|
5
|
+
after { Looksee.adapter = NATIVE_ADAPTER }
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def lookup_modules(object)
|
10
|
+
ancestors[object]
|
11
|
+
end
|
12
|
+
|
13
|
+
def internal_public_instance_methods(mod)
|
14
|
+
public_methods[mod]
|
15
|
+
end
|
16
|
+
|
17
|
+
def internal_protected_instance_methods(mod)
|
18
|
+
protected_methods[mod]
|
19
|
+
end
|
20
|
+
|
21
|
+
def internal_private_instance_methods(mod)
|
22
|
+
private_methods[mod]
|
23
|
+
end
|
24
|
+
|
25
|
+
def internal_undefined_instance_methods(mod)
|
26
|
+
undefined_methods[mod]
|
27
|
+
end
|
28
|
+
|
29
|
+
def included_class?(object)
|
30
|
+
NATIVE_ADAPTER.included_class?(object)
|
31
|
+
end
|
32
|
+
|
33
|
+
def singleton_class?(object)
|
34
|
+
NATIVE_ADAPTER.singleton_class?(object)
|
35
|
+
end
|
36
|
+
|
37
|
+
def singleton_instance(object)
|
38
|
+
NATIVE_ADAPTER.singleton_instance(object)
|
39
|
+
end
|
40
|
+
|
41
|
+
def module_name(object)
|
42
|
+
NATIVE_ADAPTER.module_name(object)
|
43
|
+
end
|
44
|
+
|
45
|
+
def set_methods(mod, public, protected, private, undefined)
|
46
|
+
self.public_methods[mod] = public
|
47
|
+
self.protected_methods[mod] = protected
|
48
|
+
self.private_methods[mod] = private
|
49
|
+
self.undefined_methods[mod] = undefined
|
50
|
+
end
|
51
|
+
|
52
|
+
def source_location(method)
|
53
|
+
source_locations[[method.owner.name.to_s, method.name.to_s]]
|
54
|
+
end
|
55
|
+
|
56
|
+
def set_source_location(mod, method, location)
|
57
|
+
source_locations[[mod.name.to_s, method.to_s]] = location
|
58
|
+
end
|
59
|
+
|
60
|
+
def ancestors
|
61
|
+
@ancestors ||= Hash.new { |h, k| h[k] = [] }
|
62
|
+
end
|
63
|
+
|
64
|
+
def public_methods
|
65
|
+
@public_methods ||= Hash.new { |h, k| h[k] = [] }
|
66
|
+
end
|
67
|
+
|
68
|
+
def protected_methods
|
69
|
+
@protected_methods ||= Hash.new { |h, k| h[k] = [] }
|
70
|
+
end
|
71
|
+
|
72
|
+
def private_methods
|
73
|
+
@private_methods ||= Hash.new { |h, k| h[k] = [] }
|
74
|
+
end
|
75
|
+
|
76
|
+
def undefined_methods
|
77
|
+
@undefined_methods ||= Hash.new { |h, k| h[k] = [] }
|
78
|
+
end
|
79
|
+
|
80
|
+
def source_locations
|
81
|
+
@source_locations ||= {}
|
82
|
+
end
|
83
|
+
end
|
metadata
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: looksee
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.0
|
5
|
+
platform: universal-java-1.8
|
6
|
+
authors:
|
7
|
+
- George Ogata
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-01-06 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
- george.ogata@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files:
|
19
|
+
- CHANGELOG
|
20
|
+
- LICENSE
|
21
|
+
- README.markdown
|
22
|
+
files:
|
23
|
+
- lib/looksee.rb
|
24
|
+
- lib/looksee/adapter.rb
|
25
|
+
- lib/looksee/clean.rb
|
26
|
+
- lib/looksee/columnizer.rb
|
27
|
+
- lib/looksee/core_ext.rb
|
28
|
+
- lib/looksee/editor.rb
|
29
|
+
- lib/looksee/help.rb
|
30
|
+
- lib/looksee/inspector.rb
|
31
|
+
- lib/looksee/JRuby.jar
|
32
|
+
- lib/looksee/lookup_path.rb
|
33
|
+
- lib/looksee/rbx.bundle
|
34
|
+
- lib/looksee/version.rb
|
35
|
+
- lib/looksee/adapter/base.rb
|
36
|
+
- lib/looksee/adapter/rubinius.rb
|
37
|
+
- ext/mri/mri.c
|
38
|
+
- ext/rbx/rbx.c
|
39
|
+
- ext/mri/env-1.8.h
|
40
|
+
- ext/mri/eval_c-1.8.h
|
41
|
+
- ext/mri/node-1.9.h
|
42
|
+
- ext/mri/1.9.2/debug.h
|
43
|
+
- ext/mri/1.9.2/id.h
|
44
|
+
- ext/mri/1.9.2/method.h
|
45
|
+
- ext/mri/1.9.2/node.h
|
46
|
+
- ext/mri/1.9.2/thread_pthread.h
|
47
|
+
- ext/mri/1.9.2/vm_core.h
|
48
|
+
- ext/mri/1.9.2/vm_opts.h
|
49
|
+
- ext/mri/1.9.3/atomic.h
|
50
|
+
- ext/mri/1.9.3/debug.h
|
51
|
+
- ext/mri/1.9.3/id.h
|
52
|
+
- ext/mri/1.9.3/internal.h
|
53
|
+
- ext/mri/1.9.3/internal_falcon.h
|
54
|
+
- ext/mri/1.9.3/method.h
|
55
|
+
- ext/mri/1.9.3/node.h
|
56
|
+
- ext/mri/1.9.3/thread_pthread.h
|
57
|
+
- ext/mri/1.9.3/vm_core.h
|
58
|
+
- ext/mri/1.9.3/vm_opts.h
|
59
|
+
- ext/mri/2.0.0/internal.h
|
60
|
+
- ext/mri/2.0.0/method.h
|
61
|
+
- ext/mri/2.1.0/internal.h
|
62
|
+
- ext/mri/2.1.0/method.h
|
63
|
+
- ext/mri/2.2.0/internal.h
|
64
|
+
- ext/mri/2.2.0/method.h
|
65
|
+
- ext/extconf.rb
|
66
|
+
- CHANGELOG
|
67
|
+
- LICENSE
|
68
|
+
- Rakefile
|
69
|
+
- README.markdown
|
70
|
+
- spec/spec_helper.rb
|
71
|
+
- spec/looksee/adapter_spec.rb
|
72
|
+
- spec/looksee/clean_spec.rb
|
73
|
+
- spec/looksee/columnizer_spec.rb
|
74
|
+
- spec/looksee/core_ext_spec.rb
|
75
|
+
- spec/looksee/editor_spec.rb
|
76
|
+
- spec/looksee/inspector_spec.rb
|
77
|
+
- spec/looksee/lookup_path_spec.rb
|
78
|
+
- spec/support/core_ext.rb
|
79
|
+
- spec/support/temporary_classes.rb
|
80
|
+
- spec/support/test_adapter.rb
|
81
|
+
homepage: http://github.com/oggy/looksee
|
82
|
+
licenses:
|
83
|
+
- MIT
|
84
|
+
metadata: {}
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - '>='
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
requirements: []
|
100
|
+
rubyforge_project:
|
101
|
+
rubygems_version: 2.1.9
|
102
|
+
signing_key:
|
103
|
+
specification_version: 3
|
104
|
+
summary: Supercharged method introspection in IRB.
|
105
|
+
test_files:
|
106
|
+
- spec/spec_helper.rb
|
107
|
+
- spec/looksee/adapter_spec.rb
|
108
|
+
- spec/looksee/clean_spec.rb
|
109
|
+
- spec/looksee/columnizer_spec.rb
|
110
|
+
- spec/looksee/core_ext_spec.rb
|
111
|
+
- spec/looksee/editor_spec.rb
|
112
|
+
- spec/looksee/inspector_spec.rb
|
113
|
+
- spec/looksee/lookup_path_spec.rb
|
114
|
+
- spec/support/core_ext.rb
|
115
|
+
- spec/support/temporary_classes.rb
|
116
|
+
- spec/support/test_adapter.rb
|