milestoner 18.3.0 → 18.4.0

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: 282be813b423955e3f7e0d99fed3405b594745d848a8a5db4208ea40f347142f
4
- data.tar.gz: 27e309b692ba2cb4d9286a4db612b78011f1ab5bea2fc438fab0de4959e42356
3
+ metadata.gz: f42cba7a4f2b93a05d7fcf25fb973e2a241c8d1813a143baa779c2e1a310f1ed
4
+ data.tar.gz: 73635a67814d59b11bae524f45cb4878196aba7e302fa595ecedaaf89e350a6a
5
5
  SHA512:
6
- metadata.gz: e6e0f24087ab4ee05e0ca5a613a94e12dc45d1b38a71eab1c45c38d9e7e0406ba7438c2c6152fc4579c388f22da07fbc765fc31d13a0583bdd14335373eb011b
7
- data.tar.gz: f88afd8bff7deada4f46c0787768c2e3864ccc5a092461638793bf58a29d3b12d7a9763ab0f42f05abf19481be30b68d31708071d4ea652c1c8a8903bc32e192
6
+ metadata.gz: 9fcf5478cee6c0a63811cb133d27ae4bc292da15bacdbdb65f2edd29375057f87c23f15f4780ae68539439ed3c5c2011989477ea4c530b32effa5659f46735b1
7
+ data.tar.gz: a9e17509fa39de1247896518da061daa4586afbff8e905b5934728e5269e448ef973c1ffa1ac1136efd6d01a275912fe872c1fe84876c65c25dbaf7e32fed75a
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -52,7 +52,9 @@ The following are screenshots of using this gem to render release notes for the
52
52
 
53
53
  === ASCII Doc Format
54
54
 
55
- image:https://alchemists.io/images/projects/milestoner/screenshots/build-ascii_doc.png[Release Notes,width=882,height=738,role=focal_point]
55
+ image:https://alchemists.io/images/projects/milestoner/screenshots/build-ascii_doc-collapsed.png[Release Notes,width=1149,height=830,role=focal_point]
56
+
57
+ image:https://alchemists.io/images/projects/milestoner/screenshots/build-ascii_doc-expanded.png[Release Notes,width=1149,height=1054,role=focal_point]
56
58
 
57
59
  * *Command*: `milestoner build --format ascii_doc`
58
60
  * *Renderer*: {ascii_doc_link}
@@ -40,8 +40,8 @@ module Milestoner
40
40
  attr_reader :categorizer, :model
41
41
 
42
42
  def build_attributes commit
43
- infused_keys.each.with_object({}) do |command, attributes|
44
- attributes[command] = __send__(command).call commit
43
+ infused_keys.each.with_object({}) do |key, attributes|
44
+ attributes[key] = __send__(key).call commit
45
45
  end
46
46
  end
47
47
  end
@@ -3,7 +3,6 @@
3
3
  require "cff"
4
4
  require "dry/monads"
5
5
  require "pathname"
6
- require "refinements/hash"
7
6
 
8
7
  module Milestoner
9
8
  module Configuration
@@ -13,8 +12,6 @@ module Milestoner
13
12
  class Description
14
13
  include Dry::Monads[:result]
15
14
 
16
- using Refinements::Hash
17
-
18
15
  def initialize key = :project_description,
19
16
  path: Pathname.pwd.join("CITATION.cff"),
20
17
  citation: CFF::File
@@ -25,7 +22,8 @@ module Milestoner
25
22
 
26
23
  def call attributes
27
24
  attributes.fetch key do
28
- attributes.merge!(key => citation.open(path).abstract).compress!
25
+ value = citation.open(path).abstract
26
+ attributes.merge! key => value unless value.empty?
29
27
  end
30
28
 
31
29
  Success attributes
@@ -3,7 +3,6 @@
3
3
  require "cff"
4
4
  require "dry/monads"
5
5
  require "pathname"
6
- require "refinements/hash"
7
6
 
8
7
  module Milestoner
9
8
  module Configuration
@@ -13,8 +12,6 @@ module Milestoner
13
12
  class Label
14
13
  include Dry::Monads[:result]
15
14
 
16
- using Refinements::Hash
17
-
18
15
  def initialize key = :project_label,
19
16
  path: Pathname.pwd.join("CITATION.cff"),
20
17
  citation: CFF::File
@@ -24,7 +21,11 @@ module Milestoner
24
21
  end
25
22
 
26
23
  def call attributes
27
- attributes.fetch(key) { attributes.merge!(key => citation.open(path).title).compress! }
24
+ attributes.fetch key do
25
+ value = citation.open(path).title
26
+ attributes.merge! key => value unless value.empty?
27
+ end
28
+
28
29
  Success attributes
