looksee 3.1.0-universal-java-1.8 → 4.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 +4 -4
- data/CHANGELOG +13 -0
- data/README.markdown +61 -81
- data/ext/extconf.rb +3 -7
- data/ext/mri/2.3.0/internal.h +1404 -0
- data/ext/mri/2.3.0/method.h +213 -0
- data/ext/mri/mri.c +21 -264
- data/ext/rbx/rbx.c +0 -9
- data/lib/looksee/JRuby.jar +0 -0
- data/lib/looksee/adapter/base.rb +19 -54
- data/lib/looksee/adapter/rubinius.rb +3 -62
- data/lib/looksee/clean.rb +5 -1
- data/lib/looksee/editor.rb +1 -1
- data/lib/looksee/help.rb +3 -2
- data/lib/looksee/lookup_path.rb +7 -3
- data/lib/looksee/version.rb +1 -1
- data/spec/looksee/adapter_spec.rb +72 -365
- data/spec/looksee/editor_spec.rb +1 -1
- data/spec/looksee/inspector_spec.rb +21 -21
- data/spec/looksee/lookup_path_spec.rb +34 -21
- data/spec/spec_helper.rb +2 -0
- data/spec/support/temporary_classes.rb +10 -14
- data/spec/support/test_adapter.rb +2 -53
- metadata +8 -29
- data/ext/mri/1.9.2/debug.h +0 -36
- data/ext/mri/1.9.2/id.h +0 -170
- data/ext/mri/1.9.2/method.h +0 -103
- data/ext/mri/1.9.2/node.h +0 -483
- data/ext/mri/1.9.2/thread_pthread.h +0 -27
- data/ext/mri/1.9.2/vm_core.h +0 -707
- data/ext/mri/1.9.2/vm_opts.h +0 -51
- data/ext/mri/1.9.3/atomic.h +0 -56
- data/ext/mri/1.9.3/debug.h +0 -41
- data/ext/mri/1.9.3/id.h +0 -175
- data/ext/mri/1.9.3/internal.h +0 -227
- data/ext/mri/1.9.3/internal_falcon.h +0 -248
- data/ext/mri/1.9.3/method.h +0 -105
- data/ext/mri/1.9.3/node.h +0 -503
- data/ext/mri/1.9.3/thread_pthread.h +0 -51
- data/ext/mri/1.9.3/vm_core.h +0 -755
- data/ext/mri/1.9.3/vm_opts.h +0 -51
- data/ext/mri/2.0.0/internal.h +0 -378
- data/ext/mri/2.0.0/method.h +0 -138
- data/ext/mri/env-1.8.h +0 -27
- data/ext/mri/eval_c-1.8.h +0 -27
- data/ext/mri/node-1.9.h +0 -35
- data/lib/looksee/rbx.bundle +0 -0
@@ -4,25 +4,6 @@ require 'looksee/rbx'
|
|
4
4
|
module Looksee
|
5
5
|
module Adapter
|
6
6
|
class Rubinius < Base
|
7
|
-
def internal_superclass(klass)
|
8
|
-
klass.direct_superclass
|
9
|
-
end
|
10
|
-
|
11
|
-
def internal_public_instance_methods(mod)
|
12
|
-
return [] if !mod.origin.equal?(mod)
|
13
|
-
mod.method_table.public_names
|
14
|
-
end
|
15
|
-
|
16
|
-
def internal_protected_instance_methods(mod)
|
17
|
-
return [] if !mod.origin.equal?(mod)
|
18
|
-
mod.method_table.protected_names
|
19
|
-
end
|
20
|
-
|
21
|
-
def internal_private_instance_methods(mod)
|
22
|
-
return [] if !mod.origin.equal?(mod)
|
23
|
-
mod.method_table.private_names
|
24
|
-
end
|
25
|
-
|
26
7
|
def internal_undefined_instance_methods(mod)
|
27
8
|
return [] if !mod.origin.equal?(mod)
|
28
9
|
names = []
|
@@ -32,51 +13,11 @@ module Looksee
|
|
32
13
|
names
|
33
14
|
end
|
34
15
|
|
35
|
-
def included_class?(object)
|
36
|
-
object.is_a?(::Rubinius::IncludedModule)
|
37
|
-
end
|
38
|
-
|
39
|
-
def singleton_class?(object)
|
40
|
-
object.is_a?(Class) && !!::Rubinius::Type.singleton_class_object(object)
|
41
|
-
end
|
42
|
-
|
43
16
|
def singleton_instance(singleton_class)
|
44
|
-
singleton_class
|
45
|
-
|
46
|
-
::Rubinius::Type.singleton_class_object(singleton_class)
|
47
|
-
end
|
48
|
-
|
49
|
-
def module_name(mod)
|
50
|
-
mod.is_a?(Module) or
|
51
|
-
raise TypeError, "expected module, got #{mod.class}"
|
52
|
-
|
53
|
-
if ::Rubinius::IncludedModule === mod
|
54
|
-
if Class === mod.module
|
55
|
-
"#{module_name(mod.module)} (origin)"
|
56
|
-
else
|
57
|
-
module_name(mod.module)
|
58
|
-
end
|
59
|
-
elsif ::Rubinius::Type.respond_to?(:module_name)
|
60
|
-
::Rubinius::Type.module_name(mod) || ''
|
17
|
+
if Class === singleton_class && (instance = ::Rubinius::Type.singleton_class_object(singleton_class))
|
18
|
+
instance
|
61
19
|
else
|
62
|
-
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def source_location(method)
|
67
|
-
method.is_a?(UnboundMethod) or
|
68
|
-
raise TypeError, "expected UnboundMethod, got #{method.class}"
|
69
|
-
source_location = method.source_location and
|
70
|
-
return source_location
|
71
|
-
|
72
|
-
# #source_location doesn't always work. If it returns nil, try
|
73
|
-
# a little harder.
|
74
|
-
case (executable = method.executable)
|
75
|
-
when ::Rubinius::BlockEnvironment::AsMethod
|
76
|
-
method = executable.instance_variable_get(:@block_env).method
|
77
|
-
[method.file.to_s, method.lines[1]]
|
78
|
-
when ::Rubinius::DelegatedMethod
|
79
|
-
executable.instance_variable_get(:@receiver).source_location
|
20
|
+
nil
|
80
21
|
end
|
81
22
|
end
|
82
23
|
end
|
data/lib/looksee/clean.rb
CHANGED
@@ -15,7 +15,6 @@ module Looksee
|
|
15
15
|
autoload :Help, 'looksee/help'
|
16
16
|
autoload :Inspector, 'looksee/inspector'
|
17
17
|
autoload :LookupPath, 'looksee/lookup_path'
|
18
|
-
autoload :WirbleCompatibility, 'looksee/wirble_compatibility'
|
19
18
|
|
20
19
|
class << self
|
21
20
|
#
|
@@ -138,6 +137,11 @@ module Looksee
|
|
138
137
|
def help
|
139
138
|
Help.new
|
140
139
|
end
|
140
|
+
|
141
|
+
# Call mod#method on receiver, ignoring any overrides in receiver's class.
|
142
|
+
def safe_call(mod, name, receiver, *args) # :nodoc:
|
143
|
+
mod.instance_method(name).bind(receiver).call(*args)
|
144
|
+
end
|
141
145
|
end
|
142
146
|
|
143
147
|
self.default_specifiers = [:public, :protected, :private, :undefined, :overridden]
|
data/lib/looksee/editor.rb
CHANGED
@@ -15,7 +15,7 @@ module Looksee
|
|
15
15
|
def edit(object, method_name)
|
16
16
|
method = LookupPath.new(object).find(method_name.to_s) or
|
17
17
|
raise NoMethodError, "no method `#{method_name}' in lookup path of #{object.class} instance"
|
18
|
-
file, line =
|
18
|
+
file, line = method.source_location
|
19
19
|
if !file
|
20
20
|
raise NoSourceLocationError, "no source location for #{method.owner}##{method.name}"
|
21
21
|
elsif !File.exist?(file)
|
data/lib/looksee/help.rb
CHANGED
@@ -4,7 +4,8 @@ module Looksee
|
|
4
4
|
<<-EOS.gsub(/^ *\|/, '')
|
5
5
|
|== Looksee Quick Reference
|
6
6
|
|
|
7
|
-
|
|
7
|
+
| \e[1mobject.ls(*specifiers)\e[0m or \e[1mLooksee[object, *specifiers]\e[0m
|
8
|
+
|
|
8
9
|
| Print the methods of \`object\'.
|
9
10
|
|
|
10
11
|
| Available specifiers:
|
@@ -40,7 +41,7 @@ module Looksee
|
|
40
41
|
| ...
|
41
42
|
| }
|
42
43
|
|
|
43
|
-
|
|
44
|
+
| \e[1mobject.ls.edit(method)\e[0m
|
44
45
|
|
|
45
46
|
| Jump to the source of the given method. Set your editor
|
46
47
|
| with Looksee.editor or the LOOKSEE_EDITOR environment
|
data/lib/looksee/lookup_path.rb
CHANGED
@@ -28,7 +28,7 @@ module Looksee
|
|
28
28
|
if visibility == :undefined
|
29
29
|
return nil
|
30
30
|
else
|
31
|
-
return Looksee.
|
31
|
+
return Looksee.safe_call(Module, :instance_method, entry.module, name)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
nil
|
@@ -83,11 +83,15 @@ module Looksee
|
|
83
83
|
|
84
84
|
def find_methods
|
85
85
|
methods = {}
|
86
|
-
[:public, :protected, :private
|
87
|
-
Looksee.
|
86
|
+
[:public, :protected, :private].each do |visibility|
|
87
|
+
meths = Looksee.safe_call(Module, "#{visibility}_instance_methods", @module, false)
|
88
|
+
meths.each do |method|
|
88
89
|
methods[method.to_s] = visibility
|
89
90
|
end
|
90
91
|
end
|
92
|
+
Looksee.adapter.send("internal_undefined_instance_methods", @module).each do |method|
|
93
|
+
methods[method.to_s] = :undefined
|
94
|
+
end
|
91
95
|
methods
|
92
96
|
end
|
93
97
|
end
|
data/lib/looksee/version.rb
CHANGED