daioikachan 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c10cbfb0cfbfbc731033be5a02a9f8ea843f4f5
4
- data.tar.gz: fe2a499b9da5d66a57458234d5de4f475034b734
3
+ metadata.gz: 63ee532c54d5c3cbcf00169ee3d1b2fb6621c917
4
+ data.tar.gz: 0d3b4eacfbf125714a467a5544dfd6c50752a225
5
5
  SHA512:
6
- metadata.gz: 585730388e9aff3c91ef30e36060957d3363be9cc6b376d9f23c843d1b617112383466a5166d212d4319be2083529989c9bff9d706a29ee4fd72d85f1d3d7f89
7
- data.tar.gz: 4910660d2dbd34642730b438362b7b9b799efb8946f3cd5abb7bbbd3a6beebce1589e83a61d2029fb50bd21b5763ff5ca69ac3da70f2c3e13fbdebdca2d33f7b
6
+ metadata.gz: c59f72eac8f078a362092ba2ddbebfe52cd28894a4bb772f8782c76b8f95d9e65905fa6493cd18456f478a8ce7cd03bd59f93123569e8ba396ced3c0e3a36657
7
+ data.tar.gz: 89968e0ddd67d52b3f083c8f0bcca07807f6bb3d983b59068888e9ef7e80097d056fcd1f4d6ad3c59422694634c7e5a8a6cb1c2dd372cbc3b39e137b5a539ef6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 0.0.2 (2015/03/23)
2
+
3
+ Enhancements:
4
+
5
+ * Fallback to `#{nick}_` when `:err_nick_name_in_use` occurs
6
+
1
7
  # 0.0.1 (2015/03/22)
2
8
 
3
9
  Initial version
10
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -232,11 +232,14 @@ module Fluent
232
232
  end
233
233
 
234
234
  def on_read(data)
235
+ err_nick_name_in_use = nil
235
236
  data.each_line do |line|
236
237
  begin
237
238
  msg = IRCParser.parse(line)
238
239
  log.debug { "out_irc: on_read :#{msg.class.to_sym}" }
239
240
  case msg.class.to_sym
241
+ when :rpl_welcome
242
+ log.info { "out_irc: welcome \"#{msg.nick}\" to \"#{msg.prefix}\"" }
240
243
  when :ping
241
244
  IRCParser.message(:pong) do |m|
242
245
  m.target = msg.target
@@ -247,7 +250,9 @@ module Fluent
247
250
  log.info { "out_irc: joined to #{msg.channels.join(', ')}" }
248
251
  msg.channels.each {|channel| @joined[channel] = true }
249
252
  when :err_nick_name_in_use
250
- log.warn "out_irc: nickname \"#{msg.error_nick}\" is already in use."
253
+ log.warn "out_irc: nickname \"#{msg.error_nick}\" is already in use. use \"#{msg.error_nick}_\" instead."
254
+ err_nick_name_in_use = true
255
+ @nick = "#{msg.error_nick}_"
251
256
  when :error
252
257
  log.warn "out_irc: an error occured. \"#{msg.error_message}\""
253
258
  end
@@ -255,6 +260,10 @@ module Fluent
255
260
  #TODO
256
261
  end
257
262
  end
263
+
264
+ if err_nick_name_in_use
265
+ self.on_connect
266
+ end
258
267
  end
259
268
 
260
269
  def joined?(channel)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daioikachan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naotoshi Seo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-22 00:00:00.000000000 Z
11
+ date: 2015-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd