Class: EnhanceRepo::ConfigOpts
- Inherits:
-
Object
- Object
- EnhanceRepo::ConfigOpts
- 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
-
#benchmark ⇒ Object
Returns the value of attribute benchmark.
-
#create_deltas ⇒ Object
wether to create delta rpm files and how many.
-
#deltas ⇒ Object
whether to index delta rpms.
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#diskusage ⇒ Object
Returns the value of attribute diskusage.
-
#eulas ⇒ Object
Returns the value of attribute eulas.
-
#expire ⇒ Object
Returns the value of attribute expire.
-
#generate_update ⇒ Object
Returns the value of attribute generate_update.
-
#indent ⇒ Object
Returns the value of attribute indent.
-
#index ⇒ Object
Returns the value of attribute index.
-
#keywords ⇒ Object
Returns the value of attribute keywords.
- #outputdir ⇒ Object
-
#primary ⇒ Object
Returns the value of attribute primary.
-
#products ⇒ Object
Returns the value of attribute products.
-
#repokeywords ⇒ Object
Returns the value of attribute repokeywords.
-
#repoproducts ⇒ Object
Returns the value of attribute repoproducts.
-
#signkey ⇒ Object
Returns the value of attribute signkey.
-
#split_updates ⇒ Object
Returns the value of attribute split_updates.
-
#updates ⇒ Object
Returns the value of attribute updates.
-
#updatesbasedir ⇒ Object
Returns the value of attribute updatesbasedir.
Instance Method Summary collapse
-
#initialize(opts) ⇒ ConfigOpts
constructor
A new instance of ConfigOpts.
- #read_opts(opts) ⇒ Object
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
#benchmark ⇒ Object
Returns the value of attribute benchmark.
61 62 63 |
# File 'lib/enhance_repo/config_opts.rb', line 61 def benchmark @benchmark end |
#create_deltas ⇒ Object
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 |
#deltas ⇒ Object
whether to index delta rpms
57 58 59 |
# File 'lib/enhance_repo/config_opts.rb', line 57 def deltas @deltas end |
#dir ⇒ Object
Returns the value of attribute dir.
39 40 41 |
# File 'lib/enhance_repo/config_opts.rb', line 39 def dir @dir end |
#diskusage ⇒ Object
Returns the value of attribute diskusage.
52 53 54 |
# File 'lib/enhance_repo/config_opts.rb', line 52 def diskusage @diskusage end |
#eulas ⇒ Object
Returns the value of attribute eulas.
50 51 52 |
# File 'lib/enhance_repo/config_opts.rb', line 50 def eulas @eulas end |
#expire ⇒ Object
Returns the value of attribute expire.
44 45 46 |
# File 'lib/enhance_repo/config_opts.rb', line 44 def expire @expire end |
#generate_update ⇒ Object
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 |
#indent ⇒ Object
Returns the value of attribute indent.
36 37 38 |
# File 'lib/enhance_repo/config_opts.rb', line 36 def indent @indent end |
#index ⇒ Object
Returns the value of attribute index.
35 36 37 |
# File 'lib/enhance_repo/config_opts.rb', line 35 def index @index end |
#keywords ⇒ Object
Returns the value of attribute keywords.
51 52 53 |
# File 'lib/enhance_repo/config_opts.rb', line 51 def keywords @keywords end |
#outputdir ⇒ Object
63 64 65 66 67 |
# File 'lib/enhance_repo/config_opts.rb', line 63 def outputdir return @dir if @outputdir.nil? return @outputdir end |
#primary ⇒ Object
Returns the value of attribute primary.
45 46 47 |
# File 'lib/enhance_repo/config_opts.rb', line 45 def primary @primary end |
#products ⇒ Object
Returns the value of attribute products.
59 60 61 |
# File 'lib/enhance_repo/config_opts.rb', line 59 def products @products end |
#repokeywords ⇒ Object
Returns the value of attribute repokeywords.
38 39 40 |
# File 'lib/enhance_repo/config_opts.rb', line 38 def repokeywords @repokeywords end |
#repoproducts ⇒ Object
Returns the value of attribute repoproducts.
37 38 39 |
# File 'lib/enhance_repo/config_opts.rb', line 37 def repoproducts @repoproducts end |
#signkey ⇒ Object
Returns the value of attribute signkey.
43 44 45 |
# File 'lib/enhance_repo/config_opts.rb', line 43 def signkey @signkey end |
#split_updates ⇒ Object
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 |
#updates ⇒ Object
Returns the value of attribute updates.
46 47 48 |
# File 'lib/enhance_repo/config_opts.rb', line 46 def updates @updates end |
#updatesbasedir ⇒ Object
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 |