mine was on windows with ruby 1.9.1 though.. I don't have a 1.8 around to
see if that same test works with 1.8 on windows. In 1.9.1 the tweaked stuff
works too

+ C:\dev
» irb
irb(main):001:0> require 'erb'
=> true
irb(main):002:0> require 'ostruct'
=> true
irb(main):003:0>
irb(main):004:0* class OpenStruct
irb(main):005:1>   def get_our_own_binding
irb(main):006:2>     binding
irb(main):007:2>   end
irb(main):008:1> end
=> nil
irb(main):009:0>
irb(main):010:0* class Templator
irb(main):011:1>   def self.render(template,values)
irb(main):012:2>     template = ERB.new(template)
irb(main):013:2>     context = OpenStruct.new(values)
irb(main):014:2>     template.result(context.get_our_own_binding)
irb(main):015:2>   end
irb(main):016:1> end
=> nil
irb(main):017:0>
irb(main):018:0* template = <<-EOF
irb(main):019:0"   The value of x is: <%= version %>
irb(main):020:0" EOF
=> "  The value of x is: <%= version %>\n"
irb(main):021:0>
irb(main):022:0* puts Templator.render(template, { :version => RUBY_PLATFORM
})
  The value of x is: i386-mingw32
---
Met vriendelijke groeten - Best regards - Salutations
Ivan Porto Carrero
Blog: http://flanders.co.nz
Twitter: http://twitter.com/casualjim
Author of IronRuby in Action (http://manning.com/carrero)



On Sat, Jan 30, 2010 at 2:41 PM, Thibaut Barrère
<thibaut.barr...@gmail.com>wrote:

> Hey Ivan,
>
> thanks for your answer.
>
> I redid the test on:
> - Mac OS X (mri ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0])
> => http://gist.github.com/290538#file_test_on_mac_os_x.txt
> - Windows 7 (mri ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32])
> => http://gist.github.com/290538#file_test_on_windows.txt
>
> And it works on both apparently...
>
> There must be a reason... Which version of Ruby/IRB are you using ?
>
> -- Thibaut
>
>
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core@rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
>
_______________________________________________
Ironruby-core mailing list
Ironruby-core@rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core

Reply via email to