lita-aws-cloudwatch 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd3b6f952230d48f6f56dc7745bcb2a9f33c2687
4
- data.tar.gz: 101e2b55f44ecbc6564251c02c7fb4c6950f0c1e
3
+ metadata.gz: 5b5edc8ba7f73bc83c5c4fc95ce696ff97bc13d3
4
+ data.tar.gz: b3e3d13e31343322266eb8b58031ef164646b61a
5
5
  SHA512:
6
- metadata.gz: 81e6f1b04d7f80b68fb9158e909b6c6e6f4699e28006a60f9a2437417e5692338dc39392b25628f0de96ecd8bbefc12edfb1ac61748eefba3d6a436e3ce0cbfa
7
- data.tar.gz: dc6728dbf2bb417220652346d33070b840b1183fbe3113705bd69b0e0a1e817ac6c516f019bb3951a008d03da2fb8474a5af23372b1cbcb2100dbb46f3fba241
6
+ metadata.gz: bea317dd13a0d6572aa2990dcd1aba863ec35d8ac7938b57dcaed35c65b65b0d8c4e40c44a524ca11d910f2c5b153340518f8d409dda65e0eb6a7bb8acd2e894
7
+ data.tar.gz: d0a751e262f77cbb6bedd74f310822d87c534f0b90afb3d365f61dca678a20068d3622cde8eb4bf4c14773e43c9483aa2e1c01a0758ceeb3c88ce71dc2aef195
data/README.md CHANGED
@@ -63,9 +63,9 @@ aws account list
63
63
  aws account set 123123 5Fpro co. ltd.
64
64
  ```
65
65
 
66
- - `aws account set [account id] [room name]` : set notify room for account. If you use Slack, it need to invite lita robot to room.
66
+ - `aws account room [account id] [room name]` : set notify room for account. If you use Slack, it need to invite lita robot to room.
67
67
  ```
68
- aws account set 123123 #server-state.
68
+ aws account room 123123 #server-state.
69
69
  ```
70
70
 
71
71
  ## License
@@ -16,12 +16,12 @@ module Lita
16
16
  account_id = response.matches[0][0]
17
17
  room_name = response.matches[0][1].gsub("#", "")
18
18
  redis.hset(redis_key_for_room, account_id, room_name)
19
- response.reply("AWS account: #{account_id} has set room to: ##{room_name} , please invite robot to the room.")
19
+ response.reply("AWS account: #{account_id} has set room to: #{room_name} , please invite robot to the room.")
20
20
  end
21
21
 
22
22
  route(/^aws account list/, :list_accounts, command: true, help: { "aws account list" => "List all AWS accounts" })
23
23
  def list_accounts(response)
24
- message = accounts.keys.map{ |key| "#{key}: #{accounts[key]} ( ##{fetch_room(key)} )" }.join("\n")
24
+ message = accounts.keys.map{ |key| "#{key}: #{accounts[key]} ( #{fetch_room(key)} )" }.join("\n")
25
25
  response.reply(message)
26
26
  end
27
27
 
@@ -97,18 +97,18 @@ module Lita
97
97
 
98
98
  def send_message_to_room(message, room_name = nil)
99
99
  room_name ||= config.default_room
100
- target = Source.new(room: find_room_id_by_name(room_name))
100
+ target = find_target_by_name(room_name)
101
101
  robot.send_messages(target, message)
102
102
  end
103
103
 
104
- def find_room_id_by_name(room_name)
104
+ def find_target_by_name(room_name)
105
105
  case robot.config.robot.adapter.to_s.to_sym
106
106
  when :slack
107
- if room = ::Lita::Room.find_by_name(room_name)
108
- return room.id
109
- else
110
- ::Lita::Room.find_by_name("general").id
111
- end
107
+ room = ::Lita::Room.find_by_name(room_name)
108
+ room_id = room ? room.id : ::Lita::Room.find_by_name("general").id
109
+ Source.new(room: room_id)
110
+ when :flowdock
111
+ FlowdockSource.new(room: room_name)
112
112
  else
113
113
  room_name
114
114
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-aws-cloudwatch"
3
- spec.version = "0.1.1"
3
+ spec.version = "0.1.2"
4
4
  spec.authors = ["marsz"]
5
5
  spec.email = ["marsz330@gmail.com"]
6
6
  spec.description = "Receive AWS CloudWatch alarm from AWS SNS (Simple Notification Service), and messaging to room."
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-aws-cloudwatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - marsz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-06 00:00:00.000000000 Z
11
+ date: 2016-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita
@@ -122,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  version: '0'
123
123
  requirements: []
124
124
  rubyforge_project:
125
- rubygems_version: 2.4.6
125
+ rubygems_version: 2.4.8
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: AWS CloudWatch integration with AWS SNS