lita-ey-info 0.0.1 → 0.0.3

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: 3de1ea3aff8db3f56bf64d3ce7e46f4564017bf1
4
- data.tar.gz: b06ee0d6ebc4663ed8512029c86d9921b541616b
3
+ metadata.gz: 4639d6b3167bf30cd457c791627192ca533a749c
4
+ data.tar.gz: 246c7d3a24e6c3e3b480f89771661978369d1490
5
5
  SHA512:
6
- metadata.gz: 3e7122451fd6197f2d4dc2c83c59156e5f8c3e0ad1ef2a82bb9ae0185faf685453fe697ad62b4e736c67d3a668e8e580eac7e70c88294e1e7ae09fbf9a64a4c2
7
- data.tar.gz: e2349198a2b1f6aaf5789ccb3ff7bae231a8f2c9ab99b0f0ab65ae17240e1e990c89621cde5da199a29a354a9b149f727cd7d9d70b8eb4d62bbb8d93823e75b9
6
+ metadata.gz: a668dcab0220e282515444943d597b0e85eee7bdd38e7ab7f06fd33adbb493d66242c8541db970ff4fc82e4eb1c1cc3462097f684bcc174f3668f6159b6f13d6
7
+ data.tar.gz: 4d0fadb379804dd103aaf979afd2cb631baefad254f4a754124e4e773bff3d297bdcd2a5975e500100182b54c17561b7c9acbed02c60f312167cb04eed55d40e
data/.gitignore CHANGED
@@ -1,6 +1,8 @@
1
1
  *.gem
2
2
  .bundle
3
3
  .config
4
+ .coveralls.yml
4
5
  .ruby-gemset
5
6
  .ruby-version
6
- coverage
7
+ coverage
8
+ pkg
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ -f documentation --color
data/.travis.yml ADDED
@@ -0,0 +1,13 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ script: bundle exec rake
5
+ before_install:
6
+ - gem update --system
7
+ services:
8
+ - redis-server
9
+ notifications:
10
+ email: false
11
+ webhooks:
12
+ urls:
13
+ - https://lita-freenode.herokuapp.com/travis
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lita-ey-info (0.0.1)
4
+ lita-ey-info (0.0.3)
5
5
  engineyard
6
6
  lita (>= 3.2.0)
7
7
 
@@ -9,6 +9,12 @@ GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
11
  addressable (2.3.6)
12
+ coveralls (0.7.0)
13
+ multi_json (~> 1.3)
14
+ rest-client
15
+ simplecov (>= 0.7)
16
+ term-ansicolor
17
+ thor
12
18
  diff-lcs (1.2.5)
13
19
  docile (1.1.3)
14
20
  engineyard (2.3.3)
@@ -78,7 +84,10 @@ GEM
78
84
  multi_json
79
85
  simplecov-html (~> 0.8.0)
80
86
  simplecov-html (0.8.0)
87
+ term-ansicolor (1.3.0)
88
+ tins (~> 1.0)
81
89
  thor (0.19.1)
90
+ tins (1.3.0)
82
91
  url_mount (0.2.1)
83
92
  rack
84
93
 
@@ -87,6 +96,7 @@ PLATFORMS
87
96
 
88
97
  DEPENDENCIES
89
98
  bundler
99
+ coveralls
90
100
  lita-ey-info!
91
101
  rake
92
102
  rspec (>= 3.0.0.beta1)
data/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # lita-ey-info
2
2
 
