milestoner 18.12.0 → 19.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/README.adoc +82 -68
  4. data/lib/milestoner/builders/adoc/container.rb +15 -0
  5. data/lib/milestoner/builders/adoc/dependencies.rb +9 -0
  6. data/lib/milestoner/builders/adoc/indexer.rb +28 -0
  7. data/lib/milestoner/builders/adoc/pager.rb +35 -0
  8. data/lib/milestoner/builders/ascii_doc.rb +10 -18
  9. data/lib/milestoner/builders/{import.rb → dependencies.rb} +1 -1
  10. data/lib/milestoner/builders/feed.rb +6 -15
  11. data/lib/milestoner/builders/markdown.rb +10 -18
  12. data/lib/milestoner/builders/md/container.rb +15 -0
  13. data/lib/milestoner/builders/md/dependencies.rb +9 -0
  14. data/lib/milestoner/builders/md/indexer.rb +28 -0
  15. data/lib/milestoner/builders/md/pager.rb +35 -0
  16. data/lib/milestoner/builders/path_resolver.rb +23 -0
  17. data/lib/milestoner/builders/site/container.rb +16 -0
  18. data/lib/milestoner/builders/site/dependencies.rb +9 -0
  19. data/lib/milestoner/builders/site/indexer.rb +33 -0
  20. data/lib/milestoner/builders/site/pager.rb +35 -0
  21. data/lib/milestoner/builders/site/styler.rb +47 -0
  22. data/lib/milestoner/builders/stream.rb +3 -3
  23. data/lib/milestoner/builders/syndication/builder.rb +125 -0
  24. data/lib/milestoner/builders/syndication/indexer.rb +29 -0
  25. data/lib/milestoner/builders/syndication/refine.rb +27 -0
  26. data/lib/milestoner/builders/syndication/shared.rb +27 -0
  27. data/lib/milestoner/builders/web.rb +11 -43
  28. data/lib/milestoner/cli/actions/build/basename.rb +1 -1
  29. data/lib/milestoner/cli/actions/build/format.rb +1 -1
  30. data/lib/milestoner/cli/actions/build/index.rb +26 -0
  31. data/lib/milestoner/cli/actions/build/label.rb +1 -1
  32. data/lib/milestoner/cli/actions/build/layout.rb +1 -1
  33. data/lib/milestoner/cli/actions/build/max.rb +1 -1
  34. data/lib/milestoner/cli/actions/build/output.rb +25 -0
  35. data/lib/milestoner/cli/actions/build/stylesheet.rb +5 -7
  36. data/lib/milestoner/cli/actions/build/tail.rb +1 -1
  37. data/lib/milestoner/cli/actions/build/version.rb +1 -1
  38. data/lib/milestoner/cli/actions/cache/create.rb +1 -1
  39. data/lib/milestoner/cli/actions/cache/delete.rb +1 -1
  40. data/lib/milestoner/cli/actions/cache/find.rb +1 -1
  41. data/lib/milestoner/cli/actions/cache/info.rb +1 -1
  42. data/lib/milestoner/cli/actions/cache/list.rb +1 -1
  43. data/lib/milestoner/cli/actions/next.rb +1 -1
  44. data/lib/milestoner/cli/actions/publish.rb +1 -1
  45. data/lib/milestoner/cli/commands/build.rb +4 -3
  46. data/lib/milestoner/cli/commands/cache.rb +1 -1
  47. data/lib/milestoner/cli/shell.rb +1 -1
  48. data/lib/milestoner/commits/categorizer.rb +7 -5
  49. data/lib/milestoner/commits/collector.rb +1 -1
  50. data/lib/milestoner/commits/enricher.rb +7 -5
  51. data/lib/milestoner/commits/enrichers/author.rb +1 -1
  52. data/lib/milestoner/commits/enrichers/body.rb +1 -1
  53. data/lib/milestoner/commits/enrichers/colleague.rb +1 -1
  54. data/lib/milestoner/commits/enrichers/container.rb +2 -2
  55. data/lib/milestoner/commits/enrichers/{import.rb → dependencies.rb} +1 -1
  56. data/lib/milestoner/commits/enrichers/format.rb +1 -1
  57. data/lib/milestoner/commits/enrichers/issue.rb +1 -1
  58. data/lib/milestoner/commits/enrichers/milestone.rb +1 -1
  59. data/lib/milestoner/commits/enrichers/note.rb +1 -1
  60. data/lib/milestoner/commits/enrichers/review.rb +1 -1
  61. data/lib/milestoner/commits/enrichers/uri.rb +1 -1
  62. data/lib/milestoner/commits/versioner.rb +1 -1
  63. data/lib/milestoner/configuration/contract.rb +6 -2
  64. data/lib/milestoner/configuration/defaults.yml +10 -4
  65. data/lib/milestoner/configuration/model.rb +5 -1
  66. data/lib/milestoner/configuration/transformers/gems/description.rb +1 -1
  67. data/lib/milestoner/configuration/transformers/gems/label.rb +2 -2
  68. data/lib/milestoner/configuration/transformers/gems/name.rb +1 -1
  69. data/lib/milestoner/configuration/transformers/gems/uri.rb +1 -1
  70. data/lib/milestoner/configuration/transformers/generator/label.rb +1 -1
  71. data/lib/milestoner/configuration/transformers/generator/uri.rb +1 -1
  72. data/lib/milestoner/configuration/transformers/generator/version.rb +1 -1
  73. data/lib/milestoner/configuration/transformers/project/author.rb +1 -1
  74. data/lib/milestoner/container.rb +2 -1
  75. data/lib/milestoner/{import.rb → dependencies.rb} +1 -1
  76. data/lib/milestoner/durationer.rb +25 -0
  77. data/lib/milestoner/models/commit.rb +2 -1
  78. data/lib/milestoner/renderers/universal.rb +1 -1
  79. data/lib/milestoner/tags/builder.rb +40 -0
  80. data/lib/milestoner/tags/creator.rb +7 -9
  81. data/lib/milestoner/{commits/tagger.rb → tags/enricher.rb} +27 -15
  82. data/lib/milestoner/tags/publisher.rb +1 -1
  83. data/lib/milestoner/tags/pusher.rb +1 -1
  84. data/lib/milestoner/templates/layouts/page.adoc.erb +4 -0
  85. data/lib/milestoner/templates/layouts/page.git.erb +1 -0
  86. data/lib/milestoner/templates/layouts/page.html.erb +17 -10
  87. data/lib/milestoner/templates/layouts/page.md.erb +3 -0
  88. data/lib/milestoner/templates/layouts/page.stream.erb +2 -1
  89. data/lib/milestoner/templates/layouts/page.xml.erb +4 -0
  90. data/lib/milestoner/templates/milestones/_commit.adoc.erb +4 -4
  91. data/lib/milestoner/templates/milestones/_commit.html.erb +7 -4
  92. data/lib/milestoner/templates/milestones/_commit.stream.erb +1 -1
  93. data/lib/milestoner/templates/milestones/_commit.xml.erb +2 -6
  94. data/lib/milestoner/templates/milestones/_logo.adoc.erb +1 -1
  95. data/lib/milestoner/templates/milestones/_logo.html.erb +1 -1
  96. data/lib/milestoner/templates/milestones/index.adoc.erb +13 -0
  97. data/lib/milestoner/templates/milestones/index.html.erb +31 -0
  98. data/lib/milestoner/templates/milestones/index.md.erb +13 -0
  99. data/lib/milestoner/templates/milestones/show.adoc.erb +17 -1
  100. data/lib/milestoner/templates/milestones/show.git.erb +8 -0
  101. data/lib/milestoner/templates/milestones/show.html.erb +119 -1
  102. data/lib/milestoner/templates/milestones/show.md.erb +16 -1
  103. data/lib/milestoner/templates/milestones/show.stream.erb +17 -1
  104. data/lib/milestoner/templates/milestones/show.xml.erb +22 -1
  105. data/lib/milestoner/templates/public/page.css.erb +402 -299
  106. data/lib/milestoner/views/context.rb +2 -1
  107. data/lib/milestoner/views/milestones/index.rb +23 -0
  108. data/lib/milestoner/views/milestones/show.rb +2 -2
  109. data/lib/milestoner/views/parts/commit.rb +47 -37
  110. data/lib/milestoner/views/parts/tag.rb +25 -17
  111. data/lib/milestoner/views/parts/user.rb +1 -1
  112. data/lib/milestoner.rb +5 -1
  113. data/milestoner.gemspec +18 -18
  114. data.tar.gz.sig +0 -0
  115. metadata +68 -57
  116. metadata.gz.sig +0 -0
  117. data/lib/milestoner/cli/actions/build/root.rb +0 -25
  118. data/lib/milestoner/configuration/transformers/build/root.rb +0 -21
  119. data/lib/milestoner/syndication/builder.rb +0 -123
  120. data/lib/milestoner/syndication/refine.rb +0 -25
  121. data/lib/milestoner/syndication/shared.rb +0 -25
  122. data/lib/milestoner/templates/milestones/_tag.adoc.erb +0 -13
  123. data/lib/milestoner/templates/milestones/_tag.html.erb +0 -56
  124. data/lib/milestoner/templates/milestones/_tag.md.erb +0 -14
  125. data/lib/milestoner/templates/milestones/_tag.stream.erb +0 -15
  126. data/lib/milestoner/templates/milestones/_tag.xml.erb +0 -22
@@ -10,7 +10,7 @@ module Milestoner
10
10
  class Context < Hanami::View::Context
11
11
  extend Forwardable
12
12
 
13
- include Import[:settings]
13
+ include Dependencies[:settings]
14
14
 
15
15
  delegate %i[
16
16
  build_stylesheet
@@ -26,6 +26,7 @@ module Milestoner
26
26
  project_uri_logo
27
27
  project_uri_version
28
28
  project_version
29
+ stylesheet_uri
29
30
  ] => :settings
30
31
 
31
32
  def project_slug
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "hanami/view"
4
+
5
+ module Milestoner
6
+ module Views
7
+ module Milestones
8
+ # The index view.
9
+ class Index < Hanami::View
10
+ include Dependencies[:settings]
11
+
12
+ config.default_context = Context.new
13
+ config.part_namespace = Parts
14
+ config.paths = Container[:settings].build_template_paths
15
+ config.scope_namespace = Scopes
16
+ config.scope_builder = Milestoner::Views::ScopeBuilder
17
+ config.template = "milestones/index"
18
+
19
+ expose :tags
20
+ end
21
+ end
22
+ end
23
+ end
@@ -7,7 +7,7 @@ module Milestoner
7
7
  module Milestones
8
8
  # The show view.
9
9
  class Show < Hanami::View
