http://rubyluabridge.rubyforge.org/

*主要是为了使用long string,不用写些转义字符…

l.eval <<LUA_END
        n = 5                 -- see how Ruby long strings
        s = "hello"           -- make it easy to embed Lua code?
        a = { 1, 2, 3, 4 }
        h = { a='x', b='y', }
   LUA_END
   l.n       # => 5
   l.s       # => “hello”
   l.a       # => Lua::Table
   l.a[1]    # => 1
   l.h       # => Lua::Table
   l.h['a']  # => “x”
   l.h.a     # => “x”

*当然这个LUA_END,主要是和下面的配对就行吧….

转载请注明:韦旭红的点点滴滴 » Ruby long string block(ruby长字符串的处理)