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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ecf0e6bc86a0b3f164a138e987b5662d9187174
4
- data.tar.gz: f65f91ed16d01abc8e0c4a9595155ad081436d39
3
+ metadata.gz: d4f046e738c8b8fc2db1d3246e1268b686b8ed26
4
+ data.tar.gz: 8e47ab70bcfb2e6e1534b0c539727d60a4d1905e
5
5
  SHA512:
6
- metadata.gz: 99400e5556c15a0ce3b8f5c34c145f4523a01d0d4791d322e5f1b0500c875ed3303343566c319bb282650564bf5c658b1097f1d1270b976473e90fd87b9d1ab1
7
- data.tar.gz: b021d7702b990c1ae0097263c474ffa806e80e162f96ab383757458c45ca19ab2cdb9ef0edec5e73f938d1c27b85ffc07595b5aa9affdf9aa5459bb3662ff621
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")
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-circletime"
3
- spec.version = "1.0.0"
3
+ spec.version = "1.1.0"
4
4
  spec.authors = ["yutakakinjyo"]
5
5
  spec.email = ["yutakakinjyo@gmail.com"]
6
6
  spec.description = spec.summary
@@ -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.0.0
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.0
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.