lita-stackstorm 0.4.0 → 0.5.0

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: 355c7b51c436309cd271eda9838f50e3ee509eae
4
- data.tar.gz: 07650ddee68c8a1e03c313d1888845a7959b36be
3
+ metadata.gz: 882ff1cc49a98751e6b5f2ea4d1801a1d661f0c8
4
+ data.tar.gz: eff92cd9224145295760a9c3e204083e86d026fa
5
5
  SHA512:
6
- metadata.gz: 6acb3369080dac3bcdd133e7ea32b37af81066f554da856f21ff5530e6d234cfa3a4311e7125c0a41f56e58add0d309775cecbf78fc7406de69279c13be8584f
7
- data.tar.gz: 3b3725f736f71bbd1c12cfa43cf5a8bd4f012d1772049dc0bb76ed7d5cf7ff76614c907c45704aff20a6569e42d9bee1fbb75a08c4e58c7332940c95e8b9b640
6
+ metadata.gz: b4924a3d7bae2a3cf6090af4948f412172b2860b1d44e28034702066f310f9f5b15998153beae5cef9ff944d141b6a877ea5f046d07373bc3d2dc3aeae8db176
7
+ data.tar.gz: f2eda6a8f04787578156d97853b52c940fe008fc93cdddbf4da9fdee2469c0b0f124f040f7fac5eb4e49ee43e61a0c43384f8694388f624454505693bc907117
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2015 Sophicware
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # lita-stackstorm
1
+ # lita-stackstorm [![Gem Version](https://badge.fury.io/rb/lita-stackstorm.svg)](http://badge.fury.io/rb/lita-stackstorm) **BETA**
2
2
 
3
3
  **lita-stackstorm** is an handler for [Lita](https://www.lita.io) that allows your bot to interact with your stackstorm installation via st2api.
4
4
 
@@ -35,4 +35,26 @@ end
35
35
 
36
36
  ## Usage
37
37
 
38
- TODO: Describe the plugin's features and how to use them.
38
+ `st2 list` - lists all chatops aliases from registered packs.
39
+
40
+ ### Executing Actions
41
+
42
+ Action Aliases require the `!` prefix. For example, in order to run the `packs.info` action when investigating the linux pack, you'll run:
43
+
44
+ ```shell
45
+ !pack info linux
46
+ ```
47
+
48
+ This handler also provide support for partial commands. For example, suppose you type:
49
+
50
+ ```shell
51
+ !pack deploy
52
+ ```
53
+
54
+ The handler will return the closest likely matches:
55
+
56
+ ```shell
57
+ possible matches:
58
+ pack deploy {{pack}}
59
+ pack deploy {{pack}} from {{repo}}
60
+ ```
data/Rakefile CHANGED
@@ -1,6 +1,14 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
+ require "github_changelog_generator/task"
3
4
 
4
5
  RSpec::Core::RakeTask.new(:spec)
5
6
 
7
+
8
+
9
+ GitHubChangelogGenerator::RakeTask.new :changelog do |config|
10
+ config.since_tag = 'v0.4.0'
11
+ config.future_release = 'v0.5.0'
12
+ end
13
+
6
14
  task default: :spec
@@ -47,13 +47,14 @@ module Lita
47
47
  payload = {
48
48
  name: command_array[0..1].join('_'),
49
49
  format: "#{command_array[0..1].join(' ')} {{pack}}",
50
- command: msg,
51
- user: msg.user,
50
+ command: msg.matches.flatten.first,
51
+ user: msg.user.name,
52
52
  source_channel: 'chatops',
53
53
  notification_channel: 'lita'
54
54
  }
55
55
  s = make_post_request(":#{config.execution_port}/v1/aliasexecution", payload)
56
- msg.reply "#{config.url}:#{config.execution_port}/#/history/#{s.body.to_s[1..-2]}/general"
56
+ j = JSON.parse(s.body)
57
+ msg.reply "Got it! Details available at #{config.url}/#/history/#{j['execution']['id']}/general"
57
58
  elsif l.length > 0
58
59
  response_text = "possible matches:"
59
60
  l.each do |match|
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-stackstorm"
3
- spec.version = "0.4.0"
3
+ spec.version = "0.5.0"
4
4
  spec.authors = ["Jurnell Cockhren"]
5
5
  spec.email = ["jurnell@sophicware.com"]
6
6
  spec.description = "Stackstorm handler for lita 4+"
@@ -21,4 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.add_development_dependency "rake"
22
22
  spec.add_development_dependency "rack-test"
23
23
  spec.add_development_dependency "rspec", ">= 3.0.0"
24
+ spec.add_development_dependency "fakeredis"
25
+ spec.add_development_dependency "github_changelog_generator"
26
+ spec.add_development_dependency "bump"
24
27
  end
@@ -1,4 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe Lita::Handlers::Stackstorm, lita_handler: true do
4
+ it { is_expected.to route_command('st2 login').to(:login) }
5
+ it { is_expected.to route_command('st2 list').to(:list) }
6
+ it { is_expected.to route_command('!pack info').to(:call_alias) }
4
7
  end
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "lita-stackstorm"
2
2
  require "lita/rspec"
3
+ require 'fakeredis/rspec'
3
4
 
4
5
  # A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
5
6
  # was generated with Lita 4, the compatibility mode should be left disabled.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-stackstorm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jurnell Cockhren
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-30 00:00:00.000000000 Z
11
+ date: 2016-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita
@@ -94,6 +94,48 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 3.0.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: fakeredis
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: github_changelog_generator
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: bump
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
97
139
  description: Stackstorm handler for lita 4+
98
140
  email:
99
141
  - jurnell@sophicware.com
@@ -103,6 +145,7 @@ extra_rdoc_files: []
103
145
  files:
104
146
  - ".gitignore"
105
147
  - Gemfile
148
+ - LICENSE
106
149
  - README.md
107
150
  - Rakefile
108
151
  - lib/lita-stackstorm.rb