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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2d5358d28713b3f5bf2e1b69c602aabd45d7a11
4
- data.tar.gz: fd17dd9825ccf306886bc50a4976e3996705893c
3
+ metadata.gz: fabf8f63eb71b097a9c5f42cf76a00edda509db9
4
+ data.tar.gz: efb3bcc33f8cf9b1a65886f983a2fc24fd16e930
5
5
  SHA512:
6
- metadata.gz: a186699927d1209ecaf07ddad88a1d985f99fb4804edfea437cebfd89b440747b0f08d77d3f75ee421bf67be880e3f719020acebe7a648d64c5029fa5090e4c8
7
- data.tar.gz: bffdf8f2d1108bda8255f63a567451f44b1252e8c99078fa1cf4065901f5b03b3665171cf468ea9a19ec259c8cfe3977adb1a082ac734dcbc7d081ecf3a0abfe
6
+ metadata.gz: 8ea2e9bf85b57a7ee35a3b8fda22c32f3251ee07e7cac3aad1b70b15ad0a5566d1149f4d17550807a8bc8099917dd3d0e5508203c9bb1af55767a2de9218e2ce
7
+ data.tar.gz: 6309659e606f1757ef9ef1a3d7e2a864a530bdc99925de087081df0b49fe7f1f9d700a21d6324027fb0cfb4322fdd560e4d5952b60a4d3c7be9cc3d91ddc7d69
@@ -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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-heroku"
3
- spec.version = "0.1.11"
3
+ spec.version = "0.2.0"
4
4
  spec.authors = ["Eric Boehs"]
5
5
  spec.email = ["ericboehs@gmail.com"]
6
6
  spec.description = "Lita handler for interacting with Heroku Apps"
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.1.11
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: 2016-06-20 00:00:00.000000000 Z
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.5.1
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