ruboty-gitlab 0.0.4 → 0.0.5

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: 3db9bb67ba8b770adb421aca3926538c2f2212d1
4
- data.tar.gz: 7b6bf67039bfc79b6797034719ba7967b584758c
3
+ metadata.gz: 4e78275252093665c99534a9cb71427f0ef71e14
4
+ data.tar.gz: 04250a80997f2330c3ae33cbeedf8149597f68be
5
5
  SHA512:
6
- metadata.gz: d229d58a50841f39fae0404e1fa924054bc214b4a54bd72ab7acd8f6aa26c27ae3dd86c65b951c3984917d9f9e7c10226b96507b631e583c5567ff84cb878c6d
7
- data.tar.gz: 8f1ad6d1f8402cc7b6781ded923da415326096158ae53aee8e0401979f13c3e689d955a3780bbcff133b1104f52e1299c661ba92aa20386867f71067f83ccc62
6
+ metadata.gz: fdbfa8296243ef4fb5a8eab2bfd009af5610cf66fbb778695f67319282c4c4e04100616f7cd1129103fa94ca3593619c608f17388b506e6678e3918dd78e58ff
7
+ data.tar.gz: 514429c0a9ca67ab3d3f9cef5f787b02b2f101e31a0f6346104ce74308026e2f8fc33df34337a8b9fccda28c5a89aaf4017a20bfa2e4f5801ea37ac064ba7bf1
data/README.md CHANGED
@@ -14,6 +14,7 @@ gem "ruboty-gitlab"
14
14
  ```
15
15
  @ruboty create gitlab issue "<title>" on <project>[\n<description>] - Create a new issue
16
16
  @ruboty remember my gitlab token <token> - Remember sender's GitLab private token
17
+ @ruboty clear cache gitlab brain - Clear cache of GitLab's brain
17
18
  ```
18
19
 
19
20
  ## ENV
@@ -3,6 +3,7 @@ require "gitlab"
3
3
 
4
4
  require "ruboty"
5
5
  require "ruboty/gitlab/actions/base"
6
+ require "ruboty/gitlab/actions/clear_cache"
6
7
  require "ruboty/gitlab/actions/create_issue"
7
8
  require "ruboty/gitlab/actions/remember"
8
9
  require "ruboty/gitlab/version"
@@ -52,6 +52,10 @@ module Ruboty
52
52
  message[:project]
53
53
  end
54
54
 
55
+ def clear_projects
56
+ message.robot.brain.data[NAMESPACE][:projects] = nil
57
+ end
58
+
55
59
  def client
56
60
  ::Gitlab::Client.new(client_options)
57
61
  end
@@ -0,0 +1,18 @@
1
+ module Ruboty
2
+ module Gitlab
3
+ module Actions
4
+ class ClearCache < Base
5
+ def call
6
+ clear_projects
7
+ report
8
+ end
9
+
10
+ private
11
+
12
+ def report
13
+ message.reply("Cleared gitlab brain cache")
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Gitlab
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -15,6 +15,12 @@ module Ruboty
15
15
  description: "Remember sender's GitLab private token",
16
16
  )
17
17
 
18
+ on(
19
+ /clear cache gitlab brain\z/,
20
+ name: "clear_cache",
21
+ description: "Clear cache of GitLab's brain",
22
+ )
23
+
18
24
  def create_issue(message)
19
25
  Ruboty::Gitlab::Actions::CreateIssue.new(message).call
20
26
  end
@@ -22,6 +28,10 @@ module Ruboty
22
28
  def remember(message)
23
29
  Ruboty::Gitlab::Actions::Remember.new(message).call
24
30
  end
31
+
32
+ def clear_cache(message)
33
+ Ruboty::Gitlab::Actions::ClearCache.new(message).call
34
+ end
25
35
  end
26
36
  end
27
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-gitlab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - fakestarbaby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-22 00:00:00.000000000 Z
11
+ date: 2016-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruboty
@@ -84,6 +84,7 @@ files:
84
84
  - bin/setup
85
85
  - lib/ruboty/gitlab.rb
86
86
  - lib/ruboty/gitlab/actions/base.rb
87
+ - lib/ruboty/gitlab/actions/clear_cache.rb
87
88
  - lib/ruboty/gitlab/actions/create_issue.rb
88
89
  - lib/ruboty/gitlab/actions/remember.rb
89
90
  - lib/ruboty/gitlab/version.rb