Hi.

I think about a configuration file for my utility.

I think that reusing Ruby as parser is less error-prone than writing custom
file parser. It will evaluated the file as a ruby script in a sandbox and
then I inspect it to get values of user variables and/or functions.

How to do this?
I'm exprimenting with Kernel#binding and Kernel#eval but 
still not satisfied.


class BinderUT < RUNIT::TestCase

	attr_writer :title

	def setup
		@title = 'xx'
	end

	def title(x) @title = x end
	def nobanner() puts "no__banner" end
	def nobanner=(v) puts "set__banner" end

	def test_me
		b = binding()
		eval "title 'ii'", b
		eval "nobanner", b
		eval "banner=2", b
		p b.instance_variables
	end
end

After running test_me:
BinderUT#test_me xx
no__banner
[]
ii

@title is set to 'ii', BinderUT#nobanner is called,
but banner=2 seems to have no effect.

How do I inspect this sandbox?

-- 
You are in a maze of little twisting passages, all different.