rangeclient 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/er +6 -2
- data/bin/range_diff +0 -1
- data/lib/rangeclient.rb +4 -3
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5795ee9d5625c085e50c8fe77e697b7f2d2b73ee
|
4
|
+
data.tar.gz: df4ca2d2ccd8cb1e4ffdb0d95031639687dba8a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 872151144b8aa5507e0b867b11601c8b324dd1ac16ff130af8b6ba92e91567a06311cf155e78775d6c45280e459772f3a64ef4e85702832df95cd0cb5ef4b962
|
7
|
+
data.tar.gz: 73f63033aa880e4da09773a7096aa6e2d2f205255b35906999b4dd3fabdbd4ffa2bf3f1754864994510daa4f896cdca63af556f1af4bb449fe8dac2f615fa389
|
data/bin/er
CHANGED
@@ -42,7 +42,7 @@ in_range = ARGV.join ','
|
|
42
42
|
|
43
43
|
if in_range.empty?
|
44
44
|
puts optparse
|
45
|
-
puts "[ERROR] No range specified"
|
45
|
+
STDERR.puts "[ERROR] No range specified"
|
46
46
|
exit 1
|
47
47
|
end
|
48
48
|
|
@@ -52,6 +52,10 @@ end
|
|
52
52
|
|
53
53
|
nodes = range.expand(in_range)
|
54
54
|
|
55
|
+
if not range.rangeexception.nil?
|
56
|
+
STDERR.puts "[WARNING] " + range.rangeexception
|
57
|
+
end
|
58
|
+
|
55
59
|
if options[:count]
|
56
60
|
# if counting, return count
|
57
61
|
puts nodes.size
|
@@ -66,6 +70,6 @@ elsif not nodes.size.zero?
|
|
66
70
|
puts range.compress(nodes)
|
67
71
|
end
|
68
72
|
else
|
69
|
-
puts "[WARNING] No nodes returned"
|
73
|
+
STDERR.puts "[WARNING] No nodes returned"
|
70
74
|
exit 1
|
71
75
|
end
|
data/bin/range_diff
CHANGED
data/lib/rangeclient.rb
CHANGED
@@ -5,7 +5,7 @@ require 'net/http'
|
|
5
5
|
require 'cgi'
|
6
6
|
|
7
7
|
class Range::Client
|
8
|
-
attr_accessor :host, :port, :timeout
|
8
|
+
attr_accessor :host, :port, :timeout, :rangeexception
|
9
9
|
|
10
10
|
# used to split hostnames into component parts for compression
|
11
11
|
@@NodeRegx = /
|
@@ -33,6 +33,7 @@ class Range::Client
|
|
33
33
|
http.read_timeout = @timeout
|
34
34
|
req = Net::HTTP::Get.new('/range/list?' + escaped_arg)
|
35
35
|
resp = http.request(req)
|
36
|
+
@rangeexception = resp['rangeexception']
|
36
37
|
return resp.body.split "\n"
|
37
38
|
end
|
38
39
|
|
@@ -197,10 +198,10 @@ end
|
|
197
198
|
|
198
199
|
if __FILE__ == $0
|
199
200
|
require 'pp'
|
200
|
-
rangehost = ARGV.shift
|
201
201
|
rangearg = ARGV.shift
|
202
|
-
r = Range::Client.new
|
202
|
+
r = Range::Client.new
|
203
203
|
hosts = r.expand(rangearg)
|
204
204
|
pp hosts
|
205
205
|
pp r.compress(hosts)
|
206
|
+
pp r.rangeexception
|
206
207
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rangeclient
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Miller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Use with range from https://github.com/square/libcrange
|
14
14
|
email:
|
@@ -22,35 +22,35 @@ extensions: []
|
|
22
22
|
extra_rdoc_files:
|
23
23
|
- LICENSE.md
|
24
24
|
files:
|
25
|
-
-
|
26
|
-
-
|
25
|
+
- LICENSE.md
|
26
|
+
- README.md
|
27
27
|
- bin/er
|
28
28
|
- bin/range-compress
|
29
29
|
- bin/range_diff
|
30
30
|
- bin/range_split
|
31
|
-
-
|
32
|
-
-
|
31
|
+
- lib/range/fake_client.rb
|
32
|
+
- lib/rangeclient.rb
|
33
33
|
homepage: https://github.com/square/prodeng/tree/master/ruby_rangeclient
|
34
34
|
licenses: []
|
35
35
|
metadata: {}
|
36
36
|
post_install_message:
|
37
37
|
rdoc_options:
|
38
|
-
- --charset=UTF-8
|
38
|
+
- "--charset=UTF-8"
|
39
39
|
require_paths:
|
40
40
|
- lib
|
41
41
|
required_ruby_version: !ruby/object:Gem::Requirement
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
46
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
47
|
requirements:
|
48
|
-
- -
|
48
|
+
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
50
|
version: 1.3.6
|
51
51
|
requirements: []
|
52
52
|
rubyforge_project:
|
53
|
-
rubygems_version: 2.1
|
53
|
+
rubygems_version: 2.2.1
|
54
54
|
signing_key:
|
55
55
|
specification_version: 4
|
56
56
|
summary: Simple range client for ruby.
|