lita-heroku 0.1.11 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/heroku.rb +7 -1
- data/lita-heroku.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: fabf8f63eb71b097a9c5f42cf76a00edda509db9
|
4
|
+
data.tar.gz: efb3bcc33f8cf9b1a65886f983a2fc24fd16e930
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ea2e9bf85b57a7ee35a3b8fda22c32f3251ee07e7cac3aad1b70b15ad0a5566d1149f4d17550807a8bc8099917dd3d0e5508203c9bb1af55767a2de9218e2ce
|
7
|
+
data.tar.gz: 6309659e606f1757ef9ef1a3d7e2a864a530bdc99925de087081df0b49fe7f1f9d700a21d6324027fb0cfb4322fdd560e4d5952b60a4d3c7be9cc3d91ddc7d69
|
data/lib/lita/handlers/heroku.rb
CHANGED
@@ -9,7 +9,8 @@ module Lita
|
|
9
9
|
|
10
10
|
route(/^hk\s+([^ ]+)\s+(.+)/, :heroku_cmd, command: true, help: {
|
11
11
|
"hk [app name] [command]" => "example: 'lita hk production ps'",
|
12
|
-
"hk [app name] deploy" => "example: 'lita hk production deploy'"
|
12
|
+
"hk [app name] deploy" => "example: 'lita hk production deploy'",
|
13
|
+
"hk [app name] psql [query]" => "example: 'lita hk production psql select * from users'"
|
13
14
|
})
|
14
15
|
|
15
16
|
def heroku_cmd(response)
|
@@ -17,6 +18,9 @@ module Lita
|
|
17
18
|
command = response.matches[0][1]
|
18
19
|
if command.start_with? "deploy"
|
19
20
|
heroku_deploy response
|
21
|
+
elsif command.start_with? "psql"
|
22
|
+
command = command[5..-1]
|
23
|
+
stream_command response, "echo \"#{command}\" | #{heroku_bin} pg:psql -a #{config.app_prefix}#{environment}"
|
20
24
|
else
|
21
25
|
stream_command response, "#{heroku_bin} #{command} -a #{config.app_prefix}#{environment}"
|
22
26
|
end
|
@@ -84,10 +88,12 @@ module Lita
|
|
84
88
|
text += char
|
85
89
|
text_response = "```#{text}```"
|
86
90
|
if Time.now.to_i - last_update > 2
|
91
|
+
text_response = text_response[0..3600] + "```\nTruncated (3600 of #{text_response.length})..." if text_response.length > 3600
|
87
92
|
last_update = Time.now.to_i
|
88
93
|
update_response channel, timestamp, text_response
|
89
94
|
end
|
90
95
|
end
|
96
|
+
text_response = text_response[0..3600] + "```\nTruncated (3600 of #{text_response.length})..." if text_response.length > 3600
|
91
97
|
update_response channel, timestamp, text_response
|
92
98
|
end
|
93
99
|
end
|
data/lita-heroku.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-heroku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Boehs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
135
|
rubyforge_project:
|
136
|
-
rubygems_version: 2.
|
136
|
+
rubygems_version: 2.6.8
|
137
137
|
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: Lita handler for interacting with Heroku Apps
|