coconductor 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d8837e39676c56bc60036ce0006d587366fc798de8ca31ddcd15db6f8ce8502
4
- data.tar.gz: 5193fe3915a9dc366e6af5a9fe550cca18bb6fd7dd341602c70229fd1910d877
3
+ metadata.gz: d9b4cc3e36b81bf54501ef0faecde56bc6d9d56301bf329cb3d606145f5312b2
4
+ data.tar.gz: ff6ded1918af2d981cc367cae83aa41c9dbe403c087ded3d33572ece20e76d05
5
5
  SHA512:
6
- metadata.gz: a6cb8b8f8475d88a0aa2d064e01b24dbee45907dac458aae441759507dee4036be516fd4319625b20a5990953a2552467649e44fb1637ea0e1ac15dce1b52cda
7
- data.tar.gz: a86d9c601c64f1fc8e9137a22e8d835fc39e256fc824ac573af0f1a6f9c12cb2fa5a1b7739d77f64f89cb8c06092d7585f8361df9f819d39cd82bd55473fa577
6
+ metadata.gz: 85aab5538e5f66c2b25e6d9aa08112851334502e1888a6bbf8d7e1d9e6327345bd1b1f5646d68ecce8b066f842e456e4d037ff4954a13cf1e14c55abe1e7f691
7
+ data.tar.gz: 2275c2792b3e9c012ac34ebb34daa4068aba46921fa86e2ba70fbb970b93dec488063a3b771cd2ce997a844950c353df12b2995c6370eb09b29373288f9a3466
@@ -15,6 +15,7 @@ module Coconductor
15
15
  # Returns the code of conduct specified by the key with version,
16
16
  # or the latest in the family if only the family is specified
17
17
  def find(key_or_family)
18
+ return new('other') if key_or_family == 'other'
18
19
  match = all.find { |coc| coc.key == key_or_family }
19
20
  match || latest_in_family(key_or_family)
20
21
  end
@@ -146,6 +147,11 @@ module Coconductor
146
147
  @fields ||= Field.from_code_of_conduct(self)
147
148
  end
148
149
 
150
+ def ==(other)
151
+ other.is_a?(CodeOfConduct) && key == other.key
152
+ end
153
+ alias eql? ==
154
+
149
155
  private
150
156
 
151
157
  def filename
@@ -2,7 +2,11 @@ module Coconductor
2
2
  module ProjectFiles
3
3
  class ProjectFile < Licensee::ProjectFiles::ProjectFile
4
4
  def code_of_conduct
5
- matcher && matcher.match || CodeOfConduct.find('other')
5
+ if matcher
6
+ matcher.match
7
+ else
8
+ CodeOfConduct.find('other')
9
+ end
6
10
  end
7
11
 
8
12
  undef_method :license
@@ -1,3 +1,3 @@
1
1
  module Coconductor
2
- VERSION = '0.6.1'.freeze
2
+ VERSION = '0.6.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coconductor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter