sc_analytics 0.2.0 → 0.3.0

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: 06117d6a47148c891d4af3938f92aa4bffefb7e5
4
- data.tar.gz: 3faa62b4852ae7c19a4f6f2b5d9af9ff83c516af
3
+ metadata.gz: fc07776d85d680c605a0a55a4b24a62838bc29a9
4
+ data.tar.gz: 351edcf452a06a3c54b021de94211f4e65e94b36
5
5
  SHA512:
6
- metadata.gz: 4ce36305a428e1f3588a74b2ef0d1f6436e89d8b2d9fee0431f7a44f3b5181820294c326f3601a7bc3768f6ca72584a63521757d367e6c61dc1f8352ca3e066d
7
- data.tar.gz: 6673bc0d9c2db54470fbc30735a3d879fb2f6602f0799eaa9bd95a3d44f223fdce01def57207f14ad3cc1e62b060edb0487f397f1b43108eace7dfdcac545008
6
+ metadata.gz: 3be5d48aabf3a70350d3e9afa680bec0b3cf3f2e72cb2455448e09e8b432fc171a9f5a703d83c2e7c9f8e83fdf545db6fc31ced69a63d4381baadb46eee5b05c
7
+ data.tar.gz: d7e6e51d55eb4779f68dd1092c6ea1f87a1485e39e57aa71bbde99de6551901af573d16bd5d54d3c0e11dc20bfadd6888b61ff05acbc0d40feef9ae3efb57d30
@@ -5,6 +5,7 @@ module SCAnalytics
5
5
 
6
6
  require 'oci8'
7
7
  OCI8::BindType::Mapping[:number_unknown_prec] = OCI8::BindType::BasicNumberType
8
+ OCI8::BindType::Mapping[:number_no_prec_setting] = OCI8::BindType::BasicNumberType
8
9
 
9
10
  def initialize(connection_name, config)
10
11
  super
@@ -15,11 +15,9 @@ module SCAnalytics
15
15
 
16
16
  @@total_queries = 0
17
17
 
18
- def initialize(&block)
18
+ def initialize(name = nil, &block)
19
+ @query_name = name.to_s if name
19
20
  yield self if block_given?
20
-
21
- check_params
22
- fork_query if @should_fork
23
21
  end
24
22
 
25
23
  def bind_variables(var_hash = {})
@@ -107,6 +105,8 @@ module SCAnalytics
107
105
  end
108
106
 
109
107
  def run
108
+ check_params
109
+
110
110
  unless @should_fork
111
111
  @connection = Connections.use @database.first
112
112
  @cursor = @connection.get_cursor_for self
@@ -124,6 +124,7 @@ module SCAnalytics
124
124
 
125
125
  export_csv if @to_csv
126
126
  else
127
+ fork_query
127
128
  @results = run_forked_queries
128
129
  export_csv_combined if @to_csv_combined
129
130
  end
@@ -237,7 +238,7 @@ module SCAnalytics
237
238
  end
238
239
 
239
240
  def suggest_dir(file_name, dir)
240
- return file_name unless File.dirname(file_name) == "."
241
+ return file_name unless File.dirname(file_name) == "." && dir != "."
241
242
 
242
243
  FileUtils.mkdir_p(dir.to_s)
243
244
  "#{dir}/" + file_name
@@ -1,3 +1,3 @@
1
- module SCAnalytics
2
- VERSION = "0.2.0"
3
- end
1
+ module SCAnalytics
2
+ VERSION = "0.3.0"
3
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sc_analytics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Rowan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-01 00:00:00.000000000 Z
11
+ date: 2016-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler