elecksee 1.0.18 → 1.0.20

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## v1.0.20
2
+ * Fix `LxcFileConfig` population when using `Chef::Resource` instance
3
+
1
4
  ## v1.0.18
2
5
  * Use shellwords to properly break down commands
3
6
  * Force hash type as required
@@ -7,10 +7,20 @@ class Lxc
7
7
  class << self
8
8
 
9
9
  def convert_to_hash(thing)
10
- unless(thing.is_a?(Hash))
11
- result = defined?(Mash) ? Mash.new : {}
12
- thing.to_hash.each do |k,v|
13
- result[k] = v.respond_to?(:keys) && v.respond_to?(:values) ? convert_to_hash(v) : v
10
+ if(defined?(Chef) && thing.is_a?(Chef::Resource))
11
+ result = Hash[*(
12
+ (thing.methods - Chef::Resource.instance_methods).map{ |key|
13
+ unless(key.to_s.start_with?('_') || thing.send(key).nil?)
14
+ [key, thing.send(key)]
15
+ end
16
+ }.compact.flatten(1)
17
+ )]
18
+ else
19
+ unless(thing.is_a?(Hash))
20
+ result = defined?(Mash) ? Mash.new : {}
21
+ thing.to_hash.each do |k,v|
22
+ result[k] = v.respond_to?(:keys) && v.respond_to?(:values) ? convert_to_hash(v) : v
23
+ end
14
24
  end
15
25
  end
16
26
  result || thing
@@ -2,5 +2,5 @@ module Elecksee
2
2
  class Version < Gem::Version
3
3
  end
4
4
 
5
- VERSION = Version.new('1.0.18')
5
+ VERSION = Version.new('1.0.20')
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elecksee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.18
4
+ version: 1.0.20
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-23 00:00:00.000000000 Z
12
+ date: 2014-01-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mixlib-shellout