datacatalog-importer 0.1.18 → 0.1.19

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.18
1
+ 0.1.19
@@ -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.18"
8
+ s.version = "0.1.19"
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-05-06}
12
+ s.date = %q{2010-05-12}
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
@@ -41,6 +41,12 @@ module DataCatalog
41
41
  s
42
42
  end
43
43
 
44
+ def self.standardize_name(s)
45
+ left, match, right = s.rpartition(",")
46
+ return s if left == ""
47
+ right.strip + " " + left.strip
48
+ end
49
+
44
50
  # == API ===
45
51
 
46
52
  def self.setup_api(api_key, base_uri)
@@ -50,7 +56,7 @@ module DataCatalog
50
56
 
51
57
  def self.headers
52
58
  {
53
- "UserAgent" => "National Data Catalog Importer/0.1.18",
59
+ "UserAgent" => "National Data Catalog Importer/0.1.19",
54
60
  }
55
61
  end
56
62
 
data/spec/utility_spec.rb CHANGED
@@ -94,5 +94,17 @@ describe "Utility" do
94
94
  end
95
95
 
96
96
  end
97
+
98
+ describe "standardize_name" do
99
+ it "one comma" do
100
+ U.standardize_name("City Administrator, Office of").should ==
101
+ "Office of City Administrator"
102
+ end
103
+
104
+ it "two commas" do
105
+ U.standardize_name("Children, Youth & Families, Department of").should ==
106
+ "Department of Children, Youth & Families"
107
+ end
108
+ end
97
109
 
98
110
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 18
9
- version: 0.1.18
8
+ - 19
9
+ version: 0.1.19
10
10
  platform: ruby
11
11
  authors:
12
12
  - David James
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-06 00:00:00 -04:00
17
+ date: 2010-05-12 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency