Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable mash warnings (review catch up) #273

Merged
merged 3 commits into from Dec 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/itamae.rb
Expand Up @@ -13,6 +13,7 @@
require "itamae/definition"
require "itamae/ext"
require "itamae/generators"
require "itamae/mash"

module Itamae
# Your code goes here...
Expand Down
7 changes: 7 additions & 0 deletions lib/itamae/mash.rb
@@ -0,0 +1,7 @@
require 'hashie'

module Itamae
class Mash < Hashie::Mash
disable_warnings
end
end
6 changes: 3 additions & 3 deletions lib/itamae/node.rb
Expand Up @@ -10,7 +10,7 @@ class Node
attr_reader :mash

def initialize(hash, backend)
@mash = Hashie::Mash.new(hash)
@mash = Itamae::Mash.new(hash)
@backend = backend
end

Expand Down Expand Up @@ -43,7 +43,7 @@ def validate!(&block)
private

def _reverse_merge(other_hash)
Hashie::Mash.new(other_hash).merge(@mash)
Itamae::Mash.new(other_hash).merge(@mash)
end

def method_missing(method, *args)
Expand All @@ -63,7 +63,7 @@ def respond_to?(method, priv = false)
def fetch_inventory_value(key)
value = @backend.host_inventory[key]
if value.is_a?(Hash)
value = Hashie::Mash.new(value)
value = Itamae::Mash.new(value)
end

value
Expand Down
4 changes: 2 additions & 2 deletions lib/itamae/resource/base.rb
Expand Up @@ -16,7 +16,7 @@ class EvalContext
def initialize(resource)
@resource = resource

@attributes = Hashie::Mash.new
@attributes = Itamae::Mash.new
@notifications = []
@subscriptions = []
@verify_commands = []
Expand Down Expand Up @@ -222,7 +222,7 @@ def run_action(action)
end

def clear_current_attributes
@current_attributes = Hashie::Mash.new
@current_attributes = Itamae::Mash.new
end

def pre_action
Expand Down