cranium 0.3.1 → 0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b443b2b93e702139014a95256215bf7a8b22c1cc
4
- data.tar.gz: 9c19653223b7958efe0ed35243a5308823c4849a
3
+ metadata.gz: 3c2f2dafaa2fa2a74a492f6fafe5b3c5db0ab138
4
+ data.tar.gz: a5f0901f553a33798f95f3bf038f9147be60ab28
5
5
  SHA512:
6
- metadata.gz: 6a722521a2a2b2a1f6843f3d80925f47fedbab6a84571ecc2d20d2fcd8483a410fec3832ff72b8673381f0d54b4b9edd367dda9847540cc744b3734c10509064
7
- data.tar.gz: cb0caba449594c18c1d301991263af28d158431cee96e630af0665dd2e0eac7b4e8e26120404694ba6cae1386e297ee4eda40ab09c37adb4d3b5fda5ba4eb8fd
6
+ metadata.gz: fb4e76b8484db568fd8a035b839cf7f1e3f0a8b702bf624668020378496d6318d61d5250077cecf84434d388ebfa8f516d9eb41b4fd2f9a74ff9c873b1a9521e
7
+ data.tar.gz: 7ac3455809cafffc7defa83778dea64f635a2d92a9971313ef4cf5d392389c7f7495345e677ee004de492298d6db0add03d076530866fb22ea77c9fcc212ca32
data/Vagrantfile CHANGED
@@ -9,7 +9,6 @@ VAGRANTFILE_API_VERSION = "2"
9
9
  Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
10
10
  config.vm.box = "si-build.v2"
11
11
  config.vm.box_url = "http://vboxes.ett.local/si-build.v2.box"
12
- config.vbguest.auto_update = false
13
12
 
14
13
  config.vm.hostname = 'cranium-build'
15
14
  config.vm.network :private_network, ip: "192.168.56.43"
data/cranium.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'cranium'
3
- spec.version = '0.3.1'
3
+ spec.version = '0.4'
4
4
  spec.authors = ['Emarsys Technologies']
5
5
  spec.email = ['smart-insight-dev@emarsys.com']
6
6
  spec.description = %q{Provides Extract, Transform and Load functionality for loading data from CSV files to a Greenplum database.}
@@ -10,11 +10,13 @@ class Cranium::Configuration
10
10
  attr_accessor :gpfdist_home_directory
11
11
  attr_accessor :gpfdist_url
12
12
  attr_accessor :loggers
13
+ attr_accessor :log_queries
13
14
 
14
15
 
15
16
 
16
17
  def initialize
17
18
  @loggers = []
19
+ @log_queries = true
18
20
  end
19
21
 
20
22
 
@@ -27,7 +27,11 @@ module Cranium::Database
27
27
 
28
28
 
29
29
  def self.setup_connection(connection_string)
30
- connection = Sequel.connect connection_string, loggers: Cranium.configuration.loggers
30
+ connection = if Cranium.configuration.log_queries
31
+ Sequel.connect(connection_string, loggers: Cranium.configuration.loggers)
32
+ else
33
+ Sequel.connect(connection_string)
34
+ end
31
35
  connection.extension :connection_validator
32
36
  connection.pool.connection_validation_timeout = -1
33
37
  return connection
@@ -4,6 +4,10 @@ describe Cranium::Configuration do
4
4
 
5
5
  let(:config) { Cranium::Configuration.new }
6
6
 
7
+ describe '#log_queries' do
8
+ it { is_expected.to be_truthy }
9
+ end
10
+
7
11
  describe "#upload_path" do
8
12
  it "should return the full upload path" do
9
13
  config.gpfdist_home_directory = "/gpfdist/home/dir"
@@ -7,14 +7,15 @@ describe Cranium::Database do
7
7
  let(:database) { Cranium::Database }
8
8
  let(:connection) { Sequel::Mock::Database.new }
9
9
  let(:other_connection) { Sequel::Mock::Database.new }
10
-
11
- before(:each) do
12
- allow(Cranium).to receive(:configuration).and_return(Cranium::Configuration.new.tap do |config|
13
- config.greenplum_connection_string = "connection string"
14
- config.loggers = "loggers"
15
- end)
10
+ let(:config) do
11
+ Cranium::Configuration.new.tap do |config|
12
+ config.greenplum_connection_string = "connection string"
13
+ config.loggers = "loggers"
14
+ end
16
15
  end
17
16
 
17
+ before(:each) { allow(Cranium).to receive(:configuration).and_return(config) }
18
+
18
19
 
19
20
  describe ".connection" do
20
21
  before { Cranium::Database.instance_variable_set :@connection, nil }
@@ -30,6 +31,22 @@ describe Cranium::Database do
30
31
 
31
32
  expect(database.connection).to eq database.connection
32
33
  end
34
+
35
+ context 'when query logging is turned off' do
36
+ let(:config) do
37
+ Cranium::Configuration.new.tap do |config|
38
+ config.greenplum_connection_string = "connection string"
39
+ config.loggers = "loggers"
40
+ config.log_queries = false
41
+ end
42
+ end
43
+
44
+ it "should connect to the DB without any loggers" do
45
+ expect(Sequel).to receive(:connect).with("connection string").and_return connection
46
+
47
+ expect(database.connection).to eq connection
48
+ end
49
+ end
33
50
  end
34
51
 
35
52
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cranium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emarsys Technologies
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-06 00:00:00.000000000 Z
11
+ date: 2017-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -297,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
297
  version: '0'
298
298
  requirements: []
299
299
  rubyforge_project:
300
- rubygems_version: 2.6.4
300
+ rubygems_version: 2.5.1
301
301
  signing_key:
302
302
  specification_version: 4
303
303
  summary: Pure Ruby ETL framework