libwebsocket 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+
3
+ ## 0.1.1 / 2011-10-24
4
+
5
+ - Fixed bug that prevented query strings from being included in requests
6
+
7
+ ## 0.1.0 / 2010-12-05
8
+
9
+ - new features:
10
+ - rename Handshake to OpeningHandshake(we will need ClosingHandshake in new drafts)
11
+ - bugfixes:
12
+ - relax response string parser(allow custom text after 'HTTP/1.1 101')
13
+
14
+ ## 0.0.4 / 2010-12-04
15
+
16
+ - initial release
@@ -3,7 +3,7 @@
3
3
  # or clients to provide WebSocket support.
4
4
  module LibWebSocket
5
5
 
6
- VERSION = '0.1.0' # Version of LibWebSocket
6
+ VERSION = '0.1.1' # Version of LibWebSocket
7
7
 
8
8
  autoload :Cookie, "#{File.dirname(__FILE__)}/libwebsocket/cookie"
9
9
  autoload :Frame, "#{File.dirname(__FILE__)}/libwebsocket/frame"
@@ -36,9 +36,10 @@ module LibWebSocket
36
36
  self.host = host
37
37
  self.port = uri.port.to_s if uri.port
38
38
 
39
- path = uri.path
40
- path = '/' unless path && path != ''
41
- self.resource_name = path
39
+ request_uri = uri.path
40
+ request_uri = '/' unless request_uri && request_uri != ''
41
+ request_uri += "?" + uri.query if uri.query
42
+ self.resource_name = request_uri
42
43
 
43
44
  return self
44
45
  end
@@ -1,84 +1,63 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{libwebsocket}
8
- s.version = "0.1.0"
7
+ s.name = "libwebsocket"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Bernard Potocki"]
12
- s.date = %q{2010-12-05}
13
- s.description = %q{Universal Ruby library to handle WebSocket protocol}
14
- s.email = %q{bernard.potocki@imanel.org}
12
+ s.date = "2011-10-24"
13
+ s.description = "Universal Ruby library to handle WebSocket protocol"
14
+ s.email = "bernard.potocki@imanel.org"
15
15
  s.extra_rdoc_files = [
16
16
  "README.md"
17
17
  ]
18
18
  s.files = [
19
+ "CHANGELOG.md",
19
20
  "README.md",
20
- "Rakefile",
21
- "examples/eventmachine_server.rb",
22
- "examples/plain_client.rb",
23
- "examples/thin_server.rb",
24
- "lib/libwebsocket.rb",
25
- "lib/libwebsocket/cookie.rb",
26
- "lib/libwebsocket/cookie/request.rb",
27
- "lib/libwebsocket/cookie/response.rb",
28
- "lib/libwebsocket/frame.rb",
29
- "lib/libwebsocket/message.rb",
30
- "lib/libwebsocket/opening_handshake.rb",
31
- "lib/libwebsocket/opening_handshake/client.rb",
32
- "lib/libwebsocket/opening_handshake/server.rb",
33
- "lib/libwebsocket/request.rb",
34
- "lib/libwebsocket/response.rb",
35
- "lib/libwebsocket/stateful.rb",
36
- "lib/libwebsocket/url.rb",
37
- "libwebsocket.gemspec",
38
- "test/libwebsocket/cookie/request.rb",
39
- "test/libwebsocket/cookie/response.rb",
40
- "test/libwebsocket/opening_handshake/test_client.rb",
41
- "test/libwebsocket/opening_handshake/test_server.rb",
42
- "test/libwebsocket/test_cookie.rb",
43
- "test/libwebsocket/test_frame.rb",
44
- "test/libwebsocket/test_message.rb",
45
- "test/libwebsocket/test_request_75.rb",
46
- "test/libwebsocket/test_request_76.rb",
47
- "test/libwebsocket/test_request_common.rb",
48
- "test/libwebsocket/test_response_75.rb",
49
- "test/libwebsocket/test_response_76.rb",
50
- "test/libwebsocket/test_response_common.rb",
51
- "test/libwebsocket/test_url.rb",
52
- "test/test_helper.rb"
53
- ]
54
- s.homepage = %q{http://github.com/imanel/libwebsocket}
55
- s.rdoc_options = ["--charset=UTF-8"]
56
- s.require_paths = ["lib"]
57
- s.rubygems_version = %q{1.3.7}
58
- s.summary = %q{Universal Ruby library to handle WebSocket protocol}
59
- s.test_files = [
21
+ "Rakefile",
22
+ "examples/eventmachine_server.rb",
23
+ "examples/plain_client.rb",
24
+ "examples/thin_server.rb",
25
+ "lib/libwebsocket.rb",
26
+ "lib/libwebsocket/cookie.rb",
27
+ "lib/libwebsocket/cookie/request.rb",
28
+ "lib/libwebsocket/cookie/response.rb",
29
+ "lib/libwebsocket/frame.rb",
30
+ "lib/libwebsocket/message.rb",
31
+ "lib/libwebsocket/opening_handshake.rb",
32
+ "lib/libwebsocket/opening_handshake/client.rb",
33
+ "lib/libwebsocket/opening_handshake/server.rb",
34
+ "lib/libwebsocket/request.rb",
35
+ "lib/libwebsocket/response.rb",
36
+ "lib/libwebsocket/stateful.rb",
37
+ "lib/libwebsocket/url.rb",
38
+ "libwebsocket.gemspec",
60
39
  "test/libwebsocket/cookie/request.rb",
61
- "test/libwebsocket/cookie/response.rb",
62
- "test/libwebsocket/opening_handshake/test_client.rb",
63
- "test/libwebsocket/opening_handshake/test_server.rb",
64
- "test/libwebsocket/test_cookie.rb",
65
- "test/libwebsocket/test_frame.rb",
66
- "test/libwebsocket/test_message.rb",
67
- "test/libwebsocket/test_request_75.rb",
68
- "test/libwebsocket/test_request_76.rb",
69
- "test/libwebsocket/test_request_common.rb",
70
- "test/libwebsocket/test_response_75.rb",
71
- "test/libwebsocket/test_response_76.rb",
72
- "test/libwebsocket/test_response_common.rb",
73
- "test/libwebsocket/test_url.rb",
74
- "test/test_helper.rb",
75
- "examples/eventmachine_server.rb",
76
- "examples/plain_client.rb",
77
- "examples/thin_server.rb"
40
+ "test/libwebsocket/cookie/response.rb",
41
+ "test/libwebsocket/opening_handshake/test_client.rb",
42
+ "test/libwebsocket/opening_handshake/test_server.rb",
43
+ "test/libwebsocket/test_cookie.rb",
44
+ "test/libwebsocket/test_frame.rb",
45
+ "test/libwebsocket/test_message.rb",
46
+ "test/libwebsocket/test_request_75.rb",
47
+ "test/libwebsocket/test_request_76.rb",
48
+ "test/libwebsocket/test_request_common.rb",
49
+ "test/libwebsocket/test_response_75.rb",
50
+ "test/libwebsocket/test_response_76.rb",
51
+ "test/libwebsocket/test_response_common.rb",
52
+ "test/libwebsocket/test_url.rb",
53
+ "test/test_helper.rb"
78
54
  ]
55
+ s.homepage = "http://github.com/imanel/libwebsocket"
56
+ s.require_paths = ["lib"]
57
+ s.rubygems_version = "1.8.11"
58
+ s.summary = "Universal Ruby library to handle WebSocket protocol"
79
59
 
80
60
  if s.respond_to? :specification_version then
81
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
82
61
  s.specification_version = 3
83
62
 
84
63
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -4,14 +4,14 @@ class TestServerOpeningHandshake < Test::Unit::TestCase
4
4
 
5
5
  def test_to_s
6
6
  h = LibWebSocket::OpeningHandshake::Client.new
7
- h.url = 'ws://example.com/demo'
7
+ h.url = 'ws://example.com/demo?param=true&another=hello'
8
8
 
9
9
  # Mocking
10
10
  h.req.key1 = "18x 6]8vM;54 *(5: { U1]8 z [ 8"
11
11
  h.req.key2 = "1_ tx7X d < nw 334J702) 7]o}` 0"
12
12
  h.req.challenge = "Tm[K T2u"
13
13
 
14
- assert_equal h.to_s, "GET /demo HTTP/1.1\x0d\x0a" +
14
+ assert_equal h.to_s, "GET /demo?param=true&another=hello HTTP/1.1\x0d\x0a" +
15
15
  "Upgrade: WebSocket\x0d\x0a" +
16
16
  "Connection: Upgrade\x0d\x0a" +
17
17
  "Host: example.com\x0d\x0a" +
@@ -61,4 +61,4 @@ class TestServerOpeningHandshake < Test::Unit::TestCase
61
61
  assert_equal 'Wrong response line', h.error
62
62
  end
63
63
 
64
- end
64
+ end
@@ -26,7 +26,7 @@ class TestURL < Test::Unit::TestCase
26
26
  assert url.parse('ws://example.com/demo?foo=bar')
27
27
  assert !url.secure
28
28
  assert_equal 'example.com', url.host
29
- assert_equal '/demo', url.resource_name
29
+ assert_equal '/demo?foo=bar', url.resource_name
30
30
  end
31
31
 
32
32
  def test_to_s
metadata CHANGED
@@ -1,33 +1,24 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: libwebsocket
3
- version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 1
9
- - 0
10
- version: 0.1.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Bernard Potocki
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2010-12-05 00:00:00 +01:00
19
- default_executable:
12
+ date: 2011-10-24 00:00:00.000000000Z
20
13
  dependencies: []
21
-
22
14
  description: Universal Ruby library to handle WebSocket protocol
23
15
  email: bernard.potocki@imanel.org
24
16
  executables: []
25
-
26
17
  extensions: []
27
-
28
- extra_rdoc_files:
18
+ extra_rdoc_files:
29
19
  - README.md
30
- files:
20
+ files:
21
+ - CHANGELOG.md
31
22
  - README.md
32
23
  - Rakefile
33
24
  - examples/eventmachine_server.rb
@@ -62,56 +53,28 @@ files:
62
53
  - test/libwebsocket/test_response_common.rb
63
54
  - test/libwebsocket/test_url.rb
64
55
  - test/test_helper.rb
65
- has_rdoc: true
66
56
  homepage: http://github.com/imanel/libwebsocket
67
57
  licenses: []
68
-
69
58
  post_install_message:
70
- rdoc_options:
71
- - --charset=UTF-8
72
- require_paths:
59
+ rdoc_options: []
60
+ require_paths:
73
61
  - lib
74
- required_ruby_version: !ruby/object:Gem::Requirement
62
+ required_ruby_version: !ruby/object:Gem::Requirement
75
63
  none: false
76
- requirements:
77
- - - ">="
78
- - !ruby/object:Gem::Version
79
- hash: 3
80
- segments:
81
- - 0
82
- version: "0"
83
- required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
84
69
  none: false
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- hash: 3
89
- segments:
90
- - 0
91
- version: "0"
70
+ requirements:
71
+ - - ! '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
92
74
  requirements: []
93
-
94
75
  rubyforge_project:
95
- rubygems_version: 1.3.7
76
+ rubygems_version: 1.8.11
96
77
  signing_key:
97
78
  specification_version: 3
98
79
  summary: Universal Ruby library to handle WebSocket protocol
99
- test_files:
100
- - test/libwebsocket/cookie/request.rb
101
- - test/libwebsocket/cookie/response.rb
102
- - test/libwebsocket/opening_handshake/test_client.rb
103
- - test/libwebsocket/opening_handshake/test_server.rb
104
- - test/libwebsocket/test_cookie.rb
105
- - test/libwebsocket/test_frame.rb
106
- - test/libwebsocket/test_message.rb
107
- - test/libwebsocket/test_request_75.rb
108
- - test/libwebsocket/test_request_76.rb
109
- - test/libwebsocket/test_request_common.rb
110
- - test/libwebsocket/test_response_75.rb
111
- - test/libwebsocket/test_response_76.rb
112
- - test/libwebsocket/test_response_common.rb
113
- - test/libwebsocket/test_url.rb
114
- - test/test_helper.rb
115
- - examples/eventmachine_server.rb
116
- - examples/plain_client.rb
117
- - examples/thin_server.rb
80
+ test_files: []