kafo 0.3.14 → 0.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0496a19873a30d06682f5f4bddae25d90c838c27
4
- data.tar.gz: f0bc2200a00015baa213310d5eca3debee109bdc
3
+ metadata.gz: e5f3b53d3acb1f569726344a3938dc206cf8d932
4
+ data.tar.gz: 55d2bdbec9b251ad8b2627a62dde8daebf994215
5
5
  SHA512:
6
- metadata.gz: acd423eb8378d5037fb17f7a9303f3ee286e23d1663b2d058853c12b99643e8b256e4fac02cbb1382b201ee81184636448ea30312f5c265b81617943cf71c1b6
7
- data.tar.gz: ad77e18c4f672d344c410eafe4c87ba950e6ddc4d998be4d3662d44b5cbaa9ca2f5effcc96c7f38237c05565216f8a08e0c78e1877c52d689e728a78a29fef11
6
+ metadata.gz: 8eb5532dc9274eb7f59040a4dbb6cb66874cc68d1b234d00549eec93637c3ca904e42322894b51606c3ae9e701a79820234eb15340c23200e4c5c01deffe12b7
7
+ data.tar.gz: 89e24a276af409448af18d3c29515263f654567299d9b01186973d7c83beb146b4b38aaac10fec08bb6d0958aa412f2c0e33303d02175c16966ab67a1c72bbdc
@@ -15,7 +15,7 @@ module Kafo
15
15
  definitions = Dir.glob(validate_files) + Dir.glob(is_function_files)
16
16
 
17
17
  definitions.each do |file|
18
- require file
18
+ require File.expand_path(file)
19
19
  end
20
20
 
21
21
  @params = params
@@ -64,10 +64,14 @@ module Kafo
64
64
  def engine
65
65
  @engine ||= begin
66
66
  klass = Class.new
67
- env = Puppet::PUPPETVERSION.start_with?('2.') ? env.name : Puppet.lookup(:current_environment)
67
+ env = Puppet::PUPPETVERSION.start_with?('2.') ? nil : lookup_current_environment
68
68
  klass.send :include, Puppet::Parser::Functions.environment_module(env)
69
69
  klass.new
70
70
  end
71
71
  end
72
+
73
+ def lookup_current_environment
74
+ @current_environment ||= Puppet.respond_to?(:lookup) ? Puppet.lookup(:current_environment) : Puppet::Node::Environment.current
75
+ end
72
76
  end
73
77
  end
data/lib/kafo/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # encoding: UTF-8
2
2
  module Kafo
3
- VERSION = "0.3.14"
3
+ VERSION = "0.3.15"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kafo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.14
4
+ version: 0.3.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Hulan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-17 00:00:00.000000000 Z
11
+ date: 2014-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler