milestoner 18.12.0 → 19.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +82 -68
- data/lib/milestoner/builders/adoc/container.rb +15 -0
- data/lib/milestoner/builders/adoc/dependencies.rb +9 -0
- data/lib/milestoner/builders/adoc/indexer.rb +28 -0
- data/lib/milestoner/builders/adoc/pager.rb +35 -0
- data/lib/milestoner/builders/ascii_doc.rb +10 -18
- data/lib/milestoner/builders/{import.rb → dependencies.rb} +1 -1
- data/lib/milestoner/builders/feed.rb +6 -15
- data/lib/milestoner/builders/markdown.rb +10 -18
- data/lib/milestoner/builders/md/container.rb +15 -0
- data/lib/milestoner/builders/md/dependencies.rb +9 -0
- data/lib/milestoner/builders/md/indexer.rb +28 -0
- data/lib/milestoner/builders/md/pager.rb +35 -0
- data/lib/milestoner/builders/path_resolver.rb +23 -0
- data/lib/milestoner/builders/site/container.rb +16 -0
- data/lib/milestoner/builders/site/dependencies.rb +9 -0
- data/lib/milestoner/builders/site/indexer.rb +33 -0
- data/lib/milestoner/builders/site/pager.rb +35 -0
- data/lib/milestoner/builders/site/styler.rb +47 -0
- data/lib/milestoner/builders/stream.rb +3 -3
- data/lib/milestoner/builders/syndication/builder.rb +125 -0
- data/lib/milestoner/builders/syndication/indexer.rb +29 -0
- data/lib/milestoner/builders/syndication/refine.rb +27 -0
- data/lib/milestoner/builders/syndication/shared.rb +27 -0
- data/lib/milestoner/builders/web.rb +11 -43
- data/lib/milestoner/cli/actions/build/basename.rb +1 -1
- data/lib/milestoner/cli/actions/build/format.rb +1 -1
- data/lib/milestoner/cli/actions/build/index.rb +26 -0
- data/lib/milestoner/cli/actions/build/label.rb +1 -1
- data/lib/milestoner/cli/actions/build/layout.rb +1 -1
- data/lib/milestoner/cli/actions/build/max.rb +1 -1
- data/lib/milestoner/cli/actions/build/output.rb +25 -0
- data/lib/milestoner/cli/actions/build/stylesheet.rb +5 -7
- data/lib/milestoner/cli/actions/build/tail.rb +1 -1
- data/lib/milestoner/cli/actions/build/version.rb +1 -1
- data/lib/milestoner/cli/actions/cache/create.rb +1 -1
- data/lib/milestoner/cli/actions/cache/delete.rb +1 -1
- data/lib/milestoner/cli/actions/cache/find.rb +1 -1
- data/lib/milestoner/cli/actions/cache/info.rb +1 -1
- data/lib/milestoner/cli/actions/cache/list.rb +1 -1
- data/lib/milestoner/cli/actions/next.rb +1 -1
- data/lib/milestoner/cli/actions/publish.rb +1 -1
- data/lib/milestoner/cli/commands/build.rb +4 -3
- data/lib/milestoner/cli/commands/cache.rb +1 -1
- data/lib/milestoner/cli/shell.rb +1 -1
- data/lib/milestoner/commits/categorizer.rb +7 -5
- data/lib/milestoner/commits/collector.rb +1 -1
- data/lib/milestoner/commits/enricher.rb +7 -5
- data/lib/milestoner/commits/enrichers/author.rb +1 -1
- data/lib/milestoner/commits/enrichers/body.rb +1 -1
- data/lib/milestoner/commits/enrichers/colleague.rb +1 -1
- data/lib/milestoner/commits/enrichers/container.rb +2 -2
- data/lib/milestoner/commits/enrichers/{import.rb → dependencies.rb} +1 -1
- data/lib/milestoner/commits/enrichers/format.rb +1 -1
- data/lib/milestoner/commits/enrichers/issue.rb +1 -1
- data/lib/milestoner/commits/enrichers/milestone.rb +1 -1
- data/lib/milestoner/commits/enrichers/note.rb +1 -1
- data/lib/milestoner/commits/enrichers/review.rb +1 -1
- data/lib/milestoner/commits/enrichers/uri.rb +1 -1
- data/lib/milestoner/commits/versioner.rb +1 -1
- data/lib/milestoner/configuration/contract.rb +6 -2
- data/lib/milestoner/configuration/defaults.yml +10 -4
- data/lib/milestoner/configuration/model.rb +5 -1
- data/lib/milestoner/configuration/transformers/gems/description.rb +1 -1
- data/lib/milestoner/configuration/transformers/gems/label.rb +2 -2
- data/lib/milestoner/configuration/transformers/gems/name.rb +1 -1
- data/lib/milestoner/configuration/transformers/gems/uri.rb +1 -1
- data/lib/milestoner/configuration/transformers/generator/label.rb +1 -1
- data/lib/milestoner/configuration/transformers/generator/uri.rb +1 -1
- data/lib/milestoner/configuration/transformers/generator/version.rb +1 -1
- data/lib/milestoner/configuration/transformers/project/author.rb +1 -1
- data/lib/milestoner/container.rb +2 -1
- data/lib/milestoner/{import.rb → dependencies.rb} +1 -1
- data/lib/milestoner/durationer.rb +25 -0
- data/lib/milestoner/models/commit.rb +2 -1
- data/lib/milestoner/renderers/universal.rb +1 -1
- data/lib/milestoner/tags/builder.rb +40 -0
- data/lib/milestoner/tags/creator.rb +7 -9
- data/lib/milestoner/{commits/tagger.rb → tags/enricher.rb} +27 -15
- data/lib/milestoner/tags/publisher.rb +1 -1
- data/lib/milestoner/tags/pusher.rb +1 -1
- data/lib/milestoner/templates/layouts/page.adoc.erb +4 -0
- data/lib/milestoner/templates/layouts/page.git.erb +1 -0
- data/lib/milestoner/templates/layouts/page.html.erb +17 -10
- data/lib/milestoner/templates/layouts/page.md.erb +3 -0
- data/lib/milestoner/templates/layouts/page.stream.erb +2 -1
- data/lib/milestoner/templates/layouts/page.xml.erb +4 -0
- data/lib/milestoner/templates/milestones/_commit.adoc.erb +4 -4
- data/lib/milestoner/templates/milestones/_commit.html.erb +7 -4
- data/lib/milestoner/templates/milestones/_commit.stream.erb +1 -1
- data/lib/milestoner/templates/milestones/_commit.xml.erb +2 -6
- data/lib/milestoner/templates/milestones/_logo.adoc.erb +1 -1
- data/lib/milestoner/templates/milestones/_logo.html.erb +1 -1
- data/lib/milestoner/templates/milestones/index.adoc.erb +13 -0
- data/lib/milestoner/templates/milestones/index.html.erb +31 -0
- data/lib/milestoner/templates/milestones/index.md.erb +13 -0
- data/lib/milestoner/templates/milestones/show.adoc.erb +17 -1
- data/lib/milestoner/templates/milestones/show.git.erb +8 -0
- data/lib/milestoner/templates/milestones/show.html.erb +119 -1
- data/lib/milestoner/templates/milestones/show.md.erb +16 -1
- data/lib/milestoner/templates/milestones/show.stream.erb +17 -1
- data/lib/milestoner/templates/milestones/show.xml.erb +22 -1
- data/lib/milestoner/templates/public/page.css.erb +402 -299
- data/lib/milestoner/views/context.rb +2 -1
- data/lib/milestoner/views/milestones/index.rb +23 -0
- data/lib/milestoner/views/milestones/show.rb +2 -2
- data/lib/milestoner/views/parts/commit.rb +47 -37
- data/lib/milestoner/views/parts/tag.rb +25 -17
- data/lib/milestoner/views/parts/user.rb +1 -1
- data/lib/milestoner.rb +5 -1
- data/milestoner.gemspec +18 -18
- data.tar.gz.sig +0 -0
- metadata +68 -57
- metadata.gz.sig +0 -0
- data/lib/milestoner/cli/actions/build/root.rb +0 -25
- data/lib/milestoner/configuration/transformers/build/root.rb +0 -21
- data/lib/milestoner/syndication/builder.rb +0 -123
- data/lib/milestoner/syndication/refine.rb +0 -25
- data/lib/milestoner/syndication/shared.rb +0 -25
- data/lib/milestoner/templates/milestones/_tag.adoc.erb +0 -13
- data/lib/milestoner/templates/milestones/_tag.html.erb +0 -56
- data/lib/milestoner/templates/milestones/_tag.md.erb +0 -14
- data/lib/milestoner/templates/milestones/_tag.stream.erb +0 -15
- 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
|
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
|
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
|
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
|
27
|
-
|
28
|
-
|
25
|
+
def colored_author(*custom)
|
26
|
+
custom.push :bold, :blue if custom.empty?
|
27
|
+
color[author.name, *custom]
|
28
|
+
end
|
29
29
|
|
30
|
-
|
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
|
34
|
-
|
35
|
-
|
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
|
-
|
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
|
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
|
64
|
+
elsif directive? then "rebase"
|
56
65
|
else "invalid"
|
57
66
|
end
|
58
67
|
end
|
59
68
|
|
60
|
-
def
|
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
|
78
|
+
def safe_body = sanitizer.call(body_html).html_safe
|
63
79
|
|
64
|
-
def
|
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
|
-
|
86
|
+
insertions.then { |total| total.positive? ? "+#{total}" : total.to_s }
|
69
87
|
end
|
70
88
|
|
71
89
|
def tag
|
72
|
-
return "rebase" if
|
90
|
+
return "rebase" if directive?
|
73
91
|
return "invalid" unless prefixes.include? prefix
|
74
92
|
|
75
|
-
|
93
|
+
milestone
|
76
94
|
end
|
77
95
|
|
78
|
-
def popover_id = "po-#{
|
96
|
+
def popover_id = "po-#{sha}"
|
79
97
|
|
80
|
-
def security =
|
98
|
+
def security = signature == "Good" ? "secure" : "insecure"
|
81
99
|
|
82
|
-
def
|
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
|
102
|
+
def signature_id = value.fingerprint.then { |text| text.empty? ? "N/A" : text }
|
93
103
|
|
94
|
-
def
|
104
|
+
def signature_key = value.fingerprint_key.then { |text| text.empty? ? "N/A" : text }
|
95
105
|
|
96
|
-
def
|
106
|
+
def signature_label
|
107
|
+
signature.then { |kind| kind == "Good" ? "🔒 #{kind}" : "🔓 #{kind}" }
|
108
|
+
end
|
97
109
|
|
98
|
-
def
|
110
|
+
def updated_at_human = updated_at.strftime "%Y-%m-%d (%A) %I:%M %p %Z"
|
99
111
|
|
100
|
-
def
|
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
|
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
|
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
|
19
|
-
|
20
|
-
|
18
|
+
def colored_total_deletions(*custom)
|
19
|
+
custom.push :green if custom.empty?
|
20
|
+
color[total_deletions, *custom]
|
21
|
+
end
|
21
22
|
|
22
|
-
|
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 =
|
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 =
|
36
|
-
|
37
|
-
def empty? = value.commits.empty?
|
38
|
+
def deletion_count = commits.sum(&:deletions)
|
38
39
|
|
39
|
-
def
|
40
|
-
|
41
|
-
category: :deprecated
|
40
|
+
def duration
|
41
|
+
return 0 if commits.empty?
|
42
42
|
|
43
|
-
|
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
|
48
|
+
def empty? = commits.empty?
|
49
|
+
|
50
|
+
def file_count = commits.sum(&:files_changed)
|
47
51
|
|
48
|
-
def
|
52
|
+
def index? = settings.build_index
|
49
53
|
|
50
|
-
def
|
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:
|
72
|
+
def uri = format settings.project_uri_version, id: version
|
65
73
|
end
|
66
74
|
end
|
67
75
|
end
|
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 "
|
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 = "
|
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 = "
|
25
|
+
spec.required_ruby_version = "~> 3.4"
|
26
26
|
spec.add_dependency "asciidoctor", "~> 2.0"
|
27
|
-
spec.add_dependency "cff", "~> 1.
|
28
|
-
spec.add_dependency "cogger", "~> 0
|
29
|
-
spec.add_dependency "containable", "~> 0
|
30
|
-
spec.add_dependency "core", "~>
|
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", "~>
|
34
|
-
spec.add_dependency "gitt", "~>
|
35
|
-
spec.add_dependency "hanami-view", "~> 2.
|
36
|
-
spec.add_dependency "infusible", "~>
|
37
|
-
spec.add_dependency "lode", "~>
|
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", "~>
|
40
|
-
spec.add_dependency "rouge", "~> 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", "~>
|
42
|
+
spec.add_dependency "runcom", "~> 12.0"
|
43
43
|
spec.add_dependency "sanitize", "~> 6.1"
|
44
|
-
spec.add_dependency "sod", "~> 0
|
45
|
-
spec.add_dependency "spek", "~>
|
46
|
-
spec.add_dependency "tone", "~>
|
47
|
-
spec.add_dependency "versionaire", "~>
|
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
|