importeer_plan 0.1.1 → 0.2.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: 22f4b9e5d459365c156b711c0923cac15e5c0269
4
- data.tar.gz: ad7866e0a4a85bbc2c8db4e65261be2f1c60aeaa
3
+ metadata.gz: c70544dfc2c27e2b90e4796c393d03d06596ff28
4
+ data.tar.gz: 3c21e31292c1ab35bdb465383ee6a9bac67e2007
5
5
  SHA512:
6
- metadata.gz: 3f1b2e15b31999ac5f50f21450f4b8f547920ba1a6dd555516c1bef91b6d62c2bf1dd565c6db0aade88e3263be738f9852797b14ccccd01b34362e27b81edc80
7
- data.tar.gz: 2206f4bafae6bd4409858a04425f040bad1b69f98ac7fd42c2a3b89ce3caee46f0ce6bbf9adc5dd4ec078c08e7f8173635e5b6254731b7be5b3ad13090bc04a8
6
+ metadata.gz: 63ea85d41f1bb6cad947da5e5ab47a6c8947bea266e351937572c43b59d26cd4d32a827bc0c1fa996b4c9c6ea7d3aced56d20e18d35db692d9192f47a7e0ca7b
7
+ data.tar.gz: 355a289c8d30ac50d30af7fe7d2da8724828811d21b15673e3724feea31f5f04e82ba2a7c1eca70a2084d470cf2df3d1c3b16bb22400a9e350b14e955e6ca3ba
data/README.md CHANGED
@@ -25,7 +25,11 @@ Or install it yourself as:
25
25
  Importeer.new takes two options:
26
26
 
27
27
  * name (string)
28
- * size of batch_of_lines_to_import (integer, optional, defaults to 1000)
28
+ * an options-hash
29
+
30
+ * size of batch_of_lines_to_import (size_batch, integer, optional, defaults to 1000)
31
+ * type of separator for csv-files (sep, string, optional, defaults to ";")
32
+ * method of import: initial or replacing (initial, false or true, optional, defaults to false)
29
33
 
30
34
 
31
35
  My applications-classes for processing data from external files inherit from Importeer, depending the file-type:
@@ -38,7 +42,7 @@ My applications-classes for processing data from external files inherit from Imp
38
42
  ```ruby
39
43
  class ImporteerSomething < ImporteerPlan::MyXls
40
44
  attr_accessor :my_var, :another_var
41
- #call importeer("filename") to import the file in batches of 1000, optional importeer("filename", size)
45
+ #call importeer("filename") to import the file in batches of 1000, optional importeer("filename", {size_batch: 1234})
42
46
 
43
47
  def initialize(*)
44
48
  super
@@ -1,3 +1,3 @@
1
1
  module ImporteerPlan
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -4,15 +4,17 @@ module ImporteerPlan
4
4
  class Importeer
5
5
 
6
6
 
7
- attr_accessor :path, :name, :dir, :size_batch
7
+ attr_accessor :path, :name, :dir, :size_batch, :sep, :initial
8
8
  #call importeer("filename") to import the file in batches of 1000, optional importeer("filename", size_)
9
9
 
10
10
 
11
11
 
12
- def initialize(name, size_batch = 1000)
12
+ def initialize(name, options = {size_batch: 1000, sep: ";", initial: false})
13
13
  @name = name
14
14
  @path = Importeer.dir.join( @name )
15
- @size_batch = size_batch#||1000
15
+ @size_batch = options[:size_batch]#||1000
16
+ @sep = options[:sep]
17
+ @initial = options[:initial]
16
18
  end
17
19
 
18
20
  def self.dir
@@ -51,7 +53,7 @@ module ImporteerPlan
51
53
  require 'csv'
52
54
  def initialize(*)
53
55
  super
54
- @sep = ";"
56
+ # @sep = options[:sep]
55
57
  end
56
58
 
57
59
  def bron
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: importeer_plan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rolf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-10 00:00:00.000000000 Z
11
+ date: 2015-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spreadsheet
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  version: '0'
161
161
  requirements: []
162
162
  rubyforge_project:
163
- rubygems_version: 2.4.6
163
+ rubygems_version: 2.4.8
164
164
  signing_key:
165
165
  specification_version: 4
166
166
  summary: only purpose is provide some reusable defaults for processing my (.xls-,