great_schools 0.1.1 → 0.1.2

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.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZTQzYmE0ZjRiYjg3OGFiN2RmMDUyYWNjNzBiM2Y0NDI1M2YxYjA4OQ==
5
- data.tar.gz: !binary |-
6
- N2UxZWU0ZmY3NGNhNWU3Zjk4YjhjYjBlOGJjZGVjZTAyMzM4Yzc1OQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- YjIxNzNmZGIyYmIxNWI5MWUxNzFmMDEwZTdiODMzNGQzNzllYzdhMDdiMTQ1
10
- NDc0YzdkYTY2MDMxYzYzYWZlNDVlMWNhYzk1ZjcxNzJlOWU4ODk1YzEwNmJk
11
- MzZhNjBkZDZiYmU2MTEwOGQ1YzQ1YjA3YTk1ZmNhMzJiM2VlMTk=
12
- data.tar.gz: !binary |-
13
- Mzk4MWYwMzQwMDc4ZTIyZDMwN2RhYjQwZGQ5YTM4MjA3MjhlYzNmNTExMDQz
14
- NjIyYzI1YWE4Y2JhNTIzNWMzYzg1OTQ0NjNmNWFlYzVkOTlmYzA2NmYzNzYw
15
- ZWNmNDczNzQ2MzM3YjZhZDQzMmU4ZjgxMmE0N2U4MDE3YzJmMDk=
2
+ SHA1:
3
+ metadata.gz: 398015dcd615a1ba27f369cc1ddb42c6880eb115
4
+ data.tar.gz: c943ed9679e2268b2584347eb60ae94832126d97
5
+ SHA512:
6
+ metadata.gz: 45ad98c3435d2a31180eb22c3460f09b6faaac995539accd2bf00751668da1f78a48a7d169b7c896a276402809aebf6fe266a0a08f4b3b41ca43814b62e904a3
7
+ data.tar.gz: e6a3e3f30a07fd263920c38cc69d2d906f0cc5180feeb7b9dd6b89278cc9ca71cff416c52482828fe16e781c280bb0fcf7adaeba85bc9e99d3d033f6df42f69e
data/lib/great_schools.rb CHANGED
@@ -77,7 +77,7 @@ module GreatSchools
77
77
  # Returns a +Hash+ of a single element, or an +Array+ of elements without
78
78
  # the container hash.
79
79
  def parse(hash)
80
- if hash.keys.size.eql?(1) # we have an array of elements
80
+ if hash && hash.keys.size.eql?(1) # we have an array of elements
81
81
  hash.values.first # strip the container and return the array
82
82
  else # we have one element, return the hash
83
83
  hash
@@ -2,7 +2,7 @@ module GreatSchools # :nodoc:
2
2
  class Version # :nodoc:
3
3
  MAJOR = 0 # version when you make incompatible API changes
4
4
  MINOR = 1 # version when you add functionality in a backwards-compatible manner
5
- PATCH = 1 # version when you make backwards-compatible bug fixes
5
+ PATCH = 2 # version when you make backwards-compatible bug fixes
6
6
 
7
7
  class << self # Class methods
8
8
  # MAJOR.MINOR.PATCH per Semantic Versioning 2.0.0
@@ -0,0 +1,2 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ <schools/>
@@ -68,6 +68,17 @@ describe GreatSchools::School do
68
68
  school.ratings_link.should eql('http://www.greatschools.org/school/rating.page?state=CA&id=11536&s_cid=gsapi')
69
69
  school.reviews_link.should eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=11536&s_cid=gsapi')
70
70
  end
71
+
72
+ it 'should handle no results coming back from the web service' do
73
+ xml = File.read(File.expand_path(
74
+ File.join(File.dirname(__FILE__), '..', 'fixtures', 'nearby_schools_empty.xml')
75
+ ))
76
+ FakeWeb.register_uri(:get, 'http://api.greatschools.org/schools/nearby?state=CA&zip=00000&limit=2&key=0123456789ABCDEF', body: xml)
77
+
78
+ schools = GreatSchools::School.nearby('CA', zip_code: '00000', limit: 2)
79
+
80
+ schools.size.should eql(0)
81
+ end
71
82
  end
72
83
 
73
84
  describe '#profile' do
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: great_schools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael J. Sepcot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-03 00:00:00.000000000 Z
11
+ date: 2014-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: fakeweb
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: activesupport
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: 3.0.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 3.0.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: httparty
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: 0.12.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.12.0
97
97
  description: The GreatSchools API allows access to School Profiles, Test Scores, School
@@ -102,7 +102,7 @@ executables: []
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
- - .gitignore
105
+ - ".gitignore"
106
106
  - Gemfile
107
107
  - LICENSE.txt
108
108
  - README.md
@@ -128,6 +128,7 @@ files:
128
128
  - spec/fixtures/error.xml
129
129
  - spec/fixtures/nearby_cities.xml
130
130
  - spec/fixtures/nearby_schools.xml
131
+ - spec/fixtures/nearby_schools_empty.xml
131
132
  - spec/fixtures/school_census_data.xml
132
133
  - spec/fixtures/school_profile.xml
133
134
  - spec/fixtures/school_reviews.xml
@@ -155,17 +156,17 @@ require_paths:
155
156
  - lib
156
157
  required_ruby_version: !ruby/object:Gem::Requirement
157
158
  requirements:
158
- - - ! '>='
159
+ - - ">="
159
160
  - !ruby/object:Gem::Version
160
161
  version: 1.9.3
161
162
  required_rubygems_version: !ruby/object:Gem::Requirement
162
163
  requirements:
163
- - - ! '>='
164
+ - - ">="
164
165
  - !ruby/object:Gem::Version
165
166
  version: '0'
166
167
  requirements: []
167
168
  rubyforge_project:
168
- rubygems_version: 2.0.3
169
+ rubygems_version: 2.2.2
169
170
  signing_key:
170
171
  specification_version: 4
171
172
  summary: A Ruby interface to the GreatSchools API.
@@ -176,6 +177,7 @@ test_files:
176
177
  - spec/fixtures/error.xml
177
178
  - spec/fixtures/nearby_cities.xml
178
179
  - spec/fixtures/nearby_schools.xml
180
+ - spec/fixtures/nearby_schools_empty.xml
179
181
  - spec/fixtures/school_census_data.xml
180
182
  - spec/fixtures/school_profile.xml
181
183
  - spec/fixtures/school_reviews.xml