Top Level Namespace

Defined Under Namespace

Modules: ShadowFacter

Instance Method Summary collapse

Instance Method Details

#exec(command) ⇒ Object

Execute a system command via Facter.



29
30
31
# File 'lib/shadow_facter.rb', line 29

def exec(command)
  Facter::Util::Resolution.exec(command)
end

#fact(key, value = nil, confine_args = {}, &b) ⇒ Object

Define a fact in Facter using a value or block. Can be confined with a hash of Facter keys (namespace_key) and value. Examples:

fact :tea, "oolong"
fact :tea, "puerh", {:drinks_season => "winter"}
fact(:rand) { rand }


19
20
21
# File 'lib/shadow_facter.rb', line 19

def fact(key, value=nil, confine_args={}, &b)
  ShadowFacter::Base.fact(key, value, confine_args, &b)
end

#facts(namespace) ⇒ Object

Return an instance of the Facts class for the specified namespace.



24
25
26
# File 'lib/shadow_facter.rb', line 24

def facts(namespace)
  ShadowFacter::Base.facts(namespace)
end

#namespace(name, &b) ⇒ Object

Define a namespace.



9
10
11
# File 'lib/shadow_facter.rb', line 9

def namespace(name, &b)
  ShadowFacter::Base.namespace(name, &b)
end

#namespacesObject

Return an array of defined namespaces names.



4
5
6
# File 'lib/shadow_facter.rb', line 4

def namespaces()
  ShadowFacter::Base.namespaces
end