10
- include Import[:settings]
10
+ include Dependencies[:settings]
11
11
 
12
12
  config.default_context = Context.new
13
13
  config.part_namespace = Parts
@@ -16,7 +16,7 @@ module Milestoner
16
16
  config.scope_builder = Milestoner::Views::ScopeBuilder
17
17
  config.template = "milestones/show"
18
18
 
19
- expose :tag
19
+ expose :past, :tag, :future
20
20
  end
21
21
  end
22
22
  end
@@ -9,7 +9,7 @@ module Milestoner
9
9
  # The commit presentation logic.
10
10
  # :reek:RepeatedConditional
11
11
  class Commit < Hanami::View::Part
12
- include Import[:settings, :sanitizer]
12
+ include Dependencies[:settings, :sanitizer, :color]
13
13
 
14
14
  using Refinements::Array
15
15
 
@@ -20,26 +20,35 @@ module Milestoner
20
20
  def initialize(**)
21
21
  super
22
22
  @prefixes = settings.commit_categories.pluck :label
23
- @authored_at = Time.at value.authored_at.to_i
24
23
  end
25
24
 
26
- def avatar_url user
27
- warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
28
- category: :deprecated
25
+ def colored_author(*custom)
26
+ custom.push :bold, :blue if custom.empty?
27
+ color[author.name, *custom]
28
+ end
29
29
 
