mogilefs-client 3.10.0 → 3.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d02264aa8b34f8fab16add61f2e81ee0643127cf
4
- data.tar.gz: 5b333aa4abe0f863d819a9a480fa11180b902f1b
3
+ metadata.gz: df67ca0268814f324ab52a02700ead9303cb7ce1
4
+ data.tar.gz: f593fa4c418f462993efe066cdd937012f23df9f
5
5
  SHA512:
6
- metadata.gz: c6d650e02544bf8b432c80d50c21b13fbdca9169cd69b5513b534e66b7dc279f25a81a7b8823233e7e2b844d4624dd7d8c06ed38f74212d79a386884b8621f30
7
- data.tar.gz: bd840975cb4154cc4aa6a0370765a7ff48dbf5374daa8aef079a48a2de9b27c4c3a96a543c9c52c6a2de95324fe8271b3a98818d41cc9d55edf8dc03890c0b09
6
+ metadata.gz: c6da0266d991711aee0b33fd1e93e90cf501407f9d4d7559a00ea9fc3e83923ad345ea32f0c0982febfdd3d54a3a605d9d3b0be004704681e3fb2746740471ba
7
+ data.tar.gz: 4f6d66be2a618be1831d6b83835452397cbce8c434bd26537ac5bf42901eeaf1f78835cccf07d35523819cf8c1e6fa16b3999b7ef85fe2ef09a6f2b157c1bbba
@@ -1,9 +1,8 @@
1
1
  ---
2
- cgit_url: http://bogomips.org/mogilefs-client.git
2
+ cgit_url: https://bogomips.org/mogilefs-client.git
3
3
  git_url: git://bogomips.org/mogilefs-client.git
4
- rdoc_url: http://bogomips.org/mogilefs-client
4
+ rdoc_url: https://bogomips.org/mogilefs-client
5
5
  changelog_start: v1.2.1
6
- private_email: e@80x24.org
7
6
  public_email: mogilefs-client-public@bogomips.org
8
7
  nntp_url: nntp://news.public-inbox.org/inbox.comp.file-systems.mogilefs.ruby
9
- ml_url: http://bogomips.org/mogilefs-client-public/
8
+ ml_url: https://bogomips.org/mogilefs-client-public/
@@ -2,7 +2,7 @@
2
2
  CONSTANT = "MogileFS::VERSION"
3
3
  RVF = "lib/mogilefs/version.rb"
4
4
  GVF = "GIT-VERSION-FILE"
5
- DEF_VER = "v3.10.0"
5
+ DEF_VER = "v3.11.0"
6
6
  vn = DEF_VER
7
7
 
8
8
  # First see if there is a version file (included in release tarballs),
data/README CHANGED
@@ -1,22 +1,21 @@
1
1
  = mogilefs-client - MogileFS client library for Ruby
2
2
 
3
3
  A MogileFS client library for Ruby. MogileFS is an open source
4
- distributed filesystem, see: http://mogilefs.org for more details. This
5
- library allows any Ruby application to read, write and delete files in a
6
- MogileFS instance.
4
+ distributed filesystem, see: http://mogilefs.org for more details.
5
+ This library allows any Ruby application to read, write and delete
6
+ files in a MogileFS instance.
7
7
 
8
8
  == Links
9
9
 
10
- rdoc :: http://bogomips.org/mogilefs-client
10
+ rdoc :: https://bogomips.org/mogilefs-client
11
11
  mogilefs :: http://mogilefs.org/
12
12
  list :: mailto:mogilefs-client-public@bogomips.org
13
13
  list-cc :: mailto:mogile@googlegroups.com
14
- list-archive :: http://bogomips.org/mogilefs-client-public
15
- email :: mailto:e@80x24.org
14
+ list-archive :: https://bogomips.org/mogilefs-client-public
16
15
  repo :: git://bogomips.org/mogilefs-client.git
17
- http://bogomips.org/mogilefs-client.git
16
+ https://bogomips.org/mogilefs-client.git
18
17
  gitweb :: http://repo.or.cz/w/ruby-mogilefs-client.git
