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 +0 -1
- data/CHANGELOG.md +3 -0
- data/lib/ruby_fs/stream.rb +2 -0
- data/lib/ruby_fs/version.rb +1 -1
- data/lib/ruby_fs.rb +0 -3
- data/{ruby_ami.gemspec → ruby_fs.gemspec} +1 -4
- data/spec/ruby_fs/stream_spec.rb +15 -0
- data/spec/spec_helper.rb +0 -6
- data/spec/support/mock_server.rb +0 -4
- metadata +5 -53
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/lib/ruby_fs/stream.rb
CHANGED
data/lib/ruby_fs/version.rb
CHANGED
data/lib/ruby_fs.rb
CHANGED
@@ -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")
|
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"]
|
data/spec/ruby_fs/stream_spec.rb
CHANGED
@@ -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
|
data/spec/support/mock_server.rb
CHANGED
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.
|
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-
|
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
|
-
-
|
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:
|
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:
|
259
|
+
hash: -2203910716731016508
|
308
260
|
requirements: []
|
309
261
|
rubyforge_project: ruby_fs
|
310
262
|
rubygems_version: 1.8.24
|