geoloco 1.0.0 → 1.1.0

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,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c53324fe06fb58786ff555b0a11d3ca0fd2bda60f489b31fd20ab4975266d2c
4
- data.tar.gz: 6d6ac9d5df99653e1e2ab13fd956966cde186b6e3da50a105f62c869c96a82e0
3
+ metadata.gz: 3f362468184f4c57e32785a761de82e7fff2ecff21b6c38f7c5b5dadd853c46e
4
+ data.tar.gz: 52082e781e0340b5c056b12cfb45e6aa8d6b7ead8880c82bdcdacba373a6eabd
5
5
  SHA512:
6
- metadata.gz: 5165c03d95aa767769f1294b58135d29fba59e79ea88035dde945f3f95e410cf94643fcaaeeb58c0f92d897f8d46813adcc3d35ca88470ce1164b282604238ba
7
- data.tar.gz: 8aaea202d406c55be223bef589a5e7c1dfcfa0d36e584cff04b68cb2c0af149647920eb2b9849beb248addf7c5a55afec0f5eab38fad3e0acbd4443f3b546493
6
+ metadata.gz: 0a1f0fbe2be6f0c617468b5c641898cc6030044c73c3d4df8b856d117fbb7fcdfeb933a1057109b096e8457e43d770a833941adccfc69bca054d38b9d10edaeb
7
+ data.tar.gz: 30d484e4dc35cc8e49e1c810560286f2656f4761bc93fc090fdce225dccbb4afe0edf2f516351b57ba86a9b1580e82e177998e1dbda58c103c1764564a8d9665
@@ -0,0 +1,2 @@
1
+ # Managed by https://github.com/powerhome/software. Do not make changes here, they will be reverted.
2
+ * @powerhome/heroes-for-hire
@@ -0,0 +1,13 @@
1
+ name: geoloco
2
+
3
+ on:
4
+ push:
5
+
6
+ jobs:
7
+ ruby:
8
+ uses: powerhome/github-actions-workflows/.github/workflows/ruby-gem.yml@main
9
+ with:
10
+ package: ${{ github.workflow }}
11
+ ruby: '["3.3","3.4","4.0"]'
12
+ bundler: '["4"]'
13
+ secrets: inherit
@@ -0,0 +1,31 @@
1
+ # Managed by https://github.com/powerhome/software. Do not make changes here, they will be reverted.
2
+
3
+ name: Automated Code Reviews
4
+ on: [pull_request]
5
+
6
+ concurrency:
7
+ group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
8
+ cancel-in-progress: true
9
+
10
+ jobs:
11
+ bearer:
12
+ name: bearer
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
16
+ - uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0
17
+ with:
18
+ reviewdog_version: latest
19
+ - name: bearer
20
+ uses: bearer/bearer-action@828eeb928ce2f4a7ca5ed57fb8b59508cb8c79bc # v2
21
+ with:
22
+ diff: true
23
+ format: rdjson
24
+ output: rd.json
25
+ config-file: bearer.yml
26
+ - name: Run reviewdog
27
+ if: always()
28
+ env:
29
+ REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30
+ run: |
31
+ touch rd.json && cat rd.json | reviewdog -f=rdjson -reporter=github-pr-check
@@ -0,0 +1,35 @@
1
+ # Managed by https://github.com/powerhome/software. Do not make changes here, they will be reverted.
2
+
3
+ name: 'Close stale issues and PRs'
4
+ on:
5
+ workflow_dispatch:
6
+ schedule:
7
+ - cron: '5 5 * * *'
8
+
9
+ jobs:
10
+ stale:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0
14
+ with:
15
+ operations-per-run: 200
16
+ delete-branch: true
17
+ stale-pr-message: >
18
+ This issue has been automatically marked as stale because it has not had
19
+ recent activity. It will be closed in 24 hours if no further activity occurs.
20
+
21
+ If this change is desirable, please accelerate completing it. If it is not,
22
+ please close the PR. If you're blocked on something, please ensure there's
23
+ a reference to this PR in a story on your team's board so the team will
24
+ follow up, and consider closing the PR for now.
25
+
26
+ Please do not artificially extend the deadline with a dummy comment. If
27
+ necessary, provide a status update, such as "this change is being actively
28
+ tested".
29
+
30
+ Thank you for your contributions and your collaboration in reducing WIP
31
+ and cycle time.
32
+ days-before-stale: 14
33
+ days-before-close: 3
34
+ days-before-issue-stale: -1
35
+ exempt-pr-labels: dependencies
data/.gitignore CHANGED
@@ -2,7 +2,6 @@
2
2
  /.yardoc
3
3
  /_yardoc/
4
4
  /coverage/
5
- /doc/
6
5
  /pkg/
7
6
  /spec/reports/
8
7
  /tmp/
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.0
1
+ 4.0.7
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+ ## 1.1.0
4
+
5
+ - Add API key authentication to the Google geocoding adapter
6
+ - Require Ruby >= 3.3 and target Ruby 4.0.7 for development
7
+ - Add `base64` as a runtime dependency (no longer a default gem since Ruby 3.4)
8
+ - Drop the pinned Bundler 1.x development dependency and update locked gems
9
+ - Replace Travis CI with the shared Power `ruby-gem` GitHub Actions workflow (tests on Ruby 3.3, 3.4 and 4.0, license compliance check, releases to RubyGems on `v*-geoloco` tags)
data/Gemfile.lock CHANGED
@@ -1,45 +1,48 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- geoloco (1.0.0)
4
+ geoloco (1.1.0)
5
+ base64
5
6
  httparty (>= 0.14.0)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
- diff-lcs (1.3)
11
- httparty (0.17.1)
12
- mime-types (~> 3.0)
11
+ base64 (0.3.0)
12
+ bigdecimal (4.1.3)
13
+ csv (3.3.6)
14
+ diff-lcs (1.6.2)
15
+ httparty (0.24.3)
16
+ csv
17
+ mini_mime (>= 1.0.0)
13
18
  multi_xml (>= 0.5.2)
14
- mime-types (3.3)
15
- mime-types-data (~> 3.2015)
16
- mime-types-data (3.2019.1009)
17
- multi_xml (0.6.0)
18
- rake (10.5.0)
19
- rspec (3.9.0)
20
- rspec-core (~> 3.9.0)
21
- rspec-expectations (~> 3.9.0)
22
- rspec-mocks (~> 3.9.0)
23
- rspec-core (3.9.0)
24
- rspec-support (~> 3.9.0)
25
- rspec-expectations (3.9.0)
19
+ mini_mime (1.1.5)
20
+ multi_xml (0.9.1)
21
+ bigdecimal (>= 3.1, < 5)
22
+ rake (13.4.2)
23
+ rspec (3.13.2)
24
+ rspec-core (~> 3.13.0)
25
+ rspec-expectations (~> 3.13.0)
26
+ rspec-mocks (~> 3.13.0)
27
+ rspec-core (3.13.6)
28
+ rspec-support (~> 3.13.0)
29
+ rspec-expectations (3.13.5)
26
30
  diff-lcs (>= 1.2.0, < 2.0)
27
- rspec-support (~> 3.9.0)
28
- rspec-mocks (3.9.0)
31
+ rspec-support (~> 3.13.0)
32
+ rspec-mocks (3.13.8)
29
33
  diff-lcs (>= 1.2.0, < 2.0)
30
- rspec-support (~> 3.9.0)
31
- rspec-support (3.9.0)
32
- timecop (0.9.1)
34
+ rspec-support (~> 3.13.0)
35
+ rspec-support (3.13.7)
36
+ timecop (0.9.11)
33
37
 
34
38
  PLATFORMS
35
39
  ruby
36
40
 
37
41
  DEPENDENCIES
38
- bundler (~> 1.17)
39
42
  geoloco!
40
- rake (~> 10.0)
43
+ rake (~> 13.0)
41
44
  rspec (~> 3.0)
42
45
  timecop (>= 0.9)
43
46
 
44
47
  BUNDLED WITH
45
- 1.17.3
48
+ 4.0.23
@@ -0,0 +1,3 @@
1
+ ---
2
+ - - :inherit_from
3
+ - https://raw.githubusercontent.com/powerhome/oss-guide/master/license_rules.yml
data/geoloco.gemspec CHANGED
@@ -38,11 +38,12 @@ Gem::Specification.new do |spec|
38
38
  spec.bindir = 'exe'
39
39
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
40
40
  spec.require_paths = ['lib']
41
+ spec.required_ruby_version = '>= 3.3'
41
42
 
43
+ spec.add_dependency 'base64'
42
44
  spec.add_dependency 'httparty', '>= 0.14.0'
43
45
 
44
- spec.add_development_dependency 'bundler', '~> 1.17'
45
- spec.add_development_dependency 'rake', '~> 10.0'
46
+ spec.add_development_dependency 'rake', '~> 13.0'
46
47
  spec.add_development_dependency 'rspec', '~> 3.0'
47
48
  spec.add_development_dependency 'timecop', '>= 0.9'
48
49
  end
@@ -11,8 +11,9 @@ module Geoloco
11
11
  GEOCODE_PATH = '/maps/api/geocode/json'
12
12
 
13
13
  class << self
14
- def geocode(address, client_id:, key:)
15
- response = Geoloco.http.get(geocode_url(address, client_id, key))
14
+ def geocode(address, key: nil, client_id: nil, api_key: nil)
15
+ url = geocode_url(address, client_id, key, api_key)
16
+ response = Geoloco.http.get(url)
16
17
  handle_errors(response, response.parsed_response)
17
18
  map_results(response.parsed_response)
18
19
  end
@@ -63,9 +64,16 @@ module Geoloco
63
64
  &.dig(data)
64
65
  end
65
66
 
66
- def geocode_url(address, client_id, key)
67
- query = URI.encode_www_form(client: client_id, address: address)
68
- signed_url(GEOCODE_PATH, query, key)
67
+ def geocode_url(address, client_id, key, api_key)
68
+ if client_id && key && api_key.nil?
69
+ query = URI.encode_www_form(client: client_id, address: address)
70
+ signed_url(GEOCODE_PATH, query, key)
71
+ elsif api_key && client_id.nil? && key.nil?
72
+ query = URI.encode_www_form(address: address, key: api_key)
73
+ "#{API_HOST}#{GEOCODE_PATH}?#{query}"
74
+ else
75
+ raise ArgumentError, 'provide client_id and key, or api_key'
76
+ end
69
77
  end
70
78
 
71
79
  def signed_url(path, query, key)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Geoloco
4
- VERSION = '1.0.0'
4
+ VERSION = '1.1.0'
5
5
  end
data/mkdocs.yml ADDED
@@ -0,0 +1,6 @@
1
+ site_name: Geoloco
2
+ site_description: Geoloco Documentation
3
+ nav:
4
+ - "Home": "README.md"
5
+ plugins:
6
+ - techdocs-core
data/portal.yml ADDED
@@ -0,0 +1,12 @@
1
+ apiVersion: backstage.io/v1alpha1
2
+ kind: Component
3
+ metadata:
4
+ name: geoloco
5
+ title: Geoloco
6
+ description: Geocoding for ruby with multiple adapters
7
+ annotations:
8
+ backstage.io/techdocs-ref: dir:.
9
+ spec:
10
+ type: library
11
+ owner: heroes-for-hire
12
+ lifecycle: production
metadata CHANGED
@@ -1,58 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoloco
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Palhares
8
8
  - Rafael Garcia
9
- autorequire:
10
9
  bindir: exe
11
10
  cert_chain: []
12
- date: 2019-11-22 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: httparty
14
+ name: base64
16
15
  requirement: !ruby/object:Gem::Requirement
17
16
  requirements:
18
17
  - - ">="
19
18
  - !ruby/object:Gem::Version
20
- version: 0.14.0
19
+ version: '0'
21
20
  type: :runtime
22
21
  prerelease: false
23
22
  version_requirements: !ruby/object:Gem::Requirement
24
23
  requirements:
25
24
  - - ">="
26
25
  - !ruby/object:Gem::Version
27
- version: 0.14.0
26
+ version: '0'
28
27
  - !ruby/object:Gem::Dependency
29
- name: bundler
28
+ name: httparty
30
29
  requirement: !ruby/object:Gem::Requirement
31
30
  requirements:
32
- - - "~>"
31
+ - - ">="
33
32
  - !ruby/object:Gem::Version
34
- version: '1.17'
35
- type: :development
33
+ version: 0.14.0
34
+ type: :runtime
36
35
  prerelease: false
37
36
  version_requirements: !ruby/object:Gem::Requirement
38
37
  requirements:
39
- - - "~>"
38
+ - - ">="
40
39
  - !ruby/object:Gem::Version
41
- version: '1.17'
40
+ version: 0.14.0
42
41
  - !ruby/object:Gem::Dependency
43
42
  name: rake
44
43
  requirement: !ruby/object:Gem::Requirement
45
44
  requirements:
46
45
  - - "~>"
47
46
  - !ruby/object:Gem::Version
48
- version: '10.0'
47
+ version: '13.0'
49
48
  type: :development
50
49
  prerelease: false
51
50
  version_requirements: !ruby/object:Gem::Requirement
52
51
  requirements:
53
52
  - - "~>"
54
53
  - !ruby/object:Gem::Version
55
- version: '10.0'
54
+ version: '13.0'
56
55
  - !ruby/object:Gem::Dependency
57
56
  name: rspec
58
57
  requirement: !ruby/object:Gem::Requirement
@@ -89,17 +88,22 @@ extensions: []
89
88
  extra_rdoc_files: []
90
89
  files:
91
90
  - ".editorconfig"
91
+ - ".github/CODEOWNERS"
92
+ - ".github/workflows/geoloco.yml"
93
+ - ".github/workflows/reviewdog.yml"
94
+ - ".github/workflows/stale.yml"
92
95
  - ".gitignore"
93
96
  - ".rspec"
94
97
  - ".ruby-version"
95
- - ".travis.yml"
98
+ - CHANGELOG.md
96
99
  - Gemfile
97
100
  - Gemfile.lock
98
101
  - LICENSE.txt
99
- - README.md
100
102
  - Rakefile
101
103
  - bin/console
102
104
  - bin/setup
105
+ - doc/dependency_decisions.yml
106
+ - docs/README.md
103
107
  - geoloco.gemspec
104
108
  - lib/geoloco.rb
105
109
  - lib/geoloco/adapters/fake.rb
@@ -108,6 +112,8 @@ files:
108
112
  - lib/geoloco/geometry.rb
109
113
  - lib/geoloco/location.rb
110
114
  - lib/geoloco/version.rb
115
+ - mkdocs.yml
116
+ - portal.yml
111
117
  homepage: https://github.com/powerhome/geoloco
112
118
  licenses:
113
119
  - MIT
@@ -115,7 +121,6 @@ metadata:
115
121
  homepage_uri: https://github.com/powerhome/geoloco
116
122
  source_code_uri: https://github.com/powerhome/geoloco
117
123
  changelog_uri: https://github.com/powerhome/geoloco
118
- post_install_message:
119
124
  rdoc_options: []
120
125
  require_paths:
121
126
  - lib
@@ -123,16 +128,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
128
  requirements:
124
129
  - - ">="
125
130
  - !ruby/object:Gem::Version
126
- version: '0'
131
+ version: '3.3'
127
132
  required_rubygems_version: !ruby/object:Gem::Requirement
128
133
  requirements:
129
134
  - - ">="
130
135
  - !ruby/object:Gem::Version
131
136
  version: '0'
132
137
  requirements: []
133
- rubyforge_project:
134
- rubygems_version: 2.7.3
135
- signing_key:
138
+ rubygems_version: 3.7.2
136
139
  specification_version: 4
137
140
  summary: Multi adapter geolocation tool
138
141
  test_files: []
data/.travis.yml DELETED
@@ -1,16 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.5.0
7
- - 2.6.3
8
- before_install: gem install bundler -v 1.17.2
9
- deploy:
10
- provider: rubygems
11
- api_key:
12
- secure: aCipdg6IqKaxQmWQXFlqI2JqGOrCAxzYlutOn6nCSk9VCzmlRjDoEp1M99ASvmF5CP3KQgfRq8bxfLql8jss8tymK0u2ExvKaUglK0zb2KoLQDGDGuHw3RxCTnaxPBuO4/2PuS+nso6IcdqUaGOzh8FA7ePKPBmxl3kyNtArEDV88Eyx6tQYs1/1w153bAeBk57nTiu8CPS+dIWg+guQADTLPZ61fH4xKjPWXnr65pFF7YtU5YdPBHFkqL60X384OZj1c7ZTGvFj70+36oo617HigSg8HCE+E0R1N4JQ8/5xo2yHBdrtgsAqYyYWRgm1C6qu+T6yKMuokdoSd0Ji3Rigz6VRrOJfjmQQkwMnno9fCY3vND62zOb9Ow+MCNuQYSgNHc+YPURKmT05wadG0FpZdmo6hstPusleuG89NxnB/s2YjR0QWQK05MW1uhFdru1S2gBd1fMH1GLoThhdfGG1UJSkKOipUJyRupFaB9zimJO3HwaTP0Q+wP8MGZDAqbyzQ3bJSZaQmJC6loC2EtxxnOQxUIxaySLtNEU2LOr9IijExj1ldXkz8X1fIWwRr6BPnIeChFnuST+L9UDYtqk1WgQTUs+tOAxUjepAWhtIUL5h3Jg2NZd9RxPXq8IngDWZJwT8yA3E9wloQx5JzTIMas5wHwCQJuwjjk5ibss=
13
- gem: consent
14
- on:
15
- tags: true
16
- repo: powerhome/consent
File without changes