is_a 0.1.2 → 0.1.3
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/.travis.yml +12 -0
- data/Gemfile +3 -1
- data/README.md +2 -0
- data/ext/is_a/extconf.rb +26 -12
- data/ext/is_a/is_a.c +4 -1
- data/lib/is_a/version.rb +1 -1
- metadata +15 -28
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a0c7710846e38b3dafc711bebe3e0ae5e5c8e05c
|
4
|
+
data.tar.gz: f7d7ba50bb03814af7a91858cee351a926cc5d21
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a2f52082d72f785d55d9c8c76eedd4215291728a1c7bf7b2faffd524e3cb026b78a159d106db17f943af5dc003e452cc797c5d43514d55a9562952cb72fb194b
|
7
|
+
data.tar.gz: f8eb698ac26988d1480fc7ec0f772f4804326b1bf079ed39f83e600a4e106f452c41e2b0c7635bb1d5e0e652696952625a4866d63f23b10cd91596592fb5bff8
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
A small library of missing ruby methods for introspection. See Usage.
|
4
4
|
|
5
|
+
[](https://travis-ci.org/Vasfed/is_a) [](https://gemnasium.com/Vasfed/is_a)
|
6
|
+
|
5
7
|
## Installation
|
6
8
|
|
7
9
|
Add this line to your application's Gemfile:
|
data/ext/is_a/extconf.rb
CHANGED
@@ -1,14 +1,17 @@
|
|
1
1
|
require 'mkmf'
|
2
2
|
require 'debugger/ruby_core_source'
|
3
3
|
|
4
|
+
#TODO: get ruby_include from args
|
4
5
|
unless ARGV.any? {|arg| arg.include?('--with-ruby-include') }
|
5
6
|
require 'rbconfig'
|
6
7
|
bindir = RbConfig::CONFIG['bindir']
|
8
|
+
ruby_libversion = RUBY_VERSION
|
9
|
+
ruby_libversion = "1.9.1" if RUBY_VERSION == "1.9.2"
|
7
10
|
if bindir =~ %r{(^.*/\.rbenv/versions)/([^/]+)/bin$}
|
8
|
-
ruby_include = "#{$1}/#{$2}/include/ruby
|
11
|
+
ruby_include = "#{$1}/#{$2}/include/ruby-#{ruby_libversion}/ruby-#{$2}"
|
9
12
|
ARGV << "--with-ruby-include=#{ruby_include}"
|
10
13
|
elsif bindir =~ %r{(^.*/\.rvm/rubies)/([^/]+)/bin$}
|
11
|
-
ruby_include = "#{$1}/#{$2}/include/ruby
|
14
|
+
ruby_include = "#{$1}/#{$2}/include/ruby-#{ruby_libversion}/#{$2}"
|
12
15
|
ruby_include = "#{ENV['rvm_path']}/src/#{$2}" unless File.exist?(ruby_include)
|
13
16
|
ARGV << "--with-ruby-include=#{ruby_include}"
|
14
17
|
end
|
@@ -20,16 +23,27 @@ hdrs = ->{
|
|
20
23
|
vm_core.h
|
21
24
|
}.all?{|hdr| have_header(hdr)}
|
22
25
|
have_struct_member("rb_iseq_t", "location", "vm_core.h")
|
23
|
-
have_func("rb_vm_get_sourceline", "vm_core.h")
|
26
|
+
res = res && (have_func("rb_vm_get_sourceline", "vm_core.h") || have_func("rb_iseq_line_no", ["vm_core.h", "method.h", "iseq.h"]))
|
24
27
|
res
|
25
28
|
}
|
26
29
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end
|
30
|
+
if RUBY_PATCHLEVEL < 0 && !Debugger::RubyCoreSource::REVISION_MAP[RUBY_REVISION]
|
31
|
+
puts "RubyCoreSource does not have support for your ruby revision, trying a workaround..."
|
32
|
+
with_cppflags("-I" + ruby_include) {
|
33
|
+
if hdrs.call
|
34
|
+
create_makefile('is_a')
|
35
|
+
else
|
36
|
+
STDERR.print("Makefile creation failed\n")
|
37
|
+
exit(1)
|
38
|
+
end
|
39
|
+
}
|
40
|
+
else
|
41
|
+
if !Debugger::RubyCoreSource::create_makefile_with_core(hdrs, "is_a")
|
42
|
+
STDERR.print("Makefile creation failed\n")
|
43
|
+
STDERR.print("*************************************************************\n\n")
|
44
|
+
STDERR.print(" NOTE: If your headers were not found, try passing\n")
|
45
|
+
STDERR.print(" --with-ruby-include=PATH_TO_HEADERS \n\n")
|
46
|
+
STDERR.print("*************************************************************\n\n")
|
47
|
+
exit(1)
|
48
|
+
end
|
49
|
+
end
|
data/ext/is_a/is_a.c
CHANGED
@@ -28,7 +28,10 @@ rb_object_id_of(VALUE self, VALUE obj)
|
|
28
28
|
#define ID_ALLOCATOR 0
|
29
29
|
#endif
|
30
30
|
|
31
|
-
#
|
31
|
+
#if !defined(HAVE_RB_VM_GET_SOURCELINE) && defined(HAVE_RB_ISEQ_LINE_NO)
|
32
|
+
#include "method.h"
|
33
|
+
#include "iseq.h"
|
34
|
+
|
32
35
|
inline static int
|
33
36
|
calc_lineno(const rb_iseq_t *iseq, const VALUE *pc)
|
34
37
|
{
|
data/lib/is_a/version.rb
CHANGED
metadata
CHANGED
@@ -1,62 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: is_a
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Vasily Fedoseyev
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-12-13 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: debugger-ruby_core_source
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake-compiler
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: minitest
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
description: Fear weak references to BasicObject no more
|
@@ -67,7 +60,8 @@ extensions:
|
|
67
60
|
- ext/is_a/extconf.rb
|
68
61
|
extra_rdoc_files: []
|
69
62
|
files:
|
70
|
-
- .gitignore
|
63
|
+
- ".gitignore"
|
64
|
+
- ".travis.yml"
|
71
65
|
- Gemfile
|
72
66
|
- LICENSE
|
73
67
|
- README.md
|
@@ -80,33 +74,26 @@ files:
|
|
80
74
|
- spec/is_a_spec.rb
|
81
75
|
homepage: http://github.com/Vasfed/is_a
|
82
76
|
licenses: []
|
77
|
+
metadata: {}
|
83
78
|
post_install_message:
|
84
79
|
rdoc_options: []
|
85
80
|
require_paths:
|
86
81
|
- lib
|
87
82
|
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
-
none: false
|
89
83
|
requirements:
|
90
|
-
- -
|
84
|
+
- - ">="
|
91
85
|
- !ruby/object:Gem::Version
|
92
86
|
version: '0'
|
93
|
-
segments:
|
94
|
-
- 0
|
95
|
-
hash: 4587415308896797553
|
96
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
88
|
requirements:
|
99
|
-
- -
|
89
|
+
- - ">="
|
100
90
|
- !ruby/object:Gem::Version
|
101
91
|
version: '0'
|
102
|
-
segments:
|
103
|
-
- 0
|
104
|
-
hash: 4587415308896797553
|
105
92
|
requirements: []
|
106
93
|
rubyforge_project:
|
107
|
-
rubygems_version: 1.
|
94
|
+
rubygems_version: 2.1.11
|
108
95
|
signing_key:
|
109
|
-
specification_version:
|
96
|
+
specification_version: 4
|
110
97
|
summary: Defines methods to introspect any ruby object more deeply
|
111
98
|
test_files:
|
112
99
|
- spec/is_a_spec.rb
|