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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 620108deec179ffaf691b2ff6f81495405cf0fa2
4
- data.tar.gz: 0a5465d39e4ae3acf50061a6f98e1b4d4a19742e
2
+ SHA256:
3
+ metadata.gz: ce6ef8a476ec70271087f82f592a137c29286089f748cfc8ee8877c9655c5d16
4
+ data.tar.gz: 40770fec8dbd2dc0502b098db9fa9018f02c2ae55c2b6febc519200a152c96d8
5
5
  SHA512:
6
- metadata.gz: e1d9f0e3655edc3d5dfbd85acb490ab6c8e7b13b64b626eccc7c25783a40a7b9fa54c6afbd8d8546bf316bc5e590071e0af3de40c1c0616a71671573b8942d2d
7
- data.tar.gz: fc8e67901755723eb5d2c4d3b948d7b789f6685d414593634a837735f5d212b12dc22193ab0b2bd770a5e77dd6ded19ccd22dcfb4209d6b828366d0fc5f11b20
6
+ metadata.gz: d8e3cf72886b7c0b93ded33bf851f5341f19aaa45da4f9f2a8c0a201689581cbead8d6a03bfaf5345ee44323b6593ce547b775d3a942fb8324422a318527ea26
7
+ data.tar.gz: 3dd6dd41b7a4c7843ad506c228680f5c3220edab78a3a8304044c5654721583c1a242499783c5b48379a0a588da850bc6623ba65208ec4635f7a97cd9a20eb3d
@@ -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
- [travis]: http://travis-ci.org/peter-murach/equatable
5
- [codeclimate]: https://codeclimate.com/github/peter-murach/equatable
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. Howerver, 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.
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-2014 Piotr Murach. See LICENSE for further details.
108
+ Copyright (c) 2012 Piotr Murach. See LICENSE for further details.
@@ -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 |gem|
7
- gem.name = "equatable"
8
- gem.version = Equatable::VERSION
9
- gem.authors = ["Piotr Murach"]
10
- gem.email = [""]
11
- gem.description = %q{Allows ruby objects to implement 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
- gem.summary = %q{Allows ruby objects to implement equality comparison and inspection methods.}
13
- gem.homepage = "http://github.com/peter-murach/equatable"
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
- gem.files = `git ls-files`.split($/)
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
- gem.add_development_dependency "bundler", "~> 1.5"
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
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'equatable/version'
4
4
 
@@ -1,5 +1,5 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
3
  module Equatable
4
- VERSION = '0.5.0'
4
+ VERSION = '0.6.0'
5
5
  end
@@ -1,8 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
4
-
5
- describe Equatable, '#eql?' do
3
+ RSpec.describe Equatable, '#eql?' do
6
4
  let(:name) { 'Value' }
7
5
  let(:value) { 11 }
8
6
 
@@ -1,8 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
4
-
5
- describe Equatable, '#==' do
3
+ RSpec.describe Equatable, '#==' do
6
4
  let(:name) { 'Value' }
7
5
  let(:value) { 11 }
8
6
 
@@ -1,8 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
4
-
5
- describe Equatable, '#include' do
3
+ RSpec.describe Equatable, '#include' do
6
4
  let(:name) { 'Value' }
7
5
  let(:object) { described_class }
8
6
 
@@ -1,8 +1,6 @@
1
- # encoding: utf-8
1
+ # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
4
-
5
- describe Equatable, 'subclass' do
3
+ RSpec.describe Equatable, 'subclass' do
6
4
  let(:name) { 'Value' }
7
5
 
8
6
  context 'when subclass' do
@@ -1,10 +1,45 @@
1
- # encoding: utf-8
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.run_all_when_everything_filtered = true
7
- config.filter_run :focus
8
- config.order = 'random'
9
- config.raise_errors_for_deprecations!
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
@@ -0,0 +1,9 @@
1
+ desc 'Load gem inside irb console'
2
+ task :console do
3
+ require 'irb'
4
+ require 'irb/completion'
5
+ require File.join(__FILE__, '../../lib/equatable')
6
+ ARGV.clear
7
+ IRB.start
8
+ end
9
+ task :c => %w[ console ]
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+
3
+ desc 'Measure code coverage'
4
+ task :coverage do
5
+ begin
6
+ original, ENV['COVERAGE'] = ENV['COVERAGE'], 'true'
7
+ Rake::Task['spec'].invoke
8
+ ensure
9
+ ENV['COVERAGE'] = original
10
+ end
11
+ end
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.5.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: 2014-09-13 00:00:00.000000000 Z
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: '1.5'
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: '1.5'
27
- description: Allows ruby objects to implement equality comparison and inspection methods.
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
- - .gitignore
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: http://github.com/peter-murach/equatable
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: '0'
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
- rubyforge_project:
74
- rubygems_version: 2.0.3
104
+ rubygems_version: 3.0.3
75
105
  signing_key:
76
106
  specification_version: 4
77
- summary: Allows ruby objects to implement equality comparison and inspection methods.
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
@@ -1,18 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- *.sw*
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --color
2
- --format documentation
@@ -1 +0,0 @@
1
- equatable
@@ -1 +0,0 @@
1
- 2.0.0
@@ -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
data/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
-
5
- group :development do
6
- gem 'rake', '~> 10.3.2'
7
- gem 'rspec', '~> 3.1.0'
8
- gem 'yard', '~> 0.8.7'
9
- end