datacatalog 0.3.4 → 0.3.5

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/Rakefile CHANGED
@@ -5,7 +5,7 @@ begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "datacatalog"
8
- gem.version = '0.3.4'
8
+ gem.version = '0.3.5'
9
9
  gem.rubyforge_project = "datacatalog"
10
10
  gem.summary = %Q{Client for the National Data Catalog API}
11
11
  gem.description = %Q{A Ruby client library for the National Data Catalog API}
data/datacatalog.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{datacatalog}
8
- s.version = "0.3.4"
8
+ s.version = "0.3.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Luigi Montanez", "David James"]
12
- s.date = %q{2009-11-04}
12
+ s.date = %q{2009-11-13}
13
13
  s.description = %q{A Ruby client library for the National Data Catalog API}
14
14
  s.email = %q{luigi@sunlightfoundation.com}
15
15
  s.extra_rdoc_files = [
@@ -5,7 +5,11 @@ module DataCatalog
5
5
  def self.all(conditions={})
6
6
  many(http_get(uri, :query => query_hash(conditions)))
7
7
  end
8
-
8
+
9
+ def self.search(term)
10
+ many(http_get(uri, :query => {:search => term.downcase}))
11
+ end
12
+
9
13
  def self.create(params={})
10
14
  one(http_post(uri, :body => params))
11
15
  end
data/spec/source_spec.rb CHANGED
@@ -65,6 +65,18 @@ describe Source do
65
65
  @sources.map(&:title).sort.should == expected.sort
66
66
  end
67
67
  end
68
+
69
+ describe ".search" do
70
+ before do
71
+ create_3_sources
72
+ end
73
+
74
+ it "should return correct search result" do
75
+ @sources = Source.search("FCC")
76
+ @sources.size.should == 1
77
+ @sources.first.title.should == "FCC Data"
78
+ end
79
+ end
68
80
 
69
81
  describe ".create" do
70
82
  it "should create a new source from basic params" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datacatalog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luigi Montanez
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-11-04 00:00:00 -05:00
13
+ date: 2009-11-13 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency