[macruby-changes] [2286] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Tue Aug 11 13:54:29 PDT 2009


Revision: 2286
          http://trac.macosforge.org/projects/ruby/changeset/2286
Author:   eloy.de.enige at gmail.com
Date:     2009-08-11 13:54:29 -0700 (Tue, 11 Aug 2009)
Log Message:
-----------
Added workarounds to be able to run the specs from the source root including the extension. Digest needed some extra workarounds, as the directory structure of it is different in the source than when it's installed.

Modified Paths:
--------------
    MacRuby/trunk/rakelib/spec.rake
    MacRuby/trunk/spec/macruby.mspec

Added Paths:
-----------
    MacRuby/trunk/ext/digest/md5.rb
    MacRuby/trunk/ext/digest/sha1.rb
    MacRuby/trunk/ext/digest/sha2.rb

Added: MacRuby/trunk/ext/digest/md5.rb
===================================================================
--- MacRuby/trunk/ext/digest/md5.rb	                        (rev 0)
+++ MacRuby/trunk/ext/digest/md5.rb	2009-08-11 20:54:29 UTC (rev 2286)
@@ -0,0 +1,3 @@
+# MacRuby TODO: This file is a workaround to the load path not adding up with
+# the layout of the ext files in the source root.
+require File.dirname(__FILE__) + '/md5/md5'
\ No newline at end of file

Added: MacRuby/trunk/ext/digest/sha1.rb
===================================================================
--- MacRuby/trunk/ext/digest/sha1.rb	                        (rev 0)
+++ MacRuby/trunk/ext/digest/sha1.rb	2009-08-11 20:54:29 UTC (rev 2286)
@@ -0,0 +1,3 @@
+# MacRuby TODO: This file is a workaround to the load path not adding up with
+# the layout of the ext files in the source root.
+require File.dirname(__FILE__) + '/sha1/sha1'
\ No newline at end of file

Added: MacRuby/trunk/ext/digest/sha2.rb
===================================================================
--- MacRuby/trunk/ext/digest/sha2.rb	                        (rev 0)
+++ MacRuby/trunk/ext/digest/sha2.rb	2009-08-11 20:54:29 UTC (rev 2286)
@@ -0,0 +1,3 @@
+# MacRuby TODO: This file is a workaround to the load path not adding up with
+# the layout of the ext files in the source root.
+require File.dirname(__FILE__) + '/sha2/sha2'
\ No newline at end of file

Modified: MacRuby/trunk/rakelib/spec.rake
===================================================================
--- MacRuby/trunk/rakelib/spec.rake	2009-08-11 20:31:30 UTC (rev 2285)
+++ MacRuby/trunk/rakelib/spec.rake	2009-08-11 20:54:29 UTC (rev 2286)
@@ -1,6 +1,6 @@
 namespace :spec do
   MACRUBY_MSPEC = "./spec/macruby.mspec"
-  DEFAULT_OPTIONS = "-I./lib -B #{MACRUBY_MSPEC}"
+  DEFAULT_OPTIONS = "-B #{MACRUBY_MSPEC}"
   
   def mspec(type, options)
     old_path = ENV['DYLD_LIBRARY_PATH']

Modified: MacRuby/trunk/spec/macruby.mspec
===================================================================
--- MacRuby/trunk/spec/macruby.mspec	2009-08-11 20:31:30 UTC (rev 2285)
+++ MacRuby/trunk/spec/macruby.mspec	2009-08-11 20:54:29 UTC (rev 2286)
@@ -64,8 +64,19 @@
   # A list of _all_ optional library specs
   set :optional, [get(:ffi)]
   
+  # All setup needed to run the specs from the macruby source root.
+  #
+  #
+  # Make the macruby binary look for the framework in the source root
+  source_root = File.expand_path('../../', __FILE__)
+  ENV['DYLD_LIBRARY_PATH'] = source_root
+  # Setup the proper load paths for lib and extensions
+  load_paths = %w{ -I./lib -I./ext }
+  load_paths.concat Dir.glob('./ext/**/*.bundle').map { |filename| "-I#{File.dirname(filename)}" }.uniq
+  load_paths.concat(get(:flags)) if get(:flags)
+  set :flags, load_paths
   # The default implementation to run the specs.
-  set :target, File.expand_path('../../macruby', __FILE__)
+  set :target, File.join(source_root, 'macruby')
   
   set :tags_patterns, [
                         [%r(language/), 'tags/macruby/language/'],
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090811/647199b6/attachment.html>


More information about the macruby-changes mailing list