Permalink
Browse files

Merged in files from latest gem

  • Loading branch information...
1 parent 6015f2c commit 6dbd5e7217f8682af220e76d9ebbbc9d8d371fa5 James Sanderson committed May 16, 2012
Showing with 692 additions and 15 deletions.
  1. +20 −0 LICENSE
  2. +18 −0 README.rdoc
  3. +52 −12 Rakefile
  4. +1 −0 VERSION
  5. +213 −0 ext/tcl_ruby/Makefile
  6. +8 −0 ext/tcl_ruby/extconf.rb
  7. +46 −0 ext/tcl_ruby/gem_make.out
  8. +23 −0 ext/tcl_ruby/mkmf.log
  9. +225 −0 ext/tcl_ruby/tcl_ruby.c
  10. +1 −3 lib/tcl.rb
  11. +70 −0 tcl.gemspec
  12. +6 −0 test/fictures
  13. +9 −0 test/helper.rb
View
20 LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2009 Sam Stephenson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -0,0 +1,18 @@
+= tcl
+
+A minimal Ruby interface to libtcl.
+The library is written by Sam Stephenson. Aslak Hellesøy forked it to gemify it.
+
+== Note on Patches/Pull Requests
+
+* Fork the project.
+* Make your feature addition or bug fix.
+* Add tests for it. This is important so I don't break it in a
+ future version unintentionally.
+* Commit, do not mess with rakefile, version, or history.
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
+* Send me a pull request. Bonus points for topic branches.
+
+== Copyright
+
+Copyright (c) 2009 Sam Stephenson. See LICENSE for details.
View
@@ -1,18 +1,58 @@
-require "rake/testtask"
-require "rcov/rcovtask"
+require 'rubygems'
+require 'rake'
-task :default => "test"
-task :test => "test:units"
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "tcl"
+ gem.summary = %Q{Tcl bindings for Ruby}
+ gem.description = %Q{A minimal Ruby interface to libtcl}
+ gem.email = "sstephenson@gmail.com"
+ gem.homepage = "http://github.com/sstephenson/ruby-tcl"
+ gem.authors = ["Sam Stephenson"]
-namespace :test do
- Rake::TestTask.new(:units) do |t|
- t.test_files = FileList["test/**/*_test.rb"]
- t.verbose = true
+ gem.extensions = FileList['ext/tcl_ruby/extconf.rb']
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
+end
+
+require 'rake/testtask'
+Rake::TestTask.new(:test) do |test|
+ test.libs << 'lib' << 'test'
+ test.pattern = 'test/*.rb'
+ test.verbose = true
+end
- Rcov::RcovTask.new(:coverage) do |t|
- t.test_files = FileList["test/**/*_test.rb"]
- t.verbose = true
- t.rcov_opts << "-x 'rcov\.rb$'"
+begin
+ require 'rcov/rcovtask'
+ Rcov::RcovTask.new do |test|
+ test.libs << 'test'
+ test.pattern = 'test/*.rb'
+ test.verbose = true
end
+rescue LoadError
+ task :rcov do
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
+ end
+end
+
+task :test => [:check_dependencies, :compile]
+
+task :default => :test
+
+require 'rake/rdoctask'
+Rake::RDocTask.new do |rdoc|
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
+
+ rdoc.rdoc_dir = 'rdoc'
+ rdoc.title = "tcl #{version}"
+ rdoc.rdoc_files.include('README*')
+ rdoc.rdoc_files.include('lib/**/*.rb')
end
+
+require 'rake/extensiontask'
+Rake::ExtensionTask.new("tcl_ruby")
+CLEAN.include ['**/*.{o,bundle,jar,so,obj,pdb,lib,def,exp,log}']
View
@@ -0,0 +1 @@
+0.0.1
View
@@ -0,0 +1,213 @@
+
+SHELL = /bin/sh
+
+# V=0 quiet, V=1 verbose. other values don't work.
+V = 0
+Q1 = $(V:1=)
+Q = $(Q1:0=@)
+n=$(NULLCMD)
+ECHO1 = $(V:1=@$n)
+ECHO = $(ECHO1:0=@echo)
+
+#### Start of system configuration section. ####
+
+srcdir = .
+topdir = /home/jsanderson/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1
+hdrdir = /home/jsanderson/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1
+arch_hdrdir = /home/jsanderson/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/$(arch)
+VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
+prefix = $(DESTDIR)/home/jsanderson/.rvm/rubies/ruby-1.9.3-p194
+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)
+
+NULLCMD = :
+
+CC = gcc
+CXX = g++
+LIBRUBY = $(LIBRUBY_SO)
+LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
+LIBRUBYARG_SHARED = -Wl,-R -Wl,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)
+LIBRUBYARG_STATIC = -Wl,-R -Wl,$(libdir) -L$(libdir) -l$(RUBY_SO_NAME)-static
+OUTFLAG = -o
+COUTFLAG = -o
+
+RUBY_EXTCONF_H =
+cflags = $(optflags) $(debugflags) $(warnflags)
+optflags = -O3
+debugflags = -ggdb
+warnflags = -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration
+CFLAGS = -fPIC $(cflags) -fPIC $(ARCH_FLAG)
+INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
+DEFS =
+CPPFLAGS = -I/home/jsanderson/.rvm/usr/include $(DEFS) $(cppflags)
+CXXFLAGS = $(CFLAGS) $(cxxflags)
+ldflags = -L. -rdynamic -Wl,-export-dynamic
+dldflags =
+ARCH_FLAG =
+DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
+LDSHARED = $(CC) -shared
+LDSHAREDXX = $(CXX) -shared
+AR = ar
+EXEEXT =
+
+RUBY_BASE_NAME = ruby
+RUBY_INSTALL_NAME = ruby
+RUBY_SO_NAME = ruby
+arch = x86_64-linux
+sitearch = $(arch)
+ruby_version = 1.9.1
+ruby = /home/jsanderson/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
+RUBY = $(ruby)
+RM = rm -f
+RM_RF = $(RUBY) -run -e rm -- -rf
+RMDIRS = rmdir --ignore-fail-on-non-empty -p
+MAKEDIRS = /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) /home/jsanderson/.rvm/usr/lib
+LIBPATH = -L. -L$(libdir) -Wl,-R$(libdir) -L/home/jsanderson/.rvm/usr/lib -Wl,-R/home/jsanderson/.rvm/usr/lib
+DEFFILE =
+
+CLEANFILES = mkmf.log
+DISTCLEANFILES =
+DISTCLEANDIRS =
+
+extout =
+extout_prefix =
+target_prefix =
+LOCAL_LIBS =
+LIBS = $(LIBRUBYARG_SHARED) -ltcl8.5 -lpthread -lrt -ldl -lcrypt -lm -lc
+SRCS = tcl_ruby.c
+OBJS = tcl_ruby.o
+TARGET = tcl_ruby
+DLLIB = $(TARGET).so
+EXTSTATIC =
+STATIC_LIB =
+
+BINDIR = $(bindir)
+RUBYCOMMONDIR = $(sitedir)$(target_prefix)
+RUBYLIBDIR = /home/jsanderson/.rvm/gems/ruby-1.9.3-p194/gems/tcl-0.0.1/lib$(target_prefix)
+RUBYARCHDIR = /home/jsanderson/.rvm/gems/ruby-1.9.3-p194/gems/tcl-0.0.1/lib$(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) 2> /dev/null || true
+
+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
+pre-install-rb-default:
+ $(ECHO) installing default tcl_ruby libraries
+$(RUBYARCHDIR):
+ $(Q) $(MAKEDIRS) $@
+
+site-install: site-install-so site-install-rb
+site-install-so: install-so
+site-install-rb: install-rb
+
+.SUFFIXES: .c .m .cc .mm .cxx .cpp .C .o
+
+.cc.o:
+ $(ECHO) compiling $(<)
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
+
+.mm.o:
+ $(ECHO) compiling $(<)
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
+
+.cxx.o:
+ $(ECHO) compiling $(<)
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
+
+.cpp.o:
+ $(ECHO) compiling $(<)
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
+
+.C.o:
+ $(ECHO) compiling $(<)
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $<
+
+.c.o:
+ $(ECHO) compiling $(<)
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
+
+.m.o:
+ $(ECHO) compiling $(<)
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $<
+
+$(DLLIB): $(OBJS) Makefile
+ $(ECHO) linking shared-object $(DLLIB)
+ @-$(RM) $(@)
+ $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
+
+
+
+$(OBJS): $(hdrdir)/ruby.h $(hdrdir)/ruby/defines.h $(arch_hdrdir)/ruby/config.h
View
@@ -0,0 +1,8 @@
+require "mkmf"
+
+# To build against Tcl 8.5 on OS X Intel:
+# RC_ARCHS=i386 ruby extconf.rb --with-tcl-dir=/path/to/tcl8.5
+
+dir_config("tcl")
+have_library("tcl") unless have_library("tcl8.5")
+create_makefile("tcl_ruby")
View
@@ -0,0 +1,46 @@
+/home/jsanderson/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
+checking for main() in -ltcl8.5... yes
+creating Makefile
+
+make
+compiling tcl_ruby.c
+tcl_ruby.c: In function ‘rb_tcl_interp_send_begin’:
+tcl_ruby.c:23: error: ‘struct RArray’ has no member named ‘len’
+tcl_ruby.c:23: error: ‘struct RArray’ has no member named ‘ptr’
+tcl_ruby.c:28: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:28: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:28: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:28: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:28: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:28: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:28: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:28: warning: ISO C90 forbids mixed declarations and code
+tcl_ruby.c: In function ‘rb_tcl_interp_send_rescue’:
+tcl_ruby.c:39: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:39: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:39: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:39: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:39: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:39: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:39: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:39: warning: ISO C90 forbids mixed declarations and code
+tcl_ruby.c: In function ‘rb_tcl_interp_send’:
+tcl_ruby.c:61: warning: ISO C90 forbids mixed declarations and code
+tcl_ruby.c: In function ‘rb_tcl_interp_eval’:
+tcl_ruby.c:100: error: ‘struct RArray’ has no member named ‘len’
+tcl_ruby.c:107: warning: ISO C90 forbids mixed declarations and code
+tcl_ruby.c:122: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:122: warning: ISO C90 forbids mixed declarations and code
+tcl_ruby.c: In function ‘rb_tcl_interp_list_to_array’:
+tcl_ruby.c:153: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:153: warning: ISO C90 forbids mixed declarations and code
+tcl_ruby.c:156: warning: ISO C90 forbids mixed declarations and code
+tcl_ruby.c:167: warning: ISO C90 forbids mixed declarations and code
+tcl_ruby.c: In function ‘rb_tcl_interp_array_to_list’:
+tcl_ruby.c:187: error: ‘struct RArray’ has no member named ‘len’
+tcl_ruby.c:187: warning: ISO C90 forbids mixed declarations and code
+tcl_ruby.c:194: error: ‘struct RString’ has no member named ‘ptr’
+tcl_ruby.c:201: warning: ISO C90 forbids mixed declarations and code
+tcl_ruby.c: In function ‘Init_tcl_ruby’:
+tcl_ruby.c:220: warning: ISO C90 forbids mixed declarations and code
+make: *** [tcl_ruby.o] Error 1
Oops, something went wrong.

0 comments on commit 6dbd5e7

Please sign in to comment.