better test for attr

still #25
This commit is contained in:
Torsten Ruger
2019-03-07 10:47:48 +02:00
parent 04720d4950
commit 5ed6a07083
8 changed files with 118 additions and 52 deletions

View File

@ -42,8 +42,12 @@ module Ruby
unless class_send.name == :attr
raise "Only remapping attr and cattr, not #{class_send.name}"
end
attr = class_send.arguments.first.value
[ getter_for(attr) , setter_for(attr) ]
methods = []
class_send.arguments.each do |attr|
methods << getter_for(attr.value)
methods << setter_for(attr.value)
end
methods
end
# creates a getter method for the given instance name (sym)

View File

@ -99,13 +99,14 @@ module RubyX
parfait = ["object"]
parfait.each do |file|
path = File.expand_path("../../parfait/#{file}.rb",__FILE__)
puts "Loading #{path}"
ruby_to_vool(File.read(path))
end
end
def self.ruby_to_binary( ruby , options)
compiler = RubyXCompiler.new(options)
# compiler.load_parfait
compiler.load_parfait if options[:load_parfait]
compiler.ruby_to_vool(ruby)
platform = options[:platform]
raise "No platform given" unless platform