Class: LicenseAcceptance::ArgAcceptance

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

Instance Method Summary collapse

Instance Method Details

#check(argv) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/license_acceptance/arg_acceptance.rb', line 4

def check(argv)
  if argv.include?("--chef-license=accept")
    return true
  end
  i = argv.index("--chef-license")
  unless i.nil?
    val = argv[i+1]
    if val != nil && val.downcase == "accept"
      return true
    end
  end
  return false
end

#check_no_persist(argv) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/license_acceptance/arg_acceptance.rb', line 18

def check_no_persist(argv)
  if argv.include?("--chef-license=accept-no-persist")
    return true
  end
  i = argv.index("--chef-license")
  unless i.nil?
    val = argv[i+1]
    if val != nil && val.downcase == "accept-no-persist"
      return true
    end
  end
  return false
end