Problem with accessing namespaces #43

Closed
pusewicz opened this Issue Jan 1, 2012 · 2 comments

Comments

Projects
None yet
2 participants

pusewicz commented Jan 1, 2012

Hi:

/Users/piotr/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/bundler/gems/chingu-962ef58b03bc/lib/chingu/game_states/enter_name.rb:66:in `initialize': uninitialized constant Chingu::GameStates::EnterName::Color (NameError)
from /Users/piotr/Work/GitHub/apocalypse/lib/apocalypse/game_window.rb:8:in `new'
from /Users/piotr/Work/GitHub/apocalypse/lib/apocalypse/game_window.rb:8:in `initialise'

And this is the code:

require 'chingu'

module Apocalypse
  class GameWindow < Chingu::Window
    def initialize
      super

      push_game_state GameStates::EnterName.new(:callback => method(:add))
    end

    def add(name)
      puts "User entered name #{name}"
    end
  end
end

I think it would be better if Chingu address the absolute namespaces in the code e.g.:

@texts[@index].color = ::Gosu::Color::RED

instead of

@texts[@index].color = Color::RED
Owner

ippa commented Jan 3, 2012

Hi, thanks for reporting. Can you make a patch that fixes this problem? I'm sure you allready know about it, but you can basically fork chingu and edit your fork with githubs builtin editor, making it extremely easy patching :).

Owner

ippa commented Mar 20, 2012

Fixed in 2ed1260

ippa closed this Mar 20, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment