what3words 2.2.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +306 -72
- data/lib/what3words/api.rb +198 -144
- data/lib/what3words/version.rb +4 -1
- data/lib/what3words.rb +3 -1
- metadata +18 -30
- data/.editorconfig +0 -17
- data/.gitignore +0 -17
- data/.travis.yml +0 -7
- data/Gemfile +0 -2
- data/LICENSE.txt +0 -22
- data/Rakefile +0 -12
- data/spec/config.sample.yaml +0 -1
- data/spec/lib/what3words/what3words_api_spec.rb +0 -150
- data/spec/spec_helper.rb +0 -7
- data/what3words.gemspec +0 -28
data/lib/what3words/api.rb
CHANGED
@@ -1,194 +1,248 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'rest-client'
|
4
|
+
require 'json'
|
5
|
+
require File.expand_path('../version', __FILE__)
|
6
|
+
require 'what3words/version'
|
4
7
|
|
5
8
|
module What3Words
|
6
|
-
#
|
7
|
-
|
8
|
-
class API # rubocop:disable Metrics/ClassLength
|
9
|
+
# What3Words v3 API wrapper
|
10
|
+
class API
|
9
11
|
class Error < RuntimeError; end
|
10
12
|
class ResponseError < Error; end
|
11
13
|
class WordError < Error; end
|
12
14
|
|
13
|
-
REGEX_3_WORD_ADDRESS =
|
14
|
-
|
15
|
-
|
16
|
-
BASE_URL = 'https://api.what3words.com/v2/'.freeze
|
15
|
+
REGEX_3_WORD_ADDRESS = /^\/{0,3}(?:[^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]{1,}[.\uFF61\u3002\uFF65\u30FB\uFE12\u17D4\u0964\u1362\u3002][^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]{1,}[.\uFF61\u3002\uFF65\u30FB\uFE12\u17D4\u0964\u1362\u3002][^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]{1,}|'<,.>?\/\";:£§º©®\s]+[.\uFF61\u3002\uFF65\u30FB\uFE12\u17D4\u0964\u1362\u3002][^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]+|[^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]+([\u0020\u00A0][^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]+){1,3}[.\uFF61\u3002\uFF65\u30FB\uFE12\u17D4\u0964\u1362\u3002][^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]+([\u0020\u00A0][^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]+){1,3}[.\uFF61\u3002\uFF65\u30FB\uFE12\u17D4\u0964\u1362\u3002][^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]+([\u0020\u00A0][^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]+){1,3})$/u.freeze
|
16
|
+
BASE_URL = 'https://api.what3words.com/v3/'
|
17
17
|
|
18
18
|
ENDPOINTS = {
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
convert_to_coordinates: 'convert-to-coordinates',
|
20
|
+
convert_to_3wa: 'convert-to-3wa',
|
21
|
+
available_languages: 'available-languages',
|
22
22
|
autosuggest: 'autosuggest',
|
23
|
-
|
24
|
-
autosuggest_ml: 'autosuggest-ml',
|
25
|
-
standardblend_ml: 'standardblend-ml',
|
26
|
-
grid: 'grid'
|
23
|
+
grid_section: 'grid-section'
|
27
24
|
}.freeze
|
28
25
|
|
26
|
+
WRAPPER_VERSION = What3Words::VERSION
|
27
|
+
|
29
28
|
def initialize(params)
|
30
29
|
@key = params.fetch(:key)
|
31
30
|
end
|
32
31
|
|
33
32
|
attr_reader :key
|
34
33
|
|
35
|
-
def
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
34
|
+
def convert_to_coordinates(words, params = {})
|
35
|
+
"""
|
36
|
+
Take a 3 word address and turn it into a pair of coordinates.
|
37
|
+
|
38
|
+
Params
|
39
|
+
------
|
40
|
+
:param string words: A 3 word address as a string
|
41
|
+
:param string format: Return data format type; can be one of json (the default), geojson
|
42
|
+
:rtype: Hash
|
43
|
+
"""
|
44
|
+
words_string = get_words_string(words)
|
45
|
+
request_params = assemble_convert_to_coordinates_request_params(words_string, params)
|
46
|
+
request!(:convert_to_coordinates, request_params)
|
47
|
+
end
|
48
|
+
|
49
|
+
def convert_to_3wa(position, params = {})
|
50
|
+
"""
|
51
|
+
Take latitude and longitude coordinates and turn them into a 3 word address.
|
52
|
+
|
53
|
+
Params
|
54
|
+
------
|
55
|
+
:param array position: The coordinates of the location to convert to 3 word address
|
56
|
+
:param string format: Return data format type; can be one of json (the default), geojson
|
57
|
+
:param string language: A supported 3 word address language as an ISO 639-1 2 letter code.
|
58
|
+
:rtype: Hash
|
59
|
+
"""
|
60
|
+
request_params = assemble_convert_to_3wa_request_params(position, params)
|
61
|
+
request!(:convert_to_3wa, request_params)
|
62
|
+
end
|
63
|
+
|
64
|
+
def grid_section(bbox, params = {})
|
65
|
+
"""
|
66
|
+
Returns a section of the 3m x 3m what3words grid for a given area.
|
67
|
+
|
68
|
+
Params
|
69
|
+
------
|
70
|
+
:param string bbox: Bounding box, specified by the northeast and southwest corner coordinates,
|
71
|
+
:param string format: Return data format type; can be one of json (the default), geojson
|
72
|
+
:rtype: Hash
|
73
|
+
"""
|
49
74
|
request_params = assemble_grid_request_params(bbox, params)
|
50
|
-
|
51
|
-
response
|
75
|
+
request!(:grid_section, request_params)
|
52
76
|
end
|
53
77
|
|
54
|
-
def
|
55
|
-
|
56
|
-
|
57
|
-
response
|
58
|
-
end
|
78
|
+
def available_languages
|
79
|
+
"""
|
80
|
+
Retrieve a list of available 3 word languages.
|
59
81
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
82
|
+
:rtype: Hash
|
83
|
+
"""
|
84
|
+
request_params = assemble_common_request_params({})
|
85
|
+
request!(:available_languages, request_params)
|
86
|
+
end
|
87
|
+
|
88
|
+
def autosuggest(input, params = {})
|
89
|
+
"""
|
90
|
+
Returns a list of 3 word addresses based on user input and other parameters.
|
91
|
+
|
92
|
+
Params
|
93
|
+
------
|
94
|
+
:param string input: The full or partial 3 word address to obtain suggestions for.
|
95
|
+
:param int n_results: The number of AutoSuggest results to return.
|
96
|
+
:param array focus: A location, specified as a latitude,longitude used to refine the results.
|
97
|
+
:param int n_focus_results: Specifies the number of results (must be <= n_results) within the results set which will have a focus.
|
98
|
+
:param string clip_to_country: Restricts autosuggest to only return results inside the countries specified by comma-separated list of uppercase ISO 3166-1 alpha-2 country codes.
|
99
|
+
:param array clip_to_bounding_box: Restrict autosuggest results to a bounding box, specified by coordinates.
|
100
|
+
:param array clip_to_circle: Restrict autosuggest results to a circle, specified by the center of the circle, latitude and longitude, and a distance in kilometres which represents the radius.
|
101
|
+
:param array clip_to_polygon: Restrict autosuggest results to a polygon, specified by a list of coordinates.
|
102
|
+
:param string input_type: For power users, used to specify voice input mode. Can be text (default), vocon-hybrid, nmdp-asr or generic-voice.
|
103
|
+
:param string prefer_land: Makes autosuggest prefer results on land to those in the sea.
|
104
|
+
:param string language: A supported 3 word address language as an ISO 639-1 2 letter code.
|
105
|
+
:rtype: Hash
|
106
|
+
"""
|
107
|
+
request_params = assemble_autosuggest_request_params(input, params)
|
108
|
+
request!(:autosuggest, request_params)
|
109
|
+
end
|
110
|
+
|
111
|
+
def isPossible3wa(text)
|
112
|
+
"""
|
113
|
+
Determines if the string passed in is the form of a three word address.
|
114
|
+
This does not validate whether it is a real address as it returns true for x.x.x
|
115
|
+
|
116
|
+
Params
|
117
|
+
------
|
118
|
+
:param string text: text to check
|
119
|
+
:rtype: Boolean
|
120
|
+
"""
|
121
|
+
regex_match = REGEX_3_WORD_ADDRESS
|
122
|
+
!(text.match(regex_match).nil?)
|
123
|
+
end
|
124
|
+
|
125
|
+
def findPossible3wa(text)
|
126
|
+
"""
|
127
|
+
Searches the string passed in for all substrings in the form of a three word address.
|
128
|
+
This does not validate whether it is a real address as it will return x.x.x as a result
|
129
|
+
|
130
|
+
Params
|
131
|
+
------
|
132
|
+
:param string text: text to check
|
133
|
+
:rtype: Array
|
134
|
+
"""
|
135
|
+
regex_search = /[^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]{1,}[.\uFF61\u3002\uFF65\u30FB\uFE12\u17D4\u0964\u1362\u3002][^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]{1,}[.\uFF61\u3002\uFF65\u30FB\uFE12\u17D4\u0964\u1362\u3002][^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]{1,}/
|
136
|
+
text.scan(regex_search)
|
137
|
+
end
|
138
|
+
|
139
|
+
def didYouMean(text)
|
140
|
+
"""
|
141
|
+
Determines if the string passed in is almost in the form of a three word address.
|
142
|
+
This will return True for values such as 'filled-count-soap' and 'filled count soap'
|
143
|
+
|
144
|
+
Params
|
145
|
+
------
|
146
|
+
:param string text: text to check
|
147
|
+
:rtype: Boolean
|
148
|
+
"""
|
149
|
+
regex_match = /^\/?[^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]{1,}[.\uFF61\u3002\uFF65\u30FB\uFE12\u17D4\u0964\u1362\u3002 ,\\\-\/+'&\\:;|\u3000]{1,2}[^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]{1,}[.\uFF61\u3002\uFF65\u30FB\uFE12\u17D4\u0964\u1362\u3002 ,\\\-\/+'&\\:;|\u3000]{1,2}[^0-9`~!@#$%^&*()+\-_=\[\{\]}\\|'<,.>?\/\";:£§º©®\s]{1,}$/
|
150
|
+
!(text.match(regex_match).nil?)
|
151
|
+
end
|
152
|
+
|
153
|
+
def isValid3wa(text)
|
154
|
+
"""
|
155
|
+
Determines if the string passed in is a real three word address. It calls the API
|
156
|
+
to verify it refers to an actual place on earth.
|
157
|
+
|
158
|
+
Params
|
159
|
+
------
|
160
|
+
:param String text: text to check
|
161
|
+
|
162
|
+
:rtype: Boolean
|
163
|
+
"""
|
164
|
+
if isPossible3wa(text)
|
165
|
+
result = autosuggest(text, 'n-results': 1)
|
166
|
+
if result[:suggestions] && result[:suggestions].length > 0
|
167
|
+
return result[:suggestions][0][:words] == text
|
168
|
+
end
|
169
|
+
end
|
170
|
+
false
|
65
171
|
end
|
66
172
|
|
67
|
-
|
68
|
-
request_params = assemble_autosuggest_request_params(addr, lang, focus,
|
69
|
-
clip, params)
|
70
|
-
response = request! :autosuggest_ml, request_params
|
71
|
-
response
|
72
|
-
end
|
173
|
+
private
|
73
174
|
|
74
|
-
def
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
response
|
79
|
-
end
|
175
|
+
def request!(endpoint_name, params)
|
176
|
+
headers = { "X-W3W-Wrapper": "what3words-Ruby/#{WRAPPER_VERSION}" }
|
177
|
+
response = RestClient.get(endpoint(endpoint_name), params: params, headers: headers)
|
178
|
+
parsed_response = JSON.parse(response.body)
|
80
179
|
|
81
|
-
|
82
|
-
request_params = assemble_standardblend_request_params(addr, lang, focus,
|
83
|
-
params)
|
84
|
-
response = request! :standardblend_ml, request_params
|
85
|
-
response
|
86
|
-
end
|
180
|
+
raise ResponseError, "#{parsed_response['code']}: #{parsed_response['message']}" if parsed_response['error'].to_s.strip != ''
|
87
181
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
h[:format] = params[:format] if params[:format]
|
92
|
-
h[:display] = params[:display] if params[:display]
|
93
|
-
h
|
182
|
+
deep_symbolize_keys(parsed_response)
|
183
|
+
rescue RestClient::ExceptionWithResponse => e
|
184
|
+
handle_rest_client_error(e)
|
94
185
|
end
|
95
|
-
private :assemble_common_request_params
|
96
186
|
|
97
|
-
def
|
98
|
-
|
99
|
-
|
187
|
+
def handle_rest_client_error(error)
|
188
|
+
parsed_response = JSON.parse(error.response)
|
189
|
+
raise ResponseError, "#{parsed_response['code']}: #{parsed_response['message']}" if parsed_response['error']
|
190
|
+
raise error
|
100
191
|
end
|
101
|
-
private :assemble_forward_request_params
|
102
192
|
|
103
|
-
def
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
private :assemble_grid_request_params
|
108
|
-
|
109
|
-
def assemble_reverse_request_params(position, params)
|
110
|
-
h = { coords: position.join(',') }
|
111
|
-
h.merge(assemble_common_request_params(params))
|
193
|
+
def get_words_string(words)
|
194
|
+
words_string = words.is_a?(Array) ? words.join('.') : words.to_s
|
195
|
+
check_words(words_string)
|
196
|
+
words_string
|
112
197
|
end
|
113
|
-
private :assemble_reverse_request_params
|
114
198
|
|
115
|
-
def
|
116
|
-
|
117
|
-
h[:lang] = lang
|
118
|
-
h[:focus] = focus.join(',') if focus.respond_to? :join
|
119
|
-
h[:clip] = clip if clip.respond_to? :to_str
|
120
|
-
h.merge(assemble_common_request_params(params))
|
199
|
+
def check_words(words)
|
200
|
+
raise WordError, "#{words} is not a valid 3 word address" unless REGEX_3_WORD_ADDRESS.match?(words)
|
121
201
|
end
|
122
|
-
private :assemble_autosuggest_request_params
|
123
202
|
|
124
|
-
def
|
125
|
-
|
126
|
-
h[:lang] = lang
|
127
|
-
h[:focus] = focus.join(',') if focus.respond_to? :join
|
128
|
-
h.merge(assemble_common_request_params(params))
|
203
|
+
def assemble_common_request_params(params)
|
204
|
+
{ key: key }.merge(params.slice(:language, :format))
|
129
205
|
end
|
130
|
-
private :assemble_standardblend_request_params
|
131
206
|
|
132
|
-
def
|
133
|
-
|
134
|
-
# puts params.inspect
|
135
|
-
begin
|
136
|
-
response = RestClient.get endpoint(endpoint_name), params: params
|
137
|
-
rescue => e
|
138
|
-
response = e.response
|
139
|
-
end
|
140
|
-
# puts '#{response.to_str}'
|
141
|
-
# puts 'Response status: #{response.code}'
|
142
|
-
response = JSON.parse(response.body)
|
143
|
-
if response['code'].to_s.strip != ''
|
144
|
-
raise ResponseError, "#{response['code']}: #{response['message']}"
|
145
|
-
end
|
146
|
-
deep_symbolize_keys(response)
|
207
|
+
def assemble_convert_to_coordinates_request_params(words_string, params)
|
208
|
+
{ words: words_string }.merge(assemble_common_request_params(params))
|
147
209
|
end
|
148
|
-
private :request!
|
149
210
|
|
150
|
-
def
|
151
|
-
|
152
|
-
w = words
|
153
|
-
elsif words.respond_to? :join
|
154
|
-
w = words.join('.')
|
155
|
-
else
|
156
|
-
raise Error, "Cannot get words string for #{words.inspect}"
|
157
|
-
end
|
158
|
-
check_words w
|
211
|
+
def assemble_convert_to_3wa_request_params(position, params)
|
212
|
+
{ coordinates: position.join(',') }.merge(assemble_common_request_params(params))
|
159
213
|
end
|
160
|
-
private :get_words_string
|
161
214
|
|
162
|
-
def
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
if
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
215
|
+
def assemble_grid_request_params(bbox, params)
|
216
|
+
{ 'bounding-box': bbox }.merge(assemble_common_request_params(params))
|
217
|
+
end
|
218
|
+
|
219
|
+
def assemble_autosuggest_request_params(input, params)
|
220
|
+
result = { input: input }
|
221
|
+
result[:'n-results'] = params[:'n-results'].to_i if params[:'n-results']
|
222
|
+
result[:focus] = params[:focus].join(',') if params[:focus].respond_to?(:join)
|
223
|
+
result[:'n-focus-results'] = params[:'n-focus-results'].to_i if params[:'n-focus-results']
|
224
|
+
result[:'clip-to-country'] = params[:'clip-to-country'] if params[:'clip-to-country'].respond_to?(:to_str)
|
225
|
+
result[:'clip-to-bounding-box'] = params[:'clip-to-bounding-box'].join(',') if params[:'clip-to-bounding-box'].respond_to?(:join)
|
226
|
+
result[:'clip-to-circle'] = params[:'clip-to-circle'].join(',') if params[:'clip-to-circle'].respond_to?(:join)
|
227
|
+
result[:'clip-to-polygon'] = params[:'clip-to-polygon'].join(',') if params[:'clip-to-polygon'].respond_to?(:join)
|
228
|
+
result[:'input-type'] = params[:'input-type'] if params[:'input-type'].respond_to?(:to_str)
|
229
|
+
result[:'prefer-land'] = params[:'prefer-land'] if params[:'prefer-land']
|
230
|
+
result.merge(assemble_common_request_params(params))
|
231
|
+
end
|
232
|
+
|
233
|
+
def deep_symbolize_keys(value)
|
234
|
+
case value
|
235
|
+
when Hash
|
236
|
+
value.transform_keys(&:to_sym).transform_values { |v| deep_symbolize_keys(v) }
|
237
|
+
when Array
|
238
|
+
value.map { |v| deep_symbolize_keys(v) }
|
178
239
|
else
|
179
|
-
|
240
|
+
value
|
180
241
|
end
|
181
|
-
|
182
|
-
ni
|
183
|
-
end
|
184
|
-
|
185
|
-
def base_url
|
186
|
-
BASE_URL
|
187
242
|
end
|
188
|
-
private :base_url
|
189
243
|
|
190
244
|
def endpoint(name)
|
191
|
-
|
245
|
+
BASE_URL + ENDPOINTS.fetch(name)
|
192
246
|
end
|
193
247
|
end
|
194
248
|
end
|
data/lib/what3words/version.rb
CHANGED
data/lib/what3words.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: what3words
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- what3words
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -73,79 +73,67 @@ dependencies:
|
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '3.4'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
76
|
+
name: rubocop
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
81
|
+
version: 0.48.1
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
88
|
+
version: 0.48.1
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
|
-
name:
|
90
|
+
name: webmock
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 0
|
95
|
+
version: '3.0'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 0
|
103
|
-
description:
|
102
|
+
version: '3.0'
|
103
|
+
description: A Ruby wrapper for the what3words API
|
104
104
|
email:
|
105
105
|
- development@what3words.com
|
106
106
|
executables: []
|
107
107
|
extensions: []
|
108
108
|
extra_rdoc_files: []
|
109
109
|
files:
|
110
|
-
- ".editorconfig"
|
111
|
-
- ".gitignore"
|
112
|
-
- ".travis.yml"
|
113
|
-
- Gemfile
|
114
|
-
- LICENSE.txt
|
115
110
|
- README.md
|
116
|
-
- Rakefile
|
117
111
|
- lib/what3words.rb
|
118
112
|
- lib/what3words/api.rb
|
119
113
|
- lib/what3words/version.rb
|
120
|
-
|
121
|
-
- spec/lib/what3words/what3words_api_spec.rb
|
122
|
-
- spec/spec_helper.rb
|
123
|
-
- what3words.gemspec
|
124
|
-
homepage: http://rubygems.org/gems/what3words
|
114
|
+
homepage: https://github.com/what3words/w3w-ruby-wrapper
|
125
115
|
licenses:
|
126
116
|
- MIT
|
127
|
-
metadata:
|
117
|
+
metadata:
|
118
|
+
documentation_uri: https://www.rubydoc.info/gems/what3words
|
119
|
+
source_code_uri: https://github.com/what3words/w3w-ruby-wrapper
|
128
120
|
post_install_message:
|
129
121
|
rdoc_options: []
|
130
122
|
require_paths:
|
131
123
|
- lib
|
132
124
|
required_ruby_version: !ruby/object:Gem::Requirement
|
133
125
|
requirements:
|
134
|
-
- - "
|
126
|
+
- - "~>"
|
135
127
|
- !ruby/object:Gem::Version
|
136
|
-
version: '
|
128
|
+
version: '2.6'
|
137
129
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
130
|
requirements:
|
139
131
|
- - ">="
|
140
132
|
- !ruby/object:Gem::Version
|
141
133
|
version: '0'
|
142
134
|
requirements: []
|
143
|
-
|
144
|
-
rubygems_version: 2.5.2
|
135
|
+
rubygems_version: 3.0.3.1
|
145
136
|
signing_key:
|
146
137
|
specification_version: 4
|
147
|
-
summary:
|
148
|
-
test_files:
|
149
|
-
- spec/config.sample.yaml
|
150
|
-
- spec/lib/what3words/what3words_api_spec.rb
|
151
|
-
- spec/spec_helper.rb
|
138
|
+
summary: Ruby wrapper for the what3words API
|
139
|
+
test_files: []
|
data/.editorconfig
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# EditorConfig is awesome: http://EditorConfig.org
|
2
|
-
|
3
|
-
# top-most EditorConfig file
|
4
|
-
root = true
|
5
|
-
|
6
|
-
# Unix-style newlines with a newline ending every file
|
7
|
-
[*]
|
8
|
-
end_of_line = lf
|
9
|
-
insert_final_newline = true
|
10
|
-
trim_trailing_whitespace = true
|
11
|
-
|
12
|
-
# Set default charset
|
13
|
-
charset = utf-8
|
14
|
-
|
15
|
-
# Indentation
|
16
|
-
indent_style = space
|
17
|
-
indent_size = 2
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.4
|
4
|
-
script: rake rubocop spec
|
5
|
-
notifications:
|
6
|
-
slack:
|
7
|
-
secure: DvejcrOH6RdAdrGEPLUrnia9cES8iCHVlVSFAMwx2vaR/I3T9bfUiHnb3VHfiqx4cvDL+9wT3opG0sZkUCFJGqzA3E//VObKNXjwUFCUptFG68qgR7LZ3vDatWlUqU+32gWeYaHM3FpNP2E/IARjphaiF3jRUZbronqVzJZN2MbMsUYBeGq7v0AaLkgbxVgOWtBnMVcBPOnarEJqHyJlqQ2unYnIy+GNoOFtPMPNZobYTf0zxrycldYpP937yT4CTsY3I7RxuEtnY2sPYW+eFBESGLg6EfnjeOruROY+b9cSHIh1Qzr7Oup6a+oQ3+vCvLbYsGpEO04RTeTTtOGc7aRlUylmvuFPi7qQwOTZ+4KD5aIBh4p7bQiPfvAeqDU4pVJxPHHZirgjFpUpAvofj48SvDgwX9cFyAhAlDZ9qBOctmhphW9KNkcAW4MY421AdVAjFWwc5CU8G5oPdKcyWam3ZB3nHwKgZm6LLAcZgbG0rjZT+iPeQBvTKH3kPx7E1CkxZNkEralHJ3l+bDwY3GdzsgcMpT3bWNl3pLszFzgXljDScMU8my1+xjDQINEnI3TCJA4MhKkzYkRgfrEBkgPb2SiF7qnhbyMzSFbCU4jsM1MLQZolNG9EsjsxJLuL4YTC2wKOHajViUUeaCNIcNU5UXBQuit93RyMu7RrLRM=
|
data/Gemfile
DELETED
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2016, 2017 What3Words Limited
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'bundler/gem_tasks'
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'rubocop/rake_task'
|
5
|
-
RuboCop::RakeTask.new(:rubocop) do |t|
|
6
|
-
t.options = ['--display-cop-names']
|
7
|
-
end
|
8
|
-
require 'rspec/core/rake_task'
|
9
|
-
RSpec::Core::RakeTask.new(:spec)
|
10
|
-
rescue LoadError => e
|
11
|
-
print e
|
12
|
-
end
|
data/spec/config.sample.yaml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# config.sample.yaml
|