zircon 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/lib/zircon.rb +15 -2
  3. data/lib/zircon/version.rb +1 -1
  4. metadata +9 -13
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f01d103a0a765b334709fe66a63f3af41a089c7f
4
+ data.tar.gz: 19289f2022eae9da1de5837b3bfd8e7e9bb7bf30
5
+ SHA512:
6
+ metadata.gz: fabb0d76ea1a593206b7242fe65131ca89ae956b94eef57ac7fa3779cf295fefc2de16d5ff2e50421630a6a97dd69d88f65465fc550e849d29c4c913e7e99124
7
+ data.tar.gz: 406d83e168766d0a7262a3dff5c68ad6c8cdaf21f4cb25e73501eca17e373aeb95e47748e402b1fd60b8efbceed4163960ee3b35329d72df9c5c5966c52b2691
@@ -2,6 +2,7 @@ require "zircon/version"
2
2
  require "zircon/callback"
3
3
  require "zircon/message"
4
4
  require "socket"
5
+ require "openssl"
5
6
 
6
7
  class Zircon
7
8
  include Callback
@@ -12,7 +13,8 @@ class Zircon
12
13
  :channel,
13
14
  :username,
14
15
  :nickname,
15
- :realname
16
+ :realname,
17
+ :use_ssl
16
18
  )
17
19
 
18
20
  COMMAND_NAMES = %w[
@@ -67,6 +69,7 @@ class Zircon
67
69
  @username = args[:username]
68
70
  @nickname = args[:nickname] || @username
69
71
  @realname = args[:realname] || @username
72
+ @use_ssl = args[:use_ssl] || false
70
73
  on_ping { |message| pong(message.raw) }
71
74
  end
72
75
 
@@ -114,6 +117,16 @@ class Zircon
114
117
  end
115
118
 
116
119
  def socket
117
- @socket ||= TCPSocket.new(@server, @port)
120
+ @socket ||= @use_ssl ? ssl_socket : tcp_socket
121
+ end
122
+
123
+ def tcp_socket
124
+ TCPSocket.new(@server, @port)
125
+ end
126
+
127
+ def ssl_socket
128
+ socket = OpenSSL::SSL::SSLSocket.new(tcp_socket)
129
+ socket.sync_close = true
130
+ socket.connect
118
131
  end
119
132
  end
@@ -1,3 +1,3 @@
1
1
  class Zircon
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zircon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
5
- prerelease:
4
+ version: 0.0.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ryo NAKAMURA
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-02-21 00:00:00.000000000 Z
11
+ date: 2013-10-20 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  description: Zircon is a mineral belonging to the group of nesosilicates.
@@ -50,27 +47,26 @@ files:
50
47
  - zircon.gemspec
51
48
  homepage: https://github.com/r7kamura/zircon
52
49
  licenses: []
50
+ metadata: {}
53
51
  post_install_message:
54
52
  rdoc_options: []
55
53
  require_paths:
56
54
  - lib
57
55
  required_ruby_version: !ruby/object:Gem::Requirement
58
- none: false
59
56
  requirements:
60
- - - ! '>='
57
+ - - '>='
61
58
  - !ruby/object:Gem::Version
62
59
  version: '0'
63
60
  required_rubygems_version: !ruby/object:Gem::Requirement
64
- none: false
65
61
  requirements:
66
- - - ! '>='
62
+ - - '>='
67
63
  - !ruby/object:Gem::Version
68
64
  version: '0'
69
65
  requirements: []
70
66
  rubyforge_project:
71
- rubygems_version: 1.8.24
67
+ rubygems_version: 2.0.3
72
68
  signing_key:
73
- specification_version: 3
69
+ specification_version: 4
74
70
  summary: IRC client library written in Pure Ruby
75
71
  test_files:
76
72
  - spec/spec_helper.rb