octospy 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.env.example +10 -0
- data/lib/octospy.rb +9 -6
- data/lib/octospy/configurable.rb +20 -15
- data/lib/octospy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8e08f9448c067f8b3f4574259fef52f9f8aaeeda
|
|
4
|
+
data.tar.gz: 2756eab8a7094619951b83abc0ea326a9db3586b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8f359f1433beeba18c9d37fca46afe892042897e6309581e43c7964b5f4009e16838ce39127c5aad2091b42284cd1a2b703f8459725dc21aeab06957ff4e96a9
|
|
7
|
+
data.tar.gz: 8b0ff9a217cdff09975808e77185931538b8344ad1cd139df0c330dc7dd04808731e6a7077bd77312c76732b9671d4ec17f245949666ba14f41842bebf9346de
|
data/.env.example
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
# Required
|
|
1
2
|
SERVER=irc.yourserver.net
|
|
2
3
|
CHANNELS=yourchannel
|
|
3
4
|
GITHUB_LOGIN=yourusername
|
|
4
5
|
GITHUB_TOKEN=e17e1c6caa3e452433ab55****************
|
|
6
|
+
|
|
7
|
+
# Options
|
|
8
|
+
# HOST=6668
|
|
9
|
+
# SSL=true
|
|
10
|
+
# PASSWORD=*****************
|
|
11
|
+
|
|
12
|
+
# GitHub Enterprise
|
|
13
|
+
# GITHUB_API_ENDPOINT=http://your.enterprise.domain/api/v3
|
|
14
|
+
# GITHUB_WEB_ENDPOINT=http://your.enterprise.domain
|
data/lib/octospy.rb
CHANGED
|
@@ -25,17 +25,20 @@ module Octospy
|
|
|
25
25
|
|
|
26
26
|
def irc_bot
|
|
27
27
|
Octokit.configure do |c|
|
|
28
|
-
c.api_endpoint = Octospy.github_api_endpoint
|
|
29
|
-
c.web_endpoint = Octospy.github_web_endpoint
|
|
30
|
-
c.login
|
|
28
|
+
c.api_endpoint = Octospy.github_api_endpoint if Octospy.github_api_endpoint
|
|
29
|
+
c.web_endpoint = Octospy.github_web_endpoint if Octospy.github_web_endpoint
|
|
30
|
+
c.login = Octospy.github_login
|
|
31
31
|
c.access_token = Octospy.github_token
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
Cinch::Bot.new do
|
|
35
35
|
configure do |c|
|
|
36
|
-
c.server
|
|
37
|
-
c.nick
|
|
38
|
-
c.channels
|
|
36
|
+
c.server = Octospy.server
|
|
37
|
+
c.nick = Octospy.nick
|
|
38
|
+
c.channels = Octospy.channels
|
|
39
|
+
c.port = Octospy.port if Octospy.port
|
|
40
|
+
c.password = Octospy.password if Octospy.password
|
|
41
|
+
c.ssl.use = Octospy.ssl if Octospy.ssl
|
|
39
42
|
c.plugins.plugins = [
|
|
40
43
|
Cinch::Plugins::Management,
|
|
41
44
|
Cinch::Plugins::Octospy
|
data/lib/octospy/configurable.rb
CHANGED
|
@@ -3,7 +3,11 @@ module Octospy
|
|
|
3
3
|
OPTIONS_KEYS = %i(
|
|
4
4
|
channels
|
|
5
5
|
server
|
|
6
|
+
port
|
|
7
|
+
ssl
|
|
8
|
+
password
|
|
6
9
|
nick
|
|
10
|
+
cinch_config_block
|
|
7
11
|
github_api_endpoint
|
|
8
12
|
github_web_endpoint
|
|
9
13
|
github_login
|
|
@@ -18,14 +22,14 @@ module Octospy
|
|
|
18
22
|
end
|
|
19
23
|
end
|
|
20
24
|
|
|
21
|
-
DEFAULT_GITHUB_API_ENDPOINT = ENV['GITHUB_API_ENDPOINT'] || 'https://api.github.com'
|
|
22
|
-
DEFAULT_GITHUB_WEB_ENDPOINT = ENV['GITHUB_WEB_ENDPOINT'] || 'https://github.com'
|
|
23
|
-
DEFAULT_NICK = ENV['NICK'] || 'octospy'
|
|
24
|
-
|
|
25
25
|
def configure
|
|
26
26
|
yield self
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
def cinch_config_block(&block)
|
|
30
|
+
@cinch_config_block = block
|
|
31
|
+
end
|
|
32
|
+
|
|
29
33
|
def options
|
|
30
34
|
Hash[Octospy::Configurable.keys.map{ |key|
|
|
31
35
|
[key, instance_variable_get(:"@#{key}")]
|
|
@@ -33,17 +37,18 @@ module Octospy
|
|
|
33
37
|
end
|
|
34
38
|
|
|
35
39
|
def setup
|
|
36
|
-
@github_api_endpoint =
|
|
37
|
-
@github_web_endpoint =
|
|
38
|
-
@nick
|
|
39
|
-
@
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
@
|
|
45
|
-
@
|
|
46
|
-
|
|
40
|
+
@github_api_endpoint = ENV['GITHUB_API_ENDPOINT']
|
|
41
|
+
@github_web_endpoint = ENV['GITHUB_WEB_ENDPOINT']
|
|
42
|
+
@nick = ENV['NICK'] || 'octospy'
|
|
43
|
+
@server = ENV['SERVER']
|
|
44
|
+
@port = ENV['PORT']
|
|
45
|
+
@ssl = !!ENV['SSL']
|
|
46
|
+
@password = ENV['PASSWORD']
|
|
47
|
+
@github_login = ENV['GITHUB_LOGIN']
|
|
48
|
+
@github_token = ENV['GITHUB_TOKEN']
|
|
49
|
+
@channels = ENV['CHANNELS'] ?
|
|
50
|
+
ENV['CHANNELS'].gsub(/\s|#/, '').split(',').map { |ch| "##{ch}" } : nil
|
|
51
|
+
@cinch_config_block = nil
|
|
47
52
|
end
|
|
48
53
|
end
|
|
49
54
|
end
|
data/lib/octospy/version.rb
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.3
|
|
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-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -323,7 +323,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
323
323
|
version: '0'
|
|
324
324
|
requirements: []
|
|
325
325
|
rubyforge_project:
|
|
326
|
-
rubygems_version: 2.2.
|
|
326
|
+
rubygems_version: 2.2.0
|
|
327
327
|
signing_key:
|
|
328
328
|
specification_version: 4
|
|
329
329
|
summary: Octospy notifies the repository activity to an IRC channel.
|