datacatalog-importer 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/datacatalog-importer.gemspec +2 -2
- data/lib/utility.rb +0 -24
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{datacatalog-importer}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["David James"]
|
12
|
-
s.date = %q{2010-02-
|
12
|
+
s.date = %q{2010-02-19}
|
13
13
|
s.description = %q{This framework makes it easier to write importers for the National Data Catalog.}
|
14
14
|
s.email = %q{djames@sunlightfoundation.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/utility.rb
CHANGED
@@ -76,30 +76,6 @@ module DataCatalog
|
|
76
76
|
DataCatalog.base_uri = base_uri
|
77
77
|
end
|
78
78
|
|
79
|
-
def self.sort_uris(uris)
|
80
|
-
uris.sort do |uri_a, uri_b|
|
81
|
-
uid(uri_a) <=> uid(uri_b)
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
# Converts a URI into a Unique ID
|
86
|
-
#
|
87
|
-
# For example:
|
88
|
-
# Utility.uid("http://data.octo.dc.gov/Metadata.aspx?id=137)
|
89
|
-
# => 137
|
90
|
-
def self.uid(uri)
|
91
|
-
last_part = uri.split("?id=").last
|
92
|
-
result = last_part.to_i
|
93
|
-
if result == 0
|
94
|
-
message = unindent <<-BLOCK
|
95
|
-
Could not make a non-zero Unique ID for this URI:
|
96
|
-
#{uri}
|
97
|
-
BLOCK
|
98
|
-
raise Error, message
|
99
|
-
end
|
100
|
-
result
|
101
|
-
end
|
102
|
-
|
103
79
|
def self.write_yaml(filename, contents)
|
104
80
|
File.open(filename, "w") do |f|
|
105
81
|
YAML::dump(contents, f)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datacatalog-importer
|
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
|
- David James
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-19 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|