ruby_fs 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -8,6 +8,5 @@ pkg/*
8
8
  doc
9
9
  coverage
10
10
  spec/reports
11
- features/reports
12
11
  vendor
13
12
  *.swp
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # develop
2
2
 
3
+ # 0.3.1
4
+ * Bugfix: Disconnect notices are successfully handled
5
+
3
6
  # 0.3.0
4
7
  * Feature/Change: Switch command methods from yielding the result asynchronously to returning it synchronously. Allows for better actor usage (async/futures)
5
8
 
@@ -161,6 +161,8 @@ module RubyFS
161
161
  command "auth #{@secret}" do
162
162
  command! "event json ALL" if @events
163
163
  end
164
+ when 'text/disconnect-notice'
165
+ terminate
164
166
  else
165
167
  raise "Unknown request type received (#{headers.inspect})"
166
168
  end
@@ -1,3 +1,3 @@
1
1
  module RubyFS
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
data/lib/ruby_fs.rb CHANGED
@@ -1,8 +1,5 @@
1
1
  %w{
2
- uuidtools
3
- future-resource
4
2
  logger
5
- countdownlatch
6
3
  celluloid/io
7
4
  }.each { |f| require f }
8
5
 
@@ -13,15 +13,12 @@ Gem::Specification.new do |s|
13
13
 
14
14
  s.rubyforge_project = "ruby_fs"
15
15
 
16
- s.files = `git ls-files`.split("\n") << 'lib/ruby_fs/lexer.rb'
16
+ s.files = `git ls-files`.split("\n")
17
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
- s.add_runtime_dependency %q<uuidtools>, [">= 0"]
22
21
  s.add_runtime_dependency %q<celluloid-io>, ["~> 0.11.0"]
23
- s.add_runtime_dependency %q<future-resource>, [">= 0"]
24
- s.add_runtime_dependency %q<countdownlatch>, ["~> 1.0"]
25
22
  s.add_runtime_dependency %q<json>
26
23
 
27
24
  s.add_development_dependency %q<bundler>, ["~> 1.0"]
@@ -4,6 +4,10 @@ module RubyFS
4
4
  describe Stream do
5
5
  let(:server_port) { 50000 - rand(1000) }
6
6
 
7
+ def client
8
+ @client ||= mock('Client')
9
+ end
10
+
7
11
  before do
8
12
  def client.message_received(message)
9
13
  @messages ||= Queue.new
@@ -306,6 +310,17 @@ Reply-Text: +OK accepted
306
310
  end
307
311
  end
308
312
 
313
+ context 'when receiving a disconnect notice' do
314
+ it 'puts itself in the stopped state and fires a disconnected event' do
315
+ expect_connected_event
316
+ expect_disconnected_event
317
+ mocked_server(0, lambda { |server| server.send_data "Content-Type: text/disconnect-notice\n\n" }) do |val, server|
318
+ @stream.stopped?.should be false
319
+ end
320
+ @stream.alive?.should be false
321
+ end
322
+ end
323
+
309
324
  it 'puts itself in the stopped state and fires a disconnected event when unbound' do
310
325
  expect_connected_event
311
326
  expect_disconnected_event
data/spec/spec_helper.rb CHANGED
@@ -13,7 +13,6 @@ end
13
13
 
14
14
  require 'ruby_fs'
15
15
  require 'mocha'
16
- require 'countdownlatch'
17
16
 
18
17
  Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}
19
18
 
@@ -23,9 +22,4 @@ RSpec.configure do |config|
23
22
  config.mock_with :mocha
24
23
  config.filter_run :focus => true
25
24
  config.run_all_when_everything_filtered = true
26
-
27
- config.before :each do
28
- uuid = UUIDTools::UUID.random_create
29
- UUIDTools::UUID.stubs :random_create => uuid
30
- end
31
25
  end
@@ -39,7 +39,3 @@ class ServerMock
39
39
  @clients.each { |client| client.write data }
40
40
  end
41
41
  end
42
-
43
- def client
44
- @client ||= mock('Client')
45
- end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_fs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,8 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-26 00:00:00.000000000 Z
12
+ date: 2012-07-29 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: uuidtools
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
14
  - !ruby/object:Gem::Dependency
31
15
  name: celluloid-io
32
16
  requirement: !ruby/object:Gem::Requirement
@@ -43,38 +27,6 @@ dependencies:
43
27
  - - ~>
44
28
  - !ruby/object:Gem::Version
45
29
  version: 0.11.0
46
- - !ruby/object:Gem::Dependency
47
- name: future-resource
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- - !ruby/object:Gem::Dependency
63
- name: countdownlatch
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ~>
68
- - !ruby/object:Gem::Version
69
- version: '1.0'
70
- type: :runtime
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ~>
76
- - !ruby/object:Gem::Version
77
- version: '1.0'
78
30
  - !ruby/object:Gem::Dependency
79
31
  name: json
80
32
  requirement: !ruby/object:Gem::Requirement
@@ -274,7 +226,7 @@ files:
274
226
  - lib/ruby_fs/response.rb
275
227
  - lib/ruby_fs/stream.rb
276
228
  - lib/ruby_fs/version.rb
277
- - ruby_ami.gemspec
229
+ - ruby_fs.gemspec
278
230
  - spec/ruby_fs/command_reply_spec.rb
279
231
  - spec/ruby_fs/event_spec.rb
280
232
  - spec/ruby_fs/response_spec.rb
@@ -295,7 +247,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
295
247
  version: '0'
296
248
  segments:
297
249
  - 0
298
- hash: 1007735488205713228
250
+ hash: -2203910716731016508
299
251
  required_rubygems_version: !ruby/object:Gem::Requirement
300
252
  none: false
301
253
  requirements:
@@ -304,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
256
  version: '0'
305
257
  segments:
306
258
  - 0
307
- hash: 1007735488205713228
259
+ hash: -2203910716731016508
308
260
  requirements: []
309
261
  rubyforge_project: ruby_fs
310
262
  rubygems_version: 1.8.24