girc-wookie 1.0.3 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 45857237afcafb3316ab70ed41086f16234525fc
4
- data.tar.gz: 692d4aefed8962f611545eaffe74914cf7cae1ea
3
+ metadata.gz: 04195b1dd551fe905db8ea68ac1d4cd639c8f699
4
+ data.tar.gz: 8af745c3a16dc94a452abbce1dec4c9f9e16cc27
5
5
  SHA512:
6
- metadata.gz: 1ef317c2a24f4c97b76ddecbbb0b4982288a098e6a2d848957fec139acaa7f1288c56c59dd8572070c721d84dea3605363f52d5b4db980b8b6c6d26a3ca4d87f
7
- data.tar.gz: 1d98647610c68f85ab15684b4efec2bee4433733a6429511a3551e9b695adf2ff463b9e6d59b63b0a008a6ab4f91521d4f2700c359a30efc485cf93a00ecc642
6
+ metadata.gz: 7f907fa754af351ae081085c25dff359ce963374bd89aa9f0250c3e654af197fd4dc6566e93a8c7870b6be3807492ac0bd464e8f7ea8ed33d5095a3e58f52674
7
+ data.tar.gz: 498eac46407b88338e8da886327076a5cdfdfe2359d5de36122b1ece57d18cd4d8f2509ca9be22e669d62a4bb2b3229ddd600d8a58ca25ef403c9e59024dfb48
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
  ## Version 1
3
+ ### Version 1.1.0
4
+ * Authentication with access tokens is possible. If you use 2 factor auth, you will have to use this otherwise it will error.
5
+
3
6
  ### Version 1.0.3
4
7
  * Update to and require Ruby 2.3
5
8
 
data/example.yaml CHANGED
@@ -2,6 +2,7 @@ github:
2
2
  username: elifoster
3
3
  password: secrets
4
4
  repo: girc-wookie
5
+ auth_code: moresecrets
5
6
 
6
7
  irc:
7
8
  server: irc.esper.net
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
- @client = Octokit::Client.new(login: @config['github']['username'],
12
- password: @config['github']['password'])
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
- return '1' if boolean
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.3
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-23 00:00:00.000000000 Z
11
+ date: 2016-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit