dry-equalizer 0.1.0 → 0.3.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: 331c7852ce35d03c2bf636b387de9f0dfda2ff0f
4
- data.tar.gz: 34c7ecb5014f00f1134b8217b70931f38787d384
2
+ SHA256:
3
+ metadata.gz: 9e167f2f667d5c3e4bf962263e4285d327c9e29aacc650c4f70debbeb1af29df
4
+ data.tar.gz: 55c6c4b07d8a4474070bfe4a964ef29f8725ba7798c3abf4e40e82db48b4eea6
5
5
  SHA512:
6
- metadata.gz: bf4777f0013c80f11093c59b9efe78b1b3b7a877f0bf4c0dc7fe2542b435a6756712ece41ea76a3d677ab1c6e97741c10e3680b85ebc1b445a055b704097d8f6
7
- data.tar.gz: de3f710c92e3c9a849ec37f4c7ef32d015d1634a0794140894647b74068a11dca02de706a2c07dab615902f3f8230bdfa305d70716635e48f7b52bcf9b276d4f
6
+ metadata.gz: 998bd2189807358dd8d1b44e30d9eb8cd634e908f7a51be3a6151af18d41a2333c3abac36f4781cec9008c55904cd890d96659cfd2a0b2eb1580d3c2af82b8dd
7
+ data.tar.gz: 7b8a7f6f5840ba503f4574b4f279f73641632ee0faf8eab8c57db44e9ceda51a7fef200112dc59dffff7a7d1fcc7e11ba8eba9951a2d0023437b935903692e25
@@ -0,0 +1,12 @@
1
+ # this file is managed by dry-rb/devtools project
2
+
3
+ version: "2"
4
+
5
+ exclude_patterns:
6
+ - "benchmarks/"
7
+ - "examples/"
8
+ - "spec/"
9
+
10
+ plugins:
11
+ rubocop:
12
+ enabled: true
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: "⚠️ Please don't ask for support via issues"
3
+ about: See CONTRIBUTING.md for more information
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: "\U0001F41B Bug report"
3
+ about: See CONTRIBUTING.md for more information
4
+ title: ''
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Before you submit this: WE ONLY ACCEPT BUG REPORTS AND FEATURE REQUESTS**
11
+
12
+ For more information see [our contribution guidelines](https://github.com/rom-rb/rom/blob/master/CONTRIBUTING.md)
13
+
14
+ **Before you report**
15
+
16
+ :warning: If you have a problem related to a schema, please **report it under [dry-schema issues](https://github.com/dry-rb/dry-schema/issues/new?assignees=&labels=bug&template=---bug-report.md&title=)** instead.
17
+
18
+ **Describe the bug**
19
+
20
+ A clear and concise description of what the bug is.
21
+
22
+ **To Reproduce**
23
+
24
+ Provide detailed steps to reproduce, an executable script would be best.
25
+
26
+ **Expected behavior**
27
+
28
+ A clear and concise description of what you expected to happen.
29
+
30
+ **Your environment**
31
+
32
+ - Affects my production application: **YES/NO**
33
+ - Ruby version: ...
34
+ - OS: ...
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: "\U0001F6E0 Feature request"
3
+ about: See CONTRIBUTING.md for more information
4
+ title: ''
5
+ labels: feature
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ Summary of what the feature is supposed to do.
11
+
12
+ ## Examples
13
+
14
+ Code examples showing how the feature could be used.
15
+
16
+ ## Resources
17
+
18
+ Additional information, like a link to the discussion forum thread where the feature was discussed etc.
@@ -0,0 +1,34 @@
1
+ # this file is managed by dry-rb/devtools project
2
+
3
+ name: docsite
4
+
5
+ on:
6
+ push:
7
+ paths:
8
+ - docsite/**
9
+ - .github/workflows/docsite.yml
10
+ branches:
11
+ - master
12
+ - release-**
13
+ tags:
14
+
15
+ jobs:
16
+ update-docs:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v1
20
+ - name: Set up Ruby
21
+ uses: actions/setup-ruby@v1
22
+ with:
23
+ ruby-version: "2.6.x"
24
+ - name: Install dependencies
25
+ run: |
26
+ gem install bundler
27
+ bundle install --jobs 4 --retry 3 --without benchmarks sql
28
+ - name: Symlink ossy
29
+ run: mkdir -p bin && ln -sf "$(bundle show ossy)/bin/ossy" bin/ossy
30
+ - name: Trigger dry-rb.org deploy
31
+ env:
32
+ GITHUB_LOGIN: dry-bot
33
+ GITHUB_TOKEN: ${{ secrets.GH_PAT }}
34
+ run: bin/ossy github workflow dry-rb/dry-rb.org ci
@@ -0,0 +1,34 @@
1
+ # this file is managed by dry-rb/devtools project
2
+
3
+ name: sync_configs
4
+
5
+ on:
6
+ repository_dispatch:
7
+
8
+ jobs:
9
+ sync-configs:
10
+ runs-on: ubuntu-latest
11
+ if: github.event.action == 'sync_configs'
12
+ steps:
13
+ - uses: actions/checkout@v1
14
+ - name: Update configuration files from devtools
15
+ env:
16
+ GITHUB_LOGIN: dry-bot
17
+ GITHUB_TOKEN: ${{ secrets.GH_PAT }}
18
+ run: |
19
+ git clone https://github.com/dry-rb/devtools.git tmp/devtools
20
+
21
+ if [ -f ".github/workflows/custom_ci.yml" ]; then
22
+ rsync -av --exclude '.github/workflows/ci.yml' tmp/devtools/shared/ . ;
23
+ else
24
+ rsync -av tmp/devtools/shared/ . ;
25
+ fi
26
+
27
+ git config --local user.email "dry-bot@dry-rb.org"
28
+ git config --local user.name "dry-bot"
29
+ git add -A
30
+ git commit -m "[devtools] config sync" || echo "nothing changed"
31
+ - name: Push changes
32
+ uses: ad-m/github-push-action@master
33
+ with:
34
+ github_token: ${{ secrets.GH_PAT }}
data/.rspec CHANGED
@@ -1,6 +1,4 @@
1
- --backtrace
2
1
  --color
3
- --format progress
2
+ --require spec_helper
4
3
  --order random
5
- --profile
6
- --warnings
4
+
@@ -0,0 +1,89 @@
1
+ # this file is managed by dry-rb/devtools project
2
+
3
+ AllCops:
4
+ TargetRubyVersion: 2.4
5
+
6
+ Style/EachWithObject:
7
+ Enabled: false
8
+
9
+ Style/StringLiterals:
10
+ Enabled: true
11
+ EnforcedStyle: single_quotes
12
+
13
+ Style/Alias:
14
+ Enabled: false
15
+
16
+ Style/LambdaCall:
17
+ Enabled: false
18
+
19
+ Style/StabbyLambdaParentheses:
20
+ Enabled: false
21
+
22
+ Style/FormatString:
23
+ Enabled: false
24
+
25
+ Style/Documentation:
26
+ Enabled: false
27
+
28
+ Layout/SpaceInLambdaLiteral:
29
+ Enabled: false
30
+
31
+ Layout/MultilineMethodCallIndentation:
32
+ Enabled: true
33
+ EnforcedStyle: indented
34
+
35
+ Metrics/LineLength:
36
+ Max: 100
37
+
38
+ Metrics/MethodLength:
39
+ Max: 22
40
+
41
+ Metrics/ClassLength:
42
+ Max: 150
43
+
44
+ Metrics/AbcSize:
45
+ Max: 20
46
+
47
+ Metrics/BlockLength:
48
+ Enabled: false
49
+
50
+ Metrics/CyclomaticComplexity:
51
+ Enabled: true
52
+ Max: 10
53
+
54
+ Lint/BooleanSymbol:
55
+ Enabled: false
56
+
57
+ Style/AccessModifierDeclarations:
58
+ Enabled: false
59
+
60
+ Style/BlockDelimiters:
61
+ Enabled: false
62
+
63
+ Layout/IndentFirstArrayElement:
64
+ EnforcedStyle: consistent
65
+
66
+ Style/ClassAndModuleChildren:
67
+ Exclude:
68
+ - "spec/**/*_spec.rb"
69
+
70
+ Lint/HandleExceptions:
71
+ Exclude:
72
+ - "spec/spec_helper.rb"
73
+
74
+ Naming/FileName:
75
+ Exclude:
76
+ - "lib/dry-*.rb"
77
+
78
+ Style/SymbolArray:
79
+ Exclude:
80
+ - "spec/**/*_spec.rb"
81
+
82
+ Style/ConditionalAssignment:
83
+ Enabled: false
84
+
85
+ Naming/MethodName:
86
+ Enabled: false
87
+
88
+ Style/AsciiComments:
89
+ Enabled: false
@@ -1,3 +1,49 @@
1
+ # v0.3.0 2019-11-07
2
+
3
+ ### Changed
4
+
5
+ - [BREAKING] Dropped support for Ruby < 2.4
6
+
7
+ ### Added
8
+
9
+ - Memoization option for immutable objects. If `immutable: true` is passed the result of `.hash` call will be memoized after its first invokation or on `.freeze` call (skryukov)
10
+ ```ruby
11
+ class User
12
+ include Dry::Equalizer(:id, :name, :age, immutable: true)
13
+ end
14
+ ```
15
+
16
+ [Compare v0.2.2...v0.3.0](https://github.com/dry-rb/dry-equalizer/compare/v0.2.2...v0.3.0)
17
+
18
+ # v0.2.2 2019-03-08
19
+
20
+ ### Added
21
+
22
+ - Generation of `#to_s` and `#inspect` can be disabled with `inspect: false` (flash-gordon)
23
+ ```ruby
24
+ class User
25
+ include Dry::Equalizer(:id, :name, :age, inspect: false)
26
+ end
27
+ ```
28
+
29
+ [Compare v0.2.1...v0.2.2](https://github.com/dry-rb/dry-equalizer/compare/v0.2.1...v0.2.2)
30
+
31
+ # v0.2.1 2018-04-26
32
+
33
+ ### Fixed
34
+
35
+ - Including equalizer module with same keys multiple times won't cause duped keys in `inspect` output (radar)
36
+
37
+ [Compare v0.2.0...v0.2.1](https://github.com/dry-rb/dry-equalizer/compare/v0.2.0...v0.2.1)
38
+
39
+ # v0.2.0 2015-11-13
40
+
41
+ Really make it work with MRI 2.0 again (it's Friday 13th OK?!)
42
+
43
+ # v0.1.1 2015-11-13
44
+
45
+ Make it work with MRI 2.0 again
46
+
1
47
  # v0.1.0 2015-11-11
2
48
 
3
49
  ## Added
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.4.0, available at [https://www.contributor-covenant.org/version/1/4/code-of-conduct](https://www.contributor-covenant.org/version/1/4/code-of-conduct)
@@ -1,11 +1,29 @@
1
- Contributing
2
- ------------
3
-
4
- * If you want your code merged into the mainline, please discuss the proposed changes with me before doing any work on it. This library is still in early development, and the direction it is going may not always be clear. Some features may not be appropriate yet, may need to be deferred until later when the foundation for them is laid, or may be more applicable in a plugin.
5
- * Fork the project.
6
- * Make your feature addition or bug fix.
7
- * Follow this [style guide](https://github.com/dkubb/styleguide).
8
- * Add specs for it. This is important so I don't break it in a future version unintentionally. Tests must cover all branches within the code, and code must be fully covered.
9
- * Commit, do not mess with Rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
10
- * Run "rake ci". This must pass and not show any regressions in the metrics for the code to be merged.
11
- * Send me a pull request. Bonus points for topic branches.
1
+ # Issue Guidelines
2
+
3
+ ## Reporting bugs
4
+
5
+ If you found a bug, report an issue and describe what's the expected behavior versus what actually happens. If the bug causes a crash, attach a full backtrace. If possible, a reproduction script showing the problem is highly appreciated.
6
+
7
+ ## Reporting feature requests
8
+
9
+ Report a feature request **only after discussing it first on [discourse.dry-rb.org](https://discourse.dry-rb.org)** where it was accepted. Please provide a concise description of the feature, don't link to a discussion thread, and instead summarize what was discussed.
10
+
11
+ ## Reporting questions, support requests, ideas, concerns etc.
12
+
13
+ **PLEASE DON'T** - use [discourse.dry-rb.org](http://discourse.dry-rb.org) instead.
14
+
15
+ # Pull Request Guidelines
16
+
17
+ A Pull Request will only be accepted if it addresses a specific issue that was reported previously, or fixes typos, mistakes in documentation etc.
18
+
19
+ Other requirements:
20
+
21
+ 1) Do not open a pull request if you can't provide tests along with it. If you have problems writing tests, ask for help in the related issue.
22
+ 2) Follow the style conventions of the surrounding code. In most cases, this is standard ruby style.
23
+ 3) Add API documentation if it's a new feature
24
+ 4) Update API documentation if it changes an existing feature
25
+ 5) Bonus points for sending a PR to [github.com/dry-rb/dry-rb.org](github.com/dry-rb/dry-rb.org) which updates user documentation and guides
26
+
27
+ # Asking for help
28
+
29
+ If these guidelines aren't helpful, and you're stuck, please post a message on [discourse.dry-rb.org](https://discourse.dry-rb.org) or join [our chat](https://dry-rb.zulipchat.com).
data/Gemfile CHANGED
@@ -1,9 +1,17 @@
1
- # encoding: utf-8
2
-
3
1
  source 'https://rubygems.org'
4
2
 
3
+ gemspec
4
+
5
5
  group :development, :test do
6
- gem 'devtools', git: 'https://github.com/mbj/devtools.git'
6
+ gem 'bundler'
7
+ gem 'rake'
8
+ gem 'rspec', '~> 3.5'
7
9
  end
8
10
 
9
- gemspec
11
+ group :test do
12
+ gem 'simplecov', require: false, platform: :mri
13
+ end
14
+
15
+ group :tools do
16
+ gem 'ossy', git: 'https://github.com/solnic/ossy.git', branch: 'master', platform: :mri
17
+ end
data/LICENSE CHANGED
@@ -1,21 +1,20 @@
1
- Copyright (c) 2009-2013 Dan Kubb
2
- Copyright (c) 2012 Markus Schirp (packaging)
1
+ The MIT License (MIT)
3
2
 
4
- Permission is hereby granted, free of charge, to any person obtaining
5
- a copy of this software and associated documentation files (the
6
- "Software"), to deal in the Software without restriction, including
7
- without limitation the rights to use, copy, modify, merge, publish,
8
- distribute, sublicense, and/or sell copies of the Software, and to
9
- permit persons to whom the Software is furnished to do so, subject to
10
- the following conditions:
3
+ Copyright (c) 2015-2019 dry-rb team
11
4
 
12
- The above copyright notice and this permission notice shall be
13
- included in all copies or substantial portions of the Software.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
14
11
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,24 +1,22 @@
1
- dry-equalizer
2
- =========
1
+ [gem]: https://rubygems.org/gems/dry-equalizer
2
+ [ci]: https://github.com/dry-rb/dry-equalizer/actions?query=workflow%3Aci
3
+ [codeclimate]: https://codeclimate.com/github/dry-rb/dry-equalizer
4
+ [chat]: https://dry-rb.zulipchat.com
3
5
 
4
- Module to define equality, equivalence and inspection methods
6
+ # dry-equalizer [![Join the chat at https://dry-rb.zulipchat.com](https://img.shields.io/badge/dry--rb-join%20chat-%23346b7a.svg)][chat]
5
7
 
6
- [![Gem Version](http://img.shields.io/gem/v/equalizer.svg)][gem]
7
- [![Build Status](http://img.shields.io/travis/dryrb/dry-equalizer.svg)][travis]
8
- [![Dependency Status](http://img.shields.io/gemnasium/dryrb/dry-equalizer.svg)][gemnasium]
9
- [![Code Climate](http://img.shields.io/codeclimate/github/dryrb/dry-equalizer.svg)][codeclimate]
8
+ Module to define equality, equivalence and inspection methods
10
9
 
11
- [gem]: https://rubygems.org/gems/equalizer
12
- [travis]: https://travis-ci.org/dryrb/dry-equalizer
13
- [gemnasium]: https://gemnasium.com/dryrb/dry-equalizer
14
- [codeclimate]: https://codeclimate.com/github/dryrb/dry-equalizer
10
+ [![Gem Version](http://img.shields.io/gem/v/dry-equalizer.svg)][gem]
11
+ [![Build Status](https://github.com/dry-rb/dry-equalizer/workflows/ci/badge.svg)][ci]
12
+ [![Maintainability](https://api.codeclimate.com/v1/badges/5a9a139af1d4a80a28c4/maintainability)][codeclimate]
13
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/5a9a139af1d4a80a28c4/test_coverage)][codeclimate]
15
14
 
16
- Examples
17
- --------
15
+ ## Examples
18
16
 
19
- ``` ruby
17
+ ```ruby
20
18
  class GeoLocation
21
- include Equalizer.new(:latitude, :longitude)
19
+ include Dry::Equalizer(:latitude, :longitude)
22
20
 
23
21
  attr_reader :latitude, :longitude
24
22
 
@@ -44,14 +42,13 @@ point_a.eql?(point_c) # => false
44
42
  point_a.equal?(point_c) # => false
45
43
  ```
46
44
 
47
- Supported Ruby Versions
48
- -----------------------
45
+ ## Supported Ruby Versions
49
46
 
50
47
  This library aims to support and is [tested against][travis] the following Ruby
51
48
  implementations:
52
49
 
53
- * Ruby 2.1
54
- * Ruby 2.2
50
+ - MRI 2.4+
51
+ - JRuby 9.x
55
52
 
56
53
  If something doesn't work on one of these versions, it's a bug.
57
54
 
@@ -67,22 +64,19 @@ patches in a timely fashion. If critical issues for a particular implementation
67
64
  exist at the time of a major release, support for that Ruby version may be
68
65
  dropped.
69
66
 
70
- Credits
71
- -------
67
+ ## Credits
72
68
 
73
69
  This is a fork of the original [equalizer](https://github.com/dkubb/equalizer).
74
70
 
75
- * Dan Kubb ([dkubb](https://github.com/dkubb))
76
- * Piotr Solnica ([solnic](https://github.com/solnic))
77
- * Markus Schirp ([mbj](https://github.com/mbj))
78
- * Erik Michaels-Ober ([sferik](https://github.com/sferik))
71
+ - Dan Kubb ([dkubb](https://github.com/dkubb))
72
+ - Piotr Solnica ([solnic](https://github.com/solnic))
73
+ - Markus Schirp ([mbj](https://github.com/mbj))
74
+ - Erik Michaels-Ober ([sferik](https://github.com/sferik))
79
75
 
80
- Contributing
81
- -------------
76
+ ## Contributing
82
77
 
83
78
  See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
84
79
 
85
- Copyright
86
- ---------
80
+ ## Copyright
87
81
 
88
82
  Copyright &copy; 2009-2013 Dan Kubb. See LICENSE for details.