{"issue":{"created_at":"2011-12-09T11:31:13Z","state":"open","updated_at":"2011-12-09T11:31:13Z","comments":0,"user":{"gravatar_id":"dca772bde69d5a9f39a62ee79b122f0b","id":42081,"url":"https://api.github.com/users/stonegao","avatar_url":"https://secure.gravatar.com/avatar/dca772bde69d5a9f39a62ee79b122f0b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"stonegao"},"body":"I tried add namespace to word_count_topology.rb in examples/simple/ : \r\n\r\n```ruby\r\nrequire 'examples/simple/random_sentence_spout'\r\nrequire 'examples/simple/split_sentence_bolt'\r\nrequire 'examples/simple/word_count_bolt'\r\nmodule Example\r\n  module Simple\r\n    class WordCountTopology < RedStorm::SimpleTopology\r\n      spout RandomSentenceSpout, :parallelism => 5\r\n  \r\n      bolt SplitSentenceBolt, :parallelism => 8 do\r\n        source RandomSentenceSpout, :shuffle\r\n      end\r\n  \r\n      bolt WordCountBolt, :parallelism => 12 do\r\n        source SplitSentenceBolt, :fields => [\"word\"]\r\n      end\r\n\r\n      configure :word_count do |env|\r\n        case env\r\n        when :local\r\n          debug true\r\n          max_task_parallelism 3\r\n        when :cluster\r\n          debug true\r\n          num_workers 20\r\n          max_spout_pending(1000);\r\n        end\r\n      end\r\n\r\n      on_submit do |env|\r\n        if env == :local\r\n          sleep(5)\r\n          cluster.shutdown\r\n        end\r\n      end\r\n    end\r\n\r\n  end\r\nend\r\n\r\n```\r\n\r\nBut after adding namespace, redstorm can't find WordCountTopology anymore. For real projects, we need to use namespace to organize code, so redstorm should support namespaced class definition.\r\n\r\n<pre>\r\nstone-laptop:redstorm-try stone$ redstorm local examples/simple/word_count_topology.rb \r\nlaunching java -cp \"/Users/stone/tmp/redstorm-try/target/classes:/Users/stone/tmp/redstorm-try/target/dependency/*\" redstorm.TopologyLauncher local examples/simple/word_count_topology.rb\r\nfile:/Users/stone/tmp/redstorm-try/target/dependency/jruby-complete-1.6.5.jar!/builtin/javasupport/core_ext/object.rb:99 warning: already initialized constant Config\r\nRedStorm v0.2.1 starting topology WordCountTopology in local environment\r\n1    [main] ERROR org.apache.zookeeper.server.NIOServerCnxn  - Thread Thread[main,5,main] died\r\norg.jruby.exceptions.RaiseException: (NameError) uninitialized constant WordCountTopology\r\n        at org.jruby.RubyModule.const_missing(org/jruby/RubyModule.java:2590)\r\n        at #<Class:0x4ab34646>.(eval)((eval):1)\r\n        at org.jruby.RubyModule.module_eval(org/jruby/RubyModule.java:2246)\r\n        at #<Class:0x3f2221f6>.main(/Users/stone/.rvm/gems/jruby-1.6.5/gems/redstorm-0.2.0/lib/red_storm/topology_launcher.rb:43)\r\n\r\n</pre>","assignee":null,"id":2500649,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[],"number":5,"title":"redstorm should support namespaced class definition","closed_at":null,"html_url":"https://github.com/colinsurprenant/redstorm/issues/5","url":"https://api.github.com/repos/colinsurprenant/redstorm/issues/5","milestone":null},"action":"opened"}