Class: Egg::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/egg/cli.rb

Overview

Defines the CLI interface to egg functions

Instance Method Summary collapse

Instance Method Details

#initObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/egg/cli.rb', line 11

def init
  config = Templates["egg_config.rb"]
  if File.exist?("egg_config.rb") && !options[:force]
    print "egg has already been initialized! (maybe you want to --force)\n"
    exit(1)
  else
    File.write("egg_config.rb", config.result)
    print "Wrote example egg_config.rb, customize it to suit your app"
    write_git_ignorance
  end
end

#readmeObject



24
25
26
27
28
29
30
# File 'lib/egg/cli.rb', line 24

def readme
  # Print out the readme
  readme_path = File.expand_path("../../../doc/README.md", __FILE__)
  File.open(readme_path, "r") do |f|
    print(f.read)
  end
end

#setupObject



33
34
35
36
# File 'lib/egg/cli.rb', line 33

def setup
  config = Configuration.load "./egg_config.rb"
  config.run_setup
end