mogilefs-client 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/GIT-VERSION-GEN +1 -1
- data/LICENSE +1 -1
- data/README +3 -3
- data/TODO +2 -2
- data/lib/mogilefs.rb +1 -1
- data/lib/mogilefs/mogilefs.rb +1 -1
- data/lib/mogilefs/socket_common.rb +2 -2
- data/test/socket_test.rb +14 -0
- metadata +32 -54
data/GIT-VERSION-GEN
CHANGED
data/LICENSE
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
Copyright 2005 Eric Hodel, The Robot Co-op. All rights reserved.
|
2
|
-
Copyright 2008 Eric Wong. All rights reserved.
|
2
|
+
Copyright 2008-2012 Eric Wong. All rights reserved.
|
3
3
|
|
4
4
|
Redistribution and use in source and binary forms, with or without
|
5
5
|
modification, are permitted provided that the following conditions
|
data/README
CHANGED
@@ -33,14 +33,14 @@ See MogileFS::MogileFS
|
|
33
33
|
|
34
34
|
== Contact
|
35
35
|
|
36
|
-
Feedback (bug reports, user/development
|
36
|
+
Feedback (bug reports, user/development discussion, patches, pull
|
37
37
|
requests) are greatly appreciated and handled via email. We currently
|
38
38
|
piggy-back onto the public MogileFS
|
39
|
-
|
39
|
+
mailing list at mailto:mogile@googlegroups.com for feedback.
|
40
40
|
|
41
41
|
If you do not want to deal with the corporate host of the MogileFS
|
42
42
|
mailing list, or if you wish to keep your issue secret, feel free to
|
43
|
-
email
|
43
|
+
email Eric Wong at mailto:normalperson@yhbt.net.
|
44
44
|
|
45
45
|
Do not expect Eric Wong to read HTML mail under any circumstances.
|
46
46
|
|
data/TODO
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
Patches and pull-requests
|
2
|
-
|
1
|
+
Patches and pull-requests by public (mailto:mogile@googlegroups.com) or
|
2
|
+
private email (mailto:normalperson@yhbt.net) greatly appreciated!
|
3
3
|
|
4
4
|
* MogileFS::Admin needs to be fleshed out
|
5
5
|
|
data/lib/mogilefs.rb
CHANGED
@@ -30,7 +30,7 @@ module MogileFS
|
|
30
30
|
class EmptyPathError < Error; end
|
31
31
|
|
32
32
|
# Raised when we are given an unsupported protocol to upload to.
|
33
|
-
# Currently, the \MogileFS (2.
|
33
|
+
# Currently, the \MogileFS (2.XX) server only supports HTTP and
|
34
34
|
# this library is only capable of HTTP.
|
35
35
|
class UnsupportedPathError < Error; end
|
36
36
|
|
data/lib/mogilefs/mogilefs.rb
CHANGED
@@ -114,7 +114,7 @@ class MogileFS::MogileFS < MogileFS::Client
|
|
114
114
|
# - :pathcount -> a positive integer of URLs to retrieve (default: 2)
|
115
115
|
# - :zone -> "alt" or nil (default: nil)
|
116
116
|
#
|
117
|
-
# :noverify defaults to
|
117
|
+
# :noverify defaults to true because this client library is capable of
|
118
118
|
# verifying paths for readability itself. It is also faster and more
|
119
119
|
# reliable to verify paths on the client.
|
120
120
|
def get_paths(key, *args)
|
@@ -44,9 +44,9 @@ module MogileFS::SocketCommon
|
|
44
44
|
def read(size, buf = "", timeout = 5)
|
45
45
|
timed_read(size, buf, timeout) or return # nil/EOF
|
46
46
|
|
47
|
-
while (size
|
47
|
+
while (remaining = size - buf.bytesize) > 0
|
48
48
|
tmp ||= ""
|
49
|
-
timed_read(
|
49
|
+
timed_read(remaining, tmp, timeout) or return buf # truncated
|
50
50
|
buf << tmp
|
51
51
|
end
|
52
52
|
|
data/test/socket_test.rb
CHANGED
@@ -95,4 +95,18 @@ module SocketTest
|
|
95
95
|
accepted.close
|
96
96
|
assert_nil sock.timed_gets
|
97
97
|
end
|
98
|
+
|
99
|
+
def test_read_in_full
|
100
|
+
sock = MogileFS::Socket.tcp(@host, @port)
|
101
|
+
accepted = @srv.accept
|
102
|
+
thr = Thread.new do
|
103
|
+
accepted.write "HELLO"
|
104
|
+
sleep 0.1
|
105
|
+
accepted.write " "
|
106
|
+
sleep 0.1
|
107
|
+
accepted.write "WORLD!!!"
|
108
|
+
end
|
109
|
+
buf = sock.read("HELLO WORLD!!!".bytesize)
|
110
|
+
assert_equal "HELLO WORLD!!!", buf
|
111
|
+
end
|
98
112
|
end
|
metadata
CHANGED
@@ -1,51 +1,37 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mogilefs-client
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.1.1
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 3
|
8
|
-
- 1
|
9
|
-
- 0
|
10
|
-
version: 3.1.0
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Eric Wong
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-02-28 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: hoe
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &71137770 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
18
|
+
requirements:
|
26
19
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 2
|
31
|
-
- 12
|
32
|
-
version: "2.12"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2.12'
|
33
22
|
type: :development
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
email:
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *71137770
|
25
|
+
description: ! '["A MogileFS client library for Ruby. MogileFS is an open source\ndistributed
|
26
|
+
filesystem, see: http://mogilefs.org for more details. This\nlibrary allows any
|
27
|
+
Ruby application to read, write and delete files in a\nMogileFS instance."]'
|
28
|
+
email:
|
41
29
|
- normalperson@yhbt.net
|
42
|
-
executables:
|
30
|
+
executables:
|
43
31
|
- mog
|
44
32
|
extensions: []
|
45
|
-
|
46
33
|
extra_rdoc_files: []
|
47
|
-
|
48
|
-
files:
|
34
|
+
files:
|
49
35
|
- .document
|
50
36
|
- .gitignore
|
51
37
|
- .wrongdoc.yml
|
@@ -113,39 +99,31 @@ files:
|
|
113
99
|
- .gemtest
|
114
100
|
homepage: http://bogomips.org/mogilefs-client
|
115
101
|
licenses: []
|
116
|
-
|
117
102
|
post_install_message:
|
118
|
-
rdoc_options:
|
103
|
+
rdoc_options:
|
119
104
|
- --main
|
120
105
|
- README
|
121
|
-
require_paths:
|
106
|
+
require_paths:
|
122
107
|
- lib
|
123
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
124
109
|
none: false
|
125
|
-
requirements:
|
126
|
-
- -
|
127
|
-
- !ruby/object:Gem::Version
|
128
|
-
|
129
|
-
|
130
|
-
- 0
|
131
|
-
version: "0"
|
132
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ! '>='
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
115
|
none: false
|
134
|
-
requirements:
|
135
|
-
- -
|
136
|
-
- !ruby/object:Gem::Version
|
137
|
-
|
138
|
-
segments:
|
139
|
-
- 0
|
140
|
-
version: "0"
|
116
|
+
requirements:
|
117
|
+
- - ! '>='
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
141
120
|
requirements: []
|
142
|
-
|
143
121
|
rubyforge_project: seattlerb
|
144
122
|
rubygems_version: 1.8.11
|
145
123
|
signing_key:
|
146
124
|
specification_version: 3
|
147
125
|
summary: MogileFS client library for Ruby
|
148
|
-
test_files:
|
126
|
+
test_files:
|
149
127
|
- test/test_http_reader.rb
|
150
128
|
- test/test_mogilefs_integration_list_keys.rb
|
151
129
|
- test/test_db_backend.rb
|