data_imp 0.2.0 → 0.2.1

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: 57cc9c4696b447711d832623c57ffe9ae43be4b1
4
- data.tar.gz: 0172aec2f0bba07abcb7898342922423fcbdfd1f
3
+ metadata.gz: fc80071b60853c94b4c43c706804b6f7712dbeb0
4
+ data.tar.gz: 80055ac1ad7be9b2ffc8bd501458d69990d9dc1c
5
5
  SHA512:
6
- metadata.gz: 4660ceb5a760d601720b5a7f69c9ec3db2b9f15ed7aa559ed1b9d6ca2b9a6d41a454a1b9dc52b03c50f867e413f8c7a91e8f082d1b74e5bc9a14809da1929034
7
- data.tar.gz: 5647c5104d74dc14e9e0933c2f86b5198b3753f1adc0cc028dd9edb22341084d363f443d12bfe6868473b7656932e443598bd9591ef14db22b494becb7d25e1e
6
+ metadata.gz: d342229618218a8768abba29c6ad57e9c2b44aec0c6fb0efcf3091abb1fe900f80447eaec47d2475c02d3b026026c435e32cfb874787cc55b3457d4bed9cc8f1
7
+ data.tar.gz: 1b2a072fc9dfc90f56d14fee71c84b88cb4b3e59c3b9f4ffbae73b67069b0f3ea3549578f87ce1fc7cdd6f153f5e6377d4c4355dfffeccff7d92de373cc40fb7
@@ -1,6 +1,9 @@
1
1
 
2
2
  require 'active_support/core_ext/string'
3
3
 
4
+ class DataImp
5
+ end
6
+
4
7
  require_relative "data_imp/finders"
5
8
  require_relative "data_imp/dir"
6
9
  require_relative "data_imp/import_methods"
@@ -16,6 +16,8 @@ class DataImp::Tds
16
16
  end
17
17
 
18
18
  def import table
19
+ table.strip!
20
+ return if table =~ /^#/
19
21
  parts = table.split('.')
20
22
  table = parts.pop
21
23
  schema = parts.shift
@@ -39,6 +41,12 @@ class DataImp::Tds
39
41
  puts
40
42
  end
41
43
 
44
+ def import_list list, *args, &block
45
+ list.each_line do |table|
46
+ import table, *args, &block
47
+ end
48
+ end
49
+
42
50
  def show_progress index
43
51
  end
44
52
  end
@@ -1,13 +1,17 @@
1
1
  class DataImp::Tds::Table
2
2
  attr_reader :client, :table, :schema
3
- def initialize client, table, schema: 'dbo'
3
+ def initialize client, table, schema:
4
4
  @client = client
5
5
  @table = table
6
6
  @schema = schema
7
7
  end
8
8
 
9
9
  def sql
10
- "select * from [#{schema}].[#{table}]"
10
+ if schema
11
+ "select * from [#{schema}].[#{table}]"
12
+ else
13
+ "select * from [#{table}]"
14
+ end
11
15
  end
12
16
 
13
17
  def result
@@ -1,3 +1,3 @@
1
1
  class DataImp
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_imp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert W. Ferney