carrier-pigeon 0.4.0 → 0.5.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.
data/README.org CHANGED
@@ -1,8 +1,3 @@
1
- * Requirements
2
-
3
- - Ruby (MRI)
4
- - RubyGems
5
-
6
1
  * Install
7
2
 
8
3
  : gem install carrier-pigeon
@@ -12,18 +7,37 @@
12
7
  : require 'carrier-pigeon'
13
8
  :
14
9
  : # In the open
15
- : CarrierPigeon.send(:uri => "irc://nick:password@irc.domain.com:6667/#channel", :message => "cooooo, coo coo")
10
+ : CarrierPigeon.send(
11
+ : :uri => "irc://nick:password@irc.domain.com:6667/#channel",
12
+ : :message => "cooooo, coo coo"
13
+ : )
16
14
  :
17
15
  : # SSL
18
- : CarrierPigeon.send(:uri => "irc://nick:password@irc.domain.com:6667/#channel", :message => "coo, secret plan", :ssl => true)
16
+ : CarrierPigeon.send(
17
+ : :uri => "irc://nick:password@irc.domain.com:6667/#channel",
18
+ : :message => "coo, secret plan",
19
+ : :ssl => true
20
+ : )
19
21
  :
20
22
  : # Join a channel (required for most Freenode channels)
21
- : CarrierPigeon.send(:uri => "irc://nick:password@irc.domain.com:6667/#channel", :message => "cooooo, coo coo", :join => true)
23
+ : CarrierPigeon.send(
24
+ : :uri => "irc://nick:password@irc.domain.com:6667/#channel",
25
+ : :message => "cooooo, part of the flock",
26
+ : :join => true
27
+ : )
22
28
  :
23
29
  : # Join a channel that requires a password
24
30
  : CarrierPigeon.send(
25
31
  : :uri => "irc://nick:password@irc.domain.com:6667/#channel",
26
- : :channel_password => "password",
32
+ : :message => "coo, the password is ..."
33
+ : :channel_password => "secret",
34
+ : :join => true
35
+ : )
36
+ :
37
+ : # Register (ping reply) prior to joining or messaging a channel (required for some private servers)
38
+ : CarrierPigeon.send(
39
+ : :uri => "irc://nick:password@irc.domain.com:6667/#channel",
27
40
  : :message => "cooooo, coo coo",
41
+ : :register_first => true,
28
42
  : :join => true
29
43
  : )
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "carrier-pigeon"
3
- s.version = "0.4.0"
3
+ s.version = "0.5.0"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.authors = ["Sean Porter"]
6
6
  s.email = ["portertech@gmail.com"]
@@ -23,6 +23,15 @@ class CarrierPigeon
23
23
  sendln "NICK #{options[:nick]}"
24
24
  sendln "USER #{options[:nick]} 0 * :#{options[:nick]}"
25
25
  sendln options[:nickserv_command] if options[:nickserv_command]
26
+ if options[:register_first]
27
+ while line = @socket.gets
28
+ case line
29
+ when /^PING :(.+)$/i
30
+ sendln "PONG :#{$1}"
31
+ break
32
+ end
33
+ end
34
+ end
26
35
  sendln "JOIN #{options[:channel]} #{options[:channel_password]}" if options[:join]
27
36
  end
28
37
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrier-pigeon
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 4
8
+ - 5
9
9
  - 0
10
- version: 0.4.0
10
+ version: 0.5.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sean Porter
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-02 00:00:00 -07:00
18
+ date: 2012-09-04 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency