diff options
author | rgnv <rondutt@gmail.com> | 2018-04-12 15:41:31 -0700 |
---|---|---|
committer | rgnv <rondutt@gmail.com> | 2018-04-12 15:41:31 -0700 |
commit | ec90b081f0fed05497ce6ae21e4b4ba4d44ecc01 (patch) | |
tree | 73aa9f6a51753ed5575166dc9c201041031e27d0 | |
parent | 48e50aca2229214fd5465d7faf1bd2908358c9ab (diff) |
fix formatting to comply with Rubocop
-rw-r--r-- | docs/Hooks.md | 2 | ||||
-rw-r--r-- | lib/oxidized/hook/ciscosparkdiff.rb | 5 |
2 files changed, 2 insertions, 5 deletions
diff --git a/docs/Hooks.md b/docs/Hooks.md index b11570a..ee7b3ee 100644 --- a/docs/Hooks.md +++ b/docs/Hooks.md @@ -188,7 +188,7 @@ Note the channel name must be in quotes. The `ciscosparkdiff` hook posts config diffs to a [Cisco Spark](https://www.ciscospark.com/) space of your choice. It only triggers for `post_store` events. -You will need to manually install the `cisco_spark` gem on your system (see [cisco_spark-ruby](https://github.com/NGMarmaduke/cisco_spark-ruby ) and generate either a [Bot or OAUTH access key](https://developer.ciscospark.com/apps.html), and retrieve the [Spark Space ID](https://developer.ciscospark.com/endpoint-rooms-get.html) +You will need to manually install the `cisco_spark` gem on your system (see [cisco_spark-ruby](https://github.com/NGMarmaduke/cisco_spark-ruby)) and generate either a [Bot or OAUTH access key](https://developer.ciscospark.com/apps.html), and retrieve the [Spark Space ID](https://developer.ciscospark.com/endpoint-rooms-get.html) ```shell gem install cisco_spark diff --git a/lib/oxidized/hook/ciscosparkdiff.rb b/lib/oxidized/hook/ciscosparkdiff.rb index a1c9130..12094e6 100644 --- a/lib/oxidized/hook/ciscosparkdiff.rb +++ b/lib/oxidized/hook/ciscosparkdiff.rb @@ -22,7 +22,6 @@ class CiscoSparkDiff < Oxidized::Hook client = CiscoSpark::Room.new(id: space) client.fetch log "Connected" - # diff snippet - default diffenable = true if cfg.has_key?('diff') == true if cfg.diff == false @@ -34,12 +33,10 @@ class CiscoSparkDiff < Oxidized::Hook diff = gitoutput.get_diff ctx.node, ctx.node.group, ctx.commitref, nil title = "#{ctx.node.name.to_s}" log "Posting diff as snippet to #{cfg.space}" - message = CiscoSpark::Message.new(text: 'Device ' + title + ' modified:' + "\n" + diff[:patch].lines.to_a[4..-1].join - ) + message = CiscoSpark::Message.new(text: 'Device ' + title + ' modified:' + "\n" + diff[:patch].lines.to_a[4..-1].join) room = CiscoSpark::Room.new(id: space) room.send_message(message) end - # message custom formatted - optional if cfg.has_key?('message') == true log cfg.message msg = cfg.message % {:node => ctx.node.name.to_s, :group => ctx.node.group.to_s, :commitref => ctx.commitref, :model => ctx.node.model.class.name.to_s.downcase} |