3
- A handler for [Lita](http://lita.io/) to display EngineYard info.
3
+ [![Build Status](https://travis-ci.org/carlosparamio/lita-ey-info.png?branch=master)](https://travis-ci.org/carlosparamio/lita-ey-info)
4
+ [![Code Climate](https://codeclimate.com/github/carlosparamio/lita-ey-info.png)](https://codeclimate.com/github/carlosparamio/lita-ey-info)
5
+ [![Coverage Status](https://coveralls.io/repos/carlosparamio/lita-ey-info/badge.png)](https://coveralls.io/r/carlosparamio/lita-ey-info)
6
+
7
+ **lita-ey-info** is a handler for [Lita](http://lita.io/) that displays EngineYard info.
4
8
 
5
9
  ## Installation
6
10
 
@@ -10,11 +14,21 @@ Add lita-ey-info to your Lita instance's Gemfile:
10
14
  gem "lita-ey-info"
11
15
  ```
12
16
 
17
+ Don't forget to include your EngineYard API key on the lita_config.rb file:
18
+
19
+ ``` ruby
20
+ config.handlers.ey.api_token = "YOUR_EY_API_TOKEN"
21
+ ```
22
+
13
23
  ## Usage
14
24
 
15
25
  ```
16
- ey envs
17
- ey <app_name> <env_name> servers
18
- ey <app_name> <env_name> logs
19
- ey <app_name> <env_name> status
20
- ```
26
+ You: @Lita ey envs
27
+ You: @Lita ey <app_name> <env_name> servers
28
+ You: @Lita ey <app_name> <env_name> logs
29
+ You: @Lita ey <app_name> <env_name> status
30
+ ```
31
+
32
+ ## License
33
+
34
+ [MIT](http://opensource.org/licenses/MIT)
@@ -8,12 +8,12 @@ module Lita
8
8
  "ey envs" => "Display list of all applications and environments."
9
9
  })
10
10
 
11
- route(/ey (\w*) (\w*) servers/i, :list_servers, restrict_to: :ey_admins, command: true, help: {
12
- "ey <app> <env> servers" => "Display list of all servers for an application environment."
11
+ route(/ey (\w*) servers/i, :list_servers, restrict_to: :ey_admins, command: true, help: {
12
+ "ey <env> servers" => "Display list of all servers for an application environment."
13
13
  })
14
14
 
15
- route(/ey (\w*) (\w*) logs/i, :show_logs, restrict_to: :ey_admins, command: true, help: {
16
- "ey <app> <env> logs" => "Retrieve the latest logs for an application environment."
15
+ route(/ey (\w*) logs/i, :show_logs, restrict_to: :ey_admins, command: true, help: {
16
+ "ey <env> logs" => "Retrieve the latest logs for an application environment."
17
17
  })
18
18
 
19
19
  route(/ey (\w*) (\w*) status/i, :show_status, restrict_to: :ey_admins, command: true, help: {
@@ -24,30 +24,44 @@ module Lita
24
24
  config.api_token = ""
25
25
  end
26
26
 
27
+ def self.namespace
28
+ "ey"
29
+ end
30
+
27
31
  def list_envs(response)
28
- response.reply "I've sent you the apps and environments list privately... shhhh..." unless response.message.source.private_message?
29
- response.reply_privately `ey environments --all --api-token=#{config.api_token}`
32
+ response.reply retrieving_msg
33
+ response.reply_privately `bundle exec ey environments --all --api-token=#{config.api_token}`
34
+ response.reply private_msg unless response.message.source.private_message?
30
35
  end
31
36
 
32
37
  def list_servers(response)
33
- app = response.matches[0][0]
34
- env = response.matches[0][1]
35
- response.reply "I've sent you the servers list privately... shhhh..." unless response.message.source.private_message?
36
- response.reply_privately `ey servers --app=#{app} --environment=#{env} --api-token=#{config.api_token}`
38
+ env = response.matches[0][0]
39
+ response.reply retrieving_msg
40
+ response.reply_privately `bundle exec ey servers --environment=#{env} --api-token=#{config.api_token}`
41
+ response.reply private_msg unless response.message.source.private_message?
37
42
  end
38
43
 
39
44
  def show_logs(response)
40
- app = response.matches[0][0]
41
- env = response.matches[0][1]
42
- response.reply "I've sent you the logs privately... shhhh..." unless response.message.source.private_message?
43
- response.reply_privately `ey logs --app=#{app} --environment=#{env} --api-token=#{config.api_token}`
45
+ env = response.matches[0][0]
46
+ response.reply retrieving_msg
47
+ response.reply_privately `bundle exec ey logs --environment=#{env} --api-token=#{config.api_token}`
48
+ response.reply private_msg unless response.message.source.private_message?
44
49
  end
45
50
 
46
51
  def show_status(response)
47
52
  app = response.matches[0][0]
48
53
  env = response.matches[0][1]
49
- response.reply "I've sent you the apps and environments list privately... shhhh..." unless response.message.source.private_message?
50
- response.reply_privately `ey status --app=#{app} --environment=#{env} --api-token=#{config.api_token}`
54
+ response.reply retrieving_msg
55
+ response.reply_privately `bundle exec ey status --app=#{app} --environment=#{env} --api-token=#{config.api_token}`
56
+ response.reply private_msg unless response.message.source.private_message?
57
+ end
58
+
59
+ def retrieving_msg
60
+ "Retrieving info..."
61
+ end
62
+
63
+ def private_msg
64
+ "I've sent you the servers list privately... shhhh..."
51
65
  end
52
66
 
53
67
  end
data/lita-ey-info.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-ey-info"
3
- spec.version = "0.0.1"
3
+ spec.version = "0.0.3"
4
4
  spec.authors = ["Carlos Paramio"]
5
5
  spec.email = ["hola@carlosparamio.com"]
6
6
  spec.description = %q{A Lita handler to consult EY info.}
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.add_dependency "engineyard"
19
19
 
20
20
  spec.add_development_dependency "bundler"
21
+ spec.add_development_dependency "coveralls"
21
22
  spec.add_development_dependency "rake"
22
23
  spec.add_development_dependency "rspec", ">= 3.0.0.beta1"
23
24
  spec.add_development_dependency "simplecov"
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe Lita::Handlers::EyInfo, lita_handler: true do
4
4
  it { routes_command("ey envs").to(:list_envs) }
5
- it { routes_command("ey appname envname servers").to(:list_servers) }
6
- it { routes_command("ey appname envname logs").to(:show_logs) }
5
+ it { routes_command("ey envname servers").to(:list_servers) }
6
+ it { routes_command("ey envname logs").to(:show_logs) }
7
7
  it { routes_command("ey appname envname status").to(:show_status) }
8
8
  end
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,11 @@
1
+ require "coveralls"
1
2
  require "simplecov"
3
+
2
4
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
3
5
  SimpleCov::Formatter::HTMLFormatter,
6
+ Coveralls::SimpleCov::Formatter
4
7
  ]
5
8
  SimpleCov.start { add_filter "/spec/" }
6
9
 
7
10
  require "lita-ey-info"
8
- require "lita/rspec"
11
+ require "lita/rspec"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-ey-info
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Paramio
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: coveralls
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rake
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -102,6 +116,8 @@ extensions: []
102
116
  extra_rdoc_files: []
103
117
  files:
104
118
  - .gitignore
119
+ - .rspec
120
+ - .travis.yml
105
121
  - Gemfile
106
122
  - Gemfile.lock
107
123
  - LICENSE