29
30
  end
30
31
 
@@ -3,7 +3,6 @@
3
3
  require "cff"
4
4
  require "dry/monads"
5
5
  require "pathname"
6
- require "refinements/hash"
7
6
 
8
7
  module Milestoner
9
8
  module Configuration
@@ -13,8 +12,6 @@ module Milestoner
13
12
  class URI
14
13
  include Dry::Monads[:result]
15
14
 
16
- using Refinements::Hash
17
-
18
15
  def initialize key = :project_uri,
19
16
  path: Pathname.pwd.join("CITATION.cff"),
20
17
  citation: CFF::File
@@ -39,7 +36,7 @@ module Milestoner
39
36
  def process attributes
40
37
  attributes.fetch(key) { citation.open(path).url }
41
38
  .then { |value| value.match?(/%<.+>s/) ? format(value, attributes) : value }
42
- .then { |value| attributes.merge!(key => value).compress! }
39
+ .then { |value| attributes.merge! key => value unless value.empty? }
43
40
  end
44
41
  end
45
42
  end
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "dry/monads"
4
4
  require "pathname"
5
- require "refinements/hash"
6
5
 
7
6
  module Milestoner
8
7
  module Configuration
@@ -13,8 +12,6 @@ module Milestoner
13
12
  include Import[:spec_loader]
14
13
  include Dry::Monads[:result]
15
14
 
16
- using Refinements::Hash
17
-
18
15
  def initialize(key = :project_description, path: "#{Pathname.pwd.basename}.gemspec", **)
19
16
  @key = key
20
17
  @path = path
@@ -23,7 +20,8 @@ module Milestoner
23
20
 
24
21
  def call attributes
25
22
  attributes.fetch key do
26
- attributes.merge!(key => spec_loader.call(path).summary).compress!
23
+ value = spec_loader.call(path).summary
24
+ attributes.merge! key => value if value
27
25
  end
28
26
 
29
27
  Success attributes
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "dry/monads"
4
4
  require "pathname"
5
- require "refinements/hash"
6
5
 
7
6
  module Milestoner
8
7
  module Configuration
@@ -13,8 +12,6 @@ module Milestoner
13
12
  include Import[:spec_loader]
14
13
  include Dry::Monads[:result]
15
14
 
16
- using Refinements::Hash
17
-
18
15
  def initialize(key = :project_name, path: "#{Pathname.pwd.basename}.gemspec", **)
19
16
  @key = key
20
17
  @path = path
@@ -23,7 +20,8 @@ module Milestoner
23
20
 
24
21
  def call attributes
25
22
  attributes.fetch key do
26
- attributes.merge!(key => spec_loader.call(path).name).compress!
23
+ value = spec_loader.call(path).name
24
+ attributes.merge! key => value if value
27
25
  end
28
26
 
29
27
  Success attributes
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "dry/monads"
4
- require "refinements/hash"
5
4
 
6
5
  module Milestoner
7
6
  module Configuration
@@ -12,8 +11,6 @@ module Milestoner
12
11
  include Import[:git]
13
12
  include Dry::Monads[:result]
14
13
 
15
- using Refinements::Hash
16
-
17
14
  def initialize(key = :project_author, **)
18
15
  @key = key
19
16
  super(**)
@@ -21,7 +18,7 @@ module Milestoner
21
18
 
22
19
  def call attributes
23
20
  attributes.fetch key do
24
- git.get("user.name", nil).bind { |value| attributes.merge!(key => value).compress! }
21
+ git.get("user.name", nil).bind { |value| attributes.merge! key => value if value }
25
22
  end
26
23
 
27
24
  Success attributes
@@ -2,7 +2,6 @@
2
2
 
3
3
  require "dry/monads"
4
4
  require "pathname"
5
- require "refinements/hash"
6
5
  require "refinements/string"
7
6
 
8
7
  module Milestoner
@@ -11,10 +10,9 @@ module Milestoner
11
10
  # Conditionally updates label based on current directory.
12
11
  module Project
13
12
  using Refinements::String
14
- using Refinements::Hash
15
13
 
16
14
  Label = lambda do |attributes, key = :project_label, default: Pathname.pwd.basename.to_s|
17
- attributes.fetch(key) { attributes.merge!(key => default.titleize).compress! }
15
+ attributes.fetch(key) { attributes.merge! key => default.titleize }
18
16
  Dry::Monads::Success attributes
19
17
  end
20
18
  end
@@ -6,7 +6,6 @@ require "etcher"
6
6
  require "gitt"
