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

#buildObject



39
40
41
42
# File 'lib/egg/cli.rb', line 39

def build
  config = Configuration.load "./egg_config.rb"
  config.docker_pull_build
end

#initObject



11
12
13
14
15
16
17
18
19
20
# 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"
  end
end

#readmeObject



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

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



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

def setup
  config = Configuration.load "./egg_config.rb"
  config.run_setup
  print "Use `docker-compose up` to start your application."
end