larskanis / opengl

The official repository of the ruby-opengl wrapper
http://larskanis.github.com/opengl
MIT License
57 stars 11 forks source link

Fix Ruby 2.0 compatibility of RedBook examples #15

Closed artob closed 9 years ago

artob commented 9 years ago

Three of the RedBook examples were failing to run with Ruby 2.0. The fixes are trivial, as per the attached commit.

$ ruby font.rb 
font.rb:87:in `+': String can't be coerced into Fixnum (TypeError)
    from font.rb:87:in `block in makeRasterFont'
    from font.rb:86:in `each'
    from font.rb:86:in `makeRasterFont'
    from font.rb:99:in `init'
    from font.rb:149:in `<main>'

$ ruby light.rb 
light.rb:146:in `<main>': undefined local variable or method `glutInit' for main:Object (NameError)

$ ruby stroke.rb 
stroke.rb:110:in `+': String can't be coerced into Fixnum (TypeError)
    from stroke.rb:110:in `myinit'
    from stroke.rb:165:in `<main>'
archseer commented 9 years ago

Thanks for your contribution!

@larskanis All of these seem to be minor, so I went ahead and merged this.

larskanis commented 9 years ago

LGTM, thanks!