lita-aws-cloudwatch 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/lita/handlers/aws_cloudwatch.rb +9 -9
- data/lita-aws-cloudwatch.gemspec +1 -1
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 5b5edc8ba7f73bc83c5c4fc95ce696ff97bc13d3
         | 
| 4 | 
            +
              data.tar.gz: b3e3d13e31343322266eb8b58031ef164646b61a
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 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  | 
| 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  | 
| 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:  | 
| 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]} (  | 
| 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 =  | 
| 100 | 
            +
                    target = find_target_by_name(room_name)
         | 
| 101 101 | 
             
                    robot.send_messages(target, message)
         | 
| 102 102 | 
             
                  end
         | 
| 103 103 |  | 
| 104 | 
            -
                  def  | 
| 104 | 
            +
                  def find_target_by_name(room_name)
         | 
| 105 105 | 
             
                    case robot.config.robot.adapter.to_s.to_sym
         | 
| 106 106 | 
             
                    when :slack
         | 
| 107 | 
            -
                       | 
| 108 | 
            -
             | 
| 109 | 
            -
                       | 
| 110 | 
            -
             | 
| 111 | 
            -
                       | 
| 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
         | 
    
        data/lita-aws-cloudwatch.gemspec
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            Gem::Specification.new do |spec|
         | 
| 2 2 | 
             
              spec.name          = "lita-aws-cloudwatch"
         | 
| 3 | 
            -
              spec.version       = "0.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. | 
| 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:  | 
| 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. | 
| 125 | 
            +
            rubygems_version: 2.4.8
         | 
| 126 126 | 
             
            signing_key: 
         | 
| 127 127 | 
             
            specification_version: 4
         | 
| 128 128 | 
             
            summary: AWS CloudWatch integration with AWS SNS
         |