octospy 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.env.example +4 -0
- data/.rspec +1 -0
- data/README.md +59 -8
- data/lib/cinch/plugins/octospy.rb +1 -1
- data/lib/cinch/plugins/octospy/job.rb +1 -1
- data/lib/cinch/plugins/octospy/recording.rb +14 -14
- data/lib/octospy.rb +0 -1
- data/lib/octospy/recordable.rb +24 -15
- data/lib/octospy/recordable/channel.rb +2 -2
- data/lib/octospy/version.rb +1 -1
- data/octospy.gemspec +1 -0
- metadata +18 -4
- data/lib/octospy/recordable/repo.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cd0013747a9a0beb2685537dfe99b7afc590887
|
4
|
+
data.tar.gz: ad7d7b31e172f099dfac8a0167db0568502e4506
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1acb8dcef9fafe09dce81b7104366a066a1c1f994522336833f3938e5adf4c40d855d1849ca6b614944453e5d301a1872cced2148049d8ee805681203e7da3ec
|
7
|
+
data.tar.gz: 51b3b6dc3f079ac109471235edea04206f4508b9f84ffe29455486c8caeb154ad7c5de256a0c112ddcc87d529e47ee9e22ac8e1bdd5aff8e50b51c5314f99fa1
|
data/.env.example
ADDED
data/.rspec
CHANGED
data/README.md
CHANGED
@@ -13,30 +13,81 @@ Octospy
|
|
13
13
|
[codeclimate]: https://codeclimate.com/github/linyows/octospy
|
14
14
|
[coveralls]: https://coveralls.io/r/linyows/octospy
|
15
15
|
|
16
|
-
Octospy notifies the repository activity to
|
16
|
+
Octospy notifies the repository activity to some IRC channels.
|
17
17
|
|
18
|
+
<div align="center">
|
18
19
|
<img src="http://octodex.github.com/images/daftpunktocat-thomas.gif" width="300">
|
19
20
|
<img src="http://octodex.github.com/images/daftpunktocat-guy.gif" width="300">
|
21
|
+
</div>
|
20
22
|
|
21
23
|
Installation
|
22
24
|
------------
|
23
25
|
|
24
26
|
Add this line to your application's Gemfile:
|
25
27
|
|
26
|
-
|
28
|
+
```ruby
|
29
|
+
gem 'octospy'
|
30
|
+
```
|
27
31
|
|
28
32
|
And then execute:
|
29
33
|
|
30
|
-
|
34
|
+
```sh
|
35
|
+
$ bundle
|
36
|
+
```
|
31
37
|
|
32
38
|
Or install it yourself as:
|
33
39
|
|
34
|
-
|
40
|
+
```sh
|
41
|
+
$ gem install octospy
|
42
|
+
```
|
35
43
|
|
36
44
|
Usage
|
37
45
|
-----
|
38
46
|
|
39
|
-
|
47
|
+
```sh
|
48
|
+
$ cp .emv.example .env
|
49
|
+
```
|
50
|
+
|
51
|
+
edit `.env`:
|
52
|
+
|
53
|
+
```sh
|
54
|
+
SERVER=irc.yourserver.net
|
55
|
+
CHANNELS=yourchannel
|
56
|
+
GITHUB_LOGIN=yourusername
|
57
|
+
GITHUB_TOKEN=e17e1c6caa3e452433ab55****************
|
58
|
+
```
|
59
|
+
|
60
|
+
github tokens: https://github.com/settings/applications
|
61
|
+
|
62
|
+
```sh
|
63
|
+
$ octospy
|
64
|
+
```
|
65
|
+
|
66
|
+
### GitHub Enterprise
|
67
|
+
|
68
|
+
add to `.env`
|
69
|
+
|
70
|
+
```sh
|
71
|
+
GITHUB_API_ENDPOINT=http://your.enterprise.domain/api/v3
|
72
|
+
GITHUB_WEB_ENDPOINT=http://your.enterprise.domain
|
73
|
+
```
|
74
|
+
|
75
|
+
Commands
|
76
|
+
--------
|
77
|
+
|
78
|
+
format: `octospy: <command>`
|
79
|
+
|
80
|
+
Command | Description
|
81
|
+
------- | -----------
|
82
|
+
`watch <repository>` | add repository to watch list (ex: watch rails/rails)
|
83
|
+
`unwatch <repository>` | remove repository to watch list
|
84
|
+
`watch <user or organization>` | add user's repositories to watch list (ex: watch dotcloud)
|
85
|
+
`unwatch <user or organization>` | remove user's repositories to watch list
|
86
|
+
`job start` | start the repository event monitoring
|
87
|
+
`job stop` | stop the repository event monitoring
|
88
|
+
`join <channel>` | invite octospy to another channel
|
89
|
+
`show watched` | display the watch list
|
90
|
+
`show status` | display the joined channels
|
40
91
|
|
41
92
|
Contributing
|
42
93
|
------------
|
@@ -47,12 +98,12 @@ Contributing
|
|
47
98
|
4. Push to the branch (`git push origin my-new-feature`)
|
48
99
|
5. Create new Pull Request
|
49
100
|
|
50
|
-
|
51
|
-
|
101
|
+
Authors
|
102
|
+
-------
|
52
103
|
|
53
104
|
- [linyows](https://github.com/linyows)
|
54
105
|
|
55
106
|
License
|
56
107
|
-------
|
57
108
|
|
58
|
-
MIT
|
109
|
+
The MIT License (MIT)
|
@@ -49,7 +49,7 @@ module Cinch
|
|
49
49
|
|
50
50
|
def show_status(m)
|
51
51
|
@bot.channels.each.with_index(1) do |channel, i|
|
52
|
-
number = ::Octospy.channel(channel).repos.count
|
52
|
+
number = ::Octospy::Recordable.channel(channel).repos.count
|
53
53
|
m.reply "#{"%02d" % i} #{channel}: #{number} repo"
|
54
54
|
end
|
55
55
|
end
|
@@ -4,10 +4,10 @@ module Cinch
|
|
4
4
|
module Recording
|
5
5
|
def self.included(base)
|
6
6
|
base.class_eval do
|
7
|
-
match(/watch ([\w\-\.]+)\/([\w\-\.]+)
|
8
|
-
match(/unwatch ([\w\-\.]+)\/([\w\-\.]+)
|
9
|
-
match(/watch ([\w\-\.]+)
|
10
|
-
match(/unwatch ([\w\-\.]+)
|
7
|
+
match(/watch ([\w\-\.]+)\/([\w\-\.]+)$/, method: :watch_repository)
|
8
|
+
match(/unwatch ([\w\-\.]+)\/([\w\-\.]+)$/, method: :unwatch_repository)
|
9
|
+
match(/watch ([\w\-\.]+)$/, method: :watch_repositories)
|
10
|
+
match(/unwatch ([\w\-\.]+)$/, method: :unwatch_repositories)
|
11
11
|
match(/show watched( repos(itories)?)?/, method: :show_watched_repositories)
|
12
12
|
end
|
13
13
|
end
|
@@ -20,8 +20,8 @@ module Cinch
|
|
20
20
|
return
|
21
21
|
end
|
22
22
|
|
23
|
-
::Octospy.add_channel m.channel.name
|
24
|
-
::Octospy.channel(m.channel.name).add_repo(repo)
|
23
|
+
::Octospy::Recordable.add_channel m.channel.name
|
24
|
+
::Octospy::Recordable.channel(m.channel.name).add_repo(repo)
|
25
25
|
|
26
26
|
restart(m)
|
27
27
|
m.reply "I started to watch the #{repo} events"
|
@@ -35,10 +35,10 @@ module Cinch
|
|
35
35
|
return
|
36
36
|
end
|
37
37
|
|
38
|
-
::Octospy.add_channel m.channel.name
|
38
|
+
::Octospy::Recordable.add_channel m.channel.name
|
39
39
|
method = "#{'org_' if user.type == 'Organization'}repos".to_sym
|
40
40
|
repos = ::Octokit.send(method, owner).map { |repo|
|
41
|
-
::Octospy.channel(m.channel.name).add_repo(repo.full_name)
|
41
|
+
::Octospy::Recordable.channel(m.channel.name).add_repo(repo.full_name)
|
42
42
|
repo.full_name
|
43
43
|
}
|
44
44
|
|
@@ -56,21 +56,21 @@ module Cinch
|
|
56
56
|
return
|
57
57
|
end
|
58
58
|
|
59
|
-
::Octospy.channel(m.channel.name).remove_repo(repo)
|
59
|
+
::Octospy::Recordable.channel(m.channel.name).remove_repo(repo)
|
60
60
|
|
61
61
|
restart(m)
|
62
62
|
m.reply "I stopped to watch the #{repo} events"
|
63
63
|
end
|
64
64
|
|
65
65
|
def unwatch_repositories(m, owner)
|
66
|
-
repos = ::Octospy.channel(m.channel.name).repos.each_with_object([]) do |repo, obj|
|
66
|
+
repos = ::Octospy::Recordable.channel(m.channel.name).repos.each_with_object([]) do |repo, obj|
|
67
67
|
next unless repo.split('/').first == owner
|
68
|
-
::Octospy.channel(m.channel.name).remove_repo(repo)
|
68
|
+
::Octospy::Recordable.channel(m.channel.name).remove_repo(repo)
|
69
69
|
opj << repo
|
70
70
|
end
|
71
71
|
|
72
72
|
if repos.count > 0
|
73
|
-
if ::Octospy.channel(m.channel.name).repos.count > 0
|
73
|
+
if ::Octospy::Recordable.channel(m.channel.name).repos.count > 0
|
74
74
|
m.reply "stopped to watch events of #{repos.count} repositories"
|
75
75
|
restart(m)
|
76
76
|
else
|
@@ -84,9 +84,9 @@ module Cinch
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def show_watched_repositories(m)
|
87
|
-
channel = ::Octospy.channel(m.channel.name)
|
87
|
+
channel = ::Octospy::Recordable.channel(m.channel.name)
|
88
88
|
|
89
|
-
if channel.nil? || channel.repos.nil? ||
|
89
|
+
if channel.nil? || channel.repos.nil? || channel.repos.empty?
|
90
90
|
m.reply 'nothing!'
|
91
91
|
return
|
92
92
|
end
|
data/lib/octospy.rb
CHANGED
data/lib/octospy/recordable.rb
CHANGED
@@ -1,25 +1,34 @@
|
|
1
1
|
require 'octospy/recordable/channel'
|
2
|
-
require 'octospy/recordable/repo'
|
3
2
|
|
4
3
|
module Octospy
|
5
4
|
module Recordable
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
class << self
|
6
|
+
def channels
|
7
|
+
@channels ||= []
|
8
|
+
end
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
def channels_include?(name)
|
11
|
+
!!find_channel(name)
|
12
|
+
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
def find_channel(name)
|
15
|
+
channels.find { |channel| channel.name.to_s == name.to_s }
|
16
|
+
end
|
17
|
+
|
18
|
+
def add_channel(name)
|
19
|
+
channels << Channel.new(name) unless channels_include? name
|
20
|
+
end
|
21
|
+
|
22
|
+
def del_channel(name)
|
23
|
+
channels.delete_if { |channel| channel.name.to_s == name.to_s }
|
24
|
+
end
|
17
25
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
26
|
+
def channel(name)
|
27
|
+
if channels_include? name
|
28
|
+
find_channel name
|
29
|
+
else
|
30
|
+
Channel.new(name)
|
31
|
+
end
|
23
32
|
end
|
24
33
|
end
|
25
34
|
end
|
data/lib/octospy/version.rb
CHANGED
data/octospy.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octospy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- linyows
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -220,6 +220,20 @@ dependencies:
|
|
220
220
|
- - ">="
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: hashie
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :runtime
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
223
237
|
description: This is IRC bot that notifies repository activity on github.
|
224
238
|
email:
|
225
239
|
- linyows@gmail.com
|
@@ -228,6 +242,7 @@ executables:
|
|
228
242
|
extensions: []
|
229
243
|
extra_rdoc_files: []
|
230
244
|
files:
|
245
|
+
- ".env.example"
|
231
246
|
- ".gitignore"
|
232
247
|
- ".rspec"
|
233
248
|
- ".travis.yml"
|
@@ -255,7 +270,6 @@ files:
|
|
255
270
|
- lib/octospy/parser/wiki.rb
|
256
271
|
- lib/octospy/recordable.rb
|
257
272
|
- lib/octospy/recordable/channel.rb
|
258
|
-
- lib/octospy/recordable/repo.rb
|
259
273
|
- lib/octospy/shortener.rb
|
260
274
|
- lib/octospy/version.rb
|
261
275
|
- lib/octospy/worker.rb
|
@@ -309,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
309
323
|
version: '0'
|
310
324
|
requirements: []
|
311
325
|
rubyforge_project:
|
312
|
-
rubygems_version: 2.2.
|
326
|
+
rubygems_version: 2.2.2
|
313
327
|
signing_key:
|
314
328
|
specification_version: 4
|
315
329
|
summary: Octospy notifies the repository activity to an IRC channel.
|