Class: EasyAutomation::Args

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

Class Method Summary collapse

Class Method Details

.parse(args) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/easy_automation/args.rb', line 4

def parse args
  Args.usage if args.include?('--help')
  args.each do |arg|
    var_name = arg.split('=')
    begin
    eval(%{
       EasyAutomation::Runner.configuration.#{var_name[0].gsub('--', '')} = "#{var_name[1]}"
    })
    rescue Exception => e
      Args.usage
      break
    end

  end
end

.usageObject



20
21
22
# File 'lib/easy_automation/args.rb', line 20

def usage
  puts "Easy Automation"
end