coconductor 0.5.1 → 0.5.2

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: cb9569c714de625fcb9cee3b70b371435212cc9c35ddf9d554b0f5d1e0ee2f29
4
- data.tar.gz: c552fec2709366a99e4607669d5ce44f093e7051c718bcd0a252cd04e80eba00
3
+ metadata.gz: bc33614c4cf488f210ba9d708de92c06bb63df664d7b428319f8243262f6c99a
4
+ data.tar.gz: 40e02ee3e59104b5dd930d770ca16f98cd1ec464e758f5a2e74cd87bbffb13fe
5
5
  SHA512:
6
- metadata.gz: ff5812bf680a616d195e834cc3a1ed8b176369776b61cefd6d56664b2ebcdc8767f62d194e37a629ea93e62d924fd764d91b55d5d30f7a310045bc95337df666
7
- data.tar.gz: e474f63bd62c39c4f1cbaaacaf7171d5c1a7c6d4194734d0c429099d30082fdfb73079d68bcecad211b890cb9df61671ccf541919b78a4bd5133c8ae37d26503
6
+ metadata.gz: 35525eb6802487b38dead731554bb261cb2de293741801399760d432667163c875b1428c075b8d96ed2ae3ad812883418e9f5acdc91234c1901316d6141561cf
7
+ data.tar.gz: c06174866d417735359136e007289dbc9d2ca684ed7684ad68ad1c0bcb3bd1e6f621006ae4927f01207767e4edc77d6c2de055976f1e6dfb1636559aa0d50646
@@ -99,7 +99,12 @@ module Coconductor
99
99
  end
100
100
 
101
101
  def content
102
- @content ||= parts.last
102
+ # See https://github.com/stumpsyn/policies/pull/21
103
+ @content ||= if citizen_code_of_conduct?
104
+ parts.last.gsub(' COMMUNITY_NAME ', ' [COMMUNITY_NAME] ')
105
+ else
106
+ parts.last
107
+ end
103
108
  end
104
109
  alias body content
105
110
 
@@ -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>.*)\]/
5
5
 
6
6
  # the matchable raw text within the code of conduct including brackets
7
7
  attr_reader :raw_text
@@ -79,7 +79,7 @@ module Coconductor
79
79
 
80
80
  def normalized_name
81
81
  @normalized_name ||= begin
82
- normalized_name = name.tr(' ', '_')
82
+ normalized_name = name.strip.tr(' ', '_')
83
83
  normalized_name = normalized_name.gsub(/\A(YOUR|INSERT)_/i, '')
84
84
  normalized_name = normalized_name.gsub(/_?HERE\z/i, '')
85
85
  normalized_name.strip
@@ -1,3 +1,3 @@
1
1
  module Coconductor
2
- VERSION = '0.5.1'.freeze
2
+ VERSION = '0.5.2'.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.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-31 00:00:00.000000000 Z
11
+ date: 2018-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: licensee