dwc-archive 0.5.5 → 0.5.6
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.
- data/VERSION +1 -1
- data/features/dwca-reader.feature +1 -0
- data/features/step_definitions/dwc-reader_steps.rb +5 -0
- data/lib/dwc-archive/ingester.rb +10 -1
- metadata +6 -13
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.6
|
@@ -27,6 +27,7 @@ Feature: Reading of a Darwing Core Archive
|
|
27
27
|
And core.file_path
|
28
28
|
And core.id
|
29
29
|
And core.fields
|
30
|
+
And core.size
|
30
31
|
Then DarwinCore instance should have an extensions array
|
31
32
|
And every extension in array should be an instance of DarwinCore::Extension
|
32
33
|
And extension should have properties, data, file_path, coreid, fields
|
@@ -64,6 +64,11 @@ end
|
|
64
64
|
And /^core\.fields$/ do
|
65
65
|
@core.fields.size.should == 5
|
66
66
|
end
|
67
|
+
|
68
|
+
And /^core\.size$/ do
|
69
|
+
@core.size.should == 588
|
70
|
+
end
|
71
|
+
|
67
72
|
Then /^DarwinCore instance should have dwc\.metadata object$/ do
|
68
73
|
@dwc.metadata.class.should == DarwinCore::Metadata
|
69
74
|
end
|
data/lib/dwc-archive/ingester.rb
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
class DarwinCore
|
2
2
|
module Ingester
|
3
|
-
attr_reader :data, :properties, :encoding, :fields_separator
|
3
|
+
attr_reader :data, :properties, :encoding, :fields_separator, :size
|
4
4
|
attr_reader :file_path, :fields, :line_separator, :quote_character, :ignore_headers
|
5
|
+
|
6
|
+
def size
|
7
|
+
@size ||= get_size
|
8
|
+
end
|
9
|
+
|
5
10
|
def read(batch_size = 10000)
|
6
11
|
DarwinCore.logger_write(@dwc.object_id, "Reading %s data" % name)
|
7
12
|
res = []
|
@@ -71,5 +76,9 @@ class DarwinCore
|
|
71
76
|
res = "\t" if res == "\\t"
|
72
77
|
res
|
73
78
|
end
|
79
|
+
|
80
|
+
def get_size
|
81
|
+
`wc -l #{@file_path}`.match(/^([\d]+)\s/)[1].to_i
|
82
|
+
end
|
74
83
|
end
|
75
84
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dwc-archive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 6
|
10
|
+
version: 0.5.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dmitry Mozzherin
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-11 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -66,11 +66,8 @@ dependencies:
|
|
66
66
|
version_requirements: *id003
|
67
67
|
description: Darwin Core Archive is the current standard exchange format for GLobal Names Architecture modules. This gem makes it easy to incorporate files in Darwin Core Archive format into a ruby project.
|
68
68
|
email: dmozzherin at gmail dot com
|
69
|
-
executables:
|
70
|
-
|
71
|
-
- parse.rb
|
72
|
-
- preparse.rb
|
73
|
-
- t
|
69
|
+
executables: []
|
70
|
+
|
74
71
|
extensions: []
|
75
72
|
|
76
73
|
extra_rdoc_files:
|
@@ -121,10 +118,6 @@ files:
|
|
121
118
|
- spec/lib/ruby_extenstions_spec.rb
|
122
119
|
- spec/spec.opts
|
123
120
|
- spec/spec_helper.rb
|
124
|
-
- bin/log.txt
|
125
|
-
- bin/parse.rb
|
126
|
-
- bin/preparse.rb
|
127
|
-
- bin/t
|
128
121
|
has_rdoc: true
|
129
122
|
homepage: http://github.com/GlobalNamesArchitecture/dwc-archive
|
130
123
|
licenses: []
|