Class: EnhanceRepo::ConfigOpts

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

Overview

Configuration class to hold the options passed from the command line to the components doing the work

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ ConfigOpts

Returns a new instance of ConfigOpts.



69
70
71
72
73
# File 'lib/enhance_repo/config_opts.rb', line 69

def initialize(opts)
  @repoproducts = Set.new
  @repokeywords = Set.new
  read_opts(opts)
end

Instance Attribute Details

#benchmarkObject

Returns the value of attribute benchmark.



61
62
63
# File 'lib/enhance_repo/config_opts.rb', line 61

def benchmark
  @benchmark
end

#create_deltasObject

wether to create delta rpm files and how many



55
56
57
# File 'lib/enhance_repo/config_opts.rb', line 55

def create_deltas
  @create_deltas
end

#deltasObject

whether to index delta rpms



57
58
59
# File 'lib/enhance_repo/config_opts.rb', line 57

def deltas
  @deltas
end

#dirObject

Returns the value of attribute dir.



39
40
41
# File 'lib/enhance_repo/config_opts.rb', line 39

def dir
  @dir
end

#diskusageObject

Returns the value of attribute diskusage.



52
53
54
# File 'lib/enhance_repo/config_opts.rb', line 52

def diskusage
  @diskusage
end

#eulasObject

Returns the value of attribute eulas.



50
51
52
# File 'lib/enhance_repo/config_opts.rb', line 50

def eulas
  @eulas
end

#expireObject

Returns the value of attribute expire.



44
45
46
# File 'lib/enhance_repo/config_opts.rb', line 44

def expire
  @expire
end

#generate_updateObject

Returns the value of attribute generate_update.



47
48
49
# File 'lib/enhance_repo/config_opts.rb', line 47

def generate_update
  @generate_update
end

#indentObject

Returns the value of attribute indent.



36
37
38
# File 'lib/enhance_repo/config_opts.rb', line 36

def indent
  @indent
end

#indexObject

Returns the value of attribute index.



35
36
37
# File 'lib/enhance_repo/config_opts.rb', line 35

def index
  @index
end

#keywordsObject

Returns the value of attribute keywords.



51
52
53
# File 'lib/enhance_repo/config_opts.rb', line 51

def keywords
  @keywords
end

#outputdirObject



63
64
65
66
67
# File 'lib/enhance_repo/config_opts.rb', line 63

def outputdir
  return @dir if @outputdir.nil?
  return @outputdir

end

#primaryObject

Returns the value of attribute primary.



45
46
47
# File 'lib/enhance_repo/config_opts.rb', line 45

def primary
  @primary
end

#productsObject

Returns the value of attribute products.



59
60
61
# File 'lib/enhance_repo/config_opts.rb', line 59

def products
  @products
end

#repokeywordsObject

Returns the value of attribute repokeywords.



38
39
40
# File 'lib/enhance_repo/config_opts.rb', line 38

def repokeywords
  @repokeywords
end

#repoproductsObject

Returns the value of attribute repoproducts.



37
38
39
# File 'lib/enhance_repo/config_opts.rb', line 37

def repoproducts
  @repoproducts
end

#signkeyObject

Returns the value of attribute signkey.



43
44
45
# File 'lib/enhance_repo/config_opts.rb', line 43

def signkey
  @signkey
end

#split_updatesObject

Returns the value of attribute split_updates.



48
49
50
# File 'lib/enhance_repo/config_opts.rb', line 48

def split_updates
  @split_updates
end

#updatesObject

Returns the value of attribute updates.



46
47
48
# File 'lib/enhance_repo/config_opts.rb', line 46

def updates
  @updates
end

#updatesbasedirObject

Returns the value of attribute updatesbasedir.



49
50
51
# File 'lib/enhance_repo/config_opts.rb', line 49

def updatesbasedir
  @updatesbasedir
end

Instance Method Details

#read_opts(opts) ⇒ Object



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/enhance_repo/config_opts.rb', line 75

def read_opts(opts)
  @index = opts[:index]
  @expire = opts[:expire]
  @primary = opts[:primary]
  @repoproducts = @repoproducts.merge([*opts[:repo_products]])
  @repokeywords = @repokeywords.merge([*opts[:repo_keywords]])
  @signkey = opts[:sign]
  @updates = opts[:updates]
  @split_updates = opts[:split_updates]
  @generate_update = opts[:generate_update]
  @eulas = opts[:eulas]
  @keywords = opts[:keywords]
  @diskusage = opts[:disk_usage]
  @deltas = opts[:deltas]
  @create_deltas = opts[:create_deltas]
  @products = opts[:products]
  @benchmark = opts[:benchmark]      
  @updatesbasedir = Pathname.new(opts[:updates_base_dir]) if opts[:updates_base_dir]
  @outputdir = Pathname.new(opts[:outputdir]) if opts[:outputdir]
  @dir = Pathname.new(opts[:dir]) if opts[:dir]
end