Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

This commit was manufactured by cvs2svn to create branch 'ruby_1_8'.

git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 1fc7f84ed05d1a457040d9be92e753ceb6cc66ce 1 parent 74e708f
(no author) authored
Showing with 66 additions and 0 deletions.
  1. +57 −0 runruby.rb
  2. +9 −0 test/rss/test_version.rb
57 runruby.rb
View
@@ -0,0 +1,57 @@
+#!./miniruby
+
+while arg = ARGV[0]
+ break ARGV.shift if arg == '--'
+ /\A--([-\w]+)(?:=(.*))?\z/ =~ arg or break
+ arg, value = $1, $2
+ re = Regexp.new('\A'+arg.gsub(/\w+\b/, '\&\\w*')+'\z', "i")
+ case
+ when re =~ "srcdir"
+ srcdir = value
+ when re =~ "archdir"
+ archdir = value
+ when re =~ "extout"
+ extout = value
+ else
+ break
+ end
+ ARGV.shift
+end
+
+require 'rbconfig'
+config = Config::CONFIG
+
+srcdir ||= File.dirname(__FILE__)
+archdir ||= '.'
+
+ruby = File.join(archdir, config["RUBY_INSTALL_NAME"]+config['EXEEXT'])
+unless File.exist?(ruby)
+ abort "#{ruby} is not found.\nTry `make' first, then `make test', please.\n"
+end
+
+abs_archdir = File.expand_path(archdir)
+libs = [abs_archdir, File.expand_path("lib", srcdir)]
+if extout
+ abs_extout = File.expand_path(extout)
+ libs << abs_extout << File.expand_path(RUBY_PLATFORM, abs_extout)
+end
+config["bindir"] = abs_archdir
+ENV["RUBY"] = File.expand_path(ruby)
+ENV["PATH"] = [abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR)
+
+if e = ENV["RUBYLIB"]
+ libs |= e.split(File::PATH_SEPARATOR)
+end
+ENV["RUBYLIB"] = $:.replace(libs).join(File::PATH_SEPARATOR)
+
+libruby_so = File.join(abs_archdir, config['LIBRUBY_SO'])
+if File.file?(libruby_so)
+ if e = config['LIBPATHENV'] and !e.empty?
+ ENV[e] = [abs_archdir, ENV[e]].compact.join(File::PATH_SEPARATOR)
+ end
+ if /linux/ =~ RUBY_PLATFORM
+ ENV["LD_PRELOAD"] = [libruby_so, ENV["LD_PRELOAD"]].compact.join(' ')
+ end
+end
+
+exec ruby, *ARGV
9 test/rss/test_version.rb
View
@@ -0,0 +1,9 @@
+require "rss-testcase"
+
+module RSS
+ class TestVersion < TestCase
+ def test_version
+ assert_equal("0.1.2", ::RSS::VERSION)
+ end
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.