Class: Chef::Knife

Inherits:
Object show all
Defined in:
lib/chef/knife/chop_base.rb,
lib/chef/knife/chop/ui.rb,
lib/chef/knife/chop_upload.rb,
lib/chef/knife/chop/logging.rb,
lib/chef/knife/chop_translate.rb,
lib/chef/knife/chop/chef_knife.rb

Overview

noinspection RubyTooManyInstanceVariablesInspection noinspection RubyTooManyMethodsInspection

Direct Known Subclasses

ChopTranslate, ChopUpload

Defined Under Namespace

Modules: ChopBase, ChopLogging Classes: ChopTranslate, ChopUI, ChopUpload, CookbookUpload, DataBagFromFile, EnvironmentFromFile, RoleFromFile

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#ALLACTIONSObject

Returns the value of attribute ALLACTIONS.



34
35
36
# File 'lib/chef/knife/chop_base.rb', line 34

def ALLACTIONS
  @ALLACTIONS
end

#ALLPARTSObject

Returns the value of attribute ALLPARTS.



33
34
35
# File 'lib/chef/knife/chop_base.rb', line 33

def ALLPARTS
  @ALLPARTS
end

#locationObject (readonly)

Returns the value of attribute location.



39
40
41
# File 'lib/chef/knife/chop/chef_knife.rb', line 39

def location
  @location
end

#loggerObject

Returns the value of attribute logger.



30
31
32
# File 'lib/chef/knife/chop_base.rb', line 30

def logger
  @logger
end

#LOGLEVELSObject

Returns the value of attribute LOGLEVELS.



32
33
34
# File 'lib/chef/knife/chop_base.rb', line 32

def LOGLEVELS
  @LOGLEVELS
end

#prec_maxObject

Returns the value of attribute prec_max.



35
36
37
# File 'lib/chef/knife/chop_base.rb', line 35

def prec_max
  @prec_max
end

#rsrctypeObject (readonly)

Returns the value of attribute rsrctype.



38
39
40
# File 'lib/chef/knife/chop/chef_knife.rb', line 38

def rsrctype
  @rsrctype
end

#verbosityObject

Returns the value of attribute verbosity.



31
32
33
# File 'lib/chef/knife/chop_base.rb', line 31

def verbosity
  @verbosity
end

Class Method Details

.allactionsObject



57
58
59
# File 'lib/chef/knife/chop_base.rb', line 57

def self.allactions
  @ALLACTIONS
end

.allactions=(acts) ⇒ Object



45
46
47
# File 'lib/chef/knife/chop_base.rb', line 45

def self.allactions=(acts)
  @ALLACTIONS = acts || [:upload, :translate]
end

.allpartsObject



53
54
55
# File 'lib/chef/knife/chop_base.rb', line 53

def self.allparts
  @ALLPARTS
end

.allparts=(parts) ⇒ Object



41
42
43
# File 'lib/chef/knife/chop_base.rb', line 41

def self.allparts=(parts)
  @ALLPARTS   = parts || [:environments, :roles, :databags, :cookbooks]
end

.loglevelsObject



49
50
51
# File 'lib/chef/knife/chop_base.rb', line 49

def self.loglevels
  @LOGLEVELS
end

.loglevels=(levels) ⇒ Object



37
38
39
# File 'lib/chef/knife/chop_base.rb', line 37

def self.loglevels=(levels)
  @LOGLEVELS  = levels || [:trace, :debug, :step, :info, :warn, :error, :fatal, :todo]
end

Instance Method Details

#translateObject




42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/chef/knife/chop/chef_knife.rb', line 42

def translate()
  if config[:all]
    translate_all()
  else
    if @name_args[0].nil?
      show_usage
      ui.fatal("You must specify a file to translate")
      exit 1
    end

    @name_args.each do |arg|
      translate_one(arg)
    end
  end
end