30
- format settings.avatar_uri, id: user.external_id
30
+ def colored_created_relative_at(*custom)
31
+ custom.push :bright_purple if custom.empty?
32
+ color[authored_relative_at, *custom]
31
33
  end
32
34
 
33
- def profile_url user
34
- warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
35
- category: :deprecated
35
+ def colored_updated_relative_at(*custom)
36
+ custom.push :cyan if custom.empty?
37
+ color[committed_relative_at, *custom]
38
+ end
36
39
 
37
- format settings.profile_uri, id: user.handle
40
+ def colored_sha(*custom)
41
+ custom.push :yellow if custom.empty?
42
+ color[sha[...12], *custom]
38
43
  end
39
44
 
45
+ def created_at_human = created_at.strftime "%Y-%m-%d (%A) %I:%M %p %Z"
46
+
47
+ def created_at_machine = created_at.strftime "%Y-%m-%dT%H:%M:%S%z"
48
+
40
49
  def kind
41
50
  if prefixes.include? prefix then "normal"
42
- elsif value.directive? then "alert"
51
+ elsif directive? then "alert"
43
52
  else "error"
44
53
  end
45
54
  end
@@ -52,58 +61,59 @@ module Milestoner
52
61
 
53
62
  def icon
54
63
  if prefixes.include? prefix then String(prefix).downcase
55
- elsif value.directive? then "rebase"
64
+ elsif directive? then "rebase"
56
65
  else "invalid"
57
66
  end
58
67
  end
59
68
 
60
- def safe_body = sanitizer.call(value.body).html_safe
69
+ def milestone_emoji
70
+ case milestone
71
+ when "major" then "🔴"
72
+ when "minor" then "🔵"
73
+ when "patch" then "🟢"
74
+ else "⚪️"
75
+ end
76
+ end
61
77
 
62
- def safe_notes = sanitizer.call(value.notes).html_safe
78
+ def safe_body = sanitizer.call(body_html).html_safe
63
79
 
64
- def total_deletions = format "%d", -value.deletions
80
+ def safe_notes = sanitizer.call(notes_html).html_safe
81
+
82
+ def total_deletions = format "%d", -deletions
65
83
 
66
84
  # :reek:FeatureEnvy
67
85
  def total_insertions
68
- value.insertions.then { |total| total.positive? ? "+#{total}" : total.to_s }
86
+ insertions.then { |total| total.positive? ? "+#{total}" : total.to_s }
69
87
  end
70
88
 
71
89
  def tag
72
- return "rebase" if value.directive?
90
+ return "rebase" if directive?
73
91
  return "invalid" unless prefixes.include? prefix
74
92
 
75
- value.milestone
93
+ milestone
76
94
  end
77
95
 
78
- def popover_id = "po-#{value.sha}"
96
+ def popover_id = "po-#{sha}"
79
97
 
80
- def security = value.signature == "Good" ? "secure" : "insecure"
98
+ def security = signature == "Good" ? "secure" : "insecure"
81
99
 
82
- def signature_label
83
- value.signature.then { |kind| kind == "Good" ? "🔒 #{kind}" : "🔓 #{kind}" }
84
- end
85
-
86
- def fingerprint = value.fingerprint.then { |text| text.empty? ? "N/A" : text }
87
-
88
- def fingerprint_key = value.fingerprint_key.then { |text| text.empty? ? "N/A" : text }
89
-
90
- def at = authored_at.strftime "%Y-%m-%dT%H:%M:%S%z"
100
+ def signature_emoji = signature.then { |kind| kind == "Good" ? "🔒" : "🔓" }
91
101
 
92
- def datetime = authored_at.strftime "%Y-%m-%d (%A) %I:%M %p %Z"
102
+ def signature_id = value.fingerprint.then { |text| text.empty? ? "N/A" : text }
93
103
 
94
- def weekday = authored_at.strftime "%A"
104
+ def signature_key = value.fingerprint_key.then { |text| text.empty? ? "N/A" : text }
95
105
 
