Class: MailMatic::Application

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

Class Method Summary collapse

Class Method Details

.run!(*args) ⇒ Object



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/mailmatic.rb', line 104

def self.run!(*args)
  command = args.shift
  args.push(Dir.pwd) if args.empty?

  case command
  when 'setup'
    args.each do |arg|
      status = MailMatic::Generator.new(arg).setup
      return status if status != 0
    end
    return 0

  when 'build'
    args.each do |arg|
      status = MailMatic::Generator.new(arg).build
      return status if status != 0
    end
    return 0

  else
    puts "ERROR: Invalid command"
    return -1
  end
end