dwc-archive 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/dwc-archive.rb +0 -11
- data/lib/dwc-archive/ingester.rb +1 -0
- data/lib/dwc-archive/utf_regex_ruby18.rb +10 -0
- metadata +13 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/dwc-archive.rb
CHANGED
@@ -22,17 +22,6 @@ class DarwinCore
|
|
22
22
|
alias :eml :metadata
|
23
23
|
|
24
24
|
DEFAULT_TMP_DIR = "/tmp"
|
25
|
-
UTF8RGX = /\A(
|
26
|
-
[\x09\x0A\x0D\x20-\x7E] # ASCII
|
27
|
-
| [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
|
28
|
-
| \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
|
29
|
-
| [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
|
30
|
-
| \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
|
31
|
-
| \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
|
32
|
-
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
|
33
|
-
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
|
34
|
-
)*\z/x unless defined? UTF8RGX
|
35
|
-
|
36
25
|
|
37
26
|
def initialize(dwc_path, tmp_dir = DEFAULT_TMP_DIR)
|
38
27
|
@archive = DarwinCore::Archive.new(dwc_path, tmp_dir)
|
data/lib/dwc-archive/ingester.rb
CHANGED
@@ -12,6 +12,7 @@ class DarwinCore
|
|
12
12
|
index_fix = 0; next if @ignore_headers && i == 0
|
13
13
|
str = r.join('')
|
14
14
|
if defined? FasterCSV
|
15
|
+
require File.join(File.dirname(__FILE__), 'utf_regex_ruby18')
|
15
16
|
UTF8RGX === str ? res << r : errors << r
|
16
17
|
else
|
17
18
|
str = str.force_encoding('utf-8')
|
@@ -0,0 +1,10 @@
|
|
1
|
+
UTF8RGX = /\A(
|
2
|
+
[\x09\x0A\x0D\x20-\x7E] # ASCII
|
3
|
+
| [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
|
4
|
+
| \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
|
5
|
+
| [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
|
6
|
+
| \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
|
7
|
+
| \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3
|
8
|
+
| [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15
|
9
|
+
| \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
|
10
|
+
)*\z/x
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dwc-archive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Dmitry Mozzherin
|
@@ -21,9 +22,11 @@ dependencies:
|
|
21
22
|
name: rspec
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 13
|
27
30
|
segments:
|
28
31
|
- 1
|
29
32
|
- 2
|
@@ -35,9 +38,11 @@ dependencies:
|
|
35
38
|
name: cucumber
|
36
39
|
prerelease: false
|
37
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
38
42
|
requirements:
|
39
43
|
- - ">="
|
40
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 3
|
41
46
|
segments:
|
42
47
|
- 0
|
43
48
|
version: "0"
|
@@ -71,6 +76,7 @@ files:
|
|
71
76
|
- lib/dwc-archive/extension.rb
|
72
77
|
- lib/dwc-archive/ingester.rb
|
73
78
|
- lib/dwc-archive/metadata.rb
|
79
|
+
- lib/dwc-archive/utf_regex_ruby18.rb
|
74
80
|
- lib/ruby_extensions.rb
|
75
81
|
- spec/files/broken.tar.gz
|
76
82
|
- spec/files/data.tar.gz
|
@@ -96,23 +102,27 @@ rdoc_options:
|
|
96
102
|
require_paths:
|
97
103
|
- lib
|
98
104
|
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
99
106
|
requirements:
|
100
107
|
- - ">="
|
101
108
|
- !ruby/object:Gem::Version
|
109
|
+
hash: 3
|
102
110
|
segments:
|
103
111
|
- 0
|
104
112
|
version: "0"
|
105
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
106
115
|
requirements:
|
107
116
|
- - ">="
|
108
117
|
- !ruby/object:Gem::Version
|
118
|
+
hash: 3
|
109
119
|
segments:
|
110
120
|
- 0
|
111
121
|
version: "0"
|
112
122
|
requirements: []
|
113
123
|
|
114
124
|
rubyforge_project:
|
115
|
-
rubygems_version: 1.3.
|
125
|
+
rubygems_version: 1.3.7
|
116
126
|
signing_key:
|
117
127
|
specification_version: 3
|
118
128
|
summary: Handler of Darwin Core Archive files
|