reel 0.6.0.pre1 → 0.6.0.pre2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of reel might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b1a993a695b913f3274786678b7a8080749b5e2b
4
- data.tar.gz: fcdccf97f738d01e317292f4f5499f8990d3948a
3
+ metadata.gz: 37c2a121aacbd4e703ab370edb1f7e5a2b6207b5
4
+ data.tar.gz: 2cadca939df61f1ec640d9043291580f67f49fe3
5
5
  SHA512:
6
- metadata.gz: a25fb72f593a8f05bae8272a4e5d3aeec408af15673ec05216b9abcaf2fae06f127e08f88b7cccc2f0c42f86a319e0ae2ae26bf6c22e7599c5da3fb52f4d8c76
7
- data.tar.gz: 0707f29757b92d69e6b9c025702fc2da0823e8e19164c8b3a81f5347d4de3f2f71fb4b94f7000eb9c6dc4bb5d9609185b4a7df61e3211b86d789b0175658b16a
6
+ metadata.gz: 22d122ff37bc6e4b755465306d40c09d272c420c67aa4b4979efe1169bffffb6e077c8a7b4b9d48703ad118ea7022abc52a095ff7ce61d2efa44504178bcaf42
7
+ data.tar.gz: ac2e9e5ebf765d08ee9ab6caa2e43236d77cd818d0234bf513ce6848422a0909e9416792d9513ef96bed778e196150618ce6913130b9513dd7e864f5915899db
@@ -18,9 +18,11 @@ module Reel
18
18
  @hijacked = true
19
19
  end
20
20
 
21
- state :closed do
21
+ # FSM fails open for valid transitions
22
+ # Set an empty array to disallow transitioning out of closed
23
+ state :closed, :to => [] do
22
24
  @socket.close unless @hijacked || @socket.closed?
23
25
  end
24
26
  end
25
27
  end
26
- end
28
+ end
data/lib/reel/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Reel
2
- VERSION = "0.6.0.pre1"
2
+ VERSION = "0.6.0.pre2"
3
3
  CODENAME = "Garland"
4
4
  end
@@ -1,6 +1,5 @@
1
1
  require 'forwardable'
2
2
  require 'websocket/driver'
3
- require 'rack'
4
3
 
5
4
  module Reel
6
5
  class WebSocket
@@ -10,10 +9,11 @@ module Reel
10
9
 
11
10
  attr_reader :socket
12
11
  def_delegators :@socket, :addr, :peeraddr
12
+ def_delegators :@driver, :ping
13
13
 
14
14
  def initialize(info, connection)
15
- driver_env = DriverEnvironment.new(info, connection.socket)
16
-
15
+ driver_env = DriverEnvironment.new(info, connection.socket)
16
+
17
17
  @socket = connection.hijack_socket
18
18
  @request_info = info
19
19
 
@@ -98,19 +98,19 @@ module Reel
98
98
 
99
99
  def_delegators :socket, :write
100
100
 
101
- def initialize(info, socket)
102
- @url = info.url
103
-
104
- env_hash = Hash[info.headers.map { |key, value| ['HTTP_' + key.upcase.gsub('-','_'),value ] }]
105
-
106
- env_hash.merge!({
107
- :method => info.method,
108
- :input => info.body.to_s,
109
- 'REMOTE_ADDR' => info.remote_addr
110
- })
111
-
112
- @env = ::Rack::MockRequest.env_for(@url, env_hash)
101
+ RACK_HEADERS = {
102
+ 'Origin' => 'HTTP_ORIGIN',
103
+ 'Sec-WebSocket-Key' => 'HTTP_SEC_WEBSOCKET_KEY',
104
+ 'Sec-WebSocket-Key1' => 'HTTP_SEC_WEBSOCKET_KEY1',
105
+ 'Sec-WebSocket-Key2' => 'HTTP_SEC_WEBSOCKET_KEY2',
106
+ 'Sec-WebSocket-Extensions' => 'HTTP_SEC_WEBSOCKET_EXTENSIONS',
107
+ 'Sec-WebSocket-Protocol' => 'HTTP_SEC_WEBSOCKET_PROTOCOL',
108
+ 'Sec-WebSocket-Version' => 'HTTP_SEC_WEBSOCKET_VERSION'
109
+ }
113
110
 
111
+ def initialize(info, socket)
112
+ @env, @url = {}, info.url
113
+ RACK_HEADERS.each {|k,v| @env[v] = info.headers[k]}
114
114
  @socket = socket
115
115
  end
116
116
  end
data/reel.gemspec CHANGED
@@ -20,7 +20,6 @@ Gem::Specification.new do |gem|
20
20
  gem.add_runtime_dependency 'http', '>= 0.6.0.pre'
21
21
  gem.add_runtime_dependency 'http_parser.rb', '>= 0.6.0'
22
22
  gem.add_runtime_dependency 'websocket-driver', '>= 0.5.1'
23
- gem.add_runtime_dependency 'rack'
24
23
 
25
24
  gem.add_development_dependency 'rake'
26
25
  gem.add_development_dependency 'rspec', '>= 2.11.0'
metadata CHANGED
@@ -1,150 +1,136 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0.pre1
4
+ version: 0.6.0.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-24 00:00:00.000000000 Z
11
+ date: 2015-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- type: :runtime
15
14
  name: celluloid
16
- prerelease: false
17
15
  requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.15.1
20
+ type: :runtime
21
+ prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.15.1
27
27
  - !ruby/object:Gem::Dependency
28
- type: :runtime
29
28
  name: celluloid-io
30
- prerelease: false
31
29
  requirement: !ruby/object:Gem::Requirement
32
30
  requirements:
33
31
  - - ">="
34
32
  - !ruby/object:Gem::Version
35
33
  version: 0.15.0
34
+ type: :runtime
35
+ prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.15.0
41
41
  - !ruby/object:Gem::Dependency
42
- type: :runtime
43
42
  name: http
44
- prerelease: false
45
43
  requirement: !ruby/object:Gem::Requirement
46
44
  requirements:
47
45
  - - ">="
48
46
  - !ruby/object:Gem::Version
49
47
  version: 0.6.0.pre
48
+ type: :runtime
49
+ prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.6.0.pre
55
55
  - !ruby/object:Gem::Dependency
56
- type: :runtime
57
56
  name: http_parser.rb
58
- prerelease: false
59
57
  requirement: !ruby/object:Gem::Requirement
60
58
  requirements:
61
59
  - - ">="
62
60
  - !ruby/object:Gem::Version
63
61
  version: 0.6.0
62
+ type: :runtime
63
+ prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.6.0
69
69
  - !ruby/object:Gem::Dependency
70
- type: :runtime
71
70
  name: websocket-driver
72
- prerelease: false
73
71
  requirement: !ruby/object:Gem::Requirement
74
72
  requirements:
75
73
  - - ">="
76
74
  - !ruby/object:Gem::Version
77
75
  version: 0.5.1
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: 0.5.1
83
- - !ruby/object:Gem::Dependency
84
76
  type: :runtime
85
- name: rack
86
77
  prerelease: false
87
- requirement: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- version: '0'
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
80
  - - ">="
95
81
  - !ruby/object:Gem::Version
96
- version: '0'
82
+ version: 0.5.1
97
83
  - !ruby/object:Gem::Dependency
98
- type: :development
99
84
  name: rake
100
- prerelease: false
101
85
  requirement: !ruby/object:Gem::Requirement
102
86
  requirements:
103
87
  - - ">="
104
88
  - !ruby/object:Gem::Version
105
89
  version: '0'
90
+ type: :development
91
+ prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
94
  - - ">="
109
95
  - !ruby/object:Gem::Version
110
96
  version: '0'
111
97
  - !ruby/object:Gem::Dependency
112
- type: :development
113
98
  name: rspec
114
- prerelease: false
115
99
  requirement: !ruby/object:Gem::Requirement
116
100
  requirements:
117
101
  - - ">="
118
102
  - !ruby/object:Gem::Version
119
103
  version: 2.11.0
104
+ type: :development
105
+ prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
108
  - - ">="
123
109
  - !ruby/object:Gem::Version
124
110
  version: 2.11.0
125
111
  - !ruby/object:Gem::Dependency
126
- type: :development
127
112
  name: certificate_authority
128
- prerelease: false
129
113
  requirement: !ruby/object:Gem::Requirement
130
114
  requirements:
131
115
  - - ">="
132
116
  - !ruby/object:Gem::Version
133
117
  version: '0'
118
+ type: :development
119
+ prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
122
  - - ">="
137
123
  - !ruby/object:Gem::Version
138
124
  version: '0'
139
125
  - !ruby/object:Gem::Dependency
140
- type: :development
141
126
  name: websocket_parser
142
- prerelease: false
143
127
  requirement: !ruby/object:Gem::Requirement
144
128
  requirements:
145
129
  - - ">="
146
130
  - !ruby/object:Gem::Version
147
131
  version: 0.1.6
132
+ type: :development
133
+ prerelease: false
148
134
  version_requirements: !ruby/object:Gem::Requirement
149
135
  requirements:
150
136
  - - ">="