dimscan 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dimscan.gemspec +1 -0
- data/lib/dimscan/http_byte_enumerator.rb +11 -9
- data/lib/dimscan/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 191ef573d63a6519e5830a9f23b9b2615117d1a5
|
4
|
+
data.tar.gz: 43fe8b8c62170bee0df76e0eb732e339df10f529
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2ebc9201d8d1455771b73fa78b830ec5791ec3f7cab9fe0bcd1c601ff59eb3d1403bb707de909873c5c96929395bb7b7d53fc1fa29449916bda6d74158180cc
|
7
|
+
data.tar.gz: d610c586114e3865277eafd3f6ebd0fc0d7b37e71fe9cd162dad927e03489dc51d2656af15d69fe822096a8fbc41edc026e244edf29ba42e6f4c13c643a9658d
|
data/dimscan.gemspec
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
require 'uri'
|
2
|
-
require 'net/http'
|
2
|
+
require 'net/http/persistent'
|
3
3
|
|
4
4
|
module Dimscan
|
5
5
|
# A utility class for enumerating over the bytes of a http response body
|
6
6
|
class HTTPByteEnumerator
|
7
|
+
|
8
|
+
class << self
|
9
|
+
def http
|
10
|
+
@http ||= Net::HTTP::Persistent.new('dimscan')
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
7
14
|
def initialize(url)
|
8
15
|
@uri = URI(url)
|
9
16
|
fail ArgumentError, 'invalid scheme' unless @uri.scheme =~ /^https?$/
|
@@ -11,14 +18,9 @@ module Dimscan
|
|
11
18
|
|
12
19
|
def each(&block)
|
13
20
|
return to_enum(__callee__) unless block_given?
|
14
|
-
request
|
15
|
-
|
16
|
-
|
17
|
-
) do |http|
|
18
|
-
http.request(request) do |response|
|
19
|
-
fail response.body if error?(response)
|
20
|
-
enumerate_response(response, &block)
|
21
|
-
end
|
21
|
+
self.class.http.request(@uri) do |response|
|
22
|
+
fail response.body if error?(response)
|
23
|
+
enumerate_response(response, &block)
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
data/lib/dimscan/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dimscan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joakim Reinert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0.1'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: net-http-persistent
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '2.9'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '2.9'
|
111
125
|
description: Bandwith efficient scanner for dimensions of web hosted images
|
112
126
|
email:
|
113
127
|
- mail@jreinert.net
|