Module: PuppetRepl::Support::Environment
- Included in:
- PuppetRepl::Support
- Defined in:
- lib/puppet-repl/support/environment.rb
Instance Method Summary collapse
- #create_environment ⇒ Object
-
#default_puppet_env_name ⇒ Object
the cached name of the environment.
-
#environment_loaders ⇒ Object
currently this is not being used.
- #puppet_env_name ⇒ Object
-
#puppet_environment ⇒ Object
creates a puppet environment given a module path and environment name this is cached.
- #set_environment(value) ⇒ Object
Instance Method Details
#create_environment ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/puppet-repl/support/environment.rb', line 10 def create_environment @puppet_environment = Puppet::Node::Environment.create( default_puppet_env_name, default_modules_paths, default_manifests_dir ) end |
#default_puppet_env_name ⇒ Object
the cached name of the environment
27 28 29 |
# File 'lib/puppet-repl/support/environment.rb', line 27 def default_puppet_env_name ENV['PUPPET_ENV'] || Puppet[:environment] end |
#environment_loaders ⇒ Object
currently this is not being used
32 33 34 |
# File 'lib/puppet-repl/support/environment.rb', line 32 def environment_loaders name = compiler.loaders.public_environment_loader.loader_name end |
#puppet_env_name ⇒ Object
22 23 24 |
# File 'lib/puppet-repl/support/environment.rb', line 22 def puppet_env_name puppet_environment.name end |
#puppet_environment ⇒ Object
creates a puppet environment given a module path and environment name this is cached
6 7 8 |
# File 'lib/puppet-repl/support/environment.rb', line 6 def puppet_environment @puppet_environment ||= create_environment end |
#set_environment(value) ⇒ Object
18 19 20 |
# File 'lib/puppet-repl/support/environment.rb', line 18 def set_environment(value) @puppet_environment = value end |