csv_piper 0.1.0 → 0.1.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2cc21c40bd5c39c089c5044849ff3736dde8f71
|
4
|
+
data.tar.gz: cd5be979020360ee93d4e647806217258974eaa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa38bd6d4777bcc3486493b92f7faa31c38b1a2db3bac615f12fd15441cb24714b28375e437c223ec23cb842e458a20a5d42ad53ff0216af289d6257352c1d3b
|
7
|
+
data.tar.gz: 03faf48f923766ff8fccd761b97b965c824cdf485fbbb45eedcc6ddad954a963bbd9f969e1f97bf17fb9ec86bdbcc945619a12a9caaf83abffdffe31b769bd2f
|
data/README.md
CHANGED
@@ -39,8 +39,8 @@ end
|
|
39
39
|
_Extracted from `spec/end_to_end_spec.rb`_
|
40
40
|
```ruby
|
41
41
|
# Build some processors beforehand so we can access them later
|
42
|
-
output_collector =
|
43
|
-
error_collector = CsvPiper::Processors::
|
42
|
+
output_collector = CollectProcessedEquations.new
|
43
|
+
error_collector = CsvPiper::Processors::CollectErrors.new
|
44
44
|
|
45
45
|
# Open the csv file to get our io source
|
46
46
|
File.open(File.join(File.dirname(__FILE__),"/data/csv_1.csv")) do |file|
|
@@ -80,7 +80,7 @@ class EvaluateEquation
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
class
|
83
|
+
class CollectProcessedEquations
|
84
84
|
attr_reader :output
|
85
85
|
def initialize
|
86
86
|
@output = []
|
@@ -150,14 +150,14 @@ Eg. `CsvPiper::Builder.new.from(io).with_processors(processors).build.process`
|
|
150
150
|
## Pre-made Processors
|
151
151
|
Over time we will collect a bunch of general purpose processors that anyone can use. They can be found in the `lib/processors` folder but here are a couple:
|
152
152
|
|
153
|
-
* `
|
154
|
-
* `
|
153
|
+
* `CollectOutput`: Collects the transformed object of every row that is passed through it
|
154
|
+
* `CollectErrors`: Collects the `RowError` object of every row that is passed through it
|
155
155
|
|
156
|
-
By using `
|
156
|
+
By using `CollectOutput` and to a lesser extent `CollectErrors` you will start to build up objects in memory. For very large csv files you might not want to use these convenience processors and rather create a new processor that does whatever you need with the row (Ie. log, write to db) which will then be discarded rather than collected.
|
157
157
|
|
158
158
|
Require them explicitly if you want to use them.
|
159
159
|
|
160
|
-
Eg. `require 'csv_piper/processors/
|
160
|
+
Eg. `require 'csv_piper/processors/collect_output'`
|
161
161
|
|
162
162
|
|
163
163
|
## Development
|
@@ -166,7 +166,7 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
166
166
|
|
167
167
|
## Contributing
|
168
168
|
|
169
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
169
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/jazzarati/csv_piper.
|
170
170
|
|
171
171
|
## License
|
172
172
|
|
data/csv_piper.gemspec
CHANGED
@@ -14,6 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = "https://github.com/jazzarati/csv_piper"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
+
spec.required_ruby_version = '>= 2'
|
17
18
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
19
|
spec.bindir = "exe"
|
19
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
data/lib/csv_piper/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csv_piper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jarrod Sibbison
|
@@ -73,8 +73,8 @@ files:
|
|
73
73
|
- lib/csv_piper/errors/row.rb
|
74
74
|
- lib/csv_piper/piper.rb
|
75
75
|
- lib/csv_piper/pre_processors/remove_extra_columns.rb
|
76
|
-
- lib/csv_piper/processors/
|
77
|
-
- lib/csv_piper/processors/
|
76
|
+
- lib/csv_piper/processors/collect_errors.rb
|
77
|
+
- lib/csv_piper/processors/collect_output.rb
|
78
78
|
- lib/csv_piper/version.rb
|
79
79
|
homepage: https://github.com/jazzarati/csv_piper
|
80
80
|
licenses:
|
@@ -88,7 +88,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
88
88
|
requirements:
|
89
89
|
- - ">="
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version: '
|
91
|
+
version: '2'
|
92
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|