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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 372cb2c5d886cc5369727d21a6e7a731fab38957
4
- data.tar.gz: 29e686c1057bb8b7a10a0ac25848ffce3827404c
2
+ SHA256:
3
+ metadata.gz: 3046a955943f2a3a16277c374c3ab62a8ed76113c3f7600fb910b0ad36e206d8
4
+ data.tar.gz: 6c17b5382025ff3fb629f350e34d784797bac3c53850acab21bf9c93d439ab3f
5
5
  SHA512:
6
- metadata.gz: cf63d7d19c2cfa2964a7c0fd319af6648febb9343a2e395130f1bb0003da7d2e6371828ddef14bf26af4de152841c41f325d8490752ca6eebd6a1d9e7038aa5c
7
- data.tar.gz: 27819b8ac2f6bd74541332cfabf551083fe9a6d62a69b9caca7d0737757b30cf009326b2c5abea28188efae5072a31adce3bea451a9da9c43f09d4636e773b11
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/wayzup/loc.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/wayzup/loc)
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/wayzup/loc/tags).
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/wayzup/loc/contributors) who participated in this project.
70
+ See the list of [contributors](https://github.com/klaxit/loc/contributors) who participated in this project.
71
71
 
72
72
  ## License
73
73
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Loc
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.1.1".freeze
3
3
  end
@@ -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(
@@ -64,4 +64,8 @@ describe Loc::Location do
64
64
  loc = described_class.new(1, 2)
65
65
  expect(loc.to_a).to eq([1, 2])
66
66
  end
67
+
68
+ it "can't be created from strings" do
69
+ expect { described_class.new("1", "2") }.to raise_error TypeError
70
+ end
67
71
  end
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.0
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: 2017-07-07 00:00:00.000000000 Z
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@wayzup.com
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: http://github.com/wayzup/loc
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
- rubyforge_project:
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