girc-wookie 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6e1db96924d244847272ddf5a36c65e74a5b0754
4
+ data.tar.gz: b63dbca8510ff21f19aafac00ab5970fa6a55be5
5
+ SHA512:
6
+ metadata.gz: f2e57816c17f7c828b99930c0e0c829f6c6704013e675e011faeac58ca9de55e168ce1d767bce1955d004613a7b6e682082b4fe8c5d2e8d2aee5700e3bd20d22
7
+ data.tar.gz: 7148aa1d728a50fcb0a8081ca3b6353deae2d46b55098a81b548eeabf978acd247b8e98cd3fb66b2b1758dc5762a4246496a7791c875ced59813b1055c94888f
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ # Changelog
2
+ ## Version 1
3
+ ### Version 1.0.0
4
+ * Initial version
data/bin/wookie ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ path = File.expand_path('../lib', __FILE__)
5
+ $LOAD_PATH.unshift(path)
6
+
7
+ require_relative '../lib/girc/wookie'
8
+
9
+ usage = 'Usage: wookie [yaml file directory]'
10
+ if ARGV.length < 1
11
+ puts usage
12
+ exit
13
+ end
14
+
15
+ wookie = GIRC::Wookie.new(ARGV[0])
16
+ wookie.run
17
+
18
+ puts 'Finished.'
19
+ exit
data/example.yaml ADDED
@@ -0,0 +1,17 @@
1
+ github:
2
+ username: elifoster
3
+ password: secrets
4
+ repo: girc-wookie
5
+
6
+ irc:
7
+ server: irc.esper.net
8
+ port: 6667
9
+ room: \#SatanicSanta, \#TheSteamTank
10
+ branches: null
11
+ nickserv_password: null
12
+ ssl: false
13
+ no_join: true
14
+ no_colors: false
15
+ long_url: false
16
+ notice: true
17
+ nick: girc-wookie
@@ -0,0 +1,41 @@
1
+ require 'octokit'
2
+ require 'yaml'
3
+
4
+ module GIRC
5
+ class Wookie
6
+ def initialize(yamlfile)
7
+ @config = YAML.load_file(yamlfile)
8
+ end
9
+
10
+ def run
11
+ @client = Octokit::Client.new(login: @config['github']['username'],
12
+ password: @config['github']['password'])
13
+
14
+ rooms = @config['irc']['room'].gsub('\\', '')
15
+ hook_config = {
16
+ server: @config['irc']['server'],
17
+ port: @config['irc']['port'],
18
+ room: rooms,
19
+ nick: @config['irc']['nick'],
20
+ branches: @config['irc']['branches'],
21
+ nickserv_password: @config['irc']['nickserv_password'],
22
+ ssl: to_int_string(@config['irc']['ssl']),
23
+ message_without_join: to_int_string(@config['irc']['no_join']),
24
+ no_colors: to_int_string(@config['irc']['no_colors']),
25
+ long_url: to_int_string(@config['irc']['long_url']),
26
+ notice: to_int_string(@config['irc']['notice'])
27
+ }
28
+
29
+ repo = "#{@config['github']['username']}/#{@config['github']['repo']}"
30
+
31
+ @client.create_hook(repo, 'irc', hook_config)
32
+ end
33
+
34
+ private
35
+
36
+ def to_int_string(boolean)
37
+ return '1' if boolean
38
+ return '0' unless boolean
39
+ end
40
+ end
41
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: girc-wookie
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Eli Foster
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-11-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: octokit
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 4.0.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 4.0.1
27
+ description: A simple command line utility that adds an IRC web hook to a GitHub repository
28
+ configured with a YAML file.
29
+ email: elifosterwy@gmail.com
30
+ executables:
31
+ - wookie
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - CHANGELOG.md
36
+ - bin/wookie
37
+ - example.yaml
38
+ - lib/girc/wookie.rb
39
+ homepage: https://github.com/elifoster/girc-wookie
40
+ licenses: []
41
+ metadata: {}
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubyforge_project:
58
+ rubygems_version: 2.4.5.1
59
+ signing_key:
60
+ specification_version: 4
61
+ summary: GitHub-IRC Wookie command line application
62
+ test_files: []
63
+ has_rdoc: