Class: Rum::Application
- Inherits:
-
Rake::Application
- Object
- Rake::Application
- Rum::Application
- Defined in:
- lib/rumrunner/application.rb
Overview
Rum main application object. When invoking rum
from the command line, a Rum::Application object is created and run.
Constant Summary collapse
- DEFAULT_RAKEFILES =
Default names for Rum Runner manifests.
[ "rumfile", "Rumfile", "rumfile.rb", "Rumfile.rb", ]
Instance Method Summary collapse
-
#init(app_name = "rum", argv = ARGV) ⇒ Object
Initialize the command line parameters and app name.
-
#initialize ⇒ Application
constructor
Initialize a Rumfile::Application object.
- #rumfile? ⇒ Boolean
- #run(argv = ARGV) ⇒ Object
Constructor Details
#initialize ⇒ Application
Initialize a Rumfile::Application object.
22 23 24 25 26 |
# File 'lib/rumrunner/application.rb', line 22 def initialize super @name = "rum" @rakefiles = DEFAULT_RAKEFILES.dup end |
Instance Method Details
#init(app_name = "rum", argv = ARGV) ⇒ Object
Initialize the command line parameters and app name.
30 31 32 |
# File 'lib/rumrunner/application.rb', line 30 def init(app_name="rum", argv = ARGV) super "rum", argv end |
#rumfile? ⇒ Boolean
34 35 36 |
# File 'lib/rumrunner/application.rb', line 34 def rumfile? DEFAULT_RAKEFILES.map{|x| File.size? x }.any? end |
#run(argv = ARGV) ⇒ Object
38 39 40 41 42 43 44 45 46 |
# File 'lib/rumrunner/application.rb', line 38 def run(argv = ARGV) if argv.first == "init" && !rumfile? Rum.init elsif ["-V", "--version"].include? argv.first puts "rum, version #{Rum::VERSION}" else super end end |