Class: MVCLI::App
- Inherits:
-
Object
- Object
- MVCLI::App
- Defined in:
- lib/mvcli/app.rb
Class Attribute Summary collapse
-
.root ⇒ Object
Returns the value of attribute root.
Class Method Summary collapse
Instance Method Summary collapse
- #call(command) ⇒ Object
-
#initialize ⇒ App
constructor
A new instance of App.
- #main(argv = ARGV.dup, input = $stdin, output = $stdout, log = $stderr, env = ENV.dup) ⇒ Object
- #root ⇒ Object
- #route_file ⇒ Object
Constructor Details
#initialize ⇒ App
Returns a new instance of App.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/mvcli/app.rb', line 12 def initialize @router = Router.new Actions.new root @router.instance_eval route_file.read, route_file.to_s, 1 [:providers, :controllers, :forms, :models].each do |path| ActiveSupport::Dependencies.autoload_paths << root.join('app', path.to_s) end @middleware = Middleware.new @middleware << Provisioning::Middleware.new @middleware << @router end |
Class Attribute Details
.root ⇒ Object
Returns the value of attribute root.
36 37 38 |
# File 'lib/mvcli/app.rb', line 36 def root @root end |
Class Method Details
.main(*args) ⇒ Object
43 44 45 |
# File 'lib/mvcli/app.rb', line 43 def self.main(*args) new.main *args end |
Instance Method Details
#call(command) ⇒ Object
23 24 25 |
# File 'lib/mvcli/app.rb', line 23 def call(command) @middleware.call command end |
#main(argv = ARGV.dup, input = $stdin, output = $stdout, log = $stderr, env = ENV.dup) ⇒ Object
39 40 41 |
# File 'lib/mvcli/app.rb', line 39 def main(argv = ARGV.dup, input = $stdin, output = $stdout, log = $stderr, env = ENV.dup) call Command.new(argv, input, output, log, env) end |
#root ⇒ Object
27 28 29 |
# File 'lib/mvcli/app.rb', line 27 def root self.class.root or fail "Invalid App: undefined application root directory" end |
#route_file ⇒ Object
31 32 33 |
# File 'lib/mvcli/app.rb', line 31 def route_file root.join 'app/routes.rb' end |