Class: CheapSkate::CLI

Inherits:
Rake::Application
  • Object
show all
Defined in:
lib/cheap_skate/cli.rb

Instance Method Summary collapse

Constructor Details

#initializeCLI

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_rakefileObject

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_rakefileObject



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

#runObject

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