Class: GenRouting

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/jt-mobile-kit/gen_routing/gen_routing.rb

Instance Method Summary collapse

Constructor Details

#initialize(args = [], options = {}, config = {}) ⇒ GenRouting

Returns a new instance of GenRouting.



6
7
8
9
# File 'lib/jt-mobile-kit/gen_routing/gen_routing.rb', line 6

def initialize(args=[], options={}, config={})
  super
  self.destination_root= ""
end

Instance Method Details

#genObject



13
14
15
16
17
18
# File 'lib/jt-mobile-kit/gen_routing/gen_routing.rb', line 13

def gen
  page_name = name
  controller_name = name
  content = ERB.new File.read("#{GenRouting.source_root}/routing.js.erb")
  inject_into_file "js/routes.js",content.result(binding), :after => "//routing generate"
end