geoloqi 0.9.43 → 0.9.44

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -14,7 +14,7 @@ If you just need to make simple requests, you can just make a simple get or post
14
14
 
15
15
  require 'geoloqi'
16
16
  result = Geoloqi.get 'YOUR ACCESS TOKEN', 'layer/info/Gx'
17
- puts response.inspect
17
+ p result
18
18
 
19
19
  # or a POST!
20
20
  result = Geoloqi.post 'YOUR ACCESS TOKEN', 'layer/create', :name => 'Test Layer'
@@ -16,6 +16,11 @@ module Geoloqi
16
16
  # @return [String]
17
17
  attr_accessor :redirect_uri
18
18
 
19
+ # Which API URL to use for Geoloqi. You shouldn't need to change this.
20
+ #
21
+ # @return [String]
22
+ attr_accessor :api_url
23
+
19
24
  # Which HTTP adapter to use for Faraday. Defaults to :net_http
20
25
  #
21
26
  # @return [Symbol]
@@ -58,7 +63,7 @@ module Geoloqi
58
63
  #
59
64
  # @return [Boolean]
60
65
  # @example
61
- # Geoloqi.config.throw_exceptions = true
66
+ # Geoloqi.config.symbolize_names = true
62
67
  attr_accessor :symbolize_names
63
68
 
64
69
 
@@ -40,7 +40,10 @@ module Geoloqi
40
40
  self.auth = opts[:auth] || {}
41
41
  self.auth[:access_token] = opts[:access_token] if opts[:access_token]
42
42
 
43
- @connection = Faraday.new(:url => Geoloqi.api_url, :ssl => {:verify => true, :ca_file => Geoloqi::SSL_CERT_FILE}) do |builder|
43
+ @connection = Faraday.new(
44
+ :url => (@config.api_url || Geoloqi.api_url),
45
+ :ssl => {:verify => true, :ca_file => Geoloqi::SSL_CERT_FILE}
46
+ ) do |builder|
44
47
  builder.adapter @config.adapter || :net_http
45
48
  end
46
49
  end
@@ -3,6 +3,6 @@ module Geoloqi
3
3
  #
4
4
  # @return [String]
5
5
  def self.version
6
- '0.9.43'
6
+ '0.9.44'
7
7
  end
8
8
  end
@@ -16,6 +16,16 @@ describe Geoloqi::Config do
16
16
  end
17
17
  end
18
18
 
19
+ it 'uses special api url' do
20
+ stub_request(:get, 'https://apispecial.geoloqi.com/1/account/username').
21
+ with(:headers => {'Authorization'=>'OAuth access_token1234'}).
22
+ to_return(:body => {'username' => 'testuser'}.to_json)
23
+
24
+ Geoloqi.config :client_id => CLIENT_ID, :client_secret => CLIENT_SECRET, :api_url => 'https://apispecial.geoloqi.com'
25
+ resp = Geoloqi.get ACCESS_TOKEN, 'account/username'
26
+ resp[:username].must_equal 'testuser'
27
+ end
28
+
19
29
  it 'displays log information if logger is provided' do
20
30
  stub_request(:get, api_url('account/username?cats=lol')).
21
31
  with(:headers => {'Authorization'=>'OAuth access_token1234'}).
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoloqi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.43
4
+ version: 0.9.44
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-05-06 00:00:00.000000000 Z
13
+ date: 2012-10-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
17
- requirement: &70151794411640 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,15 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70151794411640
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
26
31
  - !ruby/object:Gem::Dependency
27
32
  name: faraday
28
- requirement: &70151794411040 !ruby/object:Gem::Requirement
33
+ requirement: !ruby/object:Gem::Requirement
29
34
  none: false
30
35
  requirements:
31
36
  - - ! '>='
@@ -33,10 +38,15 @@ dependencies:
33
38
  version: 0.6.1
34
39
  type: :runtime
35
40
  prerelease: false
36
- version_requirements: *70151794411040
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: 0.6.1
37
47
  - !ruby/object:Gem::Dependency
38
48
  name: rack
39
- requirement: &70151794410500 !ruby/object:Gem::Requirement
49
+ requirement: !ruby/object:Gem::Requirement
40
50
  none: false
