equalizer 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZGRlOGMwM2JjYmE4MzM0Yzg0YmQxN2MwYzZmM2U3MWIzNjkxNmNkMA==
5
- data.tar.gz: !binary |-
6
- ZDVhZGIwM2U5MTdhNWYyNDZjYTlkOTY4ZTM4NzZhNzEyOTQzZGRiZQ==
2
+ SHA1:
3
+ metadata.gz: e395798ee318b7da8de8b5259ff85eca64aca178
4
+ data.tar.gz: ed52fb91d5e88f8e17dcce31953b3ce115bf201a
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- OGM3NDcwMzhjY2M3MWJjNDBlYWRjZDk4YWY4NjYyNTI1NzdiZDc3MzBiMGEz
10
- ZjAwYmJhNzgwNTg4YjU5ZmFlOTU1N2NiYjBmMWY4NmU0N2ZhOWZjZTNiNzhi
11
- ZTdiN2NjODk1YWMyNzE5OWY0ZjY2NmQ3ZjNhYjY5Yzk1NjQ5OTI=
12
- data.tar.gz: !binary |-
13
- MGM3YzJhODdkMDZhOTVmOWNkNWIzMTdhMWY1MjY5Njg1OWRmYWU5NDg5MGQw
14
- M2RmNjVmOTM4OWYzODQ0NTk5Y2I3YTViYjgwMTdmMTI3MmVlMjVlZDZmMjE0
15
- ZTc1Y2YzZGRhZWYyYTQyMWExNDJiYjY3NTljMDA5ZmIxYWVkZjI=
6
+ metadata.gz: 2eec628fe19db76bcf78f88722254ff19f80e5b50362bab177d1aec34edd527f265d89f9a2c7e536c26a55c5a12d7981d3af19bbf368717059abb0945ee7f0dc
7
+ data.tar.gz: 5e647a6611168410ede1fbc01c24f8a2dbbd422424a08ab620c2d170334c2cd9af8201a70534ab31d0e7c13dde04567f1b77a72792d9c3ef66818f2a3ec566fe
File without changes
@@ -2,9 +2,9 @@ AllCops:
2
2
  Includes:
3
3
  - '**/*.rake'
4
4
  - 'Gemfile'
5
- - 'Gemfile.devtools'
5
+ - 'Rakefile'
6
6
  Excludes:
7
- - '**/vendor/**'
7
+ - 'vendor/**'
8
8
 
9
9
  # Avoid parameter lists longer than five parameters.
10
10
  ParameterLists:
@@ -59,3 +59,11 @@ TrivialAccessors:
59
59
  # Allow empty lines around body
60
60
  EmptyLinesAroundBody:
61
61
  Enabled: false
62
+
63
+ # Enforce Ruby 1.8-compatible hash syntax
64
+ HashSyntax:
65
+ EnforcedStyle: hash_rockets
66
+
67
+ # Allow dots at the end of lines
68
+ DotPosition:
69
+ Enabled: false
@@ -1,19 +1,26 @@
1
1
  language: ruby
2
+ cache: bundler
2
3
  bundler_args: --without yard guard benchmarks
3
4
  script: "bundle exec rake ci"
4
5
  rvm:
6
+ - ree
7
+ - 1.8.7
8
+ - 1.9.2
5
9
  - 1.9.3
6
10
  - 2.0.0
7
11
  - ruby-head
8
12
  - rbx
9
13
  matrix:
10
14
  include:
15
+ - rvm: jruby-18mode
16
+ env: JRUBY_OPTS="$JRUBY_OPTS --debug" # for simplecov
11
17
  - rvm: jruby-19mode
12
- env: JRUBY_OPTS="$JRUBY_OPTS --debug"
18
+ env: JRUBY_OPTS="$JRUBY_OPTS --debug" # for simplecov
19
+ - rvm: jruby-20mode
20
+ env: JRUBY_OPTS="$JRUBY_OPTS --debug" # for simplecov
13
21
  - rvm: jruby-head
14
- env: JRUBY_OPTS="$JRUBY_OPTS --debug"
15
- allow_failures:
16
- - rvm: 2.0.0 # travis broken
22
+ env: JRUBY_OPTS="$JRUBY_OPTS --debug" # for simplecov
23
+ fast_finish: true
17
24
  notifications:
18
25
  irc:
19
26
  channels:
