Permalink
Browse files

rename from real_include to include_complete, version reset to 0.1.0,…

… and all tests passing
  • Loading branch information...
1 parent 415d9c0 commit 2a30808e561459b6a053d428a0216dd94916ffd2 @banister committed Nov 1, 2010
View
@@ -1,3 +1,5 @@
+1/11/2010 *NAME CHANGE* TO include_complete, version reset to 0.1.0
+* now called include_complete
22/10/2010 version 0.2.2
* refactored compat.h, incorporated test for 1.9
* created inline static function create_class() in compat.h
View
@@ -1,5 +1,5 @@
-Real Include
---------------
+Include Complete
+----------------
(c) John Mair (banisterfiend)
MIT license
@@ -12,7 +12,7 @@ included() hook hacks.
at own risk **
install the gem: **for testing purposes only**
-`gem install real_include`
+`gem install include_complete`
example:
@@ -29,7 +29,7 @@ example:
end
class A
- real_include M
+ include_complete M
end
# invoke class method
View
@@ -5,15 +5,15 @@ dlext = Config::CONFIG['DLEXT']
require 'rake/clean'
require 'rake/gempackagetask'
-require './lib/real_include/version'
+require './lib/include_complete/version'
CLEAN.include("ext/**/*.#{dlext}", "ext/**/*.log", "ext/**/*.o", "ext/**/*~", "ext/**/*#*", "ext/**/*.obj", "ext/**/*.def", "ext/**/*.pdb")
CLOBBER.include("**/*.#{dlext}", "**/*~", "**/*#*", "**/*.log", "**/*.o")
def apply_spec_defaults(s)
- s.name = "real_include"
+ s.name = "include_complete"
s.summary = "Fixing the limitations in traditional Module#include"
- s.version = RealInclude::VERSION
+ s.version = IncludeComplete::VERSION
s.date = Time.now.strftime '%Y-%m-%d'
s.author = "John Mair (banisterfiend)"
s.email = 'jrmair@gmail.com'
@@ -49,7 +49,7 @@ namespace :ruby do
spec = Gem::Specification.new do |s|
apply_spec_defaults(s)
s.platform = Gem::Platform::RUBY
- s.extensions = ["ext/real_include/extconf.rb"]
+ s.extensions = ["ext/include_complete/extconf.rb"]
end
Rake::GemPackageTask.new(spec) do |pkg|
@@ -0,0 +1,189 @@
+
+SHELL = /bin/sh
+
+#### Start of system configuration section. ####
+
+srcdir = .
+topdir = /C/ruby192/include/ruby-1.9.1
+hdrdir = /C/ruby192/include/ruby-1.9.1
+arch_hdrdir = C:/ruby192/include/ruby-1.9.1/$(arch)
+VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
+
+DESTDIR = C:
+prefix = $(DESTDIR)/ruby192
+rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
+exec_prefix = $(prefix)
+vendorhdrdir = $(rubyhdrdir)/vendor_ruby
+sitehdrdir = $(rubyhdrdir)/site_ruby
+rubyhdrdir = $(includedir)/$(RUBY_BASE_NAME)-$(ruby_version)
+vendordir = $(rubylibprefix)/vendor_ruby
+sitedir = $(rubylibprefix)/site_ruby
+ridir = $(datarootdir)/$(RI_BASE_NAME)
+mandir = $(datarootdir)/man
+localedir = $(datarootdir)/locale
+libdir = $(exec_prefix)/lib
+psdir = $(docdir)
+pdfdir = $(docdir)
+dvidir = $(docdir)
+htmldir = $(docdir)
+infodir = $(datarootdir)/info
+docdir = $(datarootdir)/doc/$(PACKAGE)
+oldincludedir = $(DESTDIR)/usr/include
+includedir = $(prefix)/include
+localstatedir = $(prefix)/var
+sharedstatedir = $(prefix)/com
+sysconfdir = $(prefix)/etc
+datadir = $(datarootdir)
+datarootdir = $(prefix)/share
+libexecdir = $(exec_prefix)/libexec
+sbindir = $(exec_prefix)/sbin
+bindir = $(exec_prefix)/bin
+rubylibdir = $(rubylibprefix)/$(ruby_version)
+archdir = $(rubylibdir)/$(arch)
+sitelibdir = $(sitedir)/$(ruby_version)
+sitearchdir = $(sitelibdir)/$(sitearch)
+vendorlibdir = $(vendordir)/$(ruby_version)
+vendorarchdir = $(vendorlibdir)/$(sitearch)
+
+CC = gcc
+CXX = g++
+LIBRUBY = lib$(RUBY_SO_NAME).dll.a
+LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
+LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
+LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
+OUTFLAG = -o
+COUTFLAG = -o
+
+RUBY_EXTCONF_H =
+cflags = $(optflags) $(debugflags) $(warnflags)
+optflags = -O3
+debugflags = -g
+warnflags = -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long
+CFLAGS = $(cflags) -std=c99
+INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
+DEFS =
+CPPFLAGS = $(DEFS) $(cppflags)
+CXXFLAGS = $(CFLAGS) $(cxxflags)
+ldflags = -L.
+dldflags = -Wl,--enable-auto-image-base,--enable-auto-import $(DEFFILE)
+ARCH_FLAG =
+DLDFLAGS = $(ldflags) $(dldflags)
+LDSHARED = $(CC) -shared $(if $(filter-out -g -g0,$(debugflags)),,-s)
+LDSHAREDXX = $(CXX) -shared $(if $(filter-out -g -g0,$(debugflags)),,-s)
+AR = ar
+EXEEXT = .exe
+
+RUBY_BASE_NAME = ruby
+RUBY_INSTALL_NAME = ruby
+RUBY_SO_NAME = msvcrt-ruby191
+arch = i386-mingw32
+sitearch = i386-msvcrt
+ruby_version = 1.9.1
+ruby = C:/ruby192/bin/ruby
+RUBY = $(ruby)
+RM = rm -f
+RM_RF = $(RUBY) -run -e rm -- -rf
+RMDIRS = $(RUBY) -run -e rmdir -- -p
+MAKEDIRS = /usr/bin/mkdir -p
+INSTALL = /usr/bin/install -c
+INSTALL_PROG = $(INSTALL) -m 0755
+INSTALL_DATA = $(INSTALL) -m 644
+COPY = cp
+
+#### End of system configuration section. ####
+
+preload =
+
+libpath = . $(libdir)
+LIBPATH = -L. -L$(libdir)
+DEFFILE = $(TARGET)-$(arch).def
+
+CLEANFILES = mkmf.log $(DEFFILE)
+DISTCLEANFILES =
+DISTCLEANDIRS =
+
+extout =
+extout_prefix =
+target_prefix =
+LOCAL_LIBS =
+LIBS = $(LIBRUBYARG_SHARED) -lshell32 -lws2_32
+SRCS = include_complete.c include_complete_one.c patched_include.c
+OBJS = include_complete.o include_complete_one.o patched_include.o
+TARGET = include_complete
+DLLIB = $(TARGET).so
+EXTSTATIC =
+STATIC_LIB =
+
+BINDIR = $(bindir)
+RUBYCOMMONDIR = $(sitedir)$(target_prefix)
+RUBYLIBDIR = $(sitelibdir)$(target_prefix)
+RUBYARCHDIR = $(sitearchdir)$(target_prefix)
+HDRDIR = $(rubyhdrdir)/ruby$(target_prefix)
+ARCHHDRDIR = $(rubyhdrdir)/$(arch)/ruby$(target_prefix)
+
+TARGET_SO = $(DLLIB)
+CLEANLIBS = $(TARGET).so
+CLEANOBJS = *.o *.bak
+
+all: $(DLLIB)
+static: $(STATIC_LIB)
+.PHONY: all install static install-so install-rb
+.PHONY: clean clean-so clean-rb
+
+clean-rb-default::
+clean-rb::
+clean-so::
+clean: clean-so clean-rb-default clean-rb
+ @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
+
+distclean-rb-default::
+distclean-rb::
+distclean-so::
+distclean: clean distclean-so distclean-rb-default distclean-rb
+ @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
+ @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
+ @-$(RMDIRS) $(DISTCLEANDIRS)
+
+realclean: distclean
+install: install-so install-rb
+
+install-so: $(RUBYARCHDIR)
+install-so: $(RUBYARCHDIR)/$(DLLIB)
+$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
+ @-$(MAKEDIRS) $(@D)
+ $(INSTALL_PROG) $(DLLIB) $(@D)
+install-rb: pre-install-rb install-rb-default
+install-rb-default: pre-install-rb-default
+pre-install-rb: Makefile
+pre-install-rb-default: Makefile
+$(RUBYARCHDIR):
+ $(MAKEDIRS) $@
+
+site-install: site-install-so site-install-rb
+site-install-so: install-so
+site-install-rb: install-rb
+
+.SUFFIXES: .c .m .cc .cxx .cpp .o
+
+.cc.o:
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
+
+.cxx.o:
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
+
+.cpp.o:
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
+
+.c.o:
+ $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
+
+$(DLLIB): $(DEFFILE) $(OBJS) Makefile
+ @-$(RM) $(@)
+ $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
+
+
+
+$(DEFFILE):
+ $(RUBY) -e "puts 'EXPORTS', 'Init_$(TARGET)'" > $@
+
+$(OBJS): $(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h $(arch_hdrdir)/ruby/config.h
File renamed without changes.
@@ -3,4 +3,4 @@
# let's use c99
$CFLAGS += " -std=c99"
-create_makefile('real_include')
+create_makefile('include_complete')
@@ -0,0 +1,2 @@
+EXPORTS
+Init_include_complete
@@ -1,11 +1,11 @@
/* (c) 2010 John Mair (banisterfiend), MIT license */
void Init_patched_include(void);
-void Init_real_include_one(void);
+void Init_include_complete_one(void);
void
-Init_real_include()
+Init_include_complete()
{
- Init_real_include_one();
+ Init_include_complete_one();
Init_patched_include();
}
@@ -1,7 +1,7 @@
/* (c) 2010 John Mair (banisterfiend), MIT license */
/* */
/* include a module (and its singleton) into an inheritance chain */
-/* only includes a single module, see real_include.rb for multi-module version */
+/* only includes a single module, see include_complete.rb for multi-module version */
#include <ruby.h>
#include "compat.h"
@@ -27,7 +27,7 @@ include_class_new(VALUE module, VALUE super)
if (TYPE(module) == T_ICLASS) {
- /* real_include */
+ /* include_complete */
if (!NIL_P(rb_iv_get(module, "__module__")))
module = rb_iv_get(module, "__module__");
@@ -82,7 +82,7 @@ include_class_new(VALUE module, VALUE super)
}
static VALUE
-rb_real_include_module_one(VALUE klass, VALUE module)
+rb_include_complete_module_one(VALUE klass, VALUE module)
{
VALUE p, c;
int changed = 0;
@@ -146,6 +146,6 @@ rb_real_include_module_one(VALUE klass, VALUE module)
}
void
-Init_real_include_one() {
- rb_define_method(rb_cModule, "real_include_one", rb_real_include_module_one, 1);
+Init_include_complete_one() {
+ rb_define_method(rb_cModule, "include_complete_one", rb_include_complete_module_one, 1);
}
@@ -4,24 +4,24 @@
begin
if RUBY_VERSION && RUBY_VERSION =~ /1.9/
- require "#{direc}/1.9/real_include"
+ require "#{direc}/1.9/include_complete"
else
- require "#{direc}/1.8/real_include"
+ require "#{direc}/1.8/include_complete"
end
rescue LoadError => e
require 'rbconfig'
dlext = Config::CONFIG['DLEXT']
- require "#{direc}/real_include.#{dlext}"
+ require "#{direc}/include_complete.#{dlext}"
end
-require "#{direc}/real_include/version"
+require "#{direc}/include_complete/version"
class Module
# include modules (and their singletons) into an
# inheritance chain
- # @param [Module] mods Modules to real_include
+ # @param [Module] mods Modules to include_complete
# @return Returns the receiver
# @example
# module M
@@ -30,12 +30,12 @@ class Module
# end
# end
# class C
- # real_include M
+ # include_complete M
# end
# C.hello #=> "hello"
- def real_include(*mods)
+ def include_complete(*mods)
mods.each do |mod|
- real_include_one mod
+ include_complete_one mod
end
self
end
@@ -45,7 +45,7 @@ class Object
# extend modules (and their singletons) into an
# inheritance chain
- # @param [Module] mods Modules to real_extend
+ # @param [Module] mods Modules to extend_complete
# @return Returns the receiver
# @example
# module M
@@ -54,9 +54,9 @@ class Object
# end
# end
# o = Object.new
- # o.real_extend M
+ # o.extend_complete M
# o.singleton_class.hello #=> "hello"
- def real_extend(*mods)
- class << self; self; end.send(:real_include, *mods)
+ def extend_complete(*mods)
+ class << self; self; end.send(:include_complete, *mods)
end
end
@@ -0,0 +1,3 @@
+module IncludeComplete
+ VERSION = "0.1.0"
+end
@@ -1,3 +0,0 @@
-module RealInclude
- VERSION = "0.2.2"
-end
Oops, something went wrong.

0 comments on commit 2a30808

Please sign in to comment.