96
- def date = authored_at.strftime "%Y-%m-%d"
106
+ def signature_label
107
+ signature.then { |kind| kind == "Good" ? "🔒 #{kind}" : "🔓 #{kind}" }
108
+ end
97
109
 
98
- def time = authored_at.strftime "%I:%M %p"
110
+ def updated_at_human = updated_at.strftime "%Y-%m-%d (%A) %I:%M %p %Z"
99
111
 
100
- def zone = authored_at.strftime "%Z"
112
+ def updated_at_machine = updated_at.strftime "%Y-%m-%dT%H:%M:%S%z"
101
113
 
102
114
  private
103
115
 
104
- attr_reader :prefixes, :authored_at
105
-
106
- def prefix = value.prefix
116
+ attr_reader :prefixes
107
117
  end
108
118
  end
109
119
  end
@@ -8,21 +8,24 @@ module Milestoner
8
8
  module Parts
9
9
  # The tag presentation logic.
10
10
  class Tag < Hanami::View::Part
11
- include Import[:settings]
11
+ include Dependencies[:settings, :color, :durationer]
12
12
 
13
13
  using Refinements::String
14
14
 
15
15
  decorate :commits
16
16
  decorate :author, as: :user
17
17
 
18
- def avatar_url user
19
- warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
20
- category: :deprecated
18
+ def colored_total_deletions(*custom)
19
+ custom.push :green if custom.empty?
20
+ color[total_deletions, *custom]
21
+ end
21
22
 
22
- format settings.avatar_uri, id: user.external_id
23
+ def colored_total_insertions(*custom)
24
+ custom.push :red if custom.empty?
25
+ color[total_insertions, *custom]
23
26
  end
24
27
 
25
- def commit_count = value.commits.size
28
+ def commit_count = commits.size
26
29
 
27
30
  def committed_at fallback: Time.now
28
31
  value.committed_at.then { |at| at ? Time.at(at) : fallback }
@@ -32,22 +35,25 @@ module Milestoner
32
35
 
33
36
  def committed_datetime = committed_at.strftime "%Y-%m-%dT%H:%M:%S%z"
34
37
 
35
- def deletion_count = value.commits.sum(&:deletions)
36
-
37
- def empty? = value.commits.empty?
38
+ def deletion_count = commits.sum(&:deletions)
38
39
 
39
- def profile_url user
40
- warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
41
- category: :deprecated
40
+ def duration
41
+ return 0 if commits.empty?
42
42
 
43
- format settings.profile_uri, id: user.handle
43
+ min = commits.min_by(&:created_at)
44
+ max = commits.max_by(&:updated_at)
45
+ (max.updated_at - min.created_at).to_i
44
46
  end
45
47
 
46
- def file_count = value.commits.sum(&:files_changed)
48
+ def empty? = commits.empty?
49
+
50
+ def file_count = commits.sum(&:files_changed)
47
51
 
48
- def insertion_count = value.commits.sum(&:insertions)
52
+ def index? = settings.build_index
49
53
 
50
- def security = value.signature ? "🔒 Tag (secure)" : "🔓 Tag (insecure)"
54
+ def insertion_count = commits.sum(&:insertions)
55
+
56
+ def security = signature ? "🔒 Tag (secure)" : "🔓 Tag (insecure)"
51
57
 
52
58
  def total_commits = commit_count.then { |total| "#{total} commit".pluralize "s", total }
53
59
 
@@ -57,11 +63,13 @@ module Milestoner
57
63
  deletion_count.then { |total| "#{total} deletion".pluralize "s", total }
58
64
  end
59
65
 
66
+ def total_duration = duration.zero? ? "0 seconds" : durationer.call(duration)
67
+
60
68
  def total_insertions
61
69
  insertion_count.then { |total| "#{total} insertion".pluralize "s", total }
62
70
  end
63
71
 
64
- def uri = format settings.project_uri_version, id: value.version
72
+ def uri = format settings.project_uri_version, id: version
65
73
  end
66
74
  end
67
75
  end
@@ -7,7 +7,7 @@ module Milestoner
7
7
  module Parts
