Sha256: 19ddec449122885f1d19ccce5571ca53a982fe3ba67bb245459a5108b6806476

Contents?: true

Size: 702 Bytes

Versions: 11

Compression:

Stored size: 702 Bytes

Contents

#ifndef CLASSPATH_H
#define CLASSPATH_H

#include "ruby.h"

#ruby <<END
$: << '../..'
require 'ruby_source_dir'

defn = nil
marshal_c_location = "#{RUBY_SOURCE_DIR}/marshal.c"
File.open(marshal_c_location) do |marshal_c|
  write = false
  while (line = marshal_c.gets) != nil do
    case line
    when /^(path2class|path2module|class2path)/
      record_defn = true
      defn = []
    when /^\{/
      if record_defn then
        record_defn = false
        puts "VALUE #{defn[0].sub(/\(.*/, '')}("
        vars = defn[1..-1].map { |d| d.sub(/;.*/, '') }
        puts vars.join(",\n")
        puts ");"
      end
    end
    if record_defn then
      defn << line.chomp
    end
  end
end
END

#endif

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ruby-internal-0.8.5 ext/internal/module/classpath.h.rpp
ruby-internal-0.8.4 ext/internal/module/classpath.h.rpp
ruby-internal-0.8.3 ext/internal/module/classpath.h.rpp
ruby-internal-0.8.2 ext/internal/module/classpath.h.rpp
ruby-internal-0.8.1 ext/internal/module/classpath.h.rpp
ruby-internal-0.8.0 ext/internal/module/classpath.h.rpp
ruby-internal-0.7.3 ext/internal/module/classpath.h.rpp
ruby-internal-0.7.2 ext/internal/module/classpath.h.rpp
ruby-internal-0.7.1 ext/internal/module/classpath.h.rpp
ruby-internal-0.7.0 ext/internal/module/classpath.h.rpp
ruby-internal-0.6.0 ext/internal/module/classpath.h.rpp