girc-wookie 1.0.3 → 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/CHANGELOG.md +3 -0
- data/example.yaml +1 -0
- data/lib/girc/wookie.rb +11 -4
- 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: 04195b1dd551fe905db8ea68ac1d4cd639c8f699
|
4
|
+
data.tar.gz: 8af745c3a16dc94a452abbce1dec4c9f9e16cc27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f907fa754af351ae081085c25dff359ce963374bd89aa9f0250c3e654af197fd4dc6566e93a8c7870b6be3807492ac0bd464e8f7ea8ed33d5095a3e58f52674
|
7
|
+
data.tar.gz: 498eac46407b88338e8da886327076a5cdfdfe2359d5de36122b1ece57d18cd4d8f2509ca9be22e669d62a4bb2b3229ddd600d8a58ca25ef403c9e59024dfb48
|
data/CHANGELOG.md
CHANGED
data/example.yaml
CHANGED
data/lib/girc/wookie.rb
CHANGED
@@ -3,13 +3,21 @@ require 'yaml'
|
|
3
3
|
|
4
4
|
module GIRC
|
5
5
|
class Wookie
|
6
|
+
# @return [Hash] The hash representation of the YAML config passed in the constructor.
|
7
|
+
attr_reader :config
|
8
|
+
|
6
9
|
def initialize(yamlfile)
|
7
10
|
@config = YAML.load_file(yamlfile)
|
8
11
|
end
|
9
12
|
|
10
13
|
def run
|
11
|
-
|
12
|
-
|
14
|
+
if @config['github'].key?('auth_code')
|
15
|
+
@client = Octokit::Client.new(access_token: @config['github']['auth_code'])
|
16
|
+
@client.user.login
|
17
|
+
else
|
18
|
+
@client = Octokit::Client.new(login: @config['github']['username'],
|
19
|
+
password: @config['github']['password'])
|
20
|
+
end
|
13
21
|
|
14
22
|
rooms = @config['irc']['room'].gsub('\\', '')
|
15
23
|
hook_config = {
|
@@ -41,8 +49,7 @@ module GIRC
|
|
41
49
|
# @param boolean [Boolean]
|
42
50
|
# @return [String] '1' if boolean is true, '0' if it is false.
|
43
51
|
def to_int_string(boolean)
|
44
|
-
|
45
|
-
return '0' unless boolean
|
52
|
+
boolean ? '1' : '0'
|
46
53
|
end
|
47
54
|
end
|
48
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: girc-wookie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eli Foster
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|