19
- download :: http://bogomips.org/mogilefs-client/files/
18
+ download :: https://bogomips.org/mogilefs-client/files/
20
19
 
21
20
  == Install
22
21
 
@@ -43,20 +42,19 @@ is required or available to post:
43
42
 
44
43
  mogilefs-client-public@bogomips.org
45
44
 
46
- List archives: http://bogomips.org/mogilefs-client-public/
45
+ Users of anonymous remailers and other anonymity tools are welcome.
46
+ Participants will never be asked to reveal their identity.
47
+
48
+ List archives: https://bogomips.org/mogilefs-client-public/
47
49
 
48
50
  We may also piggy-back onto the public MogileFS mailing list at
49
51
  mogile@googlegroups.com for feedback (subscription required,
50
52
  unfortunately)
51
53
 
52
- If you wish to keep your issue secret, feel free to email the author at:
53
-
54
- e@80x24.org
55
-
56
54
  Do not expect us to read HTML mail under any circumstances.
57
55
 
58
56
  == WARNING!
59
57
 
60
58
  This client is only supported in HTTP mode. NFS mode was previously
61
- supported in 1.3.x, but since MogileFS 2.x has dropped support for
62
- NFS, this client has removed support for it.
59
+ supported in 1.3.x, but since MogileFS 2.x dropped support for NFS
60
+ in in 2006, this client does not support it.
@@ -34,7 +34,9 @@
34
34
  end
35
35
 
36
36
  adm = MogileFS::Admin.new(:hosts => trackers)
37
- NHP = Net::HTTP::Persistent.new(File.basename($0))
37
+ name = File.basename($0)
38
+ Net::HTTP::Persistent::VERSION >= 3.0 and name = { :name => name }
39
+ NHP = Net::HTTP::Persistent.new(name)
38
40
  client = MogileFS::MogileFS.new(:hosts => trackers, :domain => "none")
39
41
 
40
42
  def start_perdev_thread(pfx)
@@ -1,4 +1,5 @@
1
1
  # -*- encoding: binary -*-
2
+ # frozen_string_literal: true
2
3
 
3
4
  # \MogileFS administration client, this has little real-world usage
4
5
  # and is considered a work-in-progress
@@ -54,7 +54,7 @@ def request_put(sock, uri, file_size, input = nil)
54
54
  "Content-Length: #{file_size}\r\n\r\n")
55
55
  rv = input ? MogileFS.io.copy_stream(@active = input, sock) : yield(sock)
56
56
  else
57
- trailers = @md5 ? "Trailer: Content-MD5\r\n" : ""
57
+ trailers = @md5 ? "Trailer: Content-MD5\r\n".freeze : "".freeze
58
58
  sock.write("PUT #{uri.request_uri} HTTP/1.1\r\n" \
59
59
  "Host: #{host_with_port}\r\n#{trailers}" \
60
60
  "Transfer-Encoding: chunked\r\n\r\n")
@@ -143,14 +143,14 @@ def nhp_put(devid, uri)
143
143
  end
144
144
 
145
145
  put = Net::HTTP::Put.new(uri.path)
146
- put["Content-Type"] = "application/octet-stream"
146
+ put["Content-Type".freeze] = "application/octet-stream".freeze
147
147
  if md5 = @opts[:content_md5]
148
148
  if md5.respond_to?(:call)
149
149
  md5 = md5.call.strip
150
150
  elsif md5 == :trailer
151
- md5 = [ Digest::MD5.digest(string) ].pack("m").chomp!
151
+ md5 = [ Digest::MD5.digest(string) ].pack("m".freeze).chomp!
152
152
  end
153
- put["Content-MD5"] = md5
153
+ put["Content-MD5".freeze] = md5
154
154
  end
155
155
  put.body = string
156
156
  res = @opts[:nhp_put].request(uri, put)
@@ -73,9 +73,9 @@ def initialize(args = {})
73
73
 
74
74
  @get_file_data_timeout = args[:get_file_data_timeout] || 5
75
75
  @new_file_max_time = args[:new_file_max_time] || 3600.0
