onering-client 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ $: << File.expand_path(File.dirname(__FILE__))
2
2
 
3
3
  module Onering
4
4
  module Client
5
- VERSION = "0.3.1"
5
+ VERSION = "0.3.2"
6
6
 
7
7
  class Error < Exception; end
8
8
  class FatalError < Error; end
@@ -198,7 +198,7 @@ module Onering
198
198
  # this is kinda ugly
199
199
  # because we don't know which property might have an @-prefix, progressively
200
200
  # search through all of them. first non-null match wins
201
- parts = field.split('.')
201
+ parts = field.to_s.split('.')
202
202
 
203
203
  # create an array with every component of the path prefixed with the @-symbol, then with
204
204
  # the path as is.
@@ -95,27 +95,27 @@ module Onering
95
95
  if name.downcase == 'all'
96
96
  return Facter.to_hash()
97
97
  else
98
- fact = Facter.value(name)
98
+ fact_value = Facter.value(name)
99
99
 
100
100
  # short circuit nil responses
101
- if fact.nil?
101
+ if fact_value.nil?
102
102
  return reporter.report().get(name, default)
103
103
  end
104
104
 
105
105
  # if we are asking for a nested object...
106
106
  if name.include?('.')
107
107
  # ...and the response IS an object...
108
- if fact.is_a?(Hash)
108
+ if fact_value.is_a?(Hash)
109
109
  # remove the first part and return the rest
110
110
  name = name.sub(/^[^\.]+\./,'')
111
- return fact.get(name, default)
111
+ return fact_value.get(name, default)
112
112
  else
113
113
  # not an object, return default
114
114
  return reporter.report().get(name, default)
115
115
  end
116
116
  else
117
117
  # this is a simple request, return the fact
118
- return fact
118
+ return fact_value
119
119
  end
120
120
  end
121
121
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: onering-client
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.1
5
+ version: 0.3.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Gary Hetzel