DanaDanger-data_transport 0.3 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/data_transport/data_store/csv_file.rb +25 -0
- metadata +2 -1
@@ -0,0 +1,25 @@
|
|
1
|
+
module DataTransport
|
2
|
+
class DataStore
|
3
|
+
# Identical to the File data store, except that it is preconfigured to read
|
4
|
+
# and write CSV files.
|
5
|
+
class CSVFile < File
|
6
|
+
|
7
|
+
# Accepts the same options as the File data store, except that the
|
8
|
+
# following options have different defaults:
|
9
|
+
#
|
10
|
+
# delimiter:: ","
|
11
|
+
# enclosure:: "\""
|
12
|
+
# escape:: :double
|
13
|
+
#
|
14
|
+
# These defaults describe the CSV format.
|
15
|
+
def initialize(options = {})
|
16
|
+
super({
|
17
|
+
:delimiter => ",",
|
18
|
+
:enclosure => "\"",
|
19
|
+
:escape => :double
|
20
|
+
}.merge(options))
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: DanaDanger-data_transport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dana Danger
|
@@ -25,6 +25,7 @@ files:
|
|
25
25
|
- lib/data_transport.rb
|
26
26
|
- lib/data_transport/data_store.rb
|
27
27
|
- lib/data_transport/data_store/active_record.rb
|
28
|
+
- lib/data_transport/data_store/csv_file.rb
|
28
29
|
- lib/data_transport/data_store/file.rb
|
29
30
|
- lib/data_transport/record/destination.rb
|
30
31
|
- lib/data_transport/record/source.rb
|