Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dd58439e3374
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 59f39cae4b35
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Sep 6, 2016

  1. Copy the full SHA
    974a9f4 View commit details
  2. Copy the full SHA
    59f39ca View commit details
Showing with 3 additions and 11 deletions.
  1. +3 −11 truffle/src/main/ruby/core/truffle/cext.rb
14 changes: 3 additions & 11 deletions truffle/src/main/ruby/core/truffle/cext.rb
Original file line number Diff line number Diff line change
@@ -337,8 +337,7 @@ def rb_class_real(ruby_class)
end

def rb_path2class(path)
# More than a bit of a hack
eval(path)
Object.const_get(path)
end

def rb_proc_new(function, value)
@@ -458,22 +457,15 @@ def rb_attr(ruby_class, name, read, write, ex)
end

if read
ruby_class.send :define_method, name do
instance_variable_get(name)
end

ruby_class.send :attr_reader, name
ruby_class.send :private, name if private
ruby_class.send :protected, name if protected
ruby_class.send :module_function, name if module_function
end

if write
ruby_class.send :attr_writer, name
setter_name = :"#{name}="

ruby_class.send :define_method, setter_name do |value|
instance_variable_set(name, value)
end

ruby_class.send :private, setter_name if private
ruby_class.send :protected, setter_name if protected
ruby_class.send :module_function, setter_name if module_function