File without changes
data/Gemfile CHANGED
@@ -2,10 +2,27 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
- gemspec
5
+ gem 'rake'
6
+
7
+ group :test do
8
+ gem 'backports'
9
+ gem 'coveralls', :require => false
10
+ gem 'json', :platforms => [:ruby_19]
11
+ gem 'reek'
12
+ gem 'rspec', '~> 2.14'
13
+ gem 'rubocop', :platforms => [:ruby_19, :ruby_20]
14
+ gem 'simplecov', :require => false
15
+ gem 'yardstick'
16
+ end
6
17
 
7
- group :development, :test do
8
- gem 'devtools', git: 'https://github.com/rom-rb/devtools.git'
18
+ platforms :jruby, :ruby_18 do
19
+ gem 'mime-types', '~> 1.25'
9
20
  end
10
21
 
11
- eval_gemfile 'Gemfile.devtools'
22
+ platforms :rbx do
23
+ gem 'racc'
24
+ gem 'rubinius-coverage', '~> 2.0'
25
+ gem 'rubysl', '~> 2.0'
26
+ end
27
+
28
+ gemspec
data/README.md CHANGED
@@ -46,12 +46,45 @@ point_a.eql?(point_c) # => false
46
46
  point_a.equal?(point_c) # => false
47
47
  ```
48
48
 
49
+ Supported Ruby Versions
50
+ -----------------------
51
+
52
+ This library aims to support and is [tested against][travis] the following Ruby
53
+ implementations:
54
+
55
+ * Ruby 1.8.7
56
+ * Ruby 1.9.2
57
+ * Ruby 1.9.3
58
+ * Ruby 2.0.0
59
+ * [JRuby][]
60
+ * [Rubinius][]
61
+ * [Ruby Enterprise Edition][ree]
62
+
63
+ [jruby]: http://jruby.org/
64
+ [rubinius]: http://rubini.us/
65
+ [ree]: http://www.rubyenterpriseedition.com/
66
+
67
+ If something doesn't work on one of these versions, it's a bug.
68
+
69
+ This library may inadvertently work (or seem to work) on other Ruby versions or
70
+ implementations, however support will only be provided for the implementations
71
+ listed above.
72
+
73
+ If you would like this library to support another Ruby version or
74
+ implementation, you may volunteer to be a maintainer. Being a maintainer
75
+ entails making sure all tests run and pass on that implementation. When
76
+ something breaks on your implementation, you will be responsible for providing
77
+ patches in a timely fashion. If critical issues for a particular implementation
78
+ exist at the time of a major release, support for that Ruby version may be
79
+ dropped.
80
+
49
81
  Credits
50
82
  -------
51
83
 
52
84
  * Dan Kubb ([dkubb](https://github.com/dkubb))
53
85
  * Piotr Solnica ([solnic](https://github.com/solnic))
54
86
  * Markus Schirp ([mbj](https://github.com/mbj))
87
+ * Erik Michaels-Ober ([sferik](https://github.com/sferik))
55
88
 
56
89
  Contributing
57
90
  -------------
data/Rakefile CHANGED
@@ -1,2 +1,39 @@
1
- require 'devtools'
2
- Devtools.init_rake_tasks
1
+ # encoding: utf-8
2
+
3
+ require 'bundler'
4
+ Bundler::GemHelper.install_tasks
5
+
6
+ require 'rspec/core/rake_task'
7
+ RSpec::Core::RakeTask.new(:spec)
8
+
9
+ task :test => :spec
10
+ task :default => :spec
11
+
12
+ require 'reek/rake/task'
13
+ Reek::Rake::Task.new do |reek|
14
+ reek.reek_opts = '--quiet'
15
+ reek.fail_on_error = true
16
+ reek.config_files = '.reek.yml'
17
+ end
18
+
19
+ begin
20
+ require 'rubocop/rake_task'
21
+ Rubocop::RakeTask.new
22
+ rescue LoadError
23
+ desc 'Run RuboCop'
24
+ task :rubocop do
25
+ $stderr.puts 'Rubocop is disabled'
26
+ end
27
+ end
28
+
29
+ require 'yardstick/rake/measurement'
30
+ Yardstick::Rake::Measurement.new do |measurement|
31
+ measurement.output = 'measurement/report.txt'
32
+ end
33
+
34
+ require 'yardstick/rake/verify'
35
+ Yardstick::Rake::Verify.new do |verify|
36
+ verify.threshold = 100
37
+ end
38
+
39
+ task :ci => [:spec, :rubocop, :reek, :verify_measurements]
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = %w[lib]
16
16
  gem.files = `git ls-files`.split("\n")
17
17
  gem.test_files = `git ls-files -- spec/{unit,integration}`.split("\n")
18
- gem.extra_rdoc_files = %w[LICENSE README.md CONTRIBUTING.md TODO]
18
+ gem.extra_rdoc_files = %w[LICENSE README.md CONTRIBUTING.md]
19
19
 
20
20
  gem.add_development_dependency('bundler', '~> 1.3', '>= 1.3.5')
21
21
  end
@@ -53,7 +53,7 @@ private
53
53
  def define_cmp_method
54
54
  keys = @keys
55
55
  define_method(:cmp?) do |comparator, other|
56
- keys.all? { |key| send(key).public_send(comparator, other.send(key)) }
56
+ keys.all? { |key| send(key).send(comparator, other.send(key)) }
57
57
  end
58
58
  private :cmp?
59
59
  end
@@ -66,7 +66,7 @@ private
66
66
  def define_hash_method
67
67
  keys = @keys
68
68
  define_method(:hash) do ||
69
- keys.map { |key| send(key).hash }.reduce(self.class.hash, :^)
69
+ keys.map(&method(:send)).push(self.class).hash
70
70
  end
71
71
  end
72
72
 
@@ -3,6 +3,6 @@
3
3
  class Equalizer < Module
4
4
 
5
5
  # Gem version
6
- VERSION = '0.0.8'.freeze
6
+ VERSION = '0.0.9'.freeze
7
7
 
8
8
  end # class Equalizer
@@ -20,7 +20,6 @@ if ENV['COVERAGE'] == 'true'
20
20
  end
21
21
  end
22
22
 
23
- require 'devtools/spec_helper'
24
23
  require 'equalizer'
25
24
 
26
25
  # TODO: FIXME!
@@ -24,8 +24,8 @@ describe Equalizer, '.new' do
24
24
  it { should be_frozen }
25
25
 
26
26
  it 'defines #hash and #inspect methods dynamically' do
27
- expect(subject.public_instance_methods(false).map(&:to_s).sort)
28
- .to eql(%w[hash inspect])
27
+ expect(subject.public_instance_methods(false).map(&:to_s).sort).
28
+ to eql(%w[hash inspect])
29
29
  end
30
30
 
31
31
  describe '#eql?' do
@@ -61,7 +61,7 @@ describe Equalizer, '.new' do
61
61
  expect(klass.instance_method(:hash).arity).to be(0)
62
62
  end
63
63
 
64
- it { expect(instance.hash).to eql(klass.hash) }
64
+ it { expect(instance.hash).to eql([klass].hash) }
65
65
  end
66
66
 
67
67
  describe '#inspect' do
@@ -104,8 +104,8 @@ describe Equalizer, '.new' do
104
104
  it { should be_frozen }
105
105
 
106
106
  it 'defines #hash and #inspect methods dynamically' do
107
- expect(subject.public_instance_methods(false).map(&:to_s).sort)
108
- .to eql(%w[ hash inspect ])
107
+ expect(subject.public_instance_methods(false).map(&:to_s).sort).
108
+ to eql(%w[ hash inspect ])
109
109
  end
110
110
 
111
111
  describe '#eql?' do
@@ -144,15 +144,15 @@ describe Equalizer, '.new' do
144
144
 
145
145
  describe '#hash' do
146
146
  it 'returns the expected hash' do
147
- expect(instance.hash)
148
- .to eql(klass.hash ^ firstname.hash ^ lastname.hash)
147
+ expect(instance.hash).
148
+ to eql([firstname, lastname, klass].hash)
149
149
  end
150
150
  end
151
151
 
152
152
  describe '#inspect' do
153
153
  it 'returns the expected string' do
154
- expect(instance.inspect)
155
- .to eql('#<User firstname="John" lastname="Doe">')
154
+ expect(instance.inspect).
155
+ to eql('#<User firstname="John" lastname="Doe">')
156
156
  end
157
157
  end
158
158
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: equalizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Kubb
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-02 00:00:00.000000000 Z
12
+ date: 2013-12-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -18,7 +18,7 @@ dependencies:
18
18
  - - ~>
19
19
  - !ruby/object:Gem::Version
20
20
  version: '1.3'
21
- - - ! '>='
21
+ - - '>='
22
22
  - !ruby/object:Gem::Version
23
23
  version: 1.3.5
24
24
  type: :development
@@ -28,7 +28,7 @@ dependencies:
28
28
  - - ~>
29
29
  - !ruby/object:Gem::Version
30
30
  version: '1.3'
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.3.5
34
34
  description: Module to define equality, equivalence and inspection methods
@@ -41,28 +41,19 @@ extra_rdoc_files:
41
41
  - LICENSE
42
42
  - README.md
43
43
  - CONTRIBUTING.md
44
- - TODO
45
44
  files:
46
45
  - .gitignore
46
+ - .reek.yml
47
47
  - .rspec
48
+ - .rubocop.yml
48
49
  - .ruby-gemset
49
50
  - .travis.yml
51
+ - .yardstick.yml
50
52
  - CONTRIBUTING.md
51
53
  - Gemfile
52
- - Gemfile.devtools
53
- - Guardfile
54
54
  - LICENSE
55
55
  - README.md
56
56
  - Rakefile
57
- - TODO
58
- - config/devtools.yml
59
- - config/flay.yml
60
- - config/flog.yml
61
- - config/mutant.yml
62
- - config/reek.yml
63
- - config/roodi.yml
64
- - config/rubocop.yml
65
- - config/yardstick.yml
66
57
  - equalizer.gemspec
67
58
  - lib/equalizer.rb
68
59
  - lib/equalizer/version.rb
@@ -82,12 +73,12 @@ require_paths:
82
73
  - lib
83
74
  required_ruby_version: !ruby/object:Gem::Requirement
84
75
  requirements:
85
- - - ! '>='
76
+ - - '>='
86
77
  - !ruby/object:Gem::Version
87
78
  version: '0'
88
79
  required_rubygems_version: !ruby/object:Gem::Requirement
89
80
  requirements:
90
- - - ! '>='
81
+ - - '>='
91
82
  - !ruby/object:Gem::Version
92
83
  version: '0'
93
84
  requirements: []
@@ -101,4 +92,3 @@ test_files:
101
92
  - spec/unit/equalizer/methods/eql_predicate_spec.rb
102
93
  - spec/unit/equalizer/methods/equality_operator_spec.rb
103
94
  - spec/unit/equalizer/universal_spec.rb
104
- has_rdoc:
@@ -1,68 +0,0 @@
1
- # encoding: utf-8
2
-
3
- group :development do
4
- gem 'rake', '~> 10.1.0'
5
- gem 'rspec', '~> 2.14.1'
6
- gem 'yard', '~> 0.8.7'
7
-
8
- platform :rbx do
9
- gem 'rubysl-singleton', '~> 2.0.0'
10
- end
11
- end
12
-
13
- group :yard do
14
- gem 'kramdown', '~> 1.2.0'
15
- end
16
-
17
- group :guard do
18
- gem 'guard', '~> 1.8.1'
19
- gem 'guard-bundler', '~> 1.0.0'
20
- gem 'guard-rspec', '~> 3.0.2'
21
- gem 'guard-rubocop', '~> 0.2.0'
22
- gem 'guard-mutant', '~> 0.0.1'
23
-
24
- # file system change event handling
25
- gem 'listen', '~> 1.3.0'
26
- gem 'rb-fchange', '~> 0.0.6', require: false
27
- gem 'rb-fsevent', '~> 0.9.3', require: false
28
- gem 'rb-inotify', '~> 0.9.0', require: false
29
-
30
- # notification handling
31
- gem 'libnotify', '~> 0.8.0', require: false
32
- gem 'rb-notifu', '~> 0.0.4', require: false
33
- gem 'terminal-notifier-guard', '~> 1.5.3', require: false
34
- end
35
-
36
- group :metrics do
37
- gem 'coveralls', '~> 0.7.0'
38
- gem 'flay', '~> 2.4.0'
39
- gem 'flog', '~> 4.2.0'
40
- gem 'reek', '~> 1.3.2'
41
- gem 'rubocop', '~> 0.15.0'
42
- gem 'simplecov', '~> 0.8.2'
43
- gem 'yardstick', '~> 0.9.7', git: 'https://github.com/dkubb/yardstick.git'
44
-
45
- platforms :ruby_19, :ruby_20 do
46
- gem 'mutant', '~> 0.3.0.rc3', git: 'https://github.com/mbj/mutant.git'
47
- gem 'unparser', '~> 0.1.5', git: 'https://github.com/mbj/unparser.git'
48
- gem 'yard-spellcheck', '~> 0.1.5'
49
- end
50
-
51
- platform :rbx do
52
- gem 'json', '~> 1.8.1'
53
- gem 'racc', '~> 1.4.10'
54
- gem 'rubysl-logger', '~> 2.0.0'
55
- gem 'rubysl-open-uri', '~> 2.0.0'
56
- gem 'rubysl-prettyprint', '~> 2.0.2'
57
- end
58
- end
59
-
60
- group :benchmarks do
61
- gem 'rbench', '~> 0.2.3'
62
- end
63
-
64
- platform :jruby do
65
- group :jruby do
66
- gem 'jruby-openssl', '~> 0.8.5'
67
- end
68
- end
data/Guardfile DELETED
@@ -1,32 +0,0 @@
1
- # encoding: utf-8
2
-
3
- guard :bundler do
4
- watch('Gemfile')
5
- watch('Gemfile.lock')
6
- watch(%w{.+.gemspec\z})
7
- end
8
-
9
- guard :rspec, cli: File.read('.rspec').split.join(' '), keep_failed: false do
10
- # Run all specs if configuration is modified
11
- watch('.rspec') { 'spec' }
12
- watch('Guardfile') { 'spec' }
13
- watch('Gemfile.lock') { 'spec' }
14
- watch('spec/spec_helper.rb') { 'spec' }
15
-
16
- # Run all specs if supporting files are modified
17
- watch(%r{\Aspec/(?:fixtures|lib|support|shared)/.+\.rb\z}) { 'spec' }
18
-
19
- # Run unit specs if associated lib code is modified
20
- watch(%r{\Alib/(.+)\.rb\z}) { |m| Dir["spec/unit/#{m[1]}*"] }
21
- watch(%r{\Alib/(.+)/support/(.+)\.rb\z}) { |m| Dir["spec/unit/#{m[1]}/#{m[2]}*"] }
22
- watch("lib/#{File.basename(File.expand_path('../', __FILE__))}.rb") { 'spec' }
23
-
24
- # Run a spec if it is modified
25
- watch(%r{\Aspec/(?:unit|integration)/.+_spec\.rb\z})
26
- end
27
-
28
- guard :rubocop, cli: %w[--config config/rubocop.yml] do
29
- watch(%r{.+\.(?:rb|rake)\z})
30
- watch(%r{\Aconfig/rubocop\.yml\z}) { |m| File.dirname(m[0]) }
31
- watch(%r{(?:.+/)?\.rubocop\.yml\z}) { |m| File.dirname(m[0]) }
32
- end
data/TODO DELETED
File without changes
@@ -1,2 +0,0 @@
1
- ---
2
- unit_test_timeout: 0.1
@@ -1,3 +0,0 @@
1
- ---
2
- threshold: 6
3
- total_score: 25
@@ -1,2 +0,0 @@
1
- ---
2
- threshold: 18.7
@@ -1,3 +0,0 @@
1
- ---
2
- name: equalizer
3
- namespace: Equalizer
@@ -1,18 +0,0 @@
1
- ---
2
- AbcMetricMethodCheck: { score: 10.3 }
3
- AssignmentInConditionalCheck: { }
4
- CaseMissingElseCheck: { }
5
- ClassLineCountCheck: { line_count: 293 }
6
- ClassNameCheck: { pattern: !ruby/regexp '/\A(?:[A-Z]+|[A-Z][a-z](?:[A-Z]?[a-z])+)\z/' }
7
- ClassVariableCheck: { }
8
- CyclomaticComplexityBlockCheck: { complexity: 2 }
9
- CyclomaticComplexityMethodCheck: { complexity: 4 }
10
- EmptyRescueBodyCheck: { }
11
- ForLoopCheck: { }
12
- # TODO: decrease line_count to 5 to 10
13
- MethodLineCountCheck: { line_count: 14 }
14
- MethodNameCheck: { pattern: !ruby/regexp '/\A(?:[a-z\d](?:_?[a-z\d])+[?!=]?|\[\]=?|==|<=>|[+*&|-])\z/' }
15
- ModuleLineCountCheck: { line_count: 295 }
16
- ModuleNameCheck: { pattern: !ruby/regexp '/\A(?:[A-Z]+|[A-Z][a-z](?:[A-Z]?[a-z])+)\z/' }
17
- # TODO: decrease parameter_count to 2 or less
18
- ParameterNumberCheck: { parameter_count: 3 }