loc 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +3 -3
- data/lib/loc/location.rb +3 -0
- data/lib/loc/location_collection.rb +1 -4
- data/lib/loc/version.rb +1 -1
- data/spec/loc/location_collection_spec.rb +5 -0
- data/spec/loc/location_spec.rb +4 -0
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3046a955943f2a3a16277c374c3ab62a8ed76113c3f7600fb910b0ad36e206d8
|
4
|
+
data.tar.gz: 6c17b5382025ff3fb629f350e34d784797bac3c53850acab21bf9c93d439ab3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7410af545d100fb095a81cb6ad722d583f814500646eae92c3ec559408eb80b4db4aa6a64ea51ae32c5dde09f22acb3fd8c11f680b572dbbed50f40fc509fb3
|
7
|
+
data.tar.gz: 78cf10f26447c6d0f443f32076bfff542fd83904c5b6581e1b974d12e1b9fe6942543f28922ff306818c549c43bb12f6097d879bc30aa26de320a4fa975528aa
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Loc
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/loc.svg)](https://badge.fury.io/rb/loc)
|
4
|
-
[![CircleCI](https://circleci.com/gh/
|
4
|
+
[![CircleCI](https://circleci.com/gh/klaxit/loc.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/klaxit/loc)
|
5
5
|
|
6
6
|
Location handling & geographical computations. No external API or DB.
|
7
7
|
|
@@ -63,11 +63,11 @@ collection.map(&:to_a)
|
|
63
63
|
|
64
64
|
## Versioning
|
65
65
|
|
66
|
-
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/
|
66
|
+
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/klaxit/loc/tags).
|
67
67
|
|
68
68
|
## Authors
|
69
69
|
|
70
|
-
See the list of [contributors](https://github.com/
|
70
|
+
See the list of [contributors](https://github.com/klaxit/loc/contributors) who participated in this project.
|
71
71
|
|
72
72
|
## License
|
73
73
|
|
data/lib/loc/location.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
module Loc
|
2
2
|
class Location
|
3
|
+
|
3
4
|
attr_reader :lat, :lng
|
4
5
|
|
5
6
|
def initialize(lat, lng)
|
7
|
+
raise(TypeError, "lat should be a Numeric.") unless lat.is_a?(Numeric)
|
8
|
+
raise(TypeError, "lng should be a Numeric.") unless lng.is_a?(Numeric)
|
6
9
|
@lat = lat
|
7
10
|
@lng = lng
|
8
11
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module Loc
|
2
2
|
class LocationCollection
|
3
|
+
include Enumerable
|
3
4
|
attr_reader :locations
|
4
5
|
|
5
6
|
def initialize(locations = [])
|
@@ -39,10 +40,6 @@ module Loc
|
|
39
40
|
locations.each(&block)
|
40
41
|
end
|
41
42
|
|
42
|
-
def map
|
43
|
-
locations.map { |l| yield l }
|
44
|
-
end
|
45
|
-
|
46
43
|
def shift
|
47
44
|
locations.shift
|
48
45
|
end
|
data/lib/loc/version.rb
CHANGED
@@ -35,6 +35,11 @@ describe Loc::LocationCollection do
|
|
35
35
|
expect(collection_1).to_not eq collection_3
|
36
36
|
end
|
37
37
|
|
38
|
+
it "should be enumerable" do
|
39
|
+
expect(subject).to be_a Enumerable
|
40
|
+
expect(subject).to respond_to :each_cons
|
41
|
+
end
|
42
|
+
|
38
43
|
describe "#size" do
|
39
44
|
it "should give location collection size" do
|
40
45
|
collection = described_class.new(
|
data/spec/loc/location_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyrille Courtière
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
version: '9.0'
|
41
41
|
description:
|
42
42
|
email:
|
43
|
-
- cyrille@
|
43
|
+
- cyrille@klaxit.com
|
44
44
|
executables: []
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
@@ -53,7 +53,7 @@ files:
|
|
53
53
|
- spec/loc/location_collection_spec.rb
|
54
54
|
- spec/loc/location_spec.rb
|
55
55
|
- spec/spec_helper.rb
|
56
|
-
homepage:
|
56
|
+
homepage: https://github.com/klaxit/loc
|
57
57
|
licenses:
|
58
58
|
- MIT
|
59
59
|
metadata: {}
|
@@ -72,8 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: '0'
|
74
74
|
requirements: []
|
75
|
-
|
76
|
-
rubygems_version: 2.6.8
|
75
|
+
rubygems_version: 3.0.2
|
77
76
|
signing_key:
|
78
77
|
specification_version: 4
|
79
78
|
summary: Location handling & geographical computations
|