geoloqi 0.9.7 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
data/geoloqi.gemspec CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |s|
4
4
  s.version = Geoloqi.version
5
5
  s.authors = ['Kyle Drake', 'Aaron Parecki']
6
6
  s.email = ['kyledrake@gmail.com', 'aaron@parecki.com']
7
- s.homepage = 'https://github.com/kyledrake/geoloqi-ruby'
7
+ s.homepage = 'http://github.com/geoloqi/geoloqi-ruby'
8
8
  s.summary = 'Powerful, flexible, lightweight interface to the awesome Geoloqi platform API'
9
9
  s.description = 'Powerful, flexible, lightweight interface to the awesome Geoloqi platform API! Uses Faraday, '+
10
10
  'and can be used with Ruby 1.9 and EM-Synchrony for really fast, highly concurrent development.'
data/lib/geoloqi/error.rb CHANGED
@@ -1,10 +1,15 @@
1
1
  module Geoloqi
2
2
  class ApiError < StandardError
3
- def initialize(type, message=nil)
4
- type += " - #{message}" if message
5
- super type
3
+ attr_reader :type
4
+ attr_reader :reason
5
+ def initialize(type, reason=nil)
6
+ @type = type
7
+ @reason = reason
8
+ message = type
9
+ message += " - #{reason}" if reason
10
+ super message
6
11
  end
7
12
  end
8
13
 
9
14
  class Error < StandardError; end
10
- end
15
+ end
@@ -1,5 +1,5 @@
1
1
  module Geoloqi
2
2
  def self.version
3
- '0.9.7'
3
+ '0.9.8'
4
4
  end
5
5
  end
data/spec/geoloqi_spec.rb CHANGED
@@ -26,6 +26,15 @@ describe Geoloqi do
26
26
  end
27
27
  end
28
28
 
29
+ describe Geoloqi::ApiError do
30
+ it 'throws exception properly and allows drill-down of message' do
31
+ error = Geoloqi::ApiError.new 'not_enough_cats', 'not enough cats to complete this request'
32
+ expect { error.type == 'not_enough_cats' }
33
+ expect { error.reason == 'not enough cats to complete this request' }
34
+ expect { error.message == "#{error.type} - #{error.reason}" }
35
+ end
36
+ end
37
+
29
38
  describe Geoloqi::Config do
30
39
  describe 'with redirect_uri' do
31
40
  it 'returns authorize url' do
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: geoloqi
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.7
5
+ version: 0.9.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kyle Drake
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-06-23 00:00:00 -07:00
14
+ date: 2011-06-24 00:00:00 -07:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
@@ -95,7 +95,7 @@ files:
95
95
  - license.txt
96
96
  - spec/geoloqi_spec.rb
97
97
  has_rdoc: true
98
- homepage: https://github.com/kyledrake/geoloqi-ruby
98
+ homepage: http://github.com/geoloqi/geoloqi-ruby
99
99
  licenses: []
100
100
 
101
101
  post_install_message:
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  requirements: []
119
119
 
120
120
  rubyforge_project: geoloqi
121
- rubygems_version: 1.6.2
121
+ rubygems_version: 1.5.2
122
122
  signing_key:
123
123
  specification_version: 3
124
124
  summary: Powerful, flexible, lightweight interface to the awesome Geoloqi platform API