Class: CheapSkate::CLI
- Inherits:
-
Rake::Application
- Object
- Rake::Application
- CheapSkate::CLI
- Defined in:
- lib/cheap_skate/cli.rb
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
-
#load_project_rakefile ⇒ Object
Loads the project Rakefile in a separate application.
- #load_rakefile ⇒ Object
-
#run ⇒ Object
Run the application: The equivalent code for the
warble
command is simplyWarbler::Application.new.run
.
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
8 9 10 |
# File 'lib/cheap_skate/cli.rb', line 8 def initialize super end |
Instance Method Details
#load_project_rakefile ⇒ Object
Loads the project Rakefile in a separate application
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/cheap_skate/cli.rb', line 28 def load_project_rakefile Rake.application = Rake::Application.new Rake::Application::DEFAULT_RAKEFILES.each do |rf| if File.exist?(rf) load rf break end end Rake.application = self end |
#load_rakefile ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cheap_skate/cli.rb', line 11 def load_rakefile @name = 'cheapskate' # Load the main warbler tasks CheapSkate::Task.new task :default => :help desc "Create a new CheapSkate instance" task :init => "cheapskate:init" desc "Convert a Solr schema.xml to CheapSkate schema.yml" task :convertschema => "cheapskate:convertschema" end |
#run ⇒ Object
Run the application: The equivalent code for the warble
command is simply Warbler::Application.new.run
.
41 42 43 44 |
# File 'lib/cheap_skate/cli.rb', line 41 def run Rake.application = self super end |