Class: Facter::OptionStore
- Inherits:
-
Object
- Object
- Facter::OptionStore
- Defined in:
- lib/facter/framework/core/options/option_store.rb
Class Attribute Summary collapse
-
.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
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
Returns the value of attribute external_facts.
-
.fact_groups ⇒ Object
Returns the value of attribute fact_groups.
-
.haml ⇒ Object
Returns the value of attribute haml.
-
.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
Returns the value of attribute ruby.
-
.show_legacy ⇒ Object
Returns the value of attribute show_legacy.
-
.strict ⇒ Object
Returns the value of attribute strict.
-
.trace ⇒ Object
Returns the value of attribute trace.
-
.ttls ⇒ Object
Returns the value of attribute ttls.
-
.user_query ⇒ Object
Returns the value of attribute user_query.
-
.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
- .reset ⇒ Object
- .reset_config ⇒ Object
- .set(key, value) ⇒ Object
Class Attribute Details
.block ⇒ Object
Returns the value of attribute block.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def block @block end |
.block_list ⇒ Object
Returns the value of attribute block_list.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def block_list @block_list end |
.blocked_facts ⇒ Object
Returns the value of attribute blocked_facts.
28 29 30 |
# File 'lib/facter/framework/core/options/option_store.rb', line 28 def blocked_facts @blocked_facts end |
.cache ⇒ Object
Returns the value of attribute cache.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def cache @cache end |
.cli ⇒ Object
Returns the value of attribute cli.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def cli @cli end |
.color ⇒ Object
Returns the value of attribute color.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def color @color end |
.config ⇒ Object
Returns the value of attribute config.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def config @config end |
.config_file_custom_dir ⇒ Object
Returns the value of attribute config_file_custom_dir.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def config_file_custom_dir @config_file_custom_dir end |
.config_file_external_dir ⇒ Object
Returns the value of attribute config_file_external_dir.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def config_file_external_dir @config_file_external_dir end |
.custom_facts ⇒ Object
Returns the value of attribute custom_facts.
28 29 30 |
# File 'lib/facter/framework/core/options/option_store.rb', line 28 def custom_facts @custom_facts end |
.debug ⇒ Object
Returns the value of attribute debug.
28 29 30 |
# File 'lib/facter/framework/core/options/option_store.rb', line 28 def debug @debug end |
.default_external_dir ⇒ Object
Returns the value of attribute default_external_dir.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def default_external_dir @default_external_dir end |
.external_dir ⇒ Object
57 58 59 60 61 |
# File 'lib/facter/framework/core/options/option_store.rb', line 57 def external_dir return fallback_external_dir if @external_dir.empty? && @external_facts @external_dir end |
.external_facts ⇒ Object
Returns the value of attribute external_facts.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def external_facts @external_facts end |
.fact_groups ⇒ Object
Returns the value of attribute fact_groups.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def fact_groups @fact_groups end |
.haml ⇒ Object
Returns the value of attribute haml.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def haml @haml end |
.json ⇒ Object
Returns the value of attribute json.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def json @json end |
.log_level ⇒ Object
Returns the value of attribute log_level.
28 29 30 |
# File 'lib/facter/framework/core/options/option_store.rb', line 28 def log_level @log_level end |
.puppet ⇒ Object
Returns the value of attribute puppet.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def puppet @puppet end |
.ruby ⇒ Object
Returns the value of attribute ruby.
28 29 30 |
# File 'lib/facter/framework/core/options/option_store.rb', line 28 def ruby @ruby end |
.show_legacy ⇒ Object
Returns the value of attribute show_legacy.
28 29 30 |
# File 'lib/facter/framework/core/options/option_store.rb', line 28 def show_legacy @show_legacy end |
.strict ⇒ Object
Returns the value of attribute strict.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def strict @strict end |
.trace ⇒ Object
Returns the value of attribute trace.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def trace @trace end |
.ttls ⇒ Object
Returns the value of attribute ttls.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def ttls @ttls end |
.user_query ⇒ Object
Returns the value of attribute user_query.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def user_query @user_query end |
.verbose ⇒ Object
Returns the value of attribute verbose.
28 29 30 |
# File 'lib/facter/framework/core/options/option_store.rb', line 28 def verbose @verbose end |
.yaml ⇒ Object
Returns the value of attribute yaml.
31 32 33 |
# File 'lib/facter/framework/core/options/option_store.rb', line 31 def yaml @yaml end |
Class Method Details
.all ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/facter/framework/core/options/option_store.rb', line 38 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
69 70 71 72 73 |
# File 'lib/facter/framework/core/options/option_store.rb', line 69 def custom_dir return @config_file_custom_dir unless @custom_dir.any? @custom_dir end |
.custom_dir=(*dirs) ⇒ Object
75 76 77 78 79 80 |
# File 'lib/facter/framework/core/options/option_store.rb', line 75 def custom_dir=(*dirs) @ruby = true @custom_dir = [*dirs] @custom_dir.flatten! end |
.fallback_external_dir ⇒ Object
164 165 166 167 168 |
# File 'lib/facter/framework/core/options/option_store.rb', line 164 def fallback_external_dir return @config_file_external_dir if @config_file_external_dir.any? @default_external_dir end |
.reset ⇒ Object
138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/facter/framework/core/options/option_store.rb', line 138 def reset @debug = false @verbose = false # TODO: constant is not yet available when running puppet facts @log_level = :warn @show_legacy = true @block = true @ruby = true @user_query = [] @cli = nil @cache = true @trace = false reset_config end |
.reset_config ⇒ Object
153 154 155 156 157 158 159 160 161 162 |
# File 'lib/facter/framework/core/options/option_store.rb', line 153 def reset_config @custom_dir = [] @custom_facts = true @external_dir = [] @default_external_dir = [] @external_facts = true @blocked_facts = [] @fact_groups = {} @block_list = {} end |
.set(key, value) ⇒ Object
134 135 136 |
# File 'lib/facter/framework/core/options/option_store.rb', line 134 def set(key, value) send("#{key}=".to_sym, value) end |