76
- @nhp_get = MogileFS::NHP.new('get')
76
+ @nhp_get = nhp_new('get')
77
77
  @nhp_get.open_timeout = @nhp_get.read_timeout = @get_file_data_timeout
78
- @nhp_put = MogileFS::NHP.new('put')
78
+ @nhp_put = nhp_new('put')
79
79
  @nhp_put.open_timeout = @nhp_put.read_timeout = @new_file_max_time
80
80
 
81
81
  raise ArgumentError, "you must specify a domain" unless @domain
@@ -548,4 +548,11 @@ def file_debug(args)
548
548
  end
549
549
  end
550
550
  end
551
+
552
+ def nhp_new(name) # :nodoc:
553
+ Net::HTTP::Persistent::VERSION.to_f >= 3.0 and name = { :name => name }
554
+ MogileFS::NHP.new(name)
555
+ rescue NameError
556
+ MogileFS::NHP.new(name)
557
+ end
551
558
  end
@@ -28,7 +28,7 @@ def initialize(args = {})
28
28
  ##
29
29
  # Lists keys starting with +prefix+ follwing +after+ up to +limit+. If
30
30
  # +after+ is nil the list starts at the beginning.
31
- def _list_keys(domain, prefix = '', after = '', limit = 1000)
31
+ def _list_keys(domain, prefix = ''.freeze, after = ''.freeze, limit = 1000)
32
32
  # this code is based on server/lib/MogileFS/Worker/Query.pm
33
33
  dmid = get_dmid(domain)
34
34
 
@@ -43,7 +43,7 @@ def _list_keys(domain, prefix = '', after = '', limit = 1000)
43
43
  end
44
44
 
45
45
  raise MogileFS::Backend::InvalidCharsError if /[%\\]/ =~ prefix
46
- prefix.gsub!(/_/, '\_') # not sure why MogileFS::Worker::Query does this...
46
+ prefix.gsub!(/_/, '\_'.freeze)
47
47
 
48
48
  sql = <<-EOS
49
49
  SELECT dkey,length,devcount FROM file
