coconductor 0.9.2 → 0.9.3

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
2
  SHA256:
3
- metadata.gz: 98f87de1353be1f78ac5c9681665d212c2faba34969e404bfeb02f1cdc58d68b
4
- data.tar.gz: 4c209e587734390fff1b9d8793d65c9210a7d80e01c9073c93abe4a7ac3a6fee
3
+ metadata.gz: 128e9599d1f48bd95bc530efd9bfb7c52105dfedadf5a7e044fe51da248b1f1b
4
+ data.tar.gz: 7c99d8bf7af1e1f3cc1b56cafd7376362ee1231789c61e7824bfe180376b480b
5
5
  SHA512:
6
- metadata.gz: ea64e1848d9ab8caa5a85421bc2299208736c6f0019cf2e29fc168580729ae7384586fd48064fe52c9fc172d062bc412597216baf8e537fec490c55048a3efe5
7
- data.tar.gz: 98a9042d5fe4ef83caad64845c9d2898697aec8e8a053fc2f8422d314907352482fc38a07b04cfac12356cc0ed8d17ddb159144374223df6623ae091ce4da6b9
6
+ metadata.gz: 7e2dac680fd08c0a514019b88e11bd44da54bfb7fccf1e0062c50973792d6a07a810d62ae8210e28eb582ceeb4988be4b87b36a81742aa2e9513dec25f3be2fe
7
+ data.tar.gz: 86746e9255b5063ef3761d0d8c2884528171e9e15b0652c2c950d20ccb20be812a6eac4ab19d353c47d687c5170868e23d18695158e38b0a916558b8531f39e3
@@ -37,7 +37,7 @@ module Coconductor
37
37
  [
38
38
  matches['family'], 'version', matches['version'], matches['lang']
39
39
  ].compact.join('/')
40
- end.compact
40
+ end.compact.sort
41
41
  end
42
42
 
43
43
  def latest_in_family(family, language: DEFAULT_LANGUAGE)
@@ -50,7 +50,7 @@ module Coconductor
50
50
  def families
51
51
  @families ||= begin
52
52
  families = Dir["#{vendor_dir}/*"].map { |dir| File.basename(dir) }
53
- families - ['bundle']
53
+ (families - ['bundle']).sort
54
54
  end
55
55
  end
56
56
 
@@ -70,7 +70,7 @@ module Coconductor
70
70
  /version
71
71
  /(?<version>(?<major>\d)/(?<minor>\d)(/(?<patch>\d))?|(longer|shorter))
72
72
  /#{Coconductor::ProjectFiles::CodeOfConductFile::FILENAME_REGEX}
73
- }ix
73
+ }ix.freeze
74
74
  DEFAULT_LANGUAGE = 'en'.freeze
75
75
 
76
76
  attr_reader :key
@@ -130,7 +130,7 @@ module Coconductor
130
130
  alias body content
131
131
 
132
132
  def inspect
133
- "#<Licensee::CodeOfConduct key=#{key}>"
133
+ "#<Coconductor::CodeOfConduct key=#{key}>"
134
134
  end
135
135
 
136
136
  def family
@@ -1,7 +1,7 @@
1
1
  module Coconductor
2
2
  # Represents a fillable field in a code of conduct
3
3
  class Field
4
- REGEX = /\[(?<name>[A-Z_ ]{2,})[\s:-]*(?<description>.*?)\]/
4
+ REGEX = /\[(?<name>[A-Z_ ]{2,})[\s:-]*(?<description>.*?)\]/.freeze
5
5
 
6
6
  # the matchable raw text within the code of conduct including brackets
7
7
  attr_reader :raw_text
@@ -18,7 +18,7 @@ module Coconductor
18
18
  private
19
19
 
20
20
  FIELD_PLACEHOLDER = 'COCONDUCTOR_FIELD_COCONDUCTOR'.freeze
21
- FIELD_PLACEHOLDER_REGEX = /coconductor\\ field\\ coconductor/
21
+ FIELD_PLACEHOLDER_REGEX = /coconductor\\ field\\ coconductor/.freeze
22
22
 
23
23
  def regex_for(code_of_conduct)
24
24
  coc = code_of_conduct.dup
@@ -4,11 +4,11 @@ module Coconductor
4
4
  include Licensee::ContentHelper
5
5
 
6
6
  EXTENSIONS = %w[md markdown txt].freeze
7
- EXT_REGEX = /\.#{Regexp.union(EXTENSIONS)}/i
8
- BASENAME_REGEX = /(citizen[_-])?code[_-]of[_-]conduct/i
7
+ EXT_REGEX = /\.#{Regexp.union(EXTENSIONS)}/i.freeze
8
+ BASENAME_REGEX = /(citizen[_-])?code[_-]of[_-]conduct/i.freeze
9
9
  # LANG_REGEX must contain extension to avoid matching .md as the lang
10
- LANG_REGEX = /(\.(?<lang>[a-z]{2}(-[a-z]{2})?)#{EXT_REGEX})?/i
11
- FILENAME_REGEX = /#{BASENAME_REGEX}#{LANG_REGEX}#{EXT_REGEX}?/i
10
+ LANG_REGEX = /(\.(?<lang>[a-z]{2}(-[a-z]{2})?)#{EXT_REGEX})?/i.freeze
11
+ FILENAME_REGEX = /#{BASENAME_REGEX}#{LANG_REGEX}#{EXT_REGEX}?/i.freeze
12
12
 
13
13
  def self.name_score(filename)
14
14
  filename =~ /\A#{FILENAME_REGEX}/ ? 1.0 : 0.0
@@ -14,8 +14,8 @@ module Coconductor
14
14
 
15
15
  OPTIONS = %i[filename url repo replacements html source_path wiki].freeze
16
16
  INVALID_CHARS = ["\u202D", "\u202C", "\u200E", "\u200F"].freeze
17
- UPPERCASE_WORD_REGEX = /(?:[A-Z]{3,}+ ?)+[A-Z_]+/
18
- UNMARKED_FIELD_REGEX = /(?<= |^)#{UPPERCASE_WORD_REGEX}(?= |\.|,)/
17
+ UPPERCASE_WORD_REGEX = /(?:[A-Z]{3,}+ ?)+[A-Z_]+/.freeze
18
+ UNMARKED_FIELD_REGEX = /(?<= |^)#{UPPERCASE_WORD_REGEX}(?= |\.|,)/.freeze
19
19
 
20
20
  def initialize(family, options = {})
21
21
  @family = family
@@ -1,3 +1,3 @@
1
1
  module Coconductor
2
- VERSION = '0.9.2'.freeze
2
+ VERSION = '0.9.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coconductor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-24 00:00:00.000000000 Z
11
+ date: 2019-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: licensee
@@ -297,8 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
297
  - !ruby/object:Gem::Version
298
298
  version: '0'
299
299
  requirements: []
300
- rubyforge_project:
301
- rubygems_version: 2.7.7
300
+ rubygems_version: 3.0.2
302
301
  signing_key:
303
302
  specification_version: 4
304
303
  summary: work-in-progress code of conduct detector based off Licensee