epok 0.1.1 → 0.2.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 +4 -4
- data/.claude/skills/swarf/SKILL.md +77 -0
- data/.gitignore +1 -0
- data/CLAUDE.md +31 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +45 -25
- data/README.md +25 -6
- data/epok.gemspec +2 -3
- data/lib/epok/api.rb +11 -8
- data/lib/epok/object.rb +2 -1
- data/lib/epok/version.rb +1 -1
- data/test/epok/object_test.rb +13 -9
- data/test/epok_test.rb +12 -7
- data/test/test_helper.rb +2 -0
- metadata +9 -24
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 12d0e1ef79e2fd5ff522e79748f413cdb123a79c863bba24a85dce868a1c7127
|
|
4
|
+
data.tar.gz: 0c44daa4fe8d10908c75301d9a363bacf4d03ff0edf0eb13a2ff307cf96fe286
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8358374a58c28bd2cb5f10ec9ce94248b0a9ba2a2bb2a733f4cfb003a62fecf90e8e6ec46ffd8648b8ab4172df745976586fcc09b264d10c26f34438138af961
|
|
7
|
+
data.tar.gz: bcc962b28eaf4a3d8bb62325a422709488a437338aad6c7eced0afe9bce2c27a5865f7d367674759888e7fe78c28f46d8fb4350b3424dab60fba894627050816
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: swarf
|
|
3
|
+
description: Score Ruby methods by complexity against test coverage with swarf, and turn the worst rows into the next test to write. Use after writing or changing Ruby code and before calling a change done.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# swarf
|
|
7
|
+
|
|
8
|
+
swarf scores every Ruby method with `CRAP = CC² · (1 − coverage)³ + CC` and lists them worst first. Complexity is parsed from source. Coverage is recorded by a probe loaded into the test run and stored in `.swarf/coverage.json`, so scoring works without setup but coverage needs a test run.
|
|
9
|
+
|
|
10
|
+
## The loop
|
|
11
|
+
|
|
12
|
+
1. Run the suite with the probe loaded (see Setup if unsure):
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
bundle exec rspec # or: bundle exec rake test
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
2. Score the files you touched, not the whole project:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
git diff --name-only --diff-filter=d main -- '*.rb' | xargs bundle exec swarf
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Named paths are always scored, even under `test/`, `db/` or a `.swarfignore` pattern.
|
|
25
|
+
|
|
26
|
+
3. Take the top rows and act on the Evidence column (next section). Write or extend the test, re-run the suite, score again.
|
|
27
|
+
|
|
28
|
+
4. Stop when the touched methods sit at `CRAP = CC` with `Cov% 100.0`. Nothing you test pulls a score under its CC. If a score is too high at full coverage, that is complexity, which is a refactor question, not a testing one. Do not split methods to chase the number.
|
|
29
|
+
|
|
30
|
+
Before saying a change is done, run step 2 and report the top rows.
|
|
31
|
+
|
|
32
|
+
## Reading a row
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
Method CC Cov% CRAP Evidence Location
|
|
36
|
+
Cart#checkout 6 0.0% 42.00 never called lib/cart.rb:31
|
|
37
|
+
Cart#discount 4 50.0% 6.00 3/6 br lib/cart.rb:24
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
| Evidence | Meaning | Do |
|
|
41
|
+
| -------------- | -------------------------------------------- | ------------------------------------------------------------- |
|
|
42
|
+
| `never called` | A VM call count of zero. No test reaches it. | Write a test that calls it. |
|
|
43
|
+
| `3/6 br` | 3 of 6 branch outcomes ran. | Extend a test to the untaken outcomes. |
|
|
44
|
+
| `1/1 ln` | No branches, so lines are the whole truth. | Nothing, at 100%. |
|
|
45
|
+
| `no data` | No run has been recorded for this file. | The probe is not loaded, or the suite has not run. Fix Setup. |
|
|
46
|
+
| `stale` | The file changed after it was measured. | Re-run the suite, then score again. |
|
|
47
|
+
|
|
48
|
+
`no data` and `stale` both score at the `CC² + CC` floor rather than guess. They are also counted per file under the table, because the fix is per file.
|
|
49
|
+
|
|
50
|
+
A `never called` on a method a test clearly exercises means the test ran without the probe, or the probe loaded after the file. Check Setup before writing a duplicate test.
|
|
51
|
+
|
|
52
|
+
## Setup
|
|
53
|
+
|
|
54
|
+
The probe must load before the code under test, because `Coverage` only sees files loaded after it starts. One line, placed first:
|
|
55
|
+
|
|
56
|
+
- **RSpec**: first line of `.rspec`: `--require swarf/probe`
|
|
57
|
+
- **Minitest**: first line of `test/test_helper.rb`: `require "swarf/probe"`
|
|
58
|
+
- **Rails**: in `test/test_helper.rb`, after `require "bundler/setup"` and before `require_relative "../config/environment"`. Below the environment require, the whole app is invisible to it.
|
|
59
|
+
- **Anything**: `RUBYOPT="-rswarf/probe" bundle exec rake test`
|
|
60
|
+
|
|
61
|
+
Add `.swarf/` to `.gitignore`. Runs merge, so a single spec file adds to what earlier runs proved; nothing is erased until the file's bytes change.
|
|
62
|
+
|
|
63
|
+
Do not run swarf's probe alongside SimpleCov. Ruby allows one `Coverage.start` per process; if SimpleCov started first, swarf warns and records nothing.
|
|
64
|
+
|
|
65
|
+
## Commands
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
bundle exec swarf # whole project, worst 20
|
|
69
|
+
bundle exec swarf lib/ app/ # directories
|
|
70
|
+
bundle exec swarf app/models/cart.rb # one file
|
|
71
|
+
bundle exec swarf --limit 0 # every row
|
|
72
|
+
bundle exec swarf --ignore "app/legacy/**"
|
|
73
|
+
bundle exec swarf --all # ignore nothing, including db/ and .swarfignore
|
|
74
|
+
SWARF_DIR=/tmp/swarf bundle exec swarf # store elsewhere; set for the test run too
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
swarf's CC counts `if`, `unless`, `while`, `until`, `for`, `when`, `in`, `rescue`, `&&`, `||` and `&.`, not blocks, so it will not match RuboCop's. Methods made by `define_method` are not seen.
|
data/.gitignore
CHANGED
data/CLAUDE.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Epok
|
|
2
|
+
|
|
3
|
+
Ruby gem wrapping the GCBA EPOk API (https://epok.buenosaires.gob.ar).
|
|
4
|
+
No runtime dependencies beyond the standard library.
|
|
5
|
+
|
|
6
|
+
## Development
|
|
7
|
+
|
|
8
|
+
```
|
|
9
|
+
bundle install
|
|
10
|
+
bundle exec rake test # records VCR cassettes into test/fixtures on first run
|
|
11
|
+
bundle exec swarf lib/ # complexity vs. coverage report, worst first
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Cassettes are gitignored, so the first test run hits the live API.
|
|
15
|
+
The API rejects curl's default User-Agent, but Ruby's Net::HTTP works fine.
|
|
16
|
+
|
|
17
|
+
## Releasing
|
|
18
|
+
|
|
19
|
+
1. Make sure `main` is clean and pushed, and `bundle exec rake test` passes.
|
|
20
|
+
2. Bump `Epok::VERSION` in `lib/epok/version.rb`. Follow semver:
|
|
21
|
+
patch for fixes, minor for new behaviour, major for breaking changes.
|
|
22
|
+
3. Commit it as `Bump version to X.Y.Z`.
|
|
23
|
+
4. Run `bundle exec rake release`. This builds the gem, creates and pushes
|
|
24
|
+
the `vX.Y.Z` tag, and pushes the gem to rubygems.org. It needs rubygems
|
|
25
|
+
credentials (`gem signin`) and may prompt for an OTP if the account has
|
|
26
|
+
MFA enabled. If it prompts, the user has to run it themselves.
|
|
27
|
+
5. Create a GitHub release from the tag with a short summary of what changed:
|
|
28
|
+
`gh release create vX.Y.Z --generate-notes`.
|
|
29
|
+
|
|
30
|
+
Version numbers on rubygems.org cannot be reused, so check the diff before
|
|
31
|
+
running step 4.
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,47 +1,67 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
epok (0.
|
|
4
|
+
epok (0.2.0)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
addressable (2.
|
|
10
|
-
public_suffix (>= 2.0.2, <
|
|
11
|
-
ansi (1.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
crack (0.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
minitest
|
|
9
|
+
addressable (2.9.0)
|
|
10
|
+
public_suffix (>= 2.0.2, < 8.0)
|
|
11
|
+
ansi (1.6.0)
|
|
12
|
+
bigdecimal (4.1.3)
|
|
13
|
+
builder (3.3.0)
|
|
14
|
+
crack (1.0.1)
|
|
15
|
+
bigdecimal
|
|
16
|
+
rexml
|
|
17
|
+
hashdiff (1.2.1)
|
|
18
|
+
minitest (5.27.0)
|
|
19
|
+
minitest-reporters (1.8.0)
|
|
19
20
|
ansi
|
|
20
21
|
builder
|
|
21
|
-
minitest (>= 5.0)
|
|
22
|
+
minitest (>= 5.0, < 7)
|
|
22
23
|
ruby-progressbar
|
|
23
|
-
public_suffix (
|
|
24
|
-
rake (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
public_suffix (7.0.5)
|
|
25
|
+
rake (13.4.2)
|
|
26
|
+
rexml (3.4.4)
|
|
27
|
+
ruby-progressbar (1.13.0)
|
|
28
|
+
swarf (0.2.0)
|
|
29
|
+
vcr (6.4.0)
|
|
30
|
+
webmock (3.26.4)
|
|
31
|
+
addressable (>= 2.8.0)
|
|
30
32
|
crack (>= 0.3.2)
|
|
31
|
-
hashdiff
|
|
33
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
|
32
34
|
|
|
33
35
|
PLATFORMS
|
|
36
|
+
arm64-darwin-23
|
|
34
37
|
ruby
|
|
35
38
|
|
|
36
39
|
DEPENDENCIES
|
|
37
|
-
bundler (~> 1.17)
|
|
38
|
-
byebug
|
|
39
40
|
epok!
|
|
40
41
|
minitest (~> 5.0)
|
|
41
42
|
minitest-reporters (~> 1.3, >= 1.3.6)
|
|
42
|
-
rake (~>
|
|
43
|
-
|
|
43
|
+
rake (~> 13.0)
|
|
44
|
+
swarf
|
|
45
|
+
vcr (~> 6.0)
|
|
44
46
|
webmock (~> 3.5, >= 3.5.1)
|
|
45
47
|
|
|
48
|
+
CHECKSUMS
|
|
49
|
+
addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af
|
|
50
|
+
ansi (1.6.0) sha256=ac9ea0c0ea8d32fb4e271348e609963ac78882f34b73836c2a02b3622e666658
|
|
51
|
+
bigdecimal (4.1.3) sha256=61ebe1e5e559bdc3cc6f2c0ee7f427321fc838f59611c294356eb04d6e21cf66
|
|
52
|
+
builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f
|
|
53
|
+
crack (1.0.1) sha256=ff4a10390cd31d66440b7524eb1841874db86201d5b70032028553130b6d4c7e
|
|
54
|
+
epok (0.2.0)
|
|
55
|
+
hashdiff (1.2.1) sha256=9c079dbc513dfc8833ab59c0c2d8f230fa28499cc5efb4b8dd276cf931457cd1
|
|
56
|
+
minitest (5.27.0) sha256=2d3b17f8a36fe7801c1adcffdbc38233b938eb0b4966e97a6739055a45fa77d5
|
|
57
|
+
minitest-reporters (1.8.0) sha256=8ce5280fb73ad3178ae525454df169b6f28c1b38b1d088ea91815d3a370ba384
|
|
58
|
+
public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
|
|
59
|
+
rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
|
|
60
|
+
rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142
|
|
61
|
+
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
|
|
62
|
+
swarf (0.2.0) sha256=b4306a244fe4b096cfe263e452e666156856eac2467ae5d770639ef11388b375
|
|
63
|
+
vcr (6.4.0) sha256=077ac92cc16efc5904eb90492a18153b5e6ca5398046d8a249a7c96a9ea24ae6
|
|
64
|
+
webmock (3.26.4) sha256=8d8da206d217ebe6968cfb09c77f4533c23074e1432bad865f3994eacbaad50d
|
|
65
|
+
|
|
46
66
|
BUNDLED WITH
|
|
47
|
-
|
|
67
|
+
4.0.20
|
data/README.md
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
# Epok
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
|
3
|
+
GCBA EPOk wrapper to query indexed geographic objects.
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
9
7
|
Add this line to your application's Gemfile:
|
|
10
8
|
|
|
11
9
|
```ruby
|
|
12
|
-
gem
|
|
10
|
+
gem "epok"
|
|
13
11
|
```
|
|
14
12
|
|
|
15
13
|
And then execute:
|
|
@@ -22,7 +20,28 @@ Or install it yourself as:
|
|
|
22
20
|
|
|
23
21
|
## Usage
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
```ruby
|
|
24
|
+
>> obelisco = Epok::Location.new(x: -58.381570, y: -34.603738)
|
|
25
|
+
=> #<struct Epok::Location x=-58.38157, y=-34.603738>
|
|
26
|
+
|
|
27
|
+
>> pharmacies_around_obelisco = Epok.geocoder(obelisco, "farmacias")
|
|
28
|
+
=> #<Epok::Geocoder:0x00007f8719ab4f08 @x=-58.38157, @y=-34.603738, @categories="farmacias">
|
|
29
|
+
|
|
30
|
+
>> pharmacies_around_obelisco.first.content
|
|
31
|
+
=> {"Nombre"=>"Farmacia en PELLEGRINI, CARLOS 765", "Teléfono"=>"43223198 43220298"}
|
|
32
|
+
|
|
33
|
+
>> cgp = Epok.search("cgp")
|
|
34
|
+
=> #<Epok::Search:0x00007f871a09ac60 @query="cgp">
|
|
35
|
+
|
|
36
|
+
>> sede_4 = cgp.first
|
|
37
|
+
=> #<Epok::Object:0x00007f8719b36788 @id="sedes_de_comunas|4">
|
|
38
|
+
|
|
39
|
+
>> sede_4.name
|
|
40
|
+
=> "Sede Comunal 4"
|
|
41
|
+
|
|
42
|
+
>> sede_4.content
|
|
43
|
+
=> {"Nombre"=>"Sede Comunal 4", "Dirección"=>"BARCO CENTENERA del 2906", "Teléfonos"=>"4918-2243/1815/8920-4949 9024 Int. 105", "Trámites y Servicios"=>"<a href=\"http://www.buenosaires.gob.ar/comuna-4/sede-comunal-4\" target=\"_blank\">link</a>"}
|
|
44
|
+
```
|
|
26
45
|
|
|
27
46
|
## Development
|
|
28
47
|
|
|
@@ -40,4 +59,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
40
59
|
|
|
41
60
|
## Code of Conduct
|
|
42
61
|
|
|
43
|
-
Everyone interacting in the Epok project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/arzezak/epok/blob/
|
|
62
|
+
Everyone interacting in the Epok project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/arzezak/epok/blob/main/CODE_OF_CONDUCT.md).
|
data/epok.gemspec
CHANGED
|
@@ -17,10 +17,9 @@ Gem::Specification.new do |spec|
|
|
|
17
17
|
spec.files = `git ls-files`.split("\n")
|
|
18
18
|
spec.require_paths = ["lib"]
|
|
19
19
|
|
|
20
|
-
spec.add_development_dependency "bundler", "~> 1.17"
|
|
21
20
|
spec.add_development_dependency "minitest", "~> 5.0"
|
|
22
21
|
spec.add_development_dependency "minitest-reporters", "~> 1.3", ">= 1.3.6"
|
|
23
|
-
spec.add_development_dependency "rake", "~>
|
|
24
|
-
spec.add_development_dependency "vcr", "~>
|
|
22
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
|
23
|
+
spec.add_development_dependency "vcr", "~> 6.0"
|
|
25
24
|
spec.add_development_dependency "webmock", "~> 3.5", ">= 3.5.1"
|
|
26
25
|
end
|
data/lib/epok/api.rb
CHANGED
|
@@ -3,22 +3,25 @@ require "json"
|
|
|
3
3
|
|
|
4
4
|
module Epok
|
|
5
5
|
class API
|
|
6
|
-
BASE_URL = "epok.buenosaires.gob.ar"
|
|
6
|
+
BASE_URL = "https://epok.buenosaires.gob.ar".freeze
|
|
7
7
|
|
|
8
8
|
def self.object(id)
|
|
9
|
-
|
|
10
|
-
JSON.parse(response.body)
|
|
9
|
+
JSON.parse(get("/getObjectContent/?id=#{id}"))
|
|
11
10
|
end
|
|
12
11
|
|
|
13
12
|
def self.search(query)
|
|
14
|
-
|
|
15
|
-
JSON.parse(response.body)["instancias"]
|
|
13
|
+
JSON.parse(get("/buscar/?texto=#{query}"))["instancias"]
|
|
16
14
|
end
|
|
17
15
|
|
|
18
16
|
def self.geocoder(x, y, categories)
|
|
19
|
-
|
|
20
|
-
"/reverseGeocoderLugares/?x=#{x}&y=#{y}&categorias=#{categories}&radio=500"
|
|
21
|
-
|
|
17
|
+
JSON.parse(get(
|
|
18
|
+
"/reverseGeocoderLugares/?x=#{x}&y=#{y}&categorias=#{categories}&radio=500"
|
|
19
|
+
))["instancias"]
|
|
22
20
|
end
|
|
21
|
+
|
|
22
|
+
def self.get(path)
|
|
23
|
+
Net::HTTP.get_response(URI("#{BASE_URL}#{path}")).body
|
|
24
|
+
end
|
|
25
|
+
private_class_method :get
|
|
23
26
|
end
|
|
24
27
|
end
|
data/lib/epok/object.rb
CHANGED
|
@@ -17,6 +17,7 @@ module Epok
|
|
|
17
17
|
def content
|
|
18
18
|
object["contenido"].each_with_object({}) do |entry, hash|
|
|
19
19
|
name, value = entry.values_at("nombre", "valor")
|
|
20
|
+
value = value.strip
|
|
20
21
|
hash[name] = value unless value.empty?
|
|
21
22
|
end
|
|
22
23
|
end
|
|
@@ -24,7 +25,7 @@ module Epok
|
|
|
24
25
|
private
|
|
25
26
|
|
|
26
27
|
def object
|
|
27
|
-
API.object(id)
|
|
28
|
+
@object ||= API.object(id)
|
|
28
29
|
end
|
|
29
30
|
end
|
|
30
31
|
end
|
data/lib/epok/version.rb
CHANGED
data/test/epok/object_test.rb
CHANGED
|
@@ -11,22 +11,26 @@ module Epok
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def test_that_an_object_has_a_name
|
|
14
|
-
assert_equal "
|
|
14
|
+
assert_equal "BIBLIOTECA ANMAT", object.name
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def test_that_an_object_has_a_normalized_address
|
|
18
|
-
assert_equal "
|
|
18
|
+
assert_equal "DE MAYO AV. 869", object.normalized_address
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def test_that_an_object_has_content
|
|
22
22
|
expected_content = {
|
|
23
|
-
"Nombre" => "
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
23
|
+
"Nombre" => "BIBLIOTECA ANMAT",
|
|
24
|
+
"Categoria" => "BIBLIOTECA",
|
|
25
|
+
"Subcategoria" => "ESPECIALIZADA GUBERNAMENTAL",
|
|
26
|
+
"Teléfonos" => "54.011 4340-0800 INT. 1047 FAX 54.011 4340-0800 INT. 1048",
|
|
27
|
+
"E-Mail" => "<a href=\"mailto:NDURAND@ANMAT.GOV.AR\">NDURAND@ANMAT.GOV.AR</a>",
|
|
28
|
+
"Página WEB" => "<a href=\"http://WWW.ANMAT.GOV.AR\" target=\"_blank\">WWW.ANMAT.GOV.AR</a>",
|
|
29
|
+
"Dependencia" => "ADMINISTRACION NACIONAL DE MEDICAMENTOS Y TECNOLOGIA MEDICA ANMAT",
|
|
30
|
+
"Sector" => "PUBLICO",
|
|
31
|
+
"Dirección" => "DE MAYO AV. 869",
|
|
32
|
+
"Barrio" => "MONSERRAT",
|
|
33
|
+
"Comuna" => "Comuna 1"
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
assert_equal expected_content, object.content
|
data/test/epok_test.rb
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
require "test_helper"
|
|
2
2
|
|
|
3
3
|
class EpokTest < Minitest::Test
|
|
4
|
-
def
|
|
5
|
-
|
|
6
|
-
end
|
|
4
|
+
def test_that_search_builds_a_search
|
|
5
|
+
search = Epok.search("garicoits")
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
assert_instance_of Epok::Search, search
|
|
8
|
+
assert_equal "garicoits", search.query
|
|
10
9
|
end
|
|
11
10
|
|
|
12
|
-
def
|
|
13
|
-
|
|
11
|
+
def test_that_geocoder_builds_a_geocoder
|
|
12
|
+
obelisco = Epok::Location.new(x: -58.381570, y: -34.603738)
|
|
13
|
+
geocoder = Epok.geocoder(obelisco, "farmacias")
|
|
14
|
+
|
|
15
|
+
assert_instance_of Epok::Geocoder, geocoder
|
|
16
|
+
assert_equal(-58.381570, geocoder.x)
|
|
17
|
+
assert_equal(-34.603738, geocoder.y)
|
|
18
|
+
assert_equal "farmacias", geocoder.categories
|
|
14
19
|
end
|
|
15
20
|
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,29 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: epok
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ariel Rzezak
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: bundler
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '1.17'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '1.17'
|
|
27
12
|
- !ruby/object:Gem::Dependency
|
|
28
13
|
name: minitest
|
|
29
14
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -64,28 +49,28 @@ dependencies:
|
|
|
64
49
|
requirements:
|
|
65
50
|
- - "~>"
|
|
66
51
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: '
|
|
52
|
+
version: '13.0'
|
|
68
53
|
type: :development
|
|
69
54
|
prerelease: false
|
|
70
55
|
version_requirements: !ruby/object:Gem::Requirement
|
|
71
56
|
requirements:
|
|
72
57
|
- - "~>"
|
|
73
58
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: '
|
|
59
|
+
version: '13.0'
|
|
75
60
|
- !ruby/object:Gem::Dependency
|
|
76
61
|
name: vcr
|
|
77
62
|
requirement: !ruby/object:Gem::Requirement
|
|
78
63
|
requirements:
|
|
79
64
|
- - "~>"
|
|
80
65
|
- !ruby/object:Gem::Version
|
|
81
|
-
version: '
|
|
66
|
+
version: '6.0'
|
|
82
67
|
type: :development
|
|
83
68
|
prerelease: false
|
|
84
69
|
version_requirements: !ruby/object:Gem::Requirement
|
|
85
70
|
requirements:
|
|
86
71
|
- - "~>"
|
|
87
72
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: '
|
|
73
|
+
version: '6.0'
|
|
89
74
|
- !ruby/object:Gem::Dependency
|
|
90
75
|
name: webmock
|
|
91
76
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -113,7 +98,9 @@ executables: []
|
|
|
113
98
|
extensions: []
|
|
114
99
|
extra_rdoc_files: []
|
|
115
100
|
files:
|
|
101
|
+
- ".claude/skills/swarf/SKILL.md"
|
|
116
102
|
- ".gitignore"
|
|
103
|
+
- CLAUDE.md
|
|
117
104
|
- CODE_OF_CONDUCT.md
|
|
118
105
|
- Gemfile
|
|
119
106
|
- Gemfile.lock
|
|
@@ -140,7 +127,6 @@ homepage: https://github.com/arzezak/epok
|
|
|
140
127
|
licenses:
|
|
141
128
|
- MIT
|
|
142
129
|
metadata: {}
|
|
143
|
-
post_install_message:
|
|
144
130
|
rdoc_options: []
|
|
145
131
|
require_paths:
|
|
146
132
|
- lib
|
|
@@ -155,8 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
155
141
|
- !ruby/object:Gem::Version
|
|
156
142
|
version: '0'
|
|
157
143
|
requirements: []
|
|
158
|
-
rubygems_version:
|
|
159
|
-
signing_key:
|
|
144
|
+
rubygems_version: 4.0.20
|
|
160
145
|
specification_version: 4
|
|
161
146
|
summary: GCBA EPOk wrapper.
|
|
162
147
|
test_files: []
|