8
8
  # The user presentation logic.
9
9
  class User < Hanami::View::Part
10
- include Import[:settings]
10
+ include Dependencies[:settings]
11
11
 
12
12
  def name = value.name.then { |text| text || "Unknown" }
13
13
 
data/lib/milestoner.rb CHANGED
@@ -3,7 +3,11 @@
3
3
  require "zeitwerk"
4
4
 
5
5
  Zeitwerk::Loader.new.then do |loader|
6
- loader.inflector.inflect "ascii_doc" => "ASCIIDoc", "cli" => "CLI", "uri" => "URI"
6
+ loader.inflector.inflect "adoc" => "ADoc",
7
+ "ascii_doc" => "ASCIIDoc",
8
+ "cli" => "CLI",
9
+ "md" => "MD",
10
+ "uri" => "URI"
7
11
  loader.tag = File.basename __FILE__, ".rb"
8
12
  loader.push_dir __dir__
9
13
  loader.setup
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.12.0"
5
+ spec.version = "19.0.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/milestoner"
@@ -22,29 +22,29 @@ Gem::Specification.new do |spec|
22
22
  spec.signing_key = Gem.default_key_path
23
23
  spec.cert_chain = [Gem.default_cert_path]
24
24
 
25
- spec.required_ruby_version = ">= 3.3", "<= 3.4"
25
+ spec.required_ruby_version = "~> 3.4"
26
26
  spec.add_dependency "asciidoctor", "~> 2.0"
27
- spec.add_dependency "cff", "~> 1.1"
28
- spec.add_dependency "cogger", "~> 0.31"
29
- spec.add_dependency "containable", "~> 0.2"
30
- spec.add_dependency "core", "~> 1.10"
27
+ spec.add_dependency "cff", "~> 1.3"
28
+ spec.add_dependency "cogger", "~> 1.0"
29
+ spec.add_dependency "containable", "~> 1.0"
30
+ spec.add_dependency "core", "~> 2.0"
31
31
  spec.add_dependency "dry-monads", "~> 1.6"
32
32
  spec.add_dependency "dry-schema", "~> 1.13"
33
- spec.add_dependency "etcher", "~> 2.7"
34
- spec.add_dependency "gitt", "~> 3.12"
35
- spec.add_dependency "hanami-view", "~> 2.1"
36
- spec.add_dependency "infusible", "~> 3.12"
37
- spec.add_dependency "lode", "~> 1.8"
33
+ spec.add_dependency "etcher", "~> 3.0"
34
+ spec.add_dependency "gitt", "~> 4.0"
35
+ spec.add_dependency "hanami-view", "~> 2.2"
36
+ spec.add_dependency "infusible", "~> 4.0"
37
+ spec.add_dependency "lode", "~> 2.0"
38
38
  spec.add_dependency "redcarpet", "~> 3.6"
39
- spec.add_dependency "refinements", "~> 12.10"
40
- spec.add_dependency "rouge", "~> 4.4"
39
+ spec.add_dependency "refinements", "~> 13.0"
40
+ spec.add_dependency "rouge", "~> 4.5"
41
41
  spec.add_dependency "rss", "~> 0.3"
42
- spec.add_dependency "runcom", "~> 11.10"
42
+ spec.add_dependency "runcom", "~> 12.0"
43
43
  spec.add_dependency "sanitize", "~> 6.1"
44
- spec.add_dependency "sod", "~> 0.20"
45
- spec.add_dependency "spek", "~> 3.0"
46
- spec.add_dependency "tone", "~> 1.0"
47
- spec.add_dependency "versionaire", "~> 13.10"
44
+ spec.add_dependency "sod", "~> 1.0"
45
+ spec.add_dependency "spek", "~> 4.0"
46
+ spec.add_dependency "tone", "~> 2.0"
47
+ spec.add_dependency "versionaire", "~> 14.0"
48
48
  spec.add_dependency "zeitwerk", "~> 2.7"
49
49
 
50
50
  spec.bindir = "exe"
data.tar.gz.sig CHANGED
Binary file