queuery_client 1.0.2 → 1.0.3
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5aa7c59714b2972a888c845beaaf38e220fdc0173cd746a0a73f510a1c69afd
|
4
|
+
data.tar.gz: c876ff24ba9b2d6f489d480de5fc55b74d08ab2aa0229c4cb2a74ca0914053f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c154295e3c4c676de39ee43b544ec458285044c0d797f7ec199c39589023019c7f407623745a53d2da6016a9eb1b1594240e2a1f74d0093025e9d3d73d0ab56
|
7
|
+
data.tar.gz: f7340f67c56865d1c179d062801087931db880a6f9ccbc3f5d3109438ab277a2902000e253bf6d45f8ceebf47b91f2d27fb6709e2fe305f90201d6e9fba206c7
|
@@ -1,5 +1,8 @@
|
|
1
1
|
module QueueryClient
|
2
2
|
class Configuration
|
3
|
+
REQUIRED_KEYS = [:endpoint, :token, :token_secret]
|
4
|
+
OPTIONAL_KEYS = [:host_header]
|
5
|
+
|
3
6
|
def initialize(options = {})
|
4
7
|
@options = options
|
5
8
|
end
|
@@ -12,11 +15,7 @@ module QueueryClient
|
|
12
15
|
@options = nil
|
13
16
|
end
|
14
17
|
|
15
|
-
|
16
|
-
:endpoint,
|
17
|
-
:token,
|
18
|
-
:token_secret,
|
19
|
-
].each do |key|
|
18
|
+
REQUIRED_KEYS.each do |key|
|
20
19
|
define_method(key) do
|
21
20
|
options.fetch(key)
|
22
21
|
end
|
@@ -26,6 +25,16 @@ module QueueryClient
|
|
26
25
|
end
|
27
26
|
end
|
28
27
|
|
28
|
+
OPTIONAL_KEYS.each do |key|
|
29
|
+
define_method(key) do
|
30
|
+
options[key]
|
31
|
+
end
|
32
|
+
|
33
|
+
define_method("#{key}=") do |value|
|
34
|
+
options[key] = value
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
29
38
|
def merge(other)
|
30
39
|
Configuration.new(to_h.merge(other.to_h))
|
31
40
|
end
|
@@ -12,15 +12,21 @@ module QueueryClient
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def each_row(&block)
|
15
|
+
return enum_for(:each_row) if !block_given?
|
16
|
+
|
15
17
|
f = open
|
16
18
|
begin
|
17
19
|
if gzipped_object?
|
18
20
|
f = Zlib::GzipReader.new(f)
|
19
21
|
end
|
20
|
-
RedshiftCsvFile.new(f).each
|
22
|
+
RedshiftCsvFile.new(f).each do |row|
|
23
|
+
yield row
|
24
|
+
end
|
21
25
|
ensure
|
22
26
|
f.close
|
23
27
|
end
|
28
|
+
|
29
|
+
self
|
24
30
|
end
|
25
31
|
end
|
26
32
|
end
|
@@ -3,11 +3,17 @@ module QueueryClient
|
|
3
3
|
# abstract data_files :: [DataFile]
|
4
4
|
|
5
5
|
def each_row(&block)
|
6
|
+
return enum_for(:each_row) if !block_given?
|
7
|
+
|
6
8
|
data_files.each do |file|
|
7
9
|
if file.data_object?
|
8
|
-
file.each_row
|
10
|
+
file.each_row do |row|
|
11
|
+
yield row
|
12
|
+
end
|
9
13
|
end
|
10
14
|
end
|
15
|
+
|
16
|
+
self
|
11
17
|
end
|
12
18
|
|
13
19
|
alias each each_row
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: queuery_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hidekazu Kobayashi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: garage_client
|