lita-circletime 1.0.0 → 1.1.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/circletime.rb +8 -0
- data/lita-circletime.gemspec +1 -1
- data/spec/lita/handlers/circletime_spec.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4f046e738c8b8fc2db1d3246e1268b686b8ed26
|
4
|
+
data.tar.gz: 8e47ab70bcfb2e6e1534b0c539727d60a4d1905e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4ab253760908ea4bd130337cb27b7cb40d4bc4a597cd935dfe6c4bcd72f12ff71d122bfc795b92d82c12b58c3a43fab78351779b20536c66ce16d940f36c550
|
7
|
+
data.tar.gz: 03c0073e1419d8cf6ed117240d3fa3e2e5e1296846c8dbdbd28cebd2a40898e404af0d7539673cfb12f8d29caa0133e0c5e42b79542e575236782069b9d606d4
|
@@ -7,6 +7,7 @@ module Lita
|
|
7
7
|
route(/^build week$/, :week)
|
8
8
|
route(/^build month$/, :month)
|
9
9
|
route(/^org\s+(.+)/, :set)
|
10
|
+
route(/^org$/, :show)
|
10
11
|
|
11
12
|
def set(response)
|
12
13
|
org = response.match_data[1]
|
@@ -14,6 +15,13 @@ module Lita
|
|
14
15
|
response.reply("set " + org + " to org name")
|
15
16
|
end
|
16
17
|
|
18
|
+
def show(response)
|
19
|
+
org = redis.get("org")
|
20
|
+
reply = org.nil? ? "you not set org name yet" : "#{org} is setted to org now"
|
21
|
+
response.reply(reply)
|
22
|
+
end
|
23
|
+
|
24
|
+
|
17
25
|
def today(response)
|
18
26
|
build_time = CircleTime::BuildTime.new(redis.get("org"))
|
19
27
|
response.reply("Today's build time is " + (build_time.today / 1000/ 60 ).to_s + " min")
|
data/lita-circletime.gemspec
CHANGED
@@ -3,6 +3,7 @@ require "spec_helper"
|
|
3
3
|
describe Lita::Handlers::Circletime, lita_handler: true do
|
4
4
|
|
5
5
|
it { is_expected.to route("org orgname").to(:set) }
|
6
|
+
it { is_expected.to route("org").to(:show) }
|
6
7
|
it { is_expected.to route("build today").to(:today) }
|
7
8
|
it { is_expected.to route("build yestaday").to(:yestaday) }
|
8
9
|
it { is_expected.to route("build week").to(:week) }
|
@@ -13,4 +14,17 @@ describe Lita::Handlers::Circletime, lita_handler: true do
|
|
13
14
|
expect(replies.last).to eq("set yutakakinjyo to org name")
|
14
15
|
end
|
15
16
|
|
17
|
+
it "show org name" do
|
18
|
+
send_message("org yutakakinjyo")
|
19
|
+
send_message("org")
|
20
|
+
expect(replies.last).to eq("yutakakinjyo is setted to org now")
|
21
|
+
end
|
22
|
+
|
23
|
+
it "show nothing org name message" do
|
24
|
+
send_message("org")
|
25
|
+
expect(replies.last).to eq("you not set org name yet")
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
|
16
30
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-circletime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- yutakakinjyo
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
151
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.5.
|
152
|
+
rubygems_version: 2.4.5.1
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: Get amount of build time from organization on CircleCI.
|