defog 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -254,6 +254,7 @@ plus appropriate rspec examples.)
254
254
 
255
255
  Release Notes:
256
256
 
257
+ * 0.9.1 - Bug fix: don't fail when measuring cache if file gets deleted by another process
257
258
  * 0.9.0 - Expose Handle#md5_hash
258
259
  * 0.8.0 - Include prefix in proxy_path (thus allowing cache sharing)
259
260
  * 0.7.2 - Bug fix: don't fail when clearing cache if another process clears it first
@@ -193,7 +193,15 @@ module Defog
193
193
 
194
194
  # find available space (not counting current proxy)
195
195
  available = max_cache_size
196
- proxy_root.find { |path| available -= path.size if path.file? and path != proxy_path}
196
+ proxy_root.find { |path|
197
+ available -= begin
198
+ path.size
199
+ rescue Errno::ENOENT
200
+ # some other process has snuck in and deleted the
201
+ # file since the path.file? check. has happened...
202
+ 0
203
+ end if path.file? and path != proxy_path
204
+ }
197
205
  return if available >= want_size
198
206
 
199
207
  space_needed = want_size - available
@@ -226,7 +234,7 @@ module Defog
226
234
  begin
227
235
  candidate.unlink
228
236
  rescue Errno::ENOENT
229
- # some other process has deleted the while we were looking at it.
237
+ # some other process has deleted the file while we were looking at it.
230
238
  # nothing to do.
231
239
  end
232
240
  end
@@ -1,3 +1,3 @@
1
1
  module Defog
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
@@ -167,7 +167,16 @@ shared_examples "a proxy" do |args|
167
167
  other_proxy_path("c").should_not be_exist
168
168
  end
169
169
 
170
- it "should not fail when proxies get deleted by another process" do
170
+ it "should not fail size check when proxies get deleted by another process" do
171
+ create_other_proxy("a", 10)
172
+ create_other_proxy("b", 30)
173
+ create_other_proxy("c", 40)
174
+ create_remote("x" * 80)
175
+ Pathname.any_instance.should_receive(:size).and_raise Errno::ENOENT
176
+ expect { @proxy.file(key, "r") do end }.to_not raise_error(Errno::ENOENT)
177
+ end
178
+
179
+ it "should not fail unlinking when proxies get deleted by another process" do
171
180
  create_other_proxy("a", 10)
172
181
  create_other_proxy("b", 30)
173
182
  create_other_proxy("c", 40)
metadata CHANGED
@@ -1,125 +1,142 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: defog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - ronen barzel
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-06-03 00:00:00.000000000 Z
12
+ date: 2013-06-10 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: fog
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '>='
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0'
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - '>='
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: hash_keyword_args
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - '>='
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
37
  version: '0'
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - '>='
43
+ - - ! '>='
39
44
  - !ruby/object:Gem::Version
40
45
  version: '0'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: fastandand
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - '>='
51
+ - - ! '>='
46
52
  - !ruby/object:Gem::Version
47
53
  version: '0'
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - '>='
59
+ - - ! '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: rake
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - '>='
67
+ - - ! '>='
60
68
  - !ruby/object:Gem::Version
61
69
  version: '0'
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - '>='
75
+ - - ! '>='
67
76
  - !ruby/object:Gem::Version
68
77
  version: '0'
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: rdoc
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
- - - '>='
83
+ - - ! '>='
74
84
  - !ruby/object:Gem::Version
75
85
  version: '0'
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - '>='
91
+ - - ! '>='
81
92
  - !ruby/object:Gem::Version
82
93
  version: '0'
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: rspec
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
- - - '>='
99
+ - - ! '>='
88
100
  - !ruby/object:Gem::Version
89
101
  version: '0'
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
- - - '>='
107
+ - - ! '>='
95
108
  - !ruby/object:Gem::Version
96
109
  version: '0'
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: simplecov
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
- - - '>='
115
+ - - ! '>='
102
116
  - !ruby/object:Gem::Version
103
117
  version: '0'
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
- - - '>='
123
+ - - ! '>='
109
124
  - !ruby/object:Gem::Version
110
125
  version: '0'
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: simplecov-gem-adapter
113
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
114
130
  requirements:
115
- - - '>='
131
+ - - ! '>='
116
132
  - !ruby/object:Gem::Version
117
133
  version: '0'
118
134
  type: :development
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
121
138
  requirements:
122
- - - '>='
139
+ - - ! '>='
123
140
  - !ruby/object:Gem::Version
124
141
  version: '0'
125
142
  description: Wrapper to fog gem, proxying access to cloud files as local files.
@@ -151,26 +168,27 @@ files:
151
168
  - spec/support/helpers.rb
152
169
  homepage: http://github.com/ronen/defog
153
170
  licenses: []
154
- metadata: {}
155
171
  post_install_message:
156
172
  rdoc_options: []
157
173
  require_paths:
158
174
  - lib
159
175
  required_ruby_version: !ruby/object:Gem::Requirement
176
+ none: false
160
177
  requirements:
161
- - - '>='
178
+ - - ! '>='
162
179
  - !ruby/object:Gem::Version
163
180
  version: '0'
164
181
  required_rubygems_version: !ruby/object:Gem::Requirement
182
+ none: false
165
183
  requirements:
166
- - - '>='
184
+ - - ! '>='
167
185
  - !ruby/object:Gem::Version
168
186
  version: '0'
169
187
  requirements: []
170
188
  rubyforge_project:
171
- rubygems_version: 2.0.3
189
+ rubygems_version: 1.8.25
172
190
  signing_key:
173
- specification_version: 4
191
+ specification_version: 3
174
192
  summary: Wrapper to fog gem, proxying access to cloud files as local files. Access
175
193
  can be read-only (local cache), write-only (upload), or read-write (mirror)
176
194
  test_files:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 024349bd2d3f5def5bf676cd93b7a222500003ab
4
- data.tar.gz: 1636cbfc52043124967d8cd0dd5538ae80b42e0e
5
- SHA512:
6
- metadata.gz: 282ade57688944a3d6b0203faece002aab973f92ddb93c702548ba3de50ae1252932b45a38f608c6acc56d2a0ce8ab83ac3dfb6f8d2d6c48ae4567acbdf131ca
7
- data.tar.gz: f4d0323c3ef34a697f7f7bf667f46dd1fb5fd57ec948ce33fa90199cedbe20c8e212bb91c3cc5b1a97cdb89d9ac46a8d6f15fee8d91f699d1b595e006c0f3660