dwc-archive 0.4.11 → 0.4.12
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/dwc-archive/expander.rb +10 -10
- metadata +4 -10
data/Rakefile
CHANGED
@@ -8,7 +8,7 @@ begin
|
|
8
8
|
gem.summary = %Q{Handler of Darwin Core Archive files}
|
9
9
|
gem.description = %q{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.}
|
10
10
|
gem.email = "dmozzherin at gmail dot com"
|
11
|
-
gem.homepage = "http://github.com/
|
11
|
+
gem.homepage = "http://github.com/DarwinCoreArchive/dwc-archive"
|
12
12
|
gem.authors = ["Dmitry Mozzherin"]
|
13
13
|
#gem.add_dependency "fastercsv" if RUBY_VERSION.match /^1.8/
|
14
14
|
gem.add_dependency 'parsley-store'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.12
|
data/lib/dwc-archive/expander.rb
CHANGED
@@ -26,7 +26,7 @@ class DarwinCore
|
|
26
26
|
return nil unless path && FileTest.exists?(path)
|
27
27
|
Dir.entries(path).select {|e| e !~ /[\.]{1,2}$/}.sort
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
private
|
31
31
|
|
32
32
|
def esc(a_str)
|
@@ -34,10 +34,12 @@ class DarwinCore
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def get_unpacker
|
37
|
-
|
38
|
-
|
37
|
+
file_command = IO.popen("file -z " + esc(@archive_path))
|
38
|
+
file_type = file_command.read
|
39
|
+
file_command.close
|
40
|
+
|
39
41
|
if file_type.match(/tar.*gzip/i)
|
40
|
-
return proc do |tmp_path, archive_path|
|
42
|
+
return proc do |tmp_path, archive_path|
|
41
43
|
FileUtils.mkdir tmp_path
|
42
44
|
system("tar -zxf #{esc(archive_path)} -C #{tmp_path} > /dev/null 2>&1")
|
43
45
|
end
|
@@ -46,15 +48,15 @@ class DarwinCore
|
|
46
48
|
if file_type.match(/Zip/)
|
47
49
|
return proc { |tmp_path, archive_path| system("unzip -qq -d #{tmp_path} #{esc(archive_path)} > /dev/null 2>&1") }
|
48
50
|
end
|
49
|
-
|
51
|
+
|
50
52
|
return nil
|
51
53
|
end
|
52
|
-
|
54
|
+
|
53
55
|
def path_entries(dir)
|
54
56
|
Dir.entries(dir).select {|e| e !~ /[\.]{1,2}$/}.sort
|
55
57
|
end
|
56
|
-
|
57
|
-
def files_path
|
58
|
+
|
59
|
+
def files_path
|
58
60
|
res = nil
|
59
61
|
entries = path_entries(@path)
|
60
62
|
if entries.include?('meta.xml')
|
@@ -73,6 +75,4 @@ class DarwinCore
|
|
73
75
|
res
|
74
76
|
end
|
75
77
|
end
|
76
|
-
|
77
|
-
|
78
78
|
end
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dwc-archive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 25
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
8
|
+
- 12
|
9
|
+
version: 0.4.12
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Dmitry Mozzherin
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-10-07 00:00:00 -04:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -26,7 +25,6 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
28
|
segments:
|
31
29
|
- 0
|
32
30
|
version: "0"
|
@@ -40,7 +38,6 @@ dependencies:
|
|
40
38
|
requirements:
|
41
39
|
- - ">="
|
42
40
|
- !ruby/object:Gem::Version
|
43
|
-
hash: 13
|
44
41
|
segments:
|
45
42
|
- 1
|
46
43
|
- 2
|
@@ -56,7 +53,6 @@ dependencies:
|
|
56
53
|
requirements:
|
57
54
|
- - ">="
|
58
55
|
- !ruby/object:Gem::Version
|
59
|
-
hash: 3
|
60
56
|
segments:
|
61
57
|
- 0
|
62
58
|
version: "0"
|
@@ -116,7 +112,7 @@ files:
|
|
116
112
|
- spec/spec.opts
|
117
113
|
- spec/spec_helper.rb
|
118
114
|
has_rdoc: true
|
119
|
-
homepage: http://github.com/
|
115
|
+
homepage: http://github.com/DarwinCoreArchive/dwc-archive
|
120
116
|
licenses: []
|
121
117
|
|
122
118
|
post_install_message:
|
@@ -129,7 +125,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
125
|
requirements:
|
130
126
|
- - ">="
|
131
127
|
- !ruby/object:Gem::Version
|
132
|
-
hash: 3
|
133
128
|
segments:
|
134
129
|
- 0
|
135
130
|
version: "0"
|
@@ -138,7 +133,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
133
|
requirements:
|
139
134
|
- - ">="
|
140
135
|
- !ruby/object:Gem::Version
|
141
|
-
hash: 3
|
142
136
|
segments:
|
143
137
|
- 0
|
144
138
|
version: "0"
|