7
7
  require "lode"
8
8
  require "runcom"
9
- require "sanitize"
10
9
  require "spek"
11
10
 
12
11
  module Milestoner
@@ -65,7 +64,7 @@ module Milestoner
65
64
 
66
65
  register(:settings) { Etcher.call(self[:registry]).dup }
67
66
  register(:specification) { self[:spec_loader].call "#{__dir__}/../../milestoner.gemspec" }
68
- register :sanitizer, -> content { Sanitize.fragment content, Sanitize::Config::BASIC }
67
+ register(:sanitizer) { Sanitizer.new }
69
68
  register(:spec_loader) { Spek::Loader.new }
70
69
  register(:git) { Gitt::Repository.new }
71
70
  register(:defaults_path) { Pathname(__dir__).join("configuration/defaults.yml") }
@@ -7,6 +7,7 @@ module Milestoner
7
7
  COMMIT_COMMON_ATTRIBUTES = %i[
8
8
  authored_at
9
9
  body
10
+ body_lines
10
11
  deletions
11
12
  files_changed
12
13
  fingerprint
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "refinements/array"
4
+ require "sanitize"
5
+
6
+ module Milestoner
7
+ # A custom HTML sanitizer.
8
+ class Sanitizer
9
+ using Refinements::Array
10
+
11
+ def initialize defaults: Sanitize::Config::BASIC, client: Sanitize
12
+ @defaults = defaults
13
+ @client = client
14
+ end
15
+
16
+ def call(content) = client.fragment content, configuration
17
+
18
+ private
19
+
20
+ attr_reader :defaults, :client
21
+
22
+ def configuration
23
+ client::Config.merge defaults,
24
+ elements: defaults[:elements].including("img", "video"),
25
+ attributes: defaults[:attributes].merge(
26
+ "img" => %w[alt class height id loading src width],
27
+ "video" => %w[class controls height id poster src width]
28
+ )
29
+ end
30
+ end
31
+ end
@@ -1 +1,48 @@
1
- * <%= commit.emoji %> <%= commit.subject %> - <%= render :profile, name: commit.author.name, url: commit.profile_url(commit.author) %>
1
+ .<%= commit.emoji %> <%= commit.subject %> - <%= render :profile, name: commit.author.name, url: commit.profile_url(commit.author) %>
2
+ [%collapsible]
3
+ ====
4
+ *Message*
5
+
6
+ <% if commit.body_lines && commit.body_lines.any? %>
7
+ <%= commit.body_lines.join "\n" %>
8
+ <% else %>
9
+ None.
10
+ <% end %>
11
+
12
+ <% unless commit.notes.empty? %>
13
+ *Notes*
14
+
15
+ _Notes are detected but can't be rendered at the moment. Support will be added in the next Milestoner version._
16
+ <% end %>
17
+
18
+ *Author*
19
+
20
+ <%= render :avatar, name: commit.author.name, url: commit.avatar_url(commit.author) %> <%= render :profile, name: commit.author.name, url: commit.profile_url(commit.author) %>
21
+
22
+ <% if commit.collaborators.any? %>
23
+ *Collaborators*
24
+
25
+ <% commit.collaborators.each do |collaborator| %>
26
+ * <%= render :avatar, name: collaborator.name, url: commit.avatar_url(collaborator) %> <%= render :profile, name: collaborator.name, url: commit.profile_url(collaborator) %>
27
+ <% end %>
28
+ <% end %>
29
+
30
+ <% if commit.signers.any? %>
31
+ *Signers*
32
+
33
+ <% commit.signers.each do |signer| %>
34
+ * <%= render :avatar, name: signer.name, url: commit.avatar_url(signer) %> <%= render :profile, name: signer.name, url: commit.profile_url(signer) %>
35
+ <% end %>
36
+ <% end %>
37
+
38
+ *Details*
39
+
40
+ * Milestone: <%= commit.tag.capitalize %>
41
+ * Signature: <%= commit.signature %>
42
+ * Files: link:<%= commit.uri %>[<%= commit.files_changed %>]
43
+ * Lines: <%= commit.total_deletions %>/<%= commit.total_insertions %>
44
+ * Issue: link:<%= commit.issue.uri %>[<%= commit.issue.id %>]
45
+ * Review: link:<%= commit.review.uri %>[<%= commit.review.id %>]
46
+
47
+ _<%= commit.datetime %>_
48
+ ====
@@ -28,7 +28,11 @@
28
28
  <h1 class="bar">Message</h1>
29
29
 
30
30
  <div class="content">
31
- <%= commit.safe_body %>
31
+ <% if commit.body.empty? %>
32
+ <p>None.</p>
33
+ <% else %>
34
+ <%= commit.safe_body %>
35
+ <% end %>
32
36
  </div>
33
37
  </div>
34
38
 
@@ -7,7 +7,7 @@
7
7
  <h4>Message</h4>
8
8
 
9
9
  <% if commit.body.empty? %>
10
- <p>No message.</p>
10
+ <p>None.</p>
11
11
  <% else %>
12
12
  <%= commit.safe_body %>
13
13
  <% end %>
@@ -72,11 +72,7 @@
72
72
 
73
73
  <p>
74
74
  <em style="display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1rem;">
75
- <time datetime="<%= commit.at %>"><%= commit.date %></time>
76
- <time datetime="<%= commit.at %>">(<%= commit.weekday %>)</time>
77
- at
78
- <time datetime="<%= commit.at %>"><%= commit.time %></time>
79
- <time datetime="<%= commit.at %>"><%= commit.zone %></time>
75
+ <%= commit.datetime %>
80
76
  </em>
81
77
  </p>
82
78
 
@@ -65,6 +65,8 @@ module Milestoner
65
65
 
66
66
  def at = authored_at.strftime "%Y-%m-%dT%H:%M:%S%z"
67
67
 
68
+ def datetime = authored_at.strftime "%Y-%m-%d (%A) at %H:%M %p %Z"
69
+
68
70
  def weekday = authored_at.strftime "%A"
69
71
 
70
72
  def date = authored_at.strftime "%Y-%m-%d"
data/milestoner.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "milestoner"
5
- spec.version = "18.3.0"
5
+ spec.version = "18.4.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/milestoner"
@@ -31,10 +31,10 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency "dry-monads", "~> 1.6"
32
32
  spec.add_dependency "dry-schema", "~> 1.13"
33
33
  spec.add_dependency "etcher", "~> 2.1"
34
- spec.add_dependency "gitt", "~> 3.8"
34
+ spec.add_dependency "gitt", "~> 3.9"
35
35
  spec.add_dependency "hanami-view", "~> 2.1"
36
36
  spec.add_dependency "infusible", "~> 3.8"
37
- spec.add_dependency "lode", "~> 1.4"
37
+ spec.add_dependency "lode", "~> 1.8"
38
38
  spec.add_dependency "redcarpet", "~> 3.6"
39
39
  spec.add_dependency "refinements", "~> 12.8"
40
40
  spec.add_dependency "rss", "~> 0.3"
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: milestoner
3
3
  version: !ruby/object:Gem::Version
4
- version: 18.3.0
4
+ version: 18.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -35,7 +35,7 @@ cert_chain:
35
35
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
36
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
37
  -----END CERTIFICATE-----
38
- date: 2024-09-01 00:00:00.000000000 Z
38
+ date: 2024-09-07 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: asciidoctor
@@ -155,14 +155,14 @@ dependencies:
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: '3.8'
158
+ version: '3.9'
159
159
  type: :runtime
160
160
  prerelease: false
161
161
  version_requirements: !ruby/object:Gem::Requirement
162
162
  requirements:
163
163
  - - "~>"
164
164
  - !ruby/object:Gem::Version
165
- version: '3.8'
165
+ version: '3.9'
166
166
  - !ruby/object:Gem::Dependency
167
167
  name: hanami-view
168
168
  requirement: !ruby/object:Gem::Requirement
@@ -197,14 +197,14 @@ dependencies:
197
197
  requirements:
198
198
  - - "~>"
199
199
  - !ruby/object:Gem::Version
200
- version: '1.4'
200
+ version: '1.8'
201
201
  type: :runtime
202
202
  prerelease: false
203
203
  version_requirements: !ruby/object:Gem::Requirement
204
204
  requirements:
205
205
  - - "~>"
206
206
  - !ruby/object:Gem::Version
207
- version: '1.4'
207
+ version: '1.8'
208
208
  - !ruby/object:Gem::Dependency
209
209
  name: redcarpet
210
210
  requirement: !ruby/object:Gem::Requirement
@@ -415,6 +415,7 @@ files:
415
415
  - lib/milestoner/renderers/asciidoc.rb
416
416
  - lib/milestoner/renderers/markdown.rb
417
417
  - lib/milestoner/renderers/universal.rb
418
+ - lib/milestoner/sanitizer.rb
418
419
  - lib/milestoner/syndication/builder.rb
419
420
  - lib/milestoner/syndication/refine.rb
420
421
  - lib/milestoner/syndication/shared.rb
metadata.gz.sig CHANGED
Binary file