coconductor 0.5.0 → 0.5.1
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 +4 -4
- data/lib/coconductor/field.rb +12 -1
- data/lib/coconductor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb9569c714de625fcb9cee3b70b371435212cc9c35ddf9d554b0f5d1e0ee2f29
|
4
|
+
data.tar.gz: c552fec2709366a99e4607669d5ce44f093e7051c718bcd0a252cd04e80eba00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff5812bf680a616d195e834cc3a1ed8b176369776b61cefd6d56664b2ebcdc8767f62d194e37a629ea93e62d924fd764d91b55d5d30f7a310045bc95337df666
|
7
|
+
data.tar.gz: e474f63bd62c39c4f1cbaaacaf7171d5c1a7c6d4194734d0c429099d30082fdfb73079d68bcecad211b890cb9df61671ccf541919b78a4bd5133c8ae37d26503
|
data/lib/coconductor/field.rb
CHANGED
@@ -6,6 +6,14 @@ module Coconductor
|
|
6
6
|
# the matchable raw text within the code of conduct including brackets
|
7
7
|
attr_reader :raw_text
|
8
8
|
|
9
|
+
# Hard coded field descriptions in the form of key => description
|
10
|
+
DESCRIPTIONS = {
|
11
|
+
'link_to_reporting_guidelines' => 'An optional link to guidelines for ' \
|
12
|
+
'how reports of unacceptable behavior will be handled.',
|
13
|
+
'link_to_policy' => 'An optional link to guidelines for how warnings ' \
|
14
|
+
'and expulsions of community members will be handled.'
|
15
|
+
}.freeze
|
16
|
+
|
9
17
|
class << self
|
10
18
|
# Returns an array of Fields for the given code of conduct
|
11
19
|
def from_code_of_conduct(code_of_conduct)
|
@@ -50,7 +58,10 @@ module Coconductor
|
|
50
58
|
end
|
51
59
|
|
52
60
|
def description
|
53
|
-
@description ||=
|
61
|
+
@description ||= begin
|
62
|
+
return parts[:description] if parts && parts[:description] != ''
|
63
|
+
DESCRIPTIONS[key]
|
64
|
+
end
|
54
65
|
end
|
55
66
|
|
56
67
|
def inspect
|
data/lib/coconductor/version.rb
CHANGED