glman 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmNjNTk0ZWYzZmFiMzA5YmZiMzE1YmNlMWEyYzgyMjczNzU5YzE1NA==
4
+ MjEzMDQ2MTEwMzQwZTFhNmEzODcwMjUwZTFiNzA5NDFkZjkzYTNlZg==
5
5
  data.tar.gz: !binary |-
6
- MGFiYWQwODMwZmJkNmYzMzU3NGM5ODgzM2Q0NGZhNjM1NzgyODZjNQ==
6
+ NTE4NTBiNjJlOWJiMGQwZjU3MTBlYTY1OGM2N2RlYzM5ZWQ0OWIwOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OTU0MDBmZGMwZjQ1NTkxYzNlNDJmODZkZTczNWE0ODhmNzI4NWI5YmRiZTMy
10
- YmY4MGQ4MTgxZTcxYmZiNTViZjg3ZTFiNjY2MmVkZTkxNzMwNmU1NmIzMTJk
11
- N2I5NDgyY2VlMTE4NDVhOGUxOWU5ZWVmYmFjZTZmYjU4MTExZjE=
9
+ ODVkMGM4MWQ1ZmUwMzU1YTFmZDNiNzhmNzU3NDk2ODk2NDVlYWM1NzNmYTEz
10
+ OGIzYjQ1ZWEyYmMzZWM4NTVlYTRjOTE0ZDU4OTE1YWZjNzBmY2RiZmNmNzMy
11
+ ZTM0MDNmYzc0NjkzNDY2YzVlNjFhZWEwOTYxMDU1ODVlNWNlNjE=
12
12
  data.tar.gz: !binary |-
13
- ZDgxYmVmMTk1ZTM4YjhlM2YwMzMwYzUzNjZiNTZkYTZhZjUzYzBmNTQ1YmRh
14
- MDk2YmY1MjM2NjVmMjhhOWY1NjMxMWI5MzcyMmEwMGRmMmQyMTljYWE2Zjdk
15
- ZTBmM2YwY2RlMTYwODJjZDM0NzlhZTJjNGFhYmI0NzdmN2U2MTk=
13
+ OTk5NTUyZWYyODEzMWUyYTI1MGI1YjRmM2E4MjEwZjNkYjFjMzQ1MzM3Njc3
14
+ Y2JkNTliNzc4Y2NhYjhlYjBmZDcyNmMyNDdlMjMyMjhjYmUzODlmZDMxOWUx
15
+ MTBlYTMxMDI5Yjg0NzNiNDA2NjY4M2E1MjVmNDc4NGMzMTQxYmE=
data/Gemfile CHANGED
@@ -8,4 +8,5 @@ gem "executable"
8
8
  gem "json"
9
9
  gem "active_support"
10
10
  gem "awesome_print"
11
- gem "hashie"
11
+ gem "hashie"
12
+ gem "irc-notify"
@@ -1,6 +1,7 @@
1
1
  require "glman/version"
2
2
  require 'executable'
3
3
  require 'awesome_print'
4
+ require "irc-notify"
4
5
 
5
6
  module Glman
6
7
  module Commands
@@ -31,7 +32,7 @@ module Glman
31
32
  assignee = opts['assignee'] || {}
32
33
  author = opts['author'] || {}
33
34
  info = {
34
- url: "#{configuration.load[:gitlab_url]}/resfinity/resfinity_profile/merge_requests/#{opts['iid']}",
35
+ url: "#{configuration.load[:gitlab_url]}/#{repository_name}/merge_requests/#{opts['iid']}",
35
36
  assignee: {
36
37
  username: assignee['username'],
37
38
  email: assignee['email'],
@@ -169,12 +170,30 @@ module Glman
169
170
  @git_repo ||= Repos::GitRepo.new
170
171
  end
171
172
 
173
+ def notify(msg)
174
+ nick = configuration.load[:irc][:channel] || 'glman'
175
+ irc_client.register(nick)
176
+ irc_client.notify(configuration.load[:irc][:channel], msg)
177
+ client.quit
178
+ end
179
+
180
+ def irc_client
181
+ @irc_client ||= (
182
+ irc_config = configuration.load[:irc]
183
+ server = irc_config[:server] || "irc.freenode.net"
184
+ port = (irc_config[:port] || 6697).to_i
185
+ ssl = irc_config[:ssl] == true ? true : false
186
+ IrcNotify::Client.build(server, port, ssl: ssl)
187
+ )
188
+ end
189
+
172
190
  def help_page
173
191
  %{
174
192
  commands:
175
193
 
176
194
  config # display current configuration
177
195
  config <gitlab_url> <private_token> --init # init configuration
196
+ notify_config <server:port> <channel> <ssl> # setup irc configuration for notifications
178
197
 
179
198
  alias # display aliases
180
199
  alias <user_email> <alias> # make alias for user email
@@ -1,3 +1,3 @@
1
1
  module Glman
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paweł Niemczyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-01 00:00:00.000000000 Z
11
+ date: 2014-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler