lib/omnibus/ohai.rb in omnibus-3.2.2 vs lib/omnibus/ohai.rb in omnibus-4.0.0.beta.1
- old
+ new
@@ -14,31 +14,10 @@
# limitations under the License.
#
require 'ohai'
-class Mash
- #
- # @todo Remove in the next major release
- #
- # Ohai 7 removed the ability to access Ohai attributes via dot notation. This
- # temporary monkey patch provides the ability for users to still use the old
- # dot notation, while printing out a deprecation error.
- #
- def method_missing(m, *args, &block)
- if key?(m)
- Omnibus.logger.deprecated('Ohai') do
- "Ohai.#{m}. Please use Ohai['#{m}'] instead."
- end
-
- fetch(m)
- else
- super
- end
- end
-end
-
module Omnibus
class Ohai
PLUGINS = [
'cpu',
'kernel',
@@ -57,35 +36,5 @@
@ohai ||= ::Ohai::System.new.tap { |o| o.all_plugins(PLUGINS) }.data
end
end
end
end
-
-module Omnibus
- class OhaiWithWarning < Ohai
- include Logging
-
- class << self
- def method_missing(m, *args, &block)
- bad_boy = caller[2]
-
- unless warned[bad_boy]
- log.deprecated('OHAI') do
- "OHAI constant. Please use Ohai instead: #{bad_boy}"
- end
- warned[bad_boy] = true
- end
-
- Ohai.send(m, *args, &block)
- end
-
- def warned
- @warned ||= {}
- end
- end
- end
-end
-
-#
-# @todo remove in the next major release
-#
-OHAI = Omnibus::OhaiWithWarning