Skip to content

Commit

Permalink
Fix logic
Browse files Browse the repository at this point in the history
key? would return false/nil if set to such value, causing us to take
true branch

has_key?("key") will return true, regardless what value key is set,
causing us to take key value branch
  • Loading branch information
ytti committed Dec 3, 2018
1 parent 8f56230 commit 49cb00b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/oxidized/hook/ciscosparkdiff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def run_hook(ctx)
room = CiscoSpark::Room.new(id: cfg.space)
log "Connected"

if cfg.diff? ? cfg.diff : true
if cfg.has_key?("diff") ? cfg.diff : true
gitoutput = ctx.node.output.new
diff = gitoutput.get_diff ctx.node, ctx.node.group, ctx.commitref, nil
title = ctx.node.name.to_s
Expand Down
2 changes: 1 addition & 1 deletion lib/oxidized/hook/slackdiff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def run_hook(ctx)
client = Slack::Client.new
client.auth_test
log "Connected"
if cfg.diff? ? cfg.diff : true
if cfg.has_key?("diff") ? cfg.diff : true
gitoutput = ctx.node.output.new
diff = gitoutput.get_diff ctx.node, ctx.node.group, ctx.commitref, nil
unless diff == "no diffs"
Expand Down

0 comments on commit 49cb00b

Please sign in to comment.