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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +13 -0
  3. data/README.markdown +61 -81
  4. data/ext/extconf.rb +3 -7
  5. data/ext/mri/2.3.0/internal.h +1404 -0
  6. data/ext/mri/2.3.0/method.h +213 -0
  7. data/ext/mri/mri.c +21 -264
  8. data/ext/rbx/rbx.c +0 -9
  9. data/lib/looksee/JRuby.jar +0 -0
  10. data/lib/looksee/adapter/base.rb +19 -54
  11. data/lib/looksee/adapter/rubinius.rb +3 -62
  12. data/lib/looksee/clean.rb +5 -1
  13. data/lib/looksee/editor.rb +1 -1
  14. data/lib/looksee/help.rb +3 -2
  15. data/lib/looksee/lookup_path.rb +7 -3
  16. data/lib/looksee/version.rb +1 -1
  17. data/spec/looksee/adapter_spec.rb +72 -365
  18. data/spec/looksee/editor_spec.rb +1 -1
  19. data/spec/looksee/inspector_spec.rb +21 -21
  20. data/spec/looksee/lookup_path_spec.rb +34 -21
  21. data/spec/spec_helper.rb +2 -0
  22. data/spec/support/temporary_classes.rb +10 -14
  23. data/spec/support/test_adapter.rb +2 -53
  24. metadata +8 -29
  25. data/ext/mri/1.9.2/debug.h +0 -36
  26. data/ext/mri/1.9.2/id.h +0 -170
  27. data/ext/mri/1.9.2/method.h +0 -103
  28. data/ext/mri/1.9.2/node.h +0 -483
  29. data/ext/mri/1.9.2/thread_pthread.h +0 -27
  30. data/ext/mri/1.9.2/vm_core.h +0 -707
  31. data/ext/mri/1.9.2/vm_opts.h +0 -51
  32. data/ext/mri/1.9.3/atomic.h +0 -56
  33. data/ext/mri/1.9.3/debug.h +0 -41
  34. data/ext/mri/1.9.3/id.h +0 -175
  35. data/ext/mri/1.9.3/internal.h +0 -227
  36. data/ext/mri/1.9.3/internal_falcon.h +0 -248
  37. data/ext/mri/1.9.3/method.h +0 -105
  38. data/ext/mri/1.9.3/node.h +0 -503
  39. data/ext/mri/1.9.3/thread_pthread.h +0 -51
  40. data/ext/mri/1.9.3/vm_core.h +0 -755
  41. data/ext/mri/1.9.3/vm_opts.h +0 -51
  42. data/ext/mri/2.0.0/internal.h +0 -378
  43. data/ext/mri/2.0.0/method.h +0 -138
  44. data/ext/mri/env-1.8.h +0 -27
  45. data/ext/mri/eval_c-1.8.h +0 -27
  46. data/ext/mri/node-1.9.h +0 -35
  47. 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?(singleton_class) or
45
- raise TypeError, "expected singleton class, got #{singleton_class.class}"
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
- mod.__name__
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]
@@ -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 = Looksee.adapter.source_location(method)
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
- | object.ls(*specifiers) or Looksee[object, *specifiers]
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
- | object.ls.edit(method)
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
@@ -28,7 +28,7 @@ module Looksee
28
28
  if visibility == :undefined
29
29
  return nil
30
30
  else
31
- return Looksee.adapter.real_module(entry.module).instance_method(name)
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, :undefined].each do |visibility|
87
- Looksee.adapter.send("internal_#{visibility}_instance_methods", @module).each do |method|
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
@@ -1,5 +1,5 @@
1
1
  module Looksee
2
- VERSION = [3, 1, 0]
2
+ VERSION = [4, 0, 0]
3
3
 
4
4
  class << VERSION
5
5
  include Comparable