equatable 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +21 -0
- data/README.md +15 -5
- data/equatable.gemspec +26 -14
- data/lib/equatable.rb +1 -1
- data/lib/equatable/version.rb +2 -2
- data/spec/equatable/eql_spec.rb +2 -4
- data/spec/equatable/equal_spec.rb +2 -4
- data/spec/equatable/include_spec.rb +2 -4
- data/spec/equatable/subclass_spec.rb +2 -4
- data/spec/spec_helper.rb +40 -5
- data/tasks/console.rake +9 -0
- data/tasks/coverage.rake +11 -0
- metadata +53 -29
- data/.gitignore +0 -18
- data/.rspec +0 -2
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/.travis.yml +0 -32
- data/Gemfile +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ce6ef8a476ec70271087f82f592a137c29286089f748cfc8ee8877c9655c5d16
|
4
|
+
data.tar.gz: 40770fec8dbd2dc0502b098db9fa9018f02c2ae55c2b6febc519200a152c96d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d8e3cf72886b7c0b93ded33bf851f5341f19aaa45da4f9f2a8c0a201689581cbead8d6a03bfaf5345ee44323b6593ce547b775d3a942fb8324422a318527ea26
|
7
|
+
data.tar.gz: 3dd6dd41b7a4c7843ad506c228680f5c3220edab78a3a8304044c5654721583c1a242499783c5b48379a0a588da850bc6623ba65208ec4635f7a97cd9a20eb3d
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Change log
|
2
|
+
|
3
|
+
## [v0.6.0] - 2019-06-16
|
4
|
+
|
5
|
+
### Added
|
6
|
+
* Add dev dependencies to gemspec
|
7
|
+
|
8
|
+
### Changed
|
9
|
+
* Change to limit Ruby >= 1.8.7
|
10
|
+
* Change gemspec to load files directly instead of git
|
11
|
+
|
12
|
+
## [v0.1.0] - 2012-12-09
|
13
|
+
|
14
|
+
* Initial implementation and release
|
15
|
+
|
16
|
+
[v0.6.0]: https://github.com/piotrmurach/equatable/compare/v0.5.0...v0.6.0
|
17
|
+
[v0.5.0]: https://github.com/piotrmurach/equatable/compare/v0.4.0...v0.5.0
|
18
|
+
[v0.4.0]: https://github.com/piotrmurach/equatable/compare/v0.3.0...v0.4.0
|
19
|
+
[v0.3.0]: https://github.com/piotrmurach/equatable/compare/v0.2.0...v0.3.0
|
20
|
+
[v0.2.0]: https://github.com/piotrmurach/equatable/compare/v0.1.0...v0.2.0
|
21
|
+
[v0.1.0]: https://github.com/piotrmurach/equatable/compare/v0.1.0
|
data/README.md
CHANGED
@@ -1,12 +1,22 @@
|
|
1
1
|
# Equatable
|
2
|
-
[![Gem Version](https://badge.fury.io/rb/equatable.png)](http://badge.fury.io/rb/equatable) [![Build Status](https://secure.travis-ci.org/peter-murach/equatable.png?branch=master)][travis] [![Code Climate](https://codeclimate.com/github/peter-murach/equatable.png)][codeclimate]
|
3
2
|
|
4
|
-
[
|
5
|
-
[
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/equatable.svg)][gem]
|
4
|
+
[![Build Status](https://secure.travis-ci.org/piotrmurach/equatable.svg?branch=master)][travis]
|
5
|
+
[![Build status](https://ci.appveyor.com/api/projects/status/lsb02nm0g4c6guiu?svg=true)][appveyor]
|
6
|
+
[![Code Climate](https://codeclimate.com/github/piotrmurach/equatable/badges/gpa.svg)][codeclimate]
|
7
|
+
[![Coverage Status](https://coveralls.io/repos/github/piotrmurach/equatable/badge.svg)][coverage]
|
8
|
+
[![Inline docs](http://inch-ci.org/github/piotrmurach/equatable.svg?branch=master)][inchpages]
|
9
|
+
|
10
|
+
[gem]: http://badge.fury.io/rb/equatable
|
11
|
+
[travis]: http://travis-ci.org/piotrmurach/equatable
|
12
|
+
[appveyor]: https://ci.appveyor.com/project/piotrmurach/equatable
|
13
|
+
[codeclimate]: https://codeclimate.com/github/piotrmurach/equatable
|
14
|
+
[coverage]: https://coveralls.io/github/piotrmurach/equatable
|
15
|
+
[inchpages]: http://inch-ci.org/github/piotrmurach/equatable
|
6
16
|
|
7
17
|
Allows ruby objects to implement equality comparison and inspection methods.
|
8
18
|
|
9
|
-
By including this module, a class indicates that its instances have explicit general contracts for `hash`, `==` and `eql?` methods. Specifically `eql?` contract requires that it implements an equivalence relation. By default each instance of the class is equal only to itself. This is a right behaviour when you have distinct objects.
|
19
|
+
By including this module, a class indicates that its instances have explicit general contracts for `hash`, `==` and `eql?` methods. Specifically `eql?` contract requires that it implements an equivalence relation. By default each instance of the class is equal only to itself. This is a right behaviour when you have distinct objects. However, it is the responsibility of any class to clearly define their equality. Failure to do so may prevent instances to behave as expected when for instance `Array#uniq` is invoked or when they are used as `Hash` keys.
|
10
20
|
|
11
21
|
## Installation
|
12
22
|
|
@@ -95,4 +105,4 @@ The `ColorPoint` class demonstrates that extending a class with extra value prop
|
|
95
105
|
|
96
106
|
## Copyright
|
97
107
|
|
98
|
-
Copyright (c) 2012
|
108
|
+
Copyright (c) 2012 Piotr Murach. See LICENSE for further details.
|
data/equatable.gemspec
CHANGED
@@ -1,21 +1,33 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
1
|
lib = File.expand_path('../lib', __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'equatable/version'
|
5
4
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "equatable"
|
7
|
+
spec.version = Equatable::VERSION
|
8
|
+
spec.authors = ["Piotr Murach"]
|
9
|
+
spec.email = ["me@piotrmurach.com"]
|
10
|
+
spec.summary = %q{Extends Ruby objects with equality comparison and inspection methods.}
|
11
|
+
spec.description = %q{Extends Ruby objects with equality comparison and inspection methods. By including this module, a class indicates that its instances have explicit general contracts for `hash`, `==` and `eql?` methods.}
|
12
|
+
spec.homepage = "https://github.com/piotrmurach/equatable"
|
13
|
+
if spec.respond_to?(:metadata=)
|
14
|
+
spec.metadata = {
|
15
|
+
"allowed_push_host" => "https://rubygems.org",
|
16
|
+
"bug_tracker_uri" => "#{spec.homepage}/issues",
|
17
|
+
"changelog_uri" => "#{spec.homepage}/blob/master/CHANGELOG.md",
|
18
|
+
"documentation_uri" => "https://www.rubydoc.info/gems/equatable",
|
19
|
+
"homepage_uri" => spec.homepage,
|
20
|
+
"source_code_uri" => spec.homepage
|
21
|
+
}
|
22
|
+
end
|
23
|
+
spec.files = Dir['{lib,spec,examples}/**/*.rb']
|
24
|
+
spec.files += Dir['tasks/*', 'equatable.gemspec']
|
25
|
+
spec.files += Dir['README.md', 'CHANGELOG.md', 'LICENSE.txt', 'Rakefile']
|
26
|
+
spec.require_paths = ["lib"]
|
14
27
|
|
15
|
-
|
16
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
-
gem.require_paths = ["lib"]
|
28
|
+
spec.required_ruby_version = '>= 1.8.7'
|
19
29
|
|
20
|
-
|
30
|
+
spec.add_development_dependency 'bundler', '>= 1.5.0'
|
31
|
+
spec.add_development_dependency 'rspec', '~> 3.1'
|
32
|
+
spec.add_development_dependency 'rake'
|
21
33
|
end
|
data/lib/equatable.rb
CHANGED
data/lib/equatable/version.rb
CHANGED
data/spec/equatable/eql_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,10 +1,45 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
if RUBY_VERSION > '1.9' and (ENV['COVERAGE'] || ENV['TRAVIS'])
|
4
|
+
require 'simplecov'
|
5
|
+
require 'coveralls'
|
6
|
+
|
7
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
8
|
+
SimpleCov::Formatter::HTMLFormatter,
|
9
|
+
Coveralls::SimpleCov::Formatter
|
10
|
+
]
|
11
|
+
|
12
|
+
SimpleCov.start do
|
13
|
+
command_name 'spec'
|
14
|
+
add_filter 'spec'
|
15
|
+
end
|
16
|
+
end
|
2
17
|
|
3
18
|
require 'equatable'
|
4
19
|
|
5
20
|
RSpec.configure do |config|
|
6
|
-
config.
|
7
|
-
|
8
|
-
|
9
|
-
|
21
|
+
config.expect_with :rspec do |expectations|
|
22
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
23
|
+
end
|
24
|
+
|
25
|
+
config.mock_with :rspec do |mocks|
|
26
|
+
mocks.verify_partial_doubles = true
|
27
|
+
end
|
28
|
+
|
29
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
30
|
+
config.disable_monkey_patching!
|
31
|
+
|
32
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
33
|
+
# be too noisy due to issues in dependencies.
|
34
|
+
config.warnings = true
|
35
|
+
|
36
|
+
if config.files_to_run.one?
|
37
|
+
config.default_formatter = 'doc'
|
38
|
+
end
|
39
|
+
|
40
|
+
config.profile_examples = 2
|
41
|
+
|
42
|
+
config.order = :random
|
43
|
+
|
44
|
+
Kernel.srand config.seed
|
10
45
|
end
|
data/tasks/console.rake
ADDED
data/tasks/coverage.rake
ADDED
metadata
CHANGED
@@ -1,44 +1,67 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: equatable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Murach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-16 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
|
-
version:
|
19
|
+
version: 1.5.0
|
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
|
-
version:
|
27
|
-
|
26
|
+
version: 1.5.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.1'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Extends Ruby objects with equality comparison and inspection methods.
|
28
56
|
By including this module, a class indicates that its instances have explicit general
|
29
57
|
contracts for `hash`, `==` and `eql?` methods.
|
30
58
|
email:
|
31
|
-
-
|
59
|
+
- me@piotrmurach.com
|
32
60
|
executables: []
|
33
61
|
extensions: []
|
34
62
|
extra_rdoc_files: []
|
35
63
|
files:
|
36
|
-
- .
|
37
|
-
- .rspec
|
38
|
-
- .ruby-gemset
|
39
|
-
- .ruby-version
|
40
|
-
- .travis.yml
|
41
|
-
- Gemfile
|
64
|
+
- CHANGELOG.md
|
42
65
|
- LICENSE.txt
|
43
66
|
- README.md
|
44
67
|
- Rakefile
|
@@ -51,34 +74,35 @@ files:
|
|
51
74
|
- spec/equatable/include_spec.rb
|
52
75
|
- spec/equatable/subclass_spec.rb
|
53
76
|
- spec/spec_helper.rb
|
77
|
+
- tasks/console.rake
|
78
|
+
- tasks/coverage.rake
|
54
79
|
- tasks/spec.rake
|
55
|
-
homepage:
|
80
|
+
homepage: https://github.com/piotrmurach/equatable
|
56
81
|
licenses: []
|
57
|
-
metadata:
|
82
|
+
metadata:
|
83
|
+
allowed_push_host: https://rubygems.org
|
84
|
+
bug_tracker_uri: https://github.com/piotrmurach/equatable/issues
|
85
|
+
changelog_uri: https://github.com/piotrmurach/equatable/blob/master/CHANGELOG.md
|
86
|
+
documentation_uri: https://www.rubydoc.info/gems/equatable
|
87
|
+
homepage_uri: https://github.com/piotrmurach/equatable
|
88
|
+
source_code_uri: https://github.com/piotrmurach/equatable
|
58
89
|
post_install_message:
|
59
90
|
rdoc_options: []
|
60
91
|
require_paths:
|
61
92
|
- lib
|
62
93
|
required_ruby_version: !ruby/object:Gem::Requirement
|
63
94
|
requirements:
|
64
|
-
- -
|
95
|
+
- - ">="
|
65
96
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
97
|
+
version: 1.8.7
|
67
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
99
|
requirements:
|
69
|
-
- -
|
100
|
+
- - ">="
|
70
101
|
- !ruby/object:Gem::Version
|
71
102
|
version: '0'
|
72
103
|
requirements: []
|
73
|
-
|
74
|
-
rubygems_version: 2.0.3
|
104
|
+
rubygems_version: 3.0.3
|
75
105
|
signing_key:
|
76
106
|
specification_version: 4
|
77
|
-
summary:
|
78
|
-
test_files:
|
79
|
-
- spec/equatable/eql_spec.rb
|
80
|
-
- spec/equatable/equal_spec.rb
|
81
|
-
- spec/equatable/include_spec.rb
|
82
|
-
- spec/equatable/subclass_spec.rb
|
83
|
-
- spec/spec_helper.rb
|
84
|
-
has_rdoc:
|
107
|
+
summary: Extends Ruby objects with equality comparison and inspection methods.
|
108
|
+
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
equatable
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.0.0
|
data/.travis.yml
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
before_install:
|
3
|
-
- gem install bundler
|
4
|
-
script: "bundle exec rake ci"
|
5
|
-
rvm:
|
6
|
-
- 1.8.7
|
7
|
-
- 1.9.2
|
8
|
-
- 1.9.3
|
9
|
-
- 2.0.0
|
10
|
-
- 2.1.0
|
11
|
-
- ruby-head
|
12
|
-
- jruby-18mode
|
13
|
-
- jruby-19mode
|
14
|
-
- jruby-20mode
|
15
|
-
- jruby-21mode
|
16
|
-
- rbx-18mode
|
17
|
-
- rbx-19mode
|
18
|
-
- rbx-2
|
19
|
-
- jruby-head
|
20
|
-
matrix:
|
21
|
-
allow_failures:
|
22
|
-
- rvm: ruby-head
|
23
|
-
- rvm: jruby-19mode
|
24
|
-
- rvm: jruby-20mode
|
25
|
-
- rvm: jruby-21mode
|
26
|
-
- rvm: jruby-head
|
27
|
-
- rvm: rbx-18mode
|
28
|
-
- rvm: rbx-19mode
|
29
|
-
- rvm: rbx-2
|
30
|
-
fast_finish: true
|
31
|
-
branches:
|
32
|
-
only: master
|