Class: Facter::OptionStore
- Inherits:
-
Object
- Object
- Facter::OptionStore
- Defined in:
- lib/facter/framework/core/options/option_store.rb
Class Attribute Summary collapse
-
.allow_external_loggers ⇒ Object
Returns the value of attribute allow_external_loggers.
-
.block ⇒ Object
Returns the value of attribute block.
-
.block_list ⇒ Object
Returns the value of attribute block_list.
-
.blocked_facts ⇒ Object
Returns the value of attribute blocked_facts.
-
.cache ⇒ Object
Returns the value of attribute cache.
-
.cli ⇒ Object
Returns the value of attribute cli.
-
.color ⇒ Object
Returns the value of attribute color.
-
.config ⇒ Object
Returns the value of attribute config.
-
.config_file_custom_dir ⇒ Object
Returns the value of attribute config_file_custom_dir.
-
.config_file_external_dir ⇒ Object
Returns the value of attribute config_file_external_dir.
-
.custom_facts ⇒ Object
readonly
Returns the value of attribute custom_facts.
-
.debug ⇒ Object
Returns the value of attribute debug.
-
.default_external_dir ⇒ Object
Returns the value of attribute default_external_dir.
- .external_dir ⇒ Object
-
.external_facts ⇒ Object
readonly
Returns the value of attribute external_facts.
-
.fact_groups ⇒ Object
Returns the value of attribute fact_groups.
-
.force_dot_resolution ⇒ Object
Returns the value of attribute force_dot_resolution.
-
.hocon ⇒ Object
Returns the value of attribute hocon.
-
.http_debug ⇒ Object
Returns the value of attribute http_debug.
-
.json ⇒ Object
Returns the value of attribute json.
-
.log_level ⇒ Object
Returns the value of attribute log_level.
-
.puppet ⇒ Object
Returns the value of attribute puppet.
-
.ruby ⇒ Object
readonly
Returns the value of attribute ruby.
-
.sequential ⇒ Object
Returns the value of attribute sequential.
-
.show_legacy ⇒ Object
Returns the value of attribute show_legacy.
-
.strict ⇒ Object
Returns the value of attribute strict.
-
.timing ⇒ Object
Returns the value of attribute timing.
-
.trace ⇒ Object
Returns the value of attribute trace.
-
.ttls ⇒ Object
Returns the value of attribute ttls.
-
.verbose ⇒ Object
Returns the value of attribute verbose.
-
.yaml ⇒ Object
Returns the value of attribute yaml.
Class Method Summary collapse
- .all ⇒ Object
- .custom_dir ⇒ Object
- .custom_dir=(*dirs) ⇒ Object
- .fallback_external_dir ⇒ Object
- .no_block=(bool) ⇒ Object
- .no_cache=(bool) ⇒ Object
- .no_color=(bool) ⇒ Object
- .no_custom_facts=(bool) ⇒ Object
- .no_external_facts=(bool) ⇒ Object
- .no_ruby=(bool) ⇒ Object
- .reset ⇒ Object
- .reset_config ⇒ Object
- .reset_facts ⇒ Object
- .set(key, value) ⇒ Object
Class Attribute Details
.allow_external_loggers ⇒ Object
Returns the value of attribute allow_external_loggers.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def allow_external_loggers @allow_external_loggers end |
.block ⇒ Object
Returns the value of attribute block.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def block @block end |
.block_list ⇒ Object
Returns the value of attribute block_list.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def block_list @block_list end |
.blocked_facts ⇒ Object
Returns the value of attribute blocked_facts.
42 43 44 |
# File 'lib/facter/framework/core/options/option_store.rb', line 42 def blocked_facts @blocked_facts end |
.cache ⇒ Object
Returns the value of attribute cache.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def cache @cache end |
.cli ⇒ Object
Returns the value of attribute cli.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def cli @cli end |
.color ⇒ Object
Returns the value of attribute color.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def color @color end |
.config ⇒ Object
Returns the value of attribute config.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def config @config end |
.config_file_custom_dir ⇒ Object
Returns the value of attribute config_file_custom_dir.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def config_file_custom_dir @config_file_custom_dir end |
.config_file_external_dir ⇒ Object
Returns the value of attribute config_file_external_dir.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def config_file_external_dir @config_file_external_dir end |
.custom_facts ⇒ Object (readonly)
Returns the value of attribute custom_facts.
42 43 44 |
# File 'lib/facter/framework/core/options/option_store.rb', line 42 def custom_facts @custom_facts end |
.debug ⇒ Object
Returns the value of attribute debug.
42 43 44 |
# File 'lib/facter/framework/core/options/option_store.rb', line 42 def debug @debug end |
.default_external_dir ⇒ Object
Returns the value of attribute default_external_dir.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def default_external_dir @default_external_dir end |
.external_dir ⇒ Object
83 84 85 86 87 |
# File 'lib/facter/framework/core/options/option_store.rb', line 83 def external_dir return fallback_external_dir if @external_dir.empty? && @external_facts @external_dir end |
.external_facts ⇒ Object (readonly)
Returns the value of attribute external_facts.
42 43 44 |
# File 'lib/facter/framework/core/options/option_store.rb', line 42 def external_facts @external_facts end |
.fact_groups ⇒ Object
Returns the value of attribute fact_groups.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def fact_groups @fact_groups end |
.force_dot_resolution ⇒ Object
Returns the value of attribute force_dot_resolution.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def force_dot_resolution @force_dot_resolution end |
.hocon ⇒ Object
Returns the value of attribute hocon.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def hocon @hocon end |
.http_debug ⇒ Object
Returns the value of attribute http_debug.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def http_debug @http_debug end |
.json ⇒ Object
Returns the value of attribute json.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def json @json end |
.log_level ⇒ Object
Returns the value of attribute log_level.
42 43 44 |
# File 'lib/facter/framework/core/options/option_store.rb', line 42 def log_level @log_level end |
.puppet ⇒ Object
Returns the value of attribute puppet.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def puppet @puppet end |
.ruby ⇒ Object (readonly)
Returns the value of attribute ruby.
42 43 44 |
# File 'lib/facter/framework/core/options/option_store.rb', line 42 def ruby @ruby end |
.sequential ⇒ Object
Returns the value of attribute sequential.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def sequential @sequential end |
.show_legacy ⇒ Object
Returns the value of attribute show_legacy.
42 43 44 |
# File 'lib/facter/framework/core/options/option_store.rb', line 42 def show_legacy @show_legacy end |
.strict ⇒ Object
Returns the value of attribute strict.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def strict @strict end |
.timing ⇒ Object
Returns the value of attribute timing.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def timing @timing end |
.trace ⇒ Object
Returns the value of attribute trace.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def trace @trace end |
.ttls ⇒ Object
Returns the value of attribute ttls.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def ttls @ttls end |
.verbose ⇒ Object
Returns the value of attribute verbose.
42 43 44 |
# File 'lib/facter/framework/core/options/option_store.rb', line 42 def verbose @verbose end |
.yaml ⇒ Object
Returns the value of attribute yaml.
45 46 47 |
# File 'lib/facter/framework/core/options/option_store.rb', line 45 def yaml @yaml end |
Class Method Details
.all ⇒ Object
52 53 54 55 56 57 58 59 |
# File 'lib/facter/framework/core/options/option_store.rb', line 52 def all = {} instance_variables.each do |iv| variable_name = iv.to_s.delete('@') [variable_name.to_sym] = OptionStore.send(variable_name.to_sym) end end |
.custom_dir ⇒ Object
95 96 97 98 99 |
# File 'lib/facter/framework/core/options/option_store.rb', line 95 def custom_dir return @config_file_custom_dir unless @custom_dir.any? @custom_dir end |
.custom_dir=(*dirs) ⇒ Object
101 102 103 104 105 106 |
# File 'lib/facter/framework/core/options/option_store.rb', line 101 def custom_dir=(*dirs) @ruby = true @custom_dir = [*dirs] @custom_dir.flatten! end |
.fallback_external_dir ⇒ Object
213 214 215 216 217 |
# File 'lib/facter/framework/core/options/option_store.rb', line 213 def fallback_external_dir return @config_file_external_dir if @config_file_external_dir.any? @default_external_dir end |
.no_block=(bool) ⇒ Object
71 72 73 |
# File 'lib/facter/framework/core/options/option_store.rb', line 71 def no_block=(bool) @block = !bool end |
.no_cache=(bool) ⇒ Object
75 76 77 |
# File 'lib/facter/framework/core/options/option_store.rb', line 75 def no_cache=(bool) @cache = !bool end |
.no_color=(bool) ⇒ Object
79 80 81 |
# File 'lib/facter/framework/core/options/option_store.rb', line 79 def no_color=(bool) @color = !bool end |
.no_custom_facts=(bool) ⇒ Object
127 128 129 130 131 132 133 134 |
# File 'lib/facter/framework/core/options/option_store.rb', line 127 def no_custom_facts=(bool) if bool == false @custom_facts = true @ruby = true else @custom_facts = false end end |
.no_external_facts=(bool) ⇒ Object
136 137 138 |
# File 'lib/facter/framework/core/options/option_store.rb', line 136 def no_external_facts=(bool) @external_facts = !bool end |
.no_ruby=(bool) ⇒ Object
61 62 63 64 65 66 67 68 69 |
# File 'lib/facter/framework/core/options/option_store.rb', line 61 def no_ruby=(bool) if bool @ruby = false @custom_facts = false @blocked_facts << 'ruby' else @ruby = true end end |
.reset ⇒ Object
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/facter/framework/core/options/option_store.rb', line 168 def reset @debug = false @verbose = false # TODO: constant is not yet available when running puppet facts @log_level = :warn @show_legacy = true @ruby = true @json = false @hocon = false @cache = true @yaml = false @puppet = false @ttls = [] @block = true @cli = nil @http_debug = false reset_config end |
.reset_config ⇒ Object
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/facter/framework/core/options/option_store.rb', line 187 def reset_config @blocked_facts = [] @external_facts = true @config = nil @strict = false @config_file_custom_dir = [] @config_file_external_dir = [] @default_external_dir = [] @fact_groups = {} @block_list = {} @color = true @sequential = true @ttls = [] @trace = false @timing = false @allow_external_loggers = true reset_facts end |
.reset_facts ⇒ Object
206 207 208 209 210 211 |
# File 'lib/facter/framework/core/options/option_store.rb', line 206 def reset_facts @custom_facts = true @force_dot_resolution = false @external_dir = [] @custom_dir = [] end |
.set(key, value) ⇒ Object
164 165 166 |
# File 'lib/facter/framework/core/options/option_store.rb', line 164 def set(key, value) send("#{key}=".to_sym, value) end |