41
51
  requirements:
42
52
  - - ! '>='
@@ -44,10 +54,15 @@ dependencies:
44
54
  version: '0'
45
55
  type: :runtime
46
56
  prerelease: false
47
- version_requirements: *70151794410500
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
48
63
  - !ruby/object:Gem::Dependency
49
64
  name: rake
50
- requirement: &70151794410020 !ruby/object:Gem::Requirement
65
+ requirement: !ruby/object:Gem::Requirement
51
66
  none: false
52
67
  requirements:
53
68
  - - ! '>='
@@ -55,43 +70,63 @@ dependencies:
55
70
  version: '0'
56
71
  type: :development
57
72
  prerelease: false
58
- version_requirements: *70151794410020
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
59
79
  - !ruby/object:Gem::Dependency
60
80
  name: minitest
61
- requirement: &70151794409520 !ruby/object:Gem::Requirement
81
+ requirement: !ruby/object:Gem::Requirement
62
82
  none: false
63
83
  requirements:
64
- - - =
84
+ - - '='
65
85
  - !ruby/object:Gem::Version
66
86
  version: 2.2.2
67
87
  type: :development
68
88
  prerelease: false
69
- version_requirements: *70151794409520
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - '='
93
+ - !ruby/object:Gem::Version
94
+ version: 2.2.2
70
95
  - !ruby/object:Gem::Dependency
71
96
  name: webmock
72
- requirement: &70151794430700 !ruby/object:Gem::Requirement
97
+ requirement: !ruby/object:Gem::Requirement
73
98
  none: false
74
99
  requirements:
75
- - - =
100
+ - - '='
76
101
  - !ruby/object:Gem::Version
77
102
  version: 1.6.4
78
103
  type: :development
79
104
  prerelease: false
80
- version_requirements: *70151794430700
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - '='
109
+ - !ruby/object:Gem::Version
110
+ version: 1.6.4
81
111
  - !ruby/object:Gem::Dependency
82
112
  name: hashie
83
- requirement: &70151794429940 !ruby/object:Gem::Requirement
113
+ requirement: !ruby/object:Gem::Requirement
84
114
  none: false
85
115
  requirements:
86
- - - =
116
+ - - '='
87
117
  - !ruby/object:Gem::Version
88
118
  version: 1.0.0
89
119
  type: :development
90
120
  prerelease: false
91
- version_requirements: *70151794429940
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
123
+ requirements:
124
+ - - '='
125
+ - !ruby/object:Gem::Version
126
+ version: 1.0.0
92
127
  - !ruby/object:Gem::Dependency
93
128
  name: addressable
94
- requirement: &70151794429340 !ruby/object:Gem::Requirement
129
+ requirement: !ruby/object:Gem::Requirement
95
130
  none: false
96
131
  requirements:
97
132
  - - ! '>='
@@ -99,10 +134,15 @@ dependencies:
99
134
  version: '0'
100
135
  type: :development
101
136
  prerelease: false
102
- version_requirements: *70151794429340
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
103
143
  - !ruby/object:Gem::Dependency
104
144
  name: yard
105
- requirement: &70151794428940 !ruby/object:Gem::Requirement
145
+ requirement: !ruby/object:Gem::Requirement
106
146
  none: false
107
147
  requirements:
108
148
  - - ! '>='
@@ -110,7 +150,12 @@ dependencies:
110
150
  version: '0'
111
151
  type: :development
112
152
  prerelease: false
113
- version_requirements: *70151794428940
153
+ version_requirements: !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ! '>='
157
+ - !ruby/object:Gem::Version
158
+ version: '0'
114
159
  description: Powerful, flexible, lightweight, thread-safe interface to the Geoloqi
115
160
  Platform API
116
161
  email:
@@ -164,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
209
  version: 1.3.4
165
210
  requirements: []
166
211
  rubyforge_project: geoloqi
167
- rubygems_version: 1.8.17
212
+ rubygems_version: 1.8.24
168
213
  signing_key:
169
214
  specification_version: 3
170
215
  summary: Powerful, flexible, lightweight interface to the Geoloqi Platform API