@@ -150,7 +150,7 @@ def refresh_device(force = false)
150
150
  tmp[devid.to_i] = {
151
151
  :hostip => hostip.freeze,
152
152
  :altip => (altip || hostip).freeze,
153
- :readable => (host_status == "alive" &&
153
+ :readable => (host_status == "alive".freeze &&
154
154
  DEV_STATUS_READABLE.include?(dev_status)),
155
155
  :http_port => http_port,
156
156
  :http_get_port => http_get_port ? http_get_port.to_i : http_port,
@@ -7,14 +7,14 @@
7
7
 
8
8
  module MogileFS::NewFile::Common
9
9
  # :stopdoc:
10
- class RetryableError < MogileFS::Error; end
11
- class EmptyResponseError < RetryableError; end
12
- class BadResponseError < RetryableError; end
13
- class UnparseableResponseError < RetryableError; end
10
+ RetryableError = Class.new(MogileFS::Error)
11
+ EmptyResponseError = Class.new(RetryableError)
12
+ BadResponseError = Class.new(RetryableError)
13
+ UnparseableResponseError = Class.new(RetryableError)
14
14
  class NoStorageNodesError < MogileFS::Error
15
15
  def message; 'Unable to open socket to storage node'; end
16
16
  end
17
- class NonRetryableError < MogileFS::Error; end
17
+ NonRetryableError = Class.new(MogileFS::Error)
18
18
 
19
19
  MD5_TRAILER_NODES = {} # :nodoc: # EXPERIMENTAL
20
20
 
@@ -23,7 +23,7 @@ def read_response(sock)
23
23
  start_time = @opts[:start_time] and tout -= MogileFS.now - start_time
24
24
  set_socket_options(sock)
25
25
  case line = sock.timed_read(23, "", tout > 0.0 ? tout : 0)
26
- when %r{^HTTP/\d\.\d\s+(2\d\d)\s} # success!
26
+ when %r{^HTTP/\d\.\d\s+(?:2\d\d)\s} # success!
27
27
  when nil
28
28
  raise EmptyResponseError, 'Unable to read response line from server'
29
29
  when %r{^HTTP/\d\.\d\s+(\d+)}
@@ -66,7 +66,7 @@ def commit
66
66
  def start_sock(sock, uri)
67
67
  host_with_port = "#{uri.host}:#{uri.port}"
68
68
  headers = "PUT #{uri.request_uri} HTTP/1.1\r\n" \
69
- "Host: #{host_with_port}\r\n" \
69
+ "Host: #{host_with_port}\r\n"
70
70
 
71
71
  content_md5 = @opts[:content_md5]
72
72
  if String === content_md5
@@ -75,16 +75,16 @@ def start_sock(sock, uri)
75
75
  :trailer == content_md5 ||
76
76
  MD5_TRAILER_NODES[host_with_port]
77
77
  @md5 = Digest::MD5.new
78
- headers << "Trailer: Content-MD5\r\n"
78
+ headers << "Trailer: Content-MD5\r\n".freeze
79
79
  end
80
80
 
81
81
  if ! @md5 && clen = @opts[:content_length]
82
82
  headers << "Content-Length: #{clen}\r\n"
83
83
  else
84
- headers << "Transfer-Encoding: chunked\r\n"
84
+ headers << "Transfer-Encoding: chunked\r\n".freeze
85
85
  end
86
86
 
87
- sock.write(headers << "\r\n")
87
+ sock.write(headers << "\r\n".freeze)
88
88
  end
89
89
 
90
90
  alias syswrite write
@@ -9,7 +9,7 @@ module MogileFS::NewFile::Writer
9
9
  def puts(*args)
10
10
  args.each do |obj|
11
11
  write(obj)
12
- write("\n")
12
+ write("\n".freeze)
13
13
  end
14
14
  nil
15
15
  end
@@ -10,7 +10,7 @@ def self.call(paths)
10
10
  begin
11
11
  case r = Net::HTTP.start(uri.host, uri.port) { |x| x.head(uri.path) }
12
12
  when Net::HTTPOK
13
- return r["Content-Length"].to_i
13
+ return r['Content-Length'.freeze].to_i
14
14
  else
15
15
  errors[path] = r
16
16
  end
@@ -23,18 +23,17 @@ def request_truncated!(written, expect, timeout)
23
23
  "request truncated (sent #{written} expected #{expect} timeout=#{timeout})"
24
24
  end
25
25
 
26
- SEP_RE = /\A(.*?#{Regexp.escape("\n")})/
27
26
  def timed_gets(timeout = 5)
28
27
  unless defined?(@rbuf) && @rbuf
29
28
  @rbuf = timed_read(1024, "", timeout) or return # EOF
30
29
  end
31
30
  begin
32
- @rbuf.sub!(SEP_RE, "") and return $1
31
+ @rbuf.sub!(/\A(.*\n)/o, "".freeze) and return $1
33
32
  tmp ||= ""
34
33
  if timed_read(1024, tmp, timeout)
35
34
  @rbuf << tmp
36
35
  else
37
- # EOF, return the last buffered bit even without SEP_RE matching
36
+ # EOF, return the last buffered bit even without separatar matching
38
37
  # (not ideal for MogileFS, this is an error)
39
38
  return @rbuf.empty? ? nil : @rbuf.slice!(0, @rbuf.size)
40
39
  end
@@ -56,4 +55,16 @@ def read(size, buf = "", timeout = 5)
56
55
  def readpartial(size, buf = "", timeout = 5)
57
56
  timed_read(size, buf, timeout) or raise EOFError, "end of file reached"
58
57
  end
58
+
59
+ # Workaround for https://bugs.ruby-lang.org/issues/13085
60
+ # (excessive garbage from IO#write)
61
+ # This looks like it will be fixed in Ruby 2.5 final.
62
+ if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby' &&
63
+ RUBY_VERSION.to_f >= 2.2 && RUBY_VERSION.to_f <= 2.4
64
+ def write(buf)
65
+ # Blocking TCP writes would error out long before one day,
66
+ # and MogileFS won't allow file creations which take over a day.
67
+ timed_write(buf, 86400)
68
+ end
69
+ end
59
70
  end
@@ -1,20 +1,20 @@
1
- ENV["VERSION"] or abort "VERSION= must be specified"
2
- require 'olddoc'
3
1
  $LOAD_PATH << 'lib'
4
- require 'mogilefs'
5
- extend Olddoc::Gemspec
6
- name, summary, title = readme_metadata
2
+ require 'mogilefs' # for MogileFS::VERSION
7
3
  Gem::Specification.new do |s|
8
4
  manifest = File.read('.manifest').split(/\n/)
9
5
  s.name = 'mogilefs-client'
10
6
  s.version = MogileFS::VERSION
11
7
  s.executables = %w(mog)
12
8
  s.authors = ["#{s.name} hackers"]
13
- s.summary = summary
14
- s.description = readme_description
15
- s.email = Olddoc.config['private_email']
9
+ s.summary = 'MogileFS client library for Ruby'
10
+ s.description = <<EOF
11
+ A MogileFS client library for Ruby. MogileFS is an open source
12
+ distributed filesystem, see: http://mogilefs.org for more details.
13
+ This library allows any Ruby application to read, write and delete
14
+ files in a MogileFS instance.
15
+ EOF
16
+ s.email = 'mogilefs-client-public@bogomips.org'
16
17
  s.files = manifest
17
- s.add_development_dependency('olddoc', '~> 1.0')
18
- s.homepage = Olddoc.config['rdoc_url']
18
+ s.homepage = 'https://bogomips.org/mogilefs-client/'
19
19
  s.license = 'BSD-3-Clause'
20
20
  end
@@ -42,7 +42,7 @@ def setup_mogilefs(plugins = nil)
42
42
  50.times do
43
43
  break if File.size(@mogstored_pid.path) > 0
44
44
  sleep 0.1
45
- end
45
+ end unless Integer === @mogstored_pid
46
46
  end
47
47
 
48
48
  def start_tracker
@@ -108,10 +108,12 @@ def add_host_device_domain
108
108
 
109
109
  def teardown_mogilefs
110
110
  return if $$ != @teardown_pid
111
- if @mogstored_pid
111
+ if Integer === @mogstored_pid
112
+ pid = @mogstored_pid
113
+ else
112
114
  pid = File.read(@mogstored_pid.path).to_i
113
- Process.kill(:TERM, pid) if pid > 0
114
115
  end
116
+ Process.kill(:TERM, pid) if pid > 0
115
117
  if @mogilefsd_pid
116
118
  s = TCPSocket.new(@test_host, @tracker_port)
117
119
  s.write "!shutdown\r\n"
@@ -1,18 +1,11 @@
1
1
  # -*- encoding: binary -*-
2
2
  require "./test/fresh"
3
- begin
4
- require 'mogstored_rack'
5
- require 'unicorn'
6
- ok = true
7
- rescue LoadError
8
- ok = false
9
- end
10
-
11
- class TestMogstoredRack < Test::Unit::TestCase
3
+
4
+ # cmogstored allows Content-Range on PUT, unlike the original mogstored
5
+ class Test_cmogstored < Test::Unit::TestCase
12
6
  include TestFreshSetup
13
- def setup
14
- setup_mogilefs
15
- end
7
+ alias setup setup_mogilefs
8
+ alias teardown teardown_mogilefs
16
9
 
17
10
  def test_range_put_new_file
18
11
  add_host_device_domain
@@ -34,6 +27,25 @@ def test_range_put_new_file
34
27
  assert_equal "a\nb\nc\nd\ne\n", client.get_file_data("puts")
35
28
  end
36
29
 
30
+ def test_garbage
31
+ add_host_device_domain
32
+ client = MogileFS::MogileFS.new :hosts => @hosts, :domain => @domain,
33
+ :timeout => 60
34
+ nr = 1024 * 1024 * 1024
35
+ client.new_file('giant', :largefile => :stream,
36
+ :content_length => nr) do |io|
37
+ assert_instance_of MogileFS::NewFile::Stream, io
38
+ zero = Zero.new
39
+ before = GC.count
40
+ wr = IO.copy_stream(zero, io, nr)
41
+ after = GC.count
42
+ assert_equal nr, wr
43
+ assert_in_delta before, after, 1
44
+ end
45
+ end if IO.respond_to?(:copy_stream) && defined?(Zero) &&
46
+ GC.respond_to?(:count) && defined?(RUBY_ENGINE) &&
47
+ RUBY_ENGINE == 'ruby' && ENV['TEST_EXPENSIVE'].to_i != 0
48
+
37
49
  def test_stream_new_file
38
50
  add_host_device_domain
39
51
  client = MogileFS::MogileFS.new :hosts => @hosts, :domain => @domain
@@ -136,60 +148,34 @@ def setup_mogstored
136
148
  @mogstored_http = TCPServer.new(@test_host, 0)
137
149
  @mogstored_mgmt_port = @mogstored_mgmt.addr[1]
138
150
  @mogstored_http_port = @mogstored_http.addr[1]
139
- @mogstored_conf = Tempfile.new(["mogstored", "conf"])
140
- @mogstored_pid = Tempfile.new(["mogstored", "pid"])
141
- @mogstored_conf.write <<EOF
142
- pidfile = #{@mogstored_pid.path}
143
- maxconns = 1000
144
- mgmtlisten = #@test_host:#{@mogstored_mgmt_port}
145
- server = none
146
- docroot = #@docroot
147
- EOF
148
- @mogstored_conf.flush
149
- @mogstored_mgmt.close
150
-
151
- unicorn_setup
152
-
153
- x!("mogstored", "--daemon", "--config=#{@mogstored_conf.path}")
154
- wait_for_port @mogstored_mgmt_port
155
- end
156
151
 
157
- # I would use Rainbows! + *Threads + Ruby 1.9.3 in production
158
- def unicorn_setup
159
- @ru = Tempfile.new(%w(mogstored_rack .ru))
160
- @ru.write <<EOF
161
- run MogstoredRack.new("#@docroot")
162
- EOF
163
- @ru.flush
164
-
165
- @unicorn_pid = Tempfile.new(%w(unicorn .pid))
166
- @unicorn_conf = Tempfile.new(%w(unicorn.conf .rb))
167
- @unicorn_stderr = Tempfile.new(%w(unicorn .stderr))
168
- @unicorn_stdout = Tempfile.new(%w(unicorn .stdout))
169
- @unicorn_conf.write <<EOF
170
- require "mogstored_rack"
171
- listen "#@test_host:#{@mogstored_http_port}"
172
- pid "#{@unicorn_pid.path}"
173
- stderr_path "#{@unicorn_stderr.path}"
174
- stdout_path "#{@unicorn_stdout.path}"
175
- rewindable_input false
176
- EOF
177
- @unicorn_conf.flush
178
-
179
- @mogstored_http.close
180
- x!("unicorn", "-E", "deployment",
181
- "--daemon", "--config", @unicorn_conf.path, @ru.path)
182
- wait_for_port @mogstored_http_port
183
- 40.times do
184
- break if File.size(@unicorn_pid.path) > 0
185
- sleep 0.1
152
+ @mogstored_pid = fork do
153
+ mgmt_fd = @mogstored_mgmt.fileno
154
+ http_fd = @mogstored_http.fileno
155
+ args = []
156
+ ENV["CMOGSTORED_FD"] = "#{mgmt_fd},#{http_fd}"
157
+ if @mogstored_mgmt.respond_to?(:close_on_exec=)
158
+ @mogstored_mgmt.close_on_exec = @mogstored_http.close_on_exec = false
159
+ args << { mgmt_fd => mgmt_fd, http_fd => http_fd }
160
+ end
161
+ $stderr.reopen('/dev/null', 'a')
162
+ exec "cmogstored", "--httplisten=#@test_host:#@mogstored_http_port",
163
+ "--mgmtlisten=#@test_host:#@mogstored_mgmt_port",
164
+ "--maxconns=1000", "--docroot=#@docroot", *args
186
165
  end
187
166
  end
167
+ end if `which cmogstored`.chomp.size > 0
168
+
169
+ # The goal of this is to use a synthetic (non-IO) reader
170
+ # to trigger the read/write loop of IO.copy_stream,
171
+ # bypassing in-kernel mechanisms like sendfile for zero copy,
172
+ # so we wrap the /dev/zero IO object:
173
+ class Zero
174
+ def initialize
175
+ @in = File.open('/dev/zero', 'rb')
176
+ end
188
177
 
189
- def teardown
190
- pid = File.read(@unicorn_pid.path).to_i
191
- Process.kill(:QUIT, pid) if pid > 0
192
- teardown_mogilefs
193
- puts(@unicorn_stderr.read) if $DEBUG
178
+ def read(len, buf)
179
+ @in.read(len, buf)
194
180
  end
195
- end if ok && `which unicorn`.chomp.size > 0
181
+ end if File.readable?('/dev/zero')
@@ -0,0 +1,25 @@
1
+ require 'test/unit'
2
+
3
+ class TestNhpCompat < Test::Unit::TestCase
4
+
5
+ def test_nhp_compat
6
+ ver_test_nhp('~> 2.9')
7
+ ver_test_nhp('~> 3.0')
8
+ end
9
+
10
+ def ver_test_nhp(verspec)
11
+ pid = fork do
12
+ begin
13
+ gem 'net-http-persistent', verspec
14
+ rescue LoadError => e
15
+ warn "SKIPPING net-http-persistent #{verspec}\n" \
16
+ "#{e.message} (#{e.class})\n"
17
+ end
18
+ require 'mogilefs'
19
+ mg = MogileFS::MogileFS.new :hosts => %w(127.0.0.1:7500), :domain => 'x'
20
+ exit!(Net::HTTP::Persistent === mg.nhp_new('foo'))
21
+ end
22
+ _, status = Process.waitpid2(pid)
23
+ assert status.success?, status.inspect
24
+ end
25
+ end
metadata CHANGED
@@ -1,35 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mogilefs-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.0
4
+ version: 3.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mogilefs-client hackers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-31 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: olddoc
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.0'
27
- description: |-
11
+ date: 2017-01-31 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: |
28
14
  A MogileFS client library for Ruby. MogileFS is an open source
29
- distributed filesystem, see: http://mogilefs.org for more details. This
30
- library allows any Ruby application to read, write and delete files in a
31
- MogileFS instance.
32
- email: e@80x24.org
15
+ distributed filesystem, see: http://mogilefs.org for more details.
16
+ This library allows any Ruby application to read, write and delete
17
+ files in a MogileFS instance.
18
+ email: mogilefs-client-public@bogomips.org
33
19
  executables:
34
20
  - mog
35
21
  extensions: []
@@ -94,6 +80,7 @@ files:
94
80
  - test/test_backend.rb
95
81
  - test/test_bigfile.rb
96
82
  - test/test_client.rb
83
+ - test/test_cmogstored.rb
97
84
  - test/test_db_backend.rb
98
85
  - test/test_fresh.rb
99
86
  - test/test_http_reader.rb
@@ -103,11 +90,11 @@ files:
103
90
  - test/test_mogilefs_integration_list_keys.rb
104
91
  - test/test_mogilefs_socket_kgio.rb
105
92
  - test/test_mogilefs_socket_pure.rb
106
- - test/test_mogstored_rack.rb
107
93
  - test/test_mogtool_bigfile.rb
108
94
  - test/test_mysql.rb
95
+ - test/test_nhp_compat.rb
109
96
  - test/test_pool.rb
110
- homepage: http://bogomips.org/mogilefs-client
97
+ homepage: https://bogomips.org/mogilefs-client/
111
98
  licenses:
112
99
  - BSD-3-Clause
113
100
  metadata: {}
@@ -127,8 +114,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
114
  version: '0'
128
115
  requirements: []
129
116
  rubyforge_project:
130
- rubygems_version: 2.6.6
117
+ rubygems_version: 2.6.10
131
118
  signing_key:
132
119
  specification_version: 4
133
- summary: client - MogileFS client library for Ruby
120
+ summary: MogileFS client library for Ruby
134
121
  test_files: []