Top Level Namespace

Includes:
Sys

Defined Under Namespace

Modules: DOT, Enumerable, FFI, Generators, HieraPuppet, Kernel, OpenSSL, PSON, Puppet, PuppetX, RDoc Classes: CheckPuppet, Class, ExternalNode, Formatter, GitIgnoreSpec, Hiera, JsonCatalogEncoder, MyExternalNode, Object, PathSpec, RegexSpec, Spec, TypeDoc, UserAttr, WindowsDaemon

Constant Summary collapse

SEPARATOR =
[Regexp.escape(File::SEPARATOR.to_s), Regexp.escape(File::ALT_SEPARATOR.to_s)].join
BASEDIR =
Dir.chdir(File.dirname(__FILE__) + "/..") { Dir.getwd }
WORKINGDIR =
"#{p.realpath}"

Instance Method Summary collapse

Instance Method Details

#_(msg) ⇒ Object

These stub the translation methods normally brought in by FastGettext. Used when Gettext could not be properly initialized.



4
5
6
# File 'lib/puppet/gettext/stubs.rb', line 4

def _(msg)
  msg
end

#dateObject

lib/trollop.rb – trollop command-line processing library

Author

William Morgan (mailto: [email protected])

Copyright

Copyright 2007 William Morgan

License

the same terms as ruby itself

2012-03: small changes made by cprice ([email protected]);

patch submitted for upstream consideration:
https://gitorious.org/trollop/mainline/merge_requests/9

2012-08: namespace changes made by Jeff McCune ([email protected])

moved Trollop into Puppet::Util::CommandLine to prevent monkey
patching the upstream trollop library if also loaded.


13
# File 'lib/puppet/util/command_line/trollop.rb', line 13

require 'date'

#log(message, level = :debug) ⇒ Object

Helper method to log to syslog; we log at level debug if no level is specified since those are the most frequent calls to this method



65
66
67
# File 'ext/regexp_nodes/regexp_nodes.rb', line 65

def log(message,level=:debug)
  Syslog.send(level,message)
end

#n_(*args, &block) ⇒ Object



8
9
10
11
# File 'lib/puppet/gettext/stubs.rb', line 8

def n_(*args, &block)
  plural = args[2] == 1 ? args[0] : args[1]
  block ? block.call : plural
end

#post_compileObject

Since:

  • 3.4.0



# File 'lib/puppet/parameter.rb', line 563

#read_node(node) ⇒ Object

Read in a pure yaml representation of our node.



62
63
64
65
66
67
68
69
# File 'ext/yaml_nodes.rb', line 62

def read_node(node)
  nodefile = File.join(YAMLDIR, "#{node}.yaml")
  if FileTest.exist?(nodefile)
    return YAML.load_file(nodefile)
  else
    raise "Could not find information for #{node}"
  end
end