sender 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +11 -0
- data/CHANGELOG.rdoc +3 -0
- data/Makefile +181 -0
- data/Manifest.txt +17 -0
- data/README.rdoc +62 -0
- data/Rakefile +25 -0
- data/ext/sender/RubySourceSupport.c +40 -0
- data/ext/sender/RubySourceSupport.h +11 -0
- data/ext/sender/extconf.rb +24 -0
- data/ext/sender/main.c +15 -0
- data/ext/sender/rb_Global.c +76 -0
- data/ext/sender/rb_Global.h +11 -0
- data/ext/sender/rb_Global_internal.h +7 -0
- data/lib/sender/sender.bundle +0 -0
- data/lib/sender.rb +5 -0
- data/mkmf.log +41 -0
- data/test/test_sender.rb +14 -0
- metadata +132 -0
data/.autotest
ADDED
data/CHANGELOG.rdoc
ADDED
data/Makefile
ADDED
@@ -0,0 +1,181 @@
|
|
1
|
+
|
2
|
+
SHELL = /bin/sh
|
3
|
+
|
4
|
+
#### Start of system configuration section. ####
|
5
|
+
|
6
|
+
srcdir = ext/sender
|
7
|
+
topdir = /usr/local/include/ruby-1.9.1
|
8
|
+
hdrdir = /usr/local/include/ruby-1.9.1
|
9
|
+
arch_hdrdir = /usr/local/include/ruby-1.9.1/$(arch)
|
10
|
+
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
|
11
|
+
prefix = $(DESTDIR)/usr/local
|
12
|
+
exec_prefix = $(prefix)
|
13
|
+
vendorhdrdir = $(rubyhdrdir)/vendor_ruby
|
14
|
+
sitehdrdir = $(rubyhdrdir)/site_ruby
|
15
|
+
rubyhdrdir = $(includedir)/$(RUBY_INSTALL_NAME)-$(ruby_version)
|
16
|
+
vendordir = $(libdir)/$(RUBY_INSTALL_NAME)/vendor_ruby
|
17
|
+
sitedir = $(libdir)/$(RUBY_INSTALL_NAME)/site_ruby
|
18
|
+
mandir = $(datarootdir)/man
|
19
|
+
localedir = $(datarootdir)/locale
|
20
|
+
libdir = $(exec_prefix)/lib
|
21
|
+
psdir = $(docdir)
|
22
|
+
pdfdir = $(docdir)
|
23
|
+
dvidir = $(docdir)
|
24
|
+
htmldir = $(docdir)
|
25
|
+
infodir = $(datarootdir)/info
|
26
|
+
docdir = $(datarootdir)/doc/$(PACKAGE)
|
27
|
+
oldincludedir = $(DESTDIR)/usr/include
|
28
|
+
includedir = $(prefix)/include
|
29
|
+
localstatedir = $(prefix)/var
|
30
|
+
sharedstatedir = $(prefix)/com
|
31
|
+
sysconfdir = $(prefix)/etc
|
32
|
+
datadir = $(datarootdir)
|
33
|
+
datarootdir = $(prefix)/share
|
34
|
+
libexecdir = $(exec_prefix)/libexec
|
35
|
+
sbindir = $(exec_prefix)/sbin
|
36
|
+
bindir = $(exec_prefix)/bin
|
37
|
+
rubylibdir = $(libdir)/$(ruby_install_name)/$(ruby_version)
|
38
|
+
archdir = $(rubylibdir)/$(arch)
|
39
|
+
sitelibdir = $(sitedir)/$(ruby_version)
|
40
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
41
|
+
vendorlibdir = $(vendordir)/$(ruby_version)
|
42
|
+
vendorarchdir = $(vendorlibdir)/$(sitearch)
|
43
|
+
|
44
|
+
CC = /Developer/usr/bin/clang
|
45
|
+
CXX = g++
|
46
|
+
LIBRUBY = $(LIBRUBY_SO)
|
47
|
+
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
48
|
+
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
|
49
|
+
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
|
50
|
+
OUTFLAG = -o
|
51
|
+
COUTFLAG = -o
|
52
|
+
|
53
|
+
RUBY_EXTCONF_H =
|
54
|
+
cflags = $(optflags) $(debugflags) $(warnflags)
|
55
|
+
optflags = -O2
|
56
|
+
debugflags = -g
|
57
|
+
warnflags = -Wall -Wno-parentheses
|
58
|
+
CFLAGS = -fno-common $(cflags) -fno-common -pipe -fno-common
|
59
|
+
INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir) -I/usr/src/ruby
|
60
|
+
DEFS =
|
61
|
+
CPPFLAGS = -I/usr/src/ruby/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE $(DEFS) $(cppflags)
|
62
|
+
CXXFLAGS = $(CFLAGS) $(cxxflags)
|
63
|
+
ldflags = -L. -L/usr/local/lib
|
64
|
+
dldflags =
|
65
|
+
archflag =
|
66
|
+
DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
|
67
|
+
LDSHARED = cc -dynamic -bundle -undefined suppress -flat_namespace
|
68
|
+
LDSHAREDXX = $(LDSHARED)
|
69
|
+
AR = ar
|
70
|
+
EXEEXT =
|
71
|
+
|
72
|
+
RUBY_INSTALL_NAME = ruby
|
73
|
+
RUBY_SO_NAME = ruby
|
74
|
+
arch = i386-darwin10.4.0
|
75
|
+
sitearch = i386-darwin10.4.0
|
76
|
+
ruby_version = 1.9.1
|
77
|
+
ruby = /usr/local/bin/ruby
|
78
|
+
RUBY = $(ruby)
|
79
|
+
RM = rm -f
|
80
|
+
RM_RF = $(RUBY) -run -e rm -- -rf
|
81
|
+
RMDIRS = $(RUBY) -run -e rmdir -- -p
|
82
|
+
MAKEDIRS = mkdir -p
|
83
|
+
INSTALL = /usr/bin/install -c
|
84
|
+
INSTALL_PROG = $(INSTALL) -m 0755
|
85
|
+
INSTALL_DATA = $(INSTALL) -m 644
|
86
|
+
COPY = cp
|
87
|
+
|
88
|
+
#### End of system configuration section. ####
|
89
|
+
|
90
|
+
preload =
|
91
|
+
|
92
|
+
libpath = . $(libdir) /usr/src/ruby/lib
|
93
|
+
LIBPATH = -L. -L$(libdir) -L/usr/src/ruby/lib
|
94
|
+
DEFFILE =
|
95
|
+
|
96
|
+
CLEANFILES = mkmf.log
|
97
|
+
DISTCLEANFILES =
|
98
|
+
DISTCLEANDIRS =
|
99
|
+
|
100
|
+
extout =
|
101
|
+
extout_prefix =
|
102
|
+
target_prefix =
|
103
|
+
LOCAL_LIBS =
|
104
|
+
LIBS = $(LIBRUBYARG_SHARED) -lpthread -ldl -lobjc
|
105
|
+
SRCS = main.c rb_Global.c RubySourceSupport.c
|
106
|
+
OBJS = main.o rb_Global.o RubySourceSupport.o
|
107
|
+
TARGET = sender
|
108
|
+
DLLIB = $(TARGET).bundle
|
109
|
+
EXTSTATIC =
|
110
|
+
STATIC_LIB =
|
111
|
+
|
112
|
+
BINDIR = $(bindir)
|
113
|
+
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
114
|
+
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
115
|
+
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
116
|
+
HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
|
117
|
+
ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
|
118
|
+
|
119
|
+
TARGET_SO = $(DLLIB)
|
120
|
+
CLEANLIBS = $(TARGET).bundle
|
121
|
+
CLEANOBJS = *.o *.bak
|
122
|
+
|
123
|
+
all: $(DLLIB)
|
124
|
+
static: $(STATIC_LIB)
|
125
|
+
|
126
|
+
clean-rb-default::
|
127
|
+
clean-rb::
|
128
|
+
clean-so::
|
129
|
+
clean: clean-so clean-rb-default clean-rb
|
130
|
+
@-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
|
131
|
+
|
132
|
+
distclean-rb-default::
|
133
|
+
distclean-rb::
|
134
|
+
distclean-so::
|
135
|
+
distclean: clean distclean-so distclean-rb-default distclean-rb
|
136
|
+
@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
137
|
+
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
138
|
+
@-$(RMDIRS) $(DISTCLEANDIRS)
|
139
|
+
|
140
|
+
realclean: distclean
|
141
|
+
install: install-so install-rb
|
142
|
+
|
143
|
+
install-so: $(RUBYARCHDIR)
|
144
|
+
install-so: $(RUBYARCHDIR)/$(DLLIB)
|
145
|
+
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
|
146
|
+
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
147
|
+
install-rb: pre-install-rb install-rb-default
|
148
|
+
install-rb-default: pre-install-rb-default
|
149
|
+
pre-install-rb: Makefile
|
150
|
+
pre-install-rb-default: Makefile
|
151
|
+
$(RUBYARCHDIR):
|
152
|
+
$(MAKEDIRS) $@
|
153
|
+
|
154
|
+
site-install: site-install-so site-install-rb
|
155
|
+
site-install-so: install-so
|
156
|
+
site-install-rb: install-rb
|
157
|
+
|
158
|
+
.SUFFIXES: .c .m .cc .cxx .cpp .C .o
|
159
|
+
|
160
|
+
.cc.o:
|
161
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
162
|
+
|
163
|
+
.cxx.o:
|
164
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
165
|
+
|
166
|
+
.cpp.o:
|
167
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
168
|
+
|
169
|
+
.C.o:
|
170
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
|
171
|
+
|
172
|
+
.c.o:
|
173
|
+
$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
|
174
|
+
|
175
|
+
$(DLLIB): $(OBJS) Makefile
|
176
|
+
@-$(RM) $(@)
|
177
|
+
$(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
$(OBJS): $(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h $(arch_hdrdir)/ruby/config.h
|
data/Manifest.txt
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
.autotest
|
2
|
+
CHANGELOG.rdoc
|
3
|
+
Makefile
|
4
|
+
Manifest.txt
|
5
|
+
README.rdoc
|
6
|
+
Rakefile
|
7
|
+
ext/sender/RubySourceSupport.c
|
8
|
+
ext/sender/RubySourceSupport.h
|
9
|
+
ext/sender/extconf.rb
|
10
|
+
ext/sender/main.c
|
11
|
+
ext/sender/rb_Global.c
|
12
|
+
ext/sender/rb_Global.h
|
13
|
+
ext/sender/rb_Global_internal.h
|
14
|
+
lib/sender.rb
|
15
|
+
lib/sender/sender.bundle
|
16
|
+
mkmf.log
|
17
|
+
test/test_sender.rb
|
data/README.rdoc
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
Sender:
|
2
|
+
|
3
|
+
== DESCRIPTION:
|
4
|
+
|
5
|
+
Adds __sender__ and __caller__ to the built-in __callee__ and __method__ functions.
|
6
|
+
|
7
|
+
== SYNOPSIS:
|
8
|
+
|
9
|
+
Example:
|
10
|
+
|
11
|
+
require 'sender'
|
12
|
+
|
13
|
+
class SenderTest
|
14
|
+
def sender_test
|
15
|
+
puts( 'Caller was: ' + __caller__.to_s )
|
16
|
+
puts( 'Sender was: ' + __sender__.to_s )
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class Test
|
21
|
+
def run_tests
|
22
|
+
test = SenderTest.new
|
23
|
+
test.sender_test
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
test = Test.new
|
28
|
+
test.run_tests
|
29
|
+
|
30
|
+
Outputs:
|
31
|
+
|
32
|
+
Caller was: sender_test
|
33
|
+
Sender was: #<SenderTest:0x0000010103ee88>
|
34
|
+
|
35
|
+
== INSTALL:
|
36
|
+
|
37
|
+
* sudo gem install sender
|
38
|
+
|
39
|
+
== LICENSE:
|
40
|
+
|
41
|
+
(The MIT License)
|
42
|
+
|
43
|
+
Copyright (c) 2010 Asher
|
44
|
+
|
45
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
46
|
+
a copy of this software and associated documentation files (the
|
47
|
+
'Software'), to deal in the Software without restriction, including
|
48
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
49
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
50
|
+
permit persons to whom the Software is furnished to do so, subject to
|
51
|
+
the following conditions:
|
52
|
+
|
53
|
+
The above copyright notice and this permission notice shall be
|
54
|
+
included in all copies or substantial portions of the Software.
|
55
|
+
|
56
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
57
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
58
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
59
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
60
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
61
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
62
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'hoe'
|
3
|
+
require 'rake/extensiontask'
|
4
|
+
|
5
|
+
Hoe.spec 'sender' do
|
6
|
+
developer( 'Asher', 'asher@ridiculouspower.com' )
|
7
|
+
self.rubyforge_name = 'asher'
|
8
|
+
self.readme_file = 'README.rdoc'
|
9
|
+
self.history_file = 'CHANGELOG.rdoc'
|
10
|
+
self.extra_rdoc_files = FileList['*.rdoc']
|
11
|
+
self.spec_extras = { :extensions => ["ext/sender/extconf.rb"] }
|
12
|
+
self.extra_dev_deps << ['rake-compiler', '>= 0']
|
13
|
+
|
14
|
+
Rake::ExtensionTask.new( 'sender', spec ) do |ext|
|
15
|
+
ext.lib_dir = File.join('lib', 'sender')
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
Rake::Task[:test].prerequisites << :compile
|
20
|
+
|
21
|
+
task :cultivate do
|
22
|
+
system "touch Manifest.txt; rake check_manifest | grep -v \"(in \" | patch"
|
23
|
+
system "rake debug_gem | grep -v \"(in \" > `basename \\`pwd\\``.gemspec"
|
24
|
+
end
|
25
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
|
2
|
+
#include "RubySourceSupport.h"
|
3
|
+
|
4
|
+
#include "vm_exec.h"
|
5
|
+
|
6
|
+
// Taken from eval.c in Ruby source
|
7
|
+
// No header, so easiest way to integrate was to copy the code and make my own header.
|
8
|
+
// Previously declared static; otherwise unchanged
|
9
|
+
|
10
|
+
ID frame_func_id( rb_control_frame_t *cfp )
|
11
|
+
{
|
12
|
+
rb_iseq_t *iseq = cfp->iseq;
|
13
|
+
if (!iseq) {
|
14
|
+
return cfp->method_id;
|
15
|
+
}
|
16
|
+
while (iseq) {
|
17
|
+
if (RUBY_VM_IFUNC_P(iseq)) {
|
18
|
+
return rb_intern("<ifunc>");
|
19
|
+
}
|
20
|
+
if (iseq->defined_method_id) {
|
21
|
+
return iseq->defined_method_id;
|
22
|
+
}
|
23
|
+
if (iseq->local_iseq == iseq) {
|
24
|
+
break;
|
25
|
+
}
|
26
|
+
iseq = iseq->parent_iseq;
|
27
|
+
}
|
28
|
+
return 0;
|
29
|
+
}
|
30
|
+
|
31
|
+
ID rb_frame_caller(void)
|
32
|
+
{
|
33
|
+
rb_thread_t *th = GET_THREAD();
|
34
|
+
rb_control_frame_t *prev_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(th->cfp);
|
35
|
+
/* check if prev_cfp can be accessible */
|
36
|
+
if ((void *)(th->stack + th->stack_size) == (void *)(prev_cfp)) {
|
37
|
+
return 0;
|
38
|
+
}
|
39
|
+
return frame_func_id(prev_cfp);
|
40
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'mkmf'
|
4
|
+
|
5
|
+
RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
|
6
|
+
|
7
|
+
target = "sender"
|
8
|
+
|
9
|
+
default_ruby_source_dir = '/usr/src/ruby'
|
10
|
+
|
11
|
+
# --with-rubysrc-include=default_ruby_source_dir
|
12
|
+
dir_config( 'rubysrc', default_ruby_source_dir )
|
13
|
+
|
14
|
+
if ! find_header( 'eval_intern.h', default_ruby_source_dir )
|
15
|
+
puts 'Could not find path to ruby source directory, so could not locate "eval_intern.h". Default location is ' + default_ruby_source_dir + '. Specify alternative directory --with-rubysrc-include=path.'
|
16
|
+
exit
|
17
|
+
end
|
18
|
+
if ! find_header( 'vm_exec.h', default_ruby_source_dir )
|
19
|
+
puts 'Could not find path to ruby source directory, so could not locate "vm_exec.h". Default location is ' + default_ruby_source_dir + '. You can specify an alternative directory --with-rubysrc-include=path, but if you are seeing this error we have most likely already found the ruby source directory, and it is missing items.'
|
20
|
+
exit
|
21
|
+
end
|
22
|
+
|
23
|
+
# Create our makefile from sources
|
24
|
+
create_makefile( target )
|
data/ext/sender/main.c
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
#include "rb_Global.h"
|
3
|
+
|
4
|
+
/*************
|
5
|
+
* Init *
|
6
|
+
*************/
|
7
|
+
|
8
|
+
// Called from ruby when RPBDB module is initialized
|
9
|
+
void Init_sender() {
|
10
|
+
|
11
|
+
rb_define_global_function( "__sender__", rb_RPRuby_SenderCaller__sender__, 0 );
|
12
|
+
rb_define_global_function( "__caller__", rb_RPRuby_SenderCaller__caller__, 0 );
|
13
|
+
|
14
|
+
}
|
15
|
+
|
@@ -0,0 +1,76 @@
|
|
1
|
+
|
2
|
+
#include <ruby.h>
|
3
|
+
|
4
|
+
#include "rb_Global.h"
|
5
|
+
#include "rb_Global_internal.h"
|
6
|
+
|
7
|
+
// Internals from ruby that aren't included in the ruby lib
|
8
|
+
#include "RubySourceSupport.h"
|
9
|
+
|
10
|
+
#include "eval_intern.h"
|
11
|
+
|
12
|
+
/***************************************************************************************************************************************************************
|
13
|
+
****************************************************************************************************************************************************************
|
14
|
+
Global Ruby Methods
|
15
|
+
****************************************************************************************************************************************************************
|
16
|
+
***************************************************************************************************************************************************************/
|
17
|
+
|
18
|
+
/***************
|
19
|
+
* __sender__ *
|
20
|
+
***************/
|
21
|
+
|
22
|
+
/*
|
23
|
+
* call-seq:
|
24
|
+
* __sender__ -> object
|
25
|
+
*
|
26
|
+
* Return object sending message to receiver.
|
27
|
+
*/
|
28
|
+
VALUE rb_RPRuby_SenderCaller__sender__() {
|
29
|
+
|
30
|
+
rb_control_frame_t* c_sending_frame = RPRuby_internal_framePriorToCurrent();
|
31
|
+
|
32
|
+
if ( c_sending_frame == NULL ) {
|
33
|
+
return Qnil;
|
34
|
+
}
|
35
|
+
|
36
|
+
// return rb_self that is sender
|
37
|
+
return c_sending_frame->self;
|
38
|
+
}
|
39
|
+
|
40
|
+
/***************
|
41
|
+
* __caller__ *
|
42
|
+
***************/
|
43
|
+
|
44
|
+
/*
|
45
|
+
* call-seq:
|
46
|
+
* __caller__ -> object
|
47
|
+
*
|
48
|
+
* Return method sending message to receiver.
|
49
|
+
*/
|
50
|
+
VALUE rb_RPRuby_SenderCaller__caller__() {
|
51
|
+
|
52
|
+
return ID2SYM( rb_frame_caller() );
|
53
|
+
}
|
54
|
+
|
55
|
+
/***************************************************************************************************************************************************************
|
56
|
+
****************************************************************************************************************************************************************
|
57
|
+
Internal Methods
|
58
|
+
****************************************************************************************************************************************************************
|
59
|
+
***************************************************************************************************************************************************************/
|
60
|
+
|
61
|
+
/*************************
|
62
|
+
* framePriorToCurrent *
|
63
|
+
************************/
|
64
|
+
|
65
|
+
rb_control_frame_t* RPRuby_internal_framePriorToCurrent() {
|
66
|
+
|
67
|
+
rb_thread_t* c_thread = GET_THREAD();
|
68
|
+
rb_control_frame_t* prior_control_frame = RUBY_VM_PREVIOUS_CONTROL_FRAME( c_thread->cfp );
|
69
|
+
|
70
|
+
// Make sure we actually have a prior frame
|
71
|
+
if ( (void*)( c_thread->stack + c_thread->stack_size ) == (void*)( prior_control_frame ) ) {
|
72
|
+
return NULL;
|
73
|
+
}
|
74
|
+
|
75
|
+
return prior_control_frame;
|
76
|
+
}
|
Binary file
|
data/lib/sender.rb
ADDED
data/mkmf.log
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
find_header: checking for eval_intern.h in /usr/src/ruby... -------------------- yes
|
2
|
+
|
3
|
+
"gcc -o conftest -I/usr/local/include/ruby-1.9.1/i386-darwin10.4.0 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -Iext/sender -I/usr/src/ruby/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O2 -g -Wall -Wno-parentheses -fno-common -pipe -fno-common conftest.c -L. -L/usr/local/lib -L/usr/src/ruby/lib -L. -L/usr/local/lib -lruby-static -lpthread -ldl -lobjc "
|
4
|
+
checked program was:
|
5
|
+
/* begin */
|
6
|
+
1: #include "ruby.h"
|
7
|
+
2:
|
8
|
+
3: int main() {return 0;}
|
9
|
+
/* end */
|
10
|
+
|
11
|
+
"gcc -E -I/usr/local/include/ruby-1.9.1/i386-darwin10.4.0 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -Iext/sender -I/usr/src/ruby/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O2 -g -Wall -Wno-parentheses -fno-common -pipe -fno-common conftest.c -o conftest.i"
|
12
|
+
conftest.c:3:25: error: eval_intern.h: No such file or directory
|
13
|
+
checked program was:
|
14
|
+
/* begin */
|
15
|
+
1: #include "ruby.h"
|
16
|
+
2:
|
17
|
+
3: #include <eval_intern.h>
|
18
|
+
/* end */
|
19
|
+
|
20
|
+
"gcc -E -I/usr/local/include/ruby-1.9.1/i386-darwin10.4.0 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -Iext/sender -I/usr/src/ruby/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O2 -g -Wall -Wno-parentheses -fno-common -pipe -fno-common -I/usr/src/ruby conftest.c -o conftest.i"
|
21
|
+
checked program was:
|
22
|
+
/* begin */
|
23
|
+
1: #include "ruby.h"
|
24
|
+
2:
|
25
|
+
3: #include <eval_intern.h>
|
26
|
+
/* end */
|
27
|
+
|
28
|
+
--------------------
|
29
|
+
|
30
|
+
find_header: checking for vm_exec.h in /usr/src/ruby... -------------------- yes
|
31
|
+
|
32
|
+
"gcc -E -I/usr/local/include/ruby-1.9.1/i386-darwin10.4.0 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -Iext/sender -I/usr/src/ruby -I/usr/src/ruby/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O2 -g -Wall -Wno-parentheses -fno-common -pipe -fno-common conftest.c -o conftest.i"
|
33
|
+
checked program was:
|
34
|
+
/* begin */
|
35
|
+
1: #include "ruby.h"
|
36
|
+
2:
|
37
|
+
3: #include <vm_exec.h>
|
38
|
+
/* end */
|
39
|
+
|
40
|
+
--------------------
|
41
|
+
|
data/test/test_sender.rb
ADDED
metadata
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sender
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Asher
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-06-22 00:00:00 -04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: rubyforge
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 0
|
33
|
+
- 4
|
34
|
+
version: 2.0.4
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rake-compiler
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 3
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
version: "0"
|
49
|
+
type: :development
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: hoe
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 21
|
60
|
+
segments:
|
61
|
+
- 2
|
62
|
+
- 6
|
63
|
+
- 1
|
64
|
+
version: 2.6.1
|
65
|
+
type: :development
|
66
|
+
version_requirements: *id003
|
67
|
+
description: Object oriented callback features.
|
68
|
+
email:
|
69
|
+
- asher@ridiculouspower.com
|
70
|
+
executables: []
|
71
|
+
|
72
|
+
extensions:
|
73
|
+
- ext/sender/extconf.rb
|
74
|
+
extra_rdoc_files:
|
75
|
+
- Manifest.txt
|
76
|
+
- CHANGELOG.rdoc
|
77
|
+
- README.rdoc
|
78
|
+
files:
|
79
|
+
- .autotest
|
80
|
+
- CHANGELOG.rdoc
|
81
|
+
- Makefile
|
82
|
+
- Manifest.txt
|
83
|
+
- README.rdoc
|
84
|
+
- Rakefile
|
85
|
+
- ext/sender/RubySourceSupport.c
|
86
|
+
- ext/sender/RubySourceSupport.h
|
87
|
+
- ext/sender/extconf.rb
|
88
|
+
- ext/sender/main.c
|
89
|
+
- ext/sender/rb_Global.c
|
90
|
+
- ext/sender/rb_Global.h
|
91
|
+
- ext/sender/rb_Global_internal.h
|
92
|
+
- lib/sender.rb
|
93
|
+
- lib/sender/sender.bundle
|
94
|
+
- mkmf.log
|
95
|
+
- test/test_sender.rb
|
96
|
+
has_rdoc: true
|
97
|
+
homepage: http://rubygems.org/gems/sender
|
98
|
+
licenses: []
|
99
|
+
|
100
|
+
post_install_message:
|
101
|
+
rdoc_options:
|
102
|
+
- --main
|
103
|
+
- README.rdoc
|
104
|
+
require_paths:
|
105
|
+
- lib
|
106
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
108
|
+
requirements:
|
109
|
+
- - ">="
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
hash: 3
|
112
|
+
segments:
|
113
|
+
- 0
|
114
|
+
version: "0"
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
117
|
+
requirements:
|
118
|
+
- - ">="
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
hash: 3
|
121
|
+
segments:
|
122
|
+
- 0
|
123
|
+
version: "0"
|
124
|
+
requirements: []
|
125
|
+
|
126
|
+
rubyforge_project: asher
|
127
|
+
rubygems_version: 1.3.7
|
128
|
+
signing_key:
|
129
|
+
specification_version: 3
|
130
|
+
summary: Adds __sender__ and __caller__ to the built-in __callee__ and __method__ functions.
|
131
|
+
test_files:
|
132
|
+
- test/test_sender.rb
|