export_to_gcloud 0.9.1 → 1.0.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: 5f5c86d7f6f8d85bb3c7fbbe631dcda328616b66
4
- data.tar.gz: eb21b534795ce76fc3f4640d704536bae3282a89
3
+ metadata.gz: c7eb4f63ec849c64e3f7742efd515f6e6837abf0
4
+ data.tar.gz: 1715d7d746d32e631a5450831929cfa854c7144e
5
5
  SHA512:
6
- metadata.gz: 3d6790af7998ac91d456749b776a738d31fa158542b4dc6618d65b6ed37881220c231707ab46a47a768efcc4f98dcded32c523cf92d8f905066bd1b3454020f6
7
- data.tar.gz: 834dee1812359c4d6b95f6fba0217076ddf555ff43963d0bec03c17e4e5a63f899319d72a8411d30c6618fdbc6e0532cae039cd804e446539d3a1d6774fc6b94
6
+ metadata.gz: 9b4fad69251d44e72315d133e119ddd74a974d3079319320142fba1007351e48d5524acc54bb9215cf0fc8398fd79727564985639458d5f9da1cfffc9c220872
7
+ data.tar.gz: 8410f5994cfe4637b528b62afba676e3d7dbf29e50935733bbc8dfd42c9262cba77c7b21c85c93f9bbc373e946bff42cf56e1bbd192c351de937559de7b47e4f
@@ -3,6 +3,8 @@ module ExportToGcloud
3
3
 
4
4
  class CSVExporter < Exporter
5
5
 
6
+ private
7
+
6
8
  def create_data_file! file, *part_data
7
9
  data = @definition.get_data(*part_data)
8
10
 
@@ -44,9 +44,7 @@ module ExportToGcloud
44
44
  start_load_job gcloud_file
45
45
  end
46
46
 
47
- def create_data_file! file, *part_data
48
- File.write file.to_path, @definition.get_data(*part_data)
49
- end
47
+
50
48
 
51
49
  def upload_file!(file, storage_name)
52
50
  file = compress_file! file
@@ -92,6 +90,10 @@ module ExportToGcloud
92
90
 
93
91
  private
94
92
 
93
+ def create_data_file! file, *part_data
94
+ File.write file.to_path, @definition.get_data(*part_data)
95
+ end
96
+
95
97
  def compress_file!(original_file)
96
98
  err = %x(pigz -f9 #{original_file.to_path} 2>&1)
97
99
  compressed_file = Pathname.new "#{original_file.to_path}.gz"
@@ -3,6 +3,18 @@ module ExportToGcloud
3
3
 
4
4
  class PGExporter < Exporter
5
5
 
6
+ def self.validate_definition! definition
7
+ definition.get_sql_executor || default_executor || raise('`sql_executor` needs to be defined!')
8
+ end
9
+
10
+ class << self
11
+
12
+ attr_accessor :default_executor
13
+
14
+ end
15
+
16
+ private
17
+
6
18
  def create_data_file! file, *part_data
7
19
  sql = @definition.get_data(*part_data)
8
20
 
@@ -21,16 +33,6 @@ module ExportToGcloud
21
33
  executor = @definition.get_sql_executor || self.class.default_executor
22
34
  executor.call sql
23
35
  end
24
-
25
- def self.validate_definition! definition
26
- definition.get_sql_executor || default_executor || raise('`sql_executor` needs to be defined!')
27
- end
28
-
29
- class << self
30
-
31
- attr_accessor :default_executor
32
-
33
- end
34
36
 
35
37
  end
36
38
 
@@ -1,5 +1,5 @@
1
1
  module ExportToGcloud
2
2
 
3
- VERSION = '0.9.1'
3
+ VERSION = '1.0.0'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: export_to_gcloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Želazko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-08 00:00:00.000000000 Z
11
+ date: 2016-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gcloud