Module: Tux::Commands
- Defined in:
- lib/tux/commands.rb
Constant Summary collapse
- SETTINGS =
%w{methodoverride inline_templates}
Instance Method Summary collapse
Instance Method Details
#app ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/tux/commands.rb', line 19 def app @app ||= begin obj = Tux.app_class.new! obj.request = Sinatra::Request.new({}) obj.response = Sinatra::Response.new obj end end |
#routes ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/tux/commands.rb', line 5 def routes Tux.app_class.routes.inject([]) {|arr, (k,v)| arr += v.map {|e| [k, (str = e[0].inspect[%r{/\^(.*)\$/}, 1]) ? str.tr('\\', '') : e[0]] } } end |
#settings ⇒ Object
13 14 15 16 17 |
# File 'lib/tux/commands.rb', line 13 def settings meths = (class << Tux.app_class; self; end).instance_methods(false). sort.map(&:to_s).select {|e| e[/=$/] }.map {|e| e[0..-2] } - SETTINGS meths.map {|meth| [meth, Tux.app_class.send(meth)] } end |