coconductor 0.9.1 → 0.10.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/.github/funding.yml +1 -0
- data/.rubocop.yml +10 -1
- data/.rubocop_todo.yml +132 -0
- data/Gemfile +2 -0
- data/Rakefile +2 -0
- data/bin/coconductor +2 -1
- data/coconductor.gemspec +7 -3
- data/docs/SECURITY.md +3 -0
- data/lib/coconductor.rb +7 -5
- data/lib/coconductor/code_of_conduct.rb +16 -10
- data/lib/coconductor/commands/detect.rb +3 -1
- data/lib/coconductor/commands/diff.rb +5 -5
- data/lib/coconductor/commands/version.rb +2 -0
- data/lib/coconductor/field.rb +6 -6
- data/lib/coconductor/matchers.rb +2 -0
- data/lib/coconductor/matchers/dice.rb +2 -0
- data/lib/coconductor/matchers/exact.rb +2 -0
- data/lib/coconductor/matchers/field_aware.rb +4 -2
- data/lib/coconductor/matchers/matcher.rb +2 -0
- data/lib/coconductor/project_files.rb +2 -0
- data/lib/coconductor/project_files/code_of_conduct_file.rb +7 -5
- data/lib/coconductor/project_files/project_file.rb +2 -0
- data/lib/coconductor/projects.rb +2 -0
- data/lib/coconductor/projects/fs_project.rb +2 -0
- data/lib/coconductor/projects/git_project.rb +2 -0
- data/lib/coconductor/projects/github_project.rb +2 -0
- data/lib/coconductor/projects/project.rb +3 -1
- data/lib/coconductor/vendorer.rb +6 -4
- data/lib/coconductor/version.rb +3 -1
- data/script/console +1 -0
- data/script/vendor-codes-of-conduct +4 -3
- data/vendor/contributor-covenant/version/1/4/code-of-conduct.ar.md +4 -4
- data/vendor/contributor-covenant/version/1/4/code-of-conduct.de.md +2 -2
- data/vendor/contributor-covenant/version/1/4/code-of-conduct.gu.md +76 -0
- data/vendor/contributor-covenant/version/1/4/code-of-conduct.hi.md +2 -2
- data/vendor/contributor-covenant/version/1/4/code-of-conduct.hu.md +53 -0
- data/vendor/contributor-covenant/version/1/4/code-of-conduct.id.md +18 -20
- data/vendor/contributor-covenant/version/1/4/code-of-conduct.md +7 -7
- data/vendor/contributor-covenant/version/1/4/code-of-conduct.mr.md +78 -0
- data/vendor/contributor-covenant/version/1/4/code-of-conduct.pl.md +14 -15
- data/vendor/contributor-covenant/version/1/4/code-of-conduct.zh-cn.md +27 -27
- data/vendor/contributor-covenant/version/2/0/code_of_conduct.ca.md +84 -0
- data/vendor/contributor-covenant/version/2/0/code_of_conduct.es.md +89 -0
- data/vendor/contributor-covenant/version/2/0/code_of_conduct.id.md +136 -0
- data/vendor/contributor-covenant/version/2/0/code_of_conduct.it.md +127 -0
- data/vendor/contributor-covenant/version/2/0/code_of_conduct.ja.md +91 -0
- data/vendor/contributor-covenant/version/2/0/code_of_conduct.md +133 -0
- data/vendor/contributor-covenant/version/2/0/code_of_conduct.ru.md +124 -0
- data/vendor/contributor-covenant/version/2/0/code_of_conduct.tr.md +85 -0
- data/vendor/go/version/1/0/CODE_OF_CONDUCT.md +2 -2
- metadata +62 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2f164d3139954a092f0e47c1a7d3ed25988927d1dc6c789c0c87906a370500c
|
4
|
+
data.tar.gz: ee301805000f620f4def3f84aea18302154aefb2bad3a43d162adf159b4832ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94d375ee6d990acd446063a34e93d28cbd93843e76d30b571f435af1eb8e2925bf9c0e7f6fe554499200eed3fba2425b505842f343afc5c99bea9983a071afb7
|
7
|
+
data.tar.gz: caebc5d1f2743c2c08710a2c5d88bf7798c1307ee51144ba6b08add09adf0f806c9fbabaf15d1e6c1c68630926808b02e3045f1d082efe70b8a89a87276d2ec1
|
data/.github/funding.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
patreon: benbalter
|
data/.rubocop.yml
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
require:
|
4
|
+
- rubocop-performance
|
5
|
+
- rubocop-rspec
|
6
|
+
|
7
|
+
AllCops:
|
8
|
+
NewCops: enable
|
9
|
+
|
1
10
|
Style/Documentation:
|
2
11
|
Enabled: false
|
3
12
|
|
@@ -6,7 +15,7 @@ Metrics/BlockLength:
|
|
6
15
|
- spec/**/*
|
7
16
|
- coconductor.gemspec
|
8
17
|
|
9
|
-
|
18
|
+
Layout/LineLength:
|
10
19
|
Exclude:
|
11
20
|
- lib/coconductor/project_files.rb
|
12
21
|
- lib/coconductor/commands/*
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2021-03-02 20:51:18 UTC using RuboCop version 1.11.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: Include.
|
11
|
+
# Include: **/*.gemspec
|
12
|
+
Gemspec/RequiredRubyVersion:
|
13
|
+
Exclude:
|
14
|
+
- 'coconductor.gemspec'
|
15
|
+
|
16
|
+
# Offense count: 1
|
17
|
+
Lint/NoReturnInBeginEndBlocks:
|
18
|
+
Exclude:
|
19
|
+
- 'lib/coconductor/field.rb'
|
20
|
+
|
21
|
+
# Offense count: 1
|
22
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
23
|
+
Metrics/MethodLength:
|
24
|
+
Max: 11
|
25
|
+
|
26
|
+
# Offense count: 7
|
27
|
+
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
|
28
|
+
# SupportedStyles: snake_case, normalcase, non_integer
|
29
|
+
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
|
30
|
+
Naming/VariableNumber:
|
31
|
+
Exclude:
|
32
|
+
- 'spec/coconductor/matchers/dice_spec.rb'
|
33
|
+
- 'spec/coconductor/matchers/exact_spec.rb'
|
34
|
+
- 'spec/coconductor/project_files/code_of_conduct_file_spec.rb'
|
35
|
+
- 'spec/coconductor/project_files/project_file_spec.rb'
|
36
|
+
- 'spec/coconductor/project_spec.rb'
|
37
|
+
- 'spec/coconductor_spec.rb'
|
38
|
+
- 'spec/integration_spec.rb'
|
39
|
+
|
40
|
+
# Offense count: 4
|
41
|
+
# Configuration parameters: MinSize.
|
42
|
+
Performance/CollectionLiteralInLoop:
|
43
|
+
Exclude:
|
44
|
+
- 'spec/coconductor/code_of_conduct_spec.rb'
|
45
|
+
- 'spec/coconductor/field_spec.rb'
|
46
|
+
- 'spec/coconductor/matchers/field_aware_spec.rb'
|
47
|
+
- 'spec/vendored_coc_spec.rb'
|
48
|
+
|
49
|
+
# Offense count: 21
|
50
|
+
# Configuration parameters: Prefixes.
|
51
|
+
# Prefixes: when, with, without
|
52
|
+
RSpec/ContextWording:
|
53
|
+
Exclude:
|
54
|
+
- 'spec/coconductor/code_of_conduct_spec.rb'
|
55
|
+
- 'spec/coconductor/field_spec.rb'
|
56
|
+
- 'spec/coconductor/matchers/dice_spec.rb'
|
57
|
+
- 'spec/coconductor/matchers/field_aware_spec.rb'
|
58
|
+
- 'spec/coconductor/project_files/code_of_conduct_file_spec.rb'
|
59
|
+
- 'spec/coconductor/project_files/project_file_spec.rb'
|
60
|
+
- 'spec/coconductor/project_spec.rb'
|
61
|
+
- 'spec/coconductor_spec.rb'
|
62
|
+
- 'spec/integration_spec.rb'
|
63
|
+
|
64
|
+
# Offense count: 3
|
65
|
+
# Configuration parameters: IgnoredMetadata.
|
66
|
+
RSpec/DescribeClass:
|
67
|
+
Exclude:
|
68
|
+
- 'spec/coconductor/bin_spec.rb'
|
69
|
+
- 'spec/integration_spec.rb'
|
70
|
+
- 'spec/vendored_coc_spec.rb'
|
71
|
+
|
72
|
+
# Offense count: 3
|
73
|
+
# Configuration parameters: Max.
|
74
|
+
RSpec/ExampleLength:
|
75
|
+
Exclude:
|
76
|
+
- 'spec/coconductor/code_of_conduct_spec.rb'
|
77
|
+
|
78
|
+
# Offense count: 19
|
79
|
+
RSpec/MultipleExpectations:
|
80
|
+
Max: 4
|
81
|
+
|
82
|
+
# Offense count: 10
|
83
|
+
# Configuration parameters: AllowSubject.
|
84
|
+
RSpec/MultipleMemoizedHelpers:
|
85
|
+
Max: 8
|
86
|
+
|
87
|
+
# Offense count: 71
|
88
|
+
# Configuration parameters: IgnoreSharedExamples.
|
89
|
+
RSpec/NamedSubject:
|
90
|
+
Exclude:
|
91
|
+
- 'spec/coconductor/code_of_conduct_spec.rb'
|
92
|
+
- 'spec/coconductor/field_spec.rb'
|
93
|
+
- 'spec/coconductor/matchers/dice_spec.rb'
|
94
|
+
- 'spec/coconductor/matchers/exact_spec.rb'
|
95
|
+
- 'spec/coconductor/matchers/matcher_spec.rb'
|
96
|
+
- 'spec/coconductor/project_files/project_file_spec.rb'
|
97
|
+
- 'spec/coconductor/project_spec.rb'
|
98
|
+
- 'spec/coconductor_spec.rb'
|
99
|
+
- 'spec/integration_spec.rb'
|
100
|
+
|
101
|
+
# Offense count: 7
|
102
|
+
RSpec/NestedGroups:
|
103
|
+
Max: 4
|
104
|
+
|
105
|
+
# Offense count: 2
|
106
|
+
RSpec/RepeatedDescription:
|
107
|
+
Exclude:
|
108
|
+
- 'spec/coconductor/code_of_conduct_spec.rb'
|
109
|
+
|
110
|
+
# Offense count: 9
|
111
|
+
RSpec/ScatteredSetup:
|
112
|
+
Exclude:
|
113
|
+
- 'spec/coconductor/project_files/project_file_spec.rb'
|
114
|
+
- 'spec/coconductor/project_spec.rb'
|
115
|
+
- 'spec/integration_spec.rb'
|
116
|
+
|
117
|
+
# Offense count: 5
|
118
|
+
RSpec/SubjectStub:
|
119
|
+
Exclude:
|
120
|
+
- 'spec/coconductor/project_files/project_file_spec.rb'
|
121
|
+
|
122
|
+
# Offense count: 1
|
123
|
+
Security/Open:
|
124
|
+
Exclude:
|
125
|
+
- 'lib/coconductor/vendorer.rb'
|
126
|
+
|
127
|
+
# Offense count: 1
|
128
|
+
# Cop supports --auto-correct.
|
129
|
+
# Configuration parameters: Methods.
|
130
|
+
Style/RedundantArgument:
|
131
|
+
Exclude:
|
132
|
+
- 'spec/coconductor/project_files/project_file_spec.rb'
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/bin/coconductor
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require_relative '../lib/coconductor'
|
4
5
|
require 'thor'
|
@@ -38,6 +39,6 @@ class CoconductorCLI < Thor
|
|
38
39
|
end
|
39
40
|
|
40
41
|
commands_dir = File.expand_path '../lib/coconductor/commands/', __dir__
|
41
|
-
Dir["#{commands_dir}/*.rb"].each { |c| require(c) }
|
42
|
+
Dir["#{commands_dir}/*.rb"].sort.each { |c| require(c) }
|
42
43
|
|
43
44
|
CoconductorCLI.start(ARGV)
|
data/coconductor.gemspec
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
lib = File.expand_path('lib', __dir__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
5
|
require 'coconductor/version'
|
@@ -24,14 +26,16 @@ Gem::Specification.new do |spec|
|
|
24
26
|
spec.require_paths = ['lib']
|
25
27
|
|
26
28
|
spec.add_dependency 'licensee', '~> 9.9', '>= 9.9.4'
|
27
|
-
spec.add_dependency 'thor', '
|
29
|
+
spec.add_dependency 'thor', '>= 0.18', '< 2.0'
|
28
30
|
spec.add_dependency 'toml', '~> 0.2'
|
29
31
|
|
30
|
-
spec.add_development_dependency '
|
32
|
+
spec.add_development_dependency 'gem-release', '~> 2.0'
|
31
33
|
spec.add_development_dependency 'pry', '~> 0.10'
|
32
34
|
spec.add_development_dependency 'reverse_markdown', '~> 1.1'
|
33
35
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
34
|
-
spec.add_development_dependency 'rubocop', '~> 0
|
36
|
+
spec.add_development_dependency 'rubocop', '~> 1.0'
|
37
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.5'
|
38
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 2.0'
|
35
39
|
spec.add_development_dependency 'twitter-text', '< 2.0'
|
36
40
|
spec.add_development_dependency 'webmock', '~> 3.1'
|
37
41
|
spec.add_development_dependency 'wikicloth', '~> 0.8'
|
data/docs/SECURITY.md
ADDED
data/lib/coconductor.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative './coconductor/version'
|
2
4
|
require 'licensee'
|
3
5
|
|
@@ -9,7 +11,7 @@ module Coconductor
|
|
9
11
|
autoload :ProjectFiles, 'coconductor/project_files'
|
10
12
|
autoload :Vendorer, 'coconductor/vendorer'
|
11
13
|
|
12
|
-
CONFIDENCE_THRESHOLD =
|
14
|
+
CONFIDENCE_THRESHOLD = 85
|
13
15
|
|
14
16
|
class << self
|
15
17
|
attr_writer :confidence_threshold
|
@@ -23,13 +25,13 @@ module Coconductor
|
|
23
25
|
end
|
24
26
|
|
25
27
|
def project(path, **args)
|
26
|
-
if
|
27
|
-
Coconductor::Projects::GitHubProject.new(path, args)
|
28
|
+
if %r{\Ahttps://github.com}.match?(path)
|
29
|
+
Coconductor::Projects::GitHubProject.new(path, **args)
|
28
30
|
else
|
29
|
-
Coconductor::Projects::GitProject.new(path, args)
|
31
|
+
Coconductor::Projects::GitProject.new(path, **args)
|
30
32
|
end
|
31
33
|
rescue Coconductor::Projects::GitProject::InvalidRepository
|
32
|
-
Coconductor::Projects::FSProject.new(path, args)
|
34
|
+
Coconductor::Projects::FSProject.new(path, **args)
|
33
35
|
end
|
34
36
|
|
35
37
|
def confidence_threshold
|
@@ -1,7 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'toml'
|
2
4
|
|
3
5
|
module Coconductor
|
4
6
|
class InvalidCodeOfConduct < ArgumentError; end
|
7
|
+
|
5
8
|
class CodeOfConduct
|
6
9
|
class << self
|
7
10
|
def all
|
@@ -37,7 +40,7 @@ module Coconductor
|
|
37
40
|
[
|
38
41
|
matches['family'], 'version', matches['version'], matches['lang']
|
39
42
|
].compact.join('/')
|
40
|
-
end.compact
|
43
|
+
end.compact.sort
|
41
44
|
end
|
42
45
|
|
43
46
|
def latest_in_family(family, language: DEFAULT_LANGUAGE)
|
@@ -50,7 +53,7 @@ module Coconductor
|
|
50
53
|
def families
|
51
54
|
@families ||= begin
|
52
55
|
families = Dir["#{vendor_dir}/*"].map { |dir| File.basename(dir) }
|
53
|
-
families - ['bundle']
|
56
|
+
(families - ['bundle']).sort
|
54
57
|
end
|
55
58
|
end
|
56
59
|
|
@@ -70,17 +73,18 @@ module Coconductor
|
|
70
73
|
/version
|
71
74
|
/(?<version>(?<major>\d)/(?<minor>\d)(/(?<patch>\d))?|(longer|shorter))
|
72
75
|
/#{Coconductor::ProjectFiles::CodeOfConductFile::FILENAME_REGEX}
|
73
|
-
}ix
|
74
|
-
DEFAULT_LANGUAGE = 'en'
|
76
|
+
}ix.freeze
|
77
|
+
DEFAULT_LANGUAGE = 'en'
|
75
78
|
|
76
79
|
attr_reader :key
|
77
80
|
attr_writer :content
|
81
|
+
|
78
82
|
include Licensee::ContentHelper
|
79
83
|
|
80
84
|
# Define dynamic predicate helpers to determine if a code of conduct is a
|
81
85
|
# member of a given family, e.g., code_of_conduct.contributor_covenant?
|
82
86
|
CodeOfConduct.families.each do |f|
|
83
|
-
define_method(f.tr('-', '_')
|
87
|
+
define_method("#{f.tr('-', '_')}?") { family == f }
|
84
88
|
end
|
85
89
|
|
86
90
|
def initialize(key)
|
@@ -96,7 +100,7 @@ module Coconductor
|
|
96
100
|
parts = key.split('/')
|
97
101
|
if pseudo?
|
98
102
|
nil
|
99
|
-
elsif
|
103
|
+
elsif /^[a-z-]{2,5}$/.match?(parts.last)
|
100
104
|
parts.last
|
101
105
|
else
|
102
106
|
DEFAULT_LANGUAGE
|
@@ -130,7 +134,7 @@ module Coconductor
|
|
130
134
|
alias body content
|
131
135
|
|
132
136
|
def inspect
|
133
|
-
"#<
|
137
|
+
"#<Coconductor::CodeOfConduct key=#{key}>"
|
134
138
|
end
|
135
139
|
|
136
140
|
def family
|
@@ -177,16 +181,18 @@ module Coconductor
|
|
177
181
|
private
|
178
182
|
|
179
183
|
def filename
|
180
|
-
filename = if contributor_covenant?
|
184
|
+
filename = if contributor_covenant? && key.include?('/version/1/')
|
181
185
|
'code-of-conduct'
|
186
|
+
elsif contributor_covenant? && key.include?('/version/2/')
|
187
|
+
'code_of_conduct'
|
182
188
|
elsif citizen_code_of_conduct?
|
183
189
|
'citizen_code_of_conduct'
|
184
190
|
else
|
185
191
|
'CODE_OF_CONDUCT'
|
186
192
|
end
|
187
193
|
|
188
|
-
filename
|
189
|
-
filename
|
194
|
+
filename += ".#{language}" unless default_language?
|
195
|
+
"#{filename}.md"
|
190
196
|
end
|
191
197
|
|
192
198
|
def filepath
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class CoconductorCLI < Thor
|
2
4
|
desc 'detect [PATH]', 'Detect the code of conduct of the given project', default: Dir.pwd
|
3
5
|
option :confidence, type: :numeric, default: Coconductor.confidence_threshold, desc: 'Confidence threshold'
|
@@ -57,7 +59,7 @@ class CoconductorCLI < Thor
|
|
57
59
|
when :confidence
|
58
60
|
Licensee::ContentHelper.format_percent(value)
|
59
61
|
when :method
|
60
|
-
value.to_s.tr('_', ' ').capitalize
|
62
|
+
"#{value.to_s.tr('_', ' ').capitalize}:"
|
61
63
|
else
|
62
64
|
value
|
63
65
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'tmpdir'
|
2
4
|
|
3
5
|
class CoconductorCLI < Thor
|
@@ -39,20 +41,18 @@ class CoconductorCLI < Thor
|
|
39
41
|
private
|
40
42
|
|
41
43
|
def code_of_conduct_to_diff
|
42
|
-
if options[:code_of_conduct_to_diff]
|
43
|
-
return options[:code_of_conduct_to_diff]
|
44
|
-
end
|
44
|
+
return options[:code_of_conduct_to_diff] if options[:code_of_conduct_to_diff]
|
45
45
|
|
46
46
|
return project.code_of_conduct_file if remote?
|
47
47
|
|
48
48
|
@code_of_conduct_to_diff ||= begin
|
49
|
-
if
|
49
|
+
if $stdin.tty?
|
50
50
|
error 'You must pipe the file contents to the command via STDIN'
|
51
51
|
exit 1
|
52
52
|
end
|
53
53
|
|
54
54
|
filename = 'CODE_OF_CONDUCT.txt'
|
55
|
-
Coconductor::ProjectFiles::CodeOfConductFile.new(
|
55
|
+
Coconductor::ProjectFiles::CodeOfConductFile.new($stdin.read, filename)
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
data/lib/coconductor/field.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Coconductor
|
2
4
|
# Represents a fillable field in a code of conduct
|
3
5
|
class Field
|
4
|
-
REGEX = /\[(?<name>[A-Z_ ]{2,})[\s:-]*(?<description>.*?)\]
|
6
|
+
REGEX = /\[(?<name>[A-Z_ ]{2,})[\s:-]*(?<description>.*?)\]/.freeze
|
5
7
|
|
6
8
|
# the matchable raw text within the code of conduct including brackets
|
7
9
|
attr_reader :raw_text
|
@@ -18,7 +20,7 @@ module Coconductor
|
|
18
20
|
# Returns an array of Fields for the given code of conduct
|
19
21
|
def from_code_of_conduct(code_of_conduct)
|
20
22
|
matches = []
|
21
|
-
return [] unless code_of_conduct
|
23
|
+
return [] unless code_of_conduct&.content
|
22
24
|
|
23
25
|
code_of_conduct.content.scan(REGEX) do |_m|
|
24
26
|
matches << Regexp.last_match
|
@@ -40,7 +42,7 @@ module Coconductor
|
|
40
42
|
def initialize(raw_text, name: nil, description: nil)
|
41
43
|
@raw_text = raw_text
|
42
44
|
@name = name
|
43
|
-
@description = description if description && description != ''
|
45
|
+
@description = description.capitalize if description && description != ''
|
44
46
|
end
|
45
47
|
|
46
48
|
# The unformatted field name as found in the code of conduct text
|
@@ -60,9 +62,7 @@ module Coconductor
|
|
60
62
|
|
61
63
|
def description
|
62
64
|
@description ||= begin
|
63
|
-
if parts && parts[:description] && parts[:description] != ''
|
64
|
-
return parts[:description].capitalize
|
65
|
-
end
|
65
|
+
return parts[:description].capitalize if parts && parts[:description] && parts[:description] != ''
|
66
66
|
|
67
67
|
DESCRIPTIONS[key]
|
68
68
|
end
|