Class: Cheese::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/controller.rb

Constant Summary collapse

CHEESE_CONF =
"/etc/cheese/cheese.conf"
NGINX_CONF =
'/etc/nginx/nginx.conf'

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Controller

Returns a new instance of Controller.



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/controller.rb', line 30

def initialize(options={})
  # Check cheese --setup has been run
  unless File.exists?(CHEESE_CONF)
    puts "Please run cheese --setup before using any cheese actions."
    exit
  end
  # Need a better way of doing this, so it works in all files
  Cheese::Verbose.dry_run = options.delete(:dry_run)
  Cheese::Verbose.loud = options.delete(:verbose)
  @preferences = YAML.load(File.open(CHEESE_CONF))
  @options = options
  run_actions
end