clumpy 0.2.8 → 1.0.0

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
2
  SHA1:
3
- metadata.gz: ce75704d0ea6206400894e839761b6f197744611
4
- data.tar.gz: 3899b14908360a9e0684779227d8ca2fb8afb285
3
+ metadata.gz: c54e552fb799c83627510c3743f36d36682a955f
4
+ data.tar.gz: b153298fb72ae0ad278fce078aa85a52c9b18f5a
5
5
  SHA512:
6
- metadata.gz: 88e903aadf9e0be90f390de1d155ca446cd5c6bfe86abb320dbebe6a5c74580092ac6c96a967c4aa633c02d1d02f487d5fd4c214769f3cbf97f155d1b7de424a
7
- data.tar.gz: d1143e3bc8bb6c1eff28b2949a3da92e72b650c3d7f0d01278c32c0e0eaee8135c55f9eb8875187710ee363900409756cb575e923a0bcc92e650c9b6b7c98905
6
+ metadata.gz: 41ce0b359bdef855b1674e50eebb1798be6f5245446b8686a4bb8f7deb1e9a4311a33fbb3892b060297698591059686cd34bf465ea761c783d0e6797402a5fb3
7
+ data.tar.gz: afa4c35a0d83673e7de4daa6bd7025d257c9707b40a94356236d890b3084baa43f1bb9580f3e741911cefcaa2ca20ac9dab6aaa526b7e86ce66b7a25b6445434
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -1 +1 @@
1
- ruby-2.1.2
1
+ 2.1.4
@@ -0,0 +1,3 @@
1
+ # 1.0.0
2
+ ## 2014-10-30
3
+ - Remove hit extensions, please provide a matching interface for hits by your own.
data/README.md CHANGED
@@ -15,7 +15,7 @@ As part of the Gemfile or by hand, nothing unusual here.
15
15
 
16
16
  Clumpy takes points, typically geocoordinates, and puts them together into clusters.
17
17
 
18
- It requires the given points to be ruby objects, responding to `latitude` and `longitude` methods.
18
+ It requires the given points to be ruby objects, responding to `#latitude` and `#longitude` methods.
19
19
 
20
20
  ```ruby
21
21
  require 'ostruct'
@@ -3,8 +3,6 @@ require "clumpy/version"
3
3
  require "clumpy/cluster_behavior"
4
4
  require "clumpy/cluster"
5
5
  require "clumpy/builder"
6
- require "clumpy/extensions/sunspot_hit"
7
- require "clumpy/extensions/chewy_hit"
8
6
  require "clumpy/bounds"
9
7
 
10
8
  module Clumpy
@@ -1,3 +1,3 @@
1
1
  module Clumpy
2
- VERSION = '0.2.8'
2
+ VERSION = '1.0.0'
3
3
  end
@@ -50,11 +50,11 @@ describe Clumpy::ClusterBehavior do
50
50
 
51
51
  context "#contains" do
52
52
  it "returns true if the given point is within the bounds" do
53
- cluster.contains?(point).should be_true
53
+ cluster.contains?(point).should eq true
54
54
  end
55
55
 
56
56
  it "returns false for a points that isn't contained" do
57
- cluster.contains?(other_point).should be_false
57
+ cluster.contains?(other_point).should eq false
58
58
  end
59
59
  end
60
60
  end
@@ -9,7 +9,3 @@ SimpleCov.start 'gem'
9
9
 
10
10
  require 'clumpy'
11
11
  require 'ostruct'
12
-
13
- RSpec.configure do |config|
14
- config.color_enabled = true
15
- end
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clumpy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Opper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-27 00:00:00.000000000 Z
11
+ date: 2014-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: simplecov
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Cluster points e.g. for a map
@@ -73,9 +73,11 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
77
- - .ruby-gemset
78
- - .ruby-version
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - ".ruby-gemset"
79
+ - ".ruby-version"
80
+ - CHANGELOG.md
79
81
  - Gemfile
80
82
  - LICENSE.txt
81
83
  - README.md
@@ -86,12 +88,9 @@ files:
86
88
  - lib/clumpy/builder.rb
87
89
  - lib/clumpy/cluster.rb
88
90
  - lib/clumpy/cluster_behavior.rb
89
- - lib/clumpy/extensions/chewy_hit.rb
90
- - lib/clumpy/extensions/sunspot_hit.rb
91
91
  - lib/clumpy/version.rb
92
92
  - spec/builder_spec.rb
93
93
  - spec/cluster_behavior_spec.rb
94
- - spec/extensions/sunspot_hit_spec.rb
95
94
  - spec/spec_helper.rb
96
95
  homepage: http://github.com/xijo/clumpy
97
96
  licenses:
@@ -103,12 +102,12 @@ require_paths:
103
102
  - lib
104
103
  required_ruby_version: !ruby/object:Gem::Requirement
105
104
  requirements:
106
- - - '>='
105
+ - - ">="
107
106
  - !ruby/object:Gem::Version
108
107
  version: '0'
109
108
  required_rubygems_version: !ruby/object:Gem::Requirement
110
109
  requirements:
111
- - - '>='
110
+ - - ">="
112
111
  - !ruby/object:Gem::Version
113
112
  version: '0'
114
113
  requirements: []
@@ -120,5 +119,4 @@ summary: Cluster a bunch of points
120
119
  test_files:
121
120
  - spec/builder_spec.rb
122
121
  - spec/cluster_behavior_spec.rb
123
- - spec/extensions/sunspot_hit_spec.rb
124
122
  - spec/spec_helper.rb
@@ -1,20 +0,0 @@
1
- module Clumpy
2
- module Extensions
3
- module ChewyHit
4
- def latitude
5
- @latitude ||= _source.lat.to_f
6
- end
7
-
8
- def longitude
9
- @longitude ||= _source.lng.to_f
10
- end
11
-
12
- def as_json(*)
13
- {
14
- id: _source.id,
15
- type: _source.full?(:type) || type.classify
16
- }
17
- end
18
- end
19
- end
20
- end
@@ -1,20 +0,0 @@
1
- module Clumpy
2
- module Extensions
3
- module SunspotHit
4
- def latitude
5
- @latitude ||= stored(:lat)
6
- end
7
-
8
- def longitude
9
- @longitude ||= stored(:lng)
10
- end
11
-
12
- def as_json(*)
13
- {
14
- id: primary_key,
15
- type: class_name
16
- }
17
- end
18
- end
19
- end
20
- end
@@ -1,36 +0,0 @@
1
- require 'spec_helper'
2
-
3
- class Hit
4
- def primary_key
5
- :foo
6
- end
7
-
8
- def class_name
9
- 'Foo'
10
- end
11
-
12
- def stored(key)
13
- key
14
- end
15
- end
16
-
17
- describe Clumpy::Extensions::SunspotHit do
18
- let(:hit) { Hit.new }
19
- let(:extended_hit) { Hit.new.extend(Clumpy::Extensions::SunspotHit) }
20
-
21
- it "adds #latitude method" do
22
- hit.should_not respond_to :latitude
23
- extended_hit.should respond_to :latitude
24
- extended_hit.latitude.should eq :lat
25
- end
26
-
27
- it "adds #longitude method" do
28
- hit.should_not respond_to :longitude
29
- extended_hit.should respond_to :longitude
30
- extended_hit.longitude.should eq :lng
31
- end
32
-
33
- it "overrides as_json to return minimal representation" do
34
- extended_hit.as_json.should eq({ id: :foo, type: 'Foo' })
35
- end
36
- end