adrian 1.3.3 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/adrian/array_queue.rb +4 -0
- data/lib/adrian/directory_queue.rb +5 -1
- data/lib/adrian/queue.rb +4 -0
- data/lib/adrian/version.rb +1 -1
- data/test/array_queue_test.rb +4 -0
- data/test/directory_queue_test.rb +6 -2
- metadata +3 -3
data/lib/adrian/array_queue.rb
CHANGED
@@ -43,6 +43,10 @@ module Adrian
|
|
43
43
|
self
|
44
44
|
end
|
45
45
|
|
46
|
+
def length
|
47
|
+
available_files.count { |file| File.file?(file) }
|
48
|
+
end
|
49
|
+
|
46
50
|
def include?(value)
|
47
51
|
item = wrap_item(value)
|
48
52
|
items.include?(item)
|
@@ -83,7 +87,7 @@ module Adrian
|
|
83
87
|
end
|
84
88
|
|
85
89
|
def default_reserved_path
|
86
|
-
File.join(
|
90
|
+
File.join(@available_path, 'cur')
|
87
91
|
end
|
88
92
|
|
89
93
|
end
|
data/lib/adrian/queue.rb
CHANGED
data/lib/adrian/version.rb
CHANGED
data/test/array_queue_test.rb
CHANGED
@@ -11,8 +11,8 @@ describe Adrian::DirectoryQueue do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
after do
|
14
|
-
|
15
|
-
|
14
|
+
FileUtils.rm_r(@q.available_path, :force => true)
|
15
|
+
FileUtils.rm_r(@q.reserved_path, :force => true)
|
16
16
|
end
|
17
17
|
|
18
18
|
it 'should act as a queue for files' do
|
@@ -24,10 +24,14 @@ describe Adrian::DirectoryQueue do
|
|
24
24
|
@q.push(item2)
|
25
25
|
@q.push(item3)
|
26
26
|
|
27
|
+
@q.length.must_equal 3
|
28
|
+
|
27
29
|
@q.pop.must_equal Adrian::FileItem.new(item1)
|
28
30
|
@q.pop.must_equal Adrian::FileItem.new(item2)
|
29
31
|
@q.pop.must_equal Adrian::FileItem.new(item3)
|
30
32
|
@q.pop.must_be_nil
|
33
|
+
|
34
|
+
@q.length.must_equal 0
|
31
35
|
end
|
32
36
|
|
33
37
|
describe 'file backend' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adrian
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2013-01-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
version: '0'
|
116
116
|
requirements: []
|
117
117
|
rubyforge_project:
|
118
|
-
rubygems_version: 1.8.
|
118
|
+
rubygems_version: 1.8.24
|
119
119
|
signing_key:
|
120
120
|
specification_version: 3
|
121
121
|
summary: Adrian does not do any real work, but is really good at delegating it
|