milestoner 17.11.0 → 18.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/README.adoc +183 -79
  4. data/lib/milestoner/builders/ascii_doc.rb +30 -10
  5. data/lib/milestoner/builders/container.rb +1 -0
  6. data/lib/milestoner/builders/feed.rb +46 -0
  7. data/lib/milestoner/builders/markdown.rb +30 -10
  8. data/lib/milestoner/builders/stream.rb +19 -8
  9. data/lib/milestoner/builders/web.rb +46 -16
  10. data/lib/milestoner/cli/actions/build/basename.rb +27 -0
  11. data/lib/milestoner/cli/actions/build/format.rb +4 -4
  12. data/lib/milestoner/cli/actions/build/label.rb +3 -3
  13. data/lib/milestoner/cli/actions/build/layout.rb +3 -3
  14. data/lib/milestoner/cli/actions/build/max.rb +24 -0
  15. data/lib/milestoner/cli/actions/build/root.rb +3 -3
  16. data/lib/milestoner/cli/actions/build/stylesheet.rb +36 -0
  17. data/lib/milestoner/cli/actions/build/tail.rb +26 -0
  18. data/lib/milestoner/cli/actions/build/version.rb +7 -3
  19. data/lib/milestoner/cli/actions/cache/delete.rb +1 -1
  20. data/lib/milestoner/cli/actions/cache/find.rb +2 -2
  21. data/lib/milestoner/cli/actions/cache/info.rb +1 -1
  22. data/lib/milestoner/cli/actions/cache/list.rb +2 -2
  23. data/lib/milestoner/cli/actions/next.rb +2 -2
  24. data/lib/milestoner/cli/actions/publish.rb +19 -4
  25. data/lib/milestoner/cli/commands/build.rb +15 -25
  26. data/lib/milestoner/cli/commands/cache.rb +1 -1
  27. data/lib/milestoner/commits/categorizer.rb +2 -2
  28. data/lib/milestoner/commits/enricher.rb +1 -1
  29. data/lib/milestoner/commits/enrichers/body.rb +2 -2
  30. data/lib/milestoner/commits/enrichers/format.rb +2 -2
  31. data/lib/milestoner/commits/enrichers/issue.rb +2 -2
  32. data/lib/milestoner/commits/enrichers/milestone.rb +1 -1
  33. data/lib/milestoner/commits/enrichers/note.rb +2 -2
  34. data/lib/milestoner/commits/enrichers/review.rb +2 -2
  35. data/lib/milestoner/commits/enrichers/uri.rb +2 -2
  36. data/lib/milestoner/commits/tagger.rb +78 -0
  37. data/lib/milestoner/configuration/contract.rb +30 -8
  38. data/lib/milestoner/configuration/defaults.yml +49 -24
  39. data/lib/milestoner/configuration/model.rb +17 -8
  40. data/lib/milestoner/configuration/transformers/build/template_paths.rb +4 -4
  41. data/lib/milestoner/configuration/transformers/citations/description.rb +5 -3
  42. data/lib/milestoner/configuration/transformers/citations/label.rb +2 -3
  43. data/lib/milestoner/configuration/transformers/citations/uri.rb +48 -0
  44. data/lib/milestoner/configuration/transformers/gems/description.rb +8 -2
  45. data/lib/milestoner/configuration/transformers/gems/label.rb +6 -3
  46. data/lib/milestoner/configuration/transformers/gems/name.rb +8 -2
  47. data/lib/milestoner/configuration/transformers/gems/uri.rb +12 -3
  48. data/lib/milestoner/configuration/transformers/generator/label.rb +2 -2
  49. data/lib/milestoner/configuration/transformers/generator/uri.rb +2 -2
  50. data/lib/milestoner/configuration/transformers/generator/version.rb +2 -2
  51. data/lib/milestoner/configuration/transformers/project/author.rb +5 -2
  52. data/lib/milestoner/configuration/transformers/project/label.rb +2 -2
  53. data/lib/milestoner/configuration/transformers/project/version.rb +2 -2
  54. data/lib/milestoner/configuration/transformers/syndication/link.rb +33 -0
  55. data/lib/milestoner/container.rb +20 -16
  56. data/lib/milestoner/models/commit.rb +2 -0
  57. data/lib/milestoner/models/tag.rb +8 -0
  58. data/lib/milestoner/renderers/universal.rb +2 -2
  59. data/lib/milestoner/syndication/builder.rb +120 -0
  60. data/lib/milestoner/syndication/refine.rb +25 -0
  61. data/lib/milestoner/syndication/shared.rb +25 -0
  62. data/lib/milestoner/tags/creator.rb +11 -33
  63. data/lib/milestoner/tags/publisher.rb +13 -5
  64. data/lib/milestoner/tags/pusher.rb +22 -13
  65. data/lib/milestoner/templates/layouts/page.html.erb +7 -1
  66. data/lib/milestoner/templates/layouts/page.xml.erb +11 -0
  67. data/lib/milestoner/templates/milestones/_avatar.adoc.erb +1 -0
  68. data/lib/milestoner/templates/milestones/_avatar.html.erb +1 -1
  69. data/lib/milestoner/templates/milestones/_avatar.md.erb +2 -0
  70. data/lib/milestoner/templates/milestones/_avatar.xml.erb +5 -0
  71. data/lib/milestoner/templates/milestones/_commit.adoc.erb +1 -1
  72. data/lib/milestoner/templates/milestones/_commit.html.erb +18 -8
  73. data/lib/milestoner/templates/milestones/_commit.md.erb +1 -1
  74. data/lib/milestoner/templates/milestones/_commit.xml.erb +84 -0
  75. data/lib/milestoner/templates/milestones/_icon.adoc.erb +1 -0
  76. data/lib/milestoner/templates/milestones/_icon.html.erb +2 -2
  77. data/lib/milestoner/templates/milestones/_icon.md.erb +5 -0
  78. data/lib/milestoner/templates/milestones/_icon.xml.erb +5 -0
  79. data/lib/milestoner/templates/milestones/_profile.adoc.erb +1 -0
  80. data/lib/milestoner/templates/milestones/_profile.md.erb +1 -0
  81. data/lib/milestoner/templates/milestones/_profile.xml.erb +5 -0
  82. data/lib/milestoner/templates/milestones/_tag.adoc.erb +13 -0
  83. data/lib/milestoner/templates/milestones/_tag.html.erb +82 -0
  84. data/lib/milestoner/templates/milestones/_tag.md.erb +18 -0
  85. data/lib/milestoner/templates/milestones/_tag.stream.erb +14 -0
  86. data/lib/milestoner/templates/milestones/_tag.xml.erb +27 -0
  87. data/lib/milestoner/templates/milestones/show.adoc.erb +1 -11
  88. data/lib/milestoner/templates/milestones/show.html.erb +1 -46
  89. data/lib/milestoner/templates/milestones/show.md.erb +1 -11
  90. data/lib/milestoner/templates/milestones/show.stream.erb +1 -11
  91. data/lib/milestoner/templates/milestones/show.xml.erb +1 -0
  92. data/lib/milestoner/templates/public/page.css.erb +111 -60
  93. data/lib/milestoner/views/context.rb +7 -4
  94. data/lib/milestoner/views/milestones/show.rb +4 -29
  95. data/lib/milestoner/views/parts/commit.rb +8 -8
  96. data/lib/milestoner/views/parts/tag.rb +51 -0
  97. data/milestoner.gemspec +8 -7
  98. data.tar.gz.sig +0 -0
  99. metadata +58 -22
  100. metadata.gz.sig +3 -3
  101. data/lib/milestoner/configuration/transformers/project/generator.rb +0 -35
  102. data/lib/milestoner/configuration/transformers/project/name.rb +0 -21
  103. data/lib/milestoner/configuration/transformers/uri/avatar.rb +0 -20
  104. data/lib/milestoner/configuration/transformers/uri/commit.rb +0 -23
  105. data/lib/milestoner/configuration/transformers/uri/profile.rb +0 -20
  106. data/lib/milestoner/configuration/transformers/uri/review.rb +0 -23
  107. data/lib/milestoner/configuration/transformers/uri/tracker.rb +0 -23
  108. data/lib/milestoner/error.rb +0 -7
@@ -0,0 +1,82 @@
1
+ <article class="milestone">
2
+ <header class="header">
3
+ <h1 class="title">
4
+ <% if project_uri_logo %>
5
+ <img src="<%= project_uri_logo %>" alt="Logo" width="30" height="30">
6
+ <% end %>
7
+
8
+ <a href="<%= project_uri_home %>" class="label"><%= project_label %></a>
9
+
10
+ <% if tag.commits.any? %>
11
+ <span class="version"><%= tag.version %></span>
12
+ <% end %>
13
+ </h1>
14
+
15
+ <time datetime="<%= tag.committed_datetime %>" class="date"><%= tag.committed_date %></time>
16
+ </header>
17
+
18
+ <% if tag.empty? %>
19
+ <p class="dormant"></p>
20
+ <% else %>
21
+ <section class="body" x-data="{open: false}">
22
+ <div class="overview">
23
+ <div class="owner">
24
+ <%= render :avatar, name: tag.author.name, url: tag.avatar_url(tag.author) %>
25
+ <%= render :profile, name: tag.author.name, url: tag.profile_url(tag.author) %>
26
+ </div>
27
+
28
+ <% if tag.signature %>
29
+ <button class="button secure" popovertarget="po-tag">
30
+ <span class="signature">Tag (valid)</span>
31
+ </button>
32
+
33
+ <dialog id="po-tag" class="popover" popover="auto">
34
+ <h1 class="label">Version <%= tag.version %></h1>
35
+
36
+ <h2 class="sublabel">SHA</h2>
37
+ <p><%= tag.sha %></p>
38
+
39
+ <h2 class="sublabel">Signature</h2>
40
+ <pre><%= tag.signature %></pre>
41
+ </dialog>
42
+ <% else %>
43
+ <button class="button insecure" popovertarget="po-tag">
44
+ <span class="signature">Tag (invalid)</span>
45
+ </button>
46
+
47
+ <dialog id="po-tag" class="popover" popover="auto">
48
+ <h1 class="label">Version <%= tag.version %></h1>
49
+ <p>No security. Signature not detected.</p>
50
+ </dialog>
51
+ <% end %>
52
+
53
+ <div class="actions">
54
+ <button class="button toggle" x-on:click="open = true">Expand</button>
55
+ <button class="button toggle" x-on:click="open = false">Collapse</button>
56
+ </div>
57
+ </div>
58
+
59
+ <div class="columns">
60
+ <span class="label">Commit</span>
61
+ <span class="label">Author</span>
62
+ <span class="label">Files</span>
63
+ <span class="label">Lines</span>
64
+ <span class="label">Issue</span>
65
+ <span class="label">Review</span>
66
+ </div>
67
+
68
+ <% tag.commits.each do |commit| %>
69
+ <%= commit.render :commit %>
70
+ <% end %>
71
+ </section>
72
+ <% end %>
73
+
74
+ <footer class="footer">
75
+ <p class="totals">
76
+ <span class="commits"><%= tag.total_commits %>.</span>
77
+ <span class="files"><%= tag.total_files %>.</span>
78
+ <span class="deletions"><%= tag.total_deletions %>.</span>
79
+ <span class="insertions"><%= tag.total_insertions %>.</span>
80
+ </p>
81
+ </footer>
82
+ </article>
@@ -0,0 +1,18 @@
1
+ <% if project_uri_logo %>
2
+ <p align="center">
3
+ <img src="<%= project_uri_logo %>" alt="Logo" width="100" height="100">
4
+ </p>
5
+ <% end %>
6
+
7
+ <% if tag.empty? %>
8
+ # [<%= project_label %>](<%= project_uri_home %>) (<%= tag.committed_date %>)
9
+
10
+ **<%= tag.total_commits %>. <%= tag.total_files %>. <%= tag.total_deletions %>. <%= tag.total_insertions %>.**
11
+ <% else %>
12
+ # [<%= project_label %>](<%= project_uri_home %>) <%= project_version %> (<%= tag.committed_date %>)
13
+ <%= render :avatar, name: tag.author.name, url: tag.avatar_url(tag.author) %> <%= render :profile, name: tag.author.name, url: tag.profile_url(tag.author) %> | <%= tag.security %>
14
+
15
+ <% tag.commits.each do |commit| %><%= commit.render :commit %><% end %>
16
+
17
+ **<%= tag.total_commits %>. <%= tag.total_files %>. <%= tag.total_deletions %>. <%= tag.total_insertions %>.**
18
+ <% end %>
@@ -0,0 +1,14 @@
1
+
2
+ <% if tag.empty? %>
3
+ <%= project_label %> (<%= tag.committed_date %>)
4
+
5
+ <%= tag.total_commits %>. <%= tag.total_files %>. <%= tag.total_deletions %>. <%= tag.total_insertions %>.
6
+ <% else %>
7
+ <%= project_label %> <%= project_version %> (<%= tag.committed_date %>)
8
+
9
+ <%= tag.author.name %> | <%= tag.security %>
10
+
11
+ <% tag.commits.each do |commit| %><%= commit.render :commit %><% end %>
12
+
13
+ <%= tag.total_commits %>. <%= tag.total_files %>. <%= tag.total_deletions %>. <%= tag.total_insertions %>.
14
+ <% end %>
@@ -0,0 +1,27 @@
1
+ <section>
2
+ <p style="display: flex; align-items: center; justify-content: center;">
3
+ <img src="<%= project_uri_logo %>" alt="Logo" height=100 width=100>
4
+ </p>
5
+
6
+ <% unless tag.empty? %>
7
+ <p style="display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;">
8
+ <%= render :avatar, name: tag.author.name, url: tag.avatar_url(tag.author) %>
9
+ <%= render :profile, name: tag.author.name, url: tag.profile_url(tag.author) %>
10
+ |
11
+ <%= tag.security %>
12
+ </p>
13
+
14
+ <% tag.commits.each do |commit| %>
15
+ <%= commit.render :commit %>
16
+ <% end %>
17
+ <% end %>
18
+
19
+ <p>
20
+ <strong>
21
+ <span><%= tag.total_commits %>.</span>
22
+ <span><%= tag.total_files %>.</span>
23
+ <span><%= tag.total_deletions %>.</span>
24
+ <span><%= tag.total_insertions %>.</span>
25
+ </strong>
26
+ </p>
27
+ </section>
@@ -1,11 +1 @@
1
- <% if commits.empty? %>
2
- = <%= project_label %> (<%= date %>)
3
-
4
- *<%= total_commits %>. <%= total_files %>. <%= total_deletions %>. <%= total_insertions %>.*
5
- <% else %>
6
- = <%= project_label %> <%= project_version %> (<%= date %>)
7
-
8
- <% commits.each do |commit| %><%= commit.render :commit %><% end %>
9
-
10
- *<%= total_commits %>. <%= total_files %>. <%= total_deletions %>. <%= total_insertions %>.*
11
- <% end %>
1
+ <%= tag.render :tag %>
@@ -1,46 +1 @@
1
- <article class="milestone">
2
- <header class="header">
3
- <h1 class="title">
4
- <a href="<%= uri %>" class="label"><%= project_label %></a>
5
-
6
- <% if commits.any? %>
7
- <span class="version"><%= project_version %></span>
8
- <% end %>
9
- </h1>
10
-
11
- <time datetime="<%= datetime %>" class="date"><%= date %></time>
12
- </header>
13
-
14
- <% if commits.empty? %>
15
- <p class="dormant"></p>
16
- <% else %>
17
- <section class="body" x-data="{open: false}">
18
- <div class="actions">
19
- <button class="toggle" x-on:click="open = true">Expand</button>
20
- <button class="toggle" x-on:click="open = false">Collapse</button>
21
- </div>
22
-
23
- <div class="columns">
24
- <span class="label">Commit</span>
25
- <span class="label">Author</span>
26
- <span class="label">Files</span>
27
- <span class="label">Lines</span>
28
- <span class="label">Issue</span>
29
- <span class="label">Review</span>
30
- </div>
31
-
32
- <% commits.each do |commit| %>
33
- <%= commit.render :commit %>
34
- <% end %>
35
- </section>
36
- <% end %>
37
-
38
- <footer class="footer">
39
- <p class="totals">
40
- <span class="commits"><%= total_commits %>.</span>
41
- <span class="files"><%= total_files %>.</span>
42
- <span class="deletions"><%= total_deletions %>.</span>
43
- <span class="insertions"><%= total_insertions %>.</span>
44
- </p>
45
- </footer>
46
- </article>
1
+ <%= tag.render :tag %>
@@ -1,11 +1 @@
1
- <% if commits.empty? %>
2
- # <%= project_label %> (<%= date %>)
3
-
4
- **<%= total_commits %>. <%= total_files %>. <%= total_deletions %>. <%= total_insertions %>.**
5
- <% else %>
6
- # <%= project_label %> <%= project_version %> (<%= date %>)
7
-
8
- <% commits.each do |commit| %><%= commit.render :commit %><% end %>
9
-
10
- **<%= total_commits %>. <%= total_files %>. <%= total_deletions %>. <%= total_insertions %>.**
11
- <% end %>
1
+ <%= tag.render :tag %>
@@ -1,11 +1 @@
1
- <% if commits.empty? %>
2
- <%= project_label %> (<%= date %>)
3
-
4
- <%= total_commits %>. <%= total_files %>. <%= total_deletions %>. <%= total_insertions %>.
5
- <% else %>
6
- <%= project_label %> <%= project_version %> (<%= date %>)
7
-
8
- <% commits.each do |commit| %><%= commit.render :commit %><% end %>
9
-
10
- <%= total_commits %>. <%= total_files %>. <%= total_deletions %>. <%= total_insertions %>.
11
- <% end %>
1
+ <%= tag.render :tag %>
@@ -0,0 +1 @@
1
+ <%= tag.render :tag %>
@@ -10,7 +10,7 @@
10
10
  --color-cheese: hsl(51, 100%, 93%);
11
11
  --color-cloud: hsl(219, 100%, 93%);
12
12
  --color-ghost: hsl(171.4, 17.1%, 92%);
13
- --color-green: hsl(110, 88%, 37%);
13
+ --color-green: hsl(112.6, 85.6%, 46.3%);
14
14
  --color-grey: hsl(240, 7%, 97%);
15
15
  --color-sea: hsl(210, 24%, 15%);
16
16
  --color-ice: hsl(216, 100%, 98%);
@@ -23,18 +23,111 @@
23
23
  --color-slate: hsl(211, 23%, 41%);
24
24
  --color-smoke: hsl(229, 31%, 93%);
25
25
  --color-white: hsl(0, 0%, 100%);
26
+ --shadow-color: 0deg 0% 0%;
26
27
 
27
28
  display: flex;
28
29
  flex-direction: column;
29
30
  font-family: var(--font-family);
30
31
  margin: 0 12vw;
31
32
 
33
+ .normal {
34
+ border-bottom-color: var(--color-ghost);
35
+ border-color: transparent;
36
+ border-style: solid;
37
+ border-width: var(--border-width);
38
+ }
39
+
40
+ .alert {
41
+ border: var(--border-width) solid var(--color-orange);
42
+ }
43
+
44
+ .error {
45
+ border: var(--border-width) solid var(--color-red);
46
+ }
47
+
48
+ .avatar {
49
+ border-radius: 50%;
50
+ }
51
+
52
+ .pill {
53
+ border-radius: 0.5rem;
54
+ padding: 0.2rem 0.4rem;
55
+ }
56
+
57
+ .popover {
58
+ border-radius: 0.5rem;
59
+ padding: 1rem;
60
+ max-width: calc(100vw - 20%);
61
+
62
+ &::backdrop {
63
+ backdrop-filter: brightness(60%);
64
+ }
65
+
66
+ .label {
67
+ font-size: 1.5rem;
68
+ text-align: center;
69
+ margin: 0 0 1rem 0;
70
+ }
71
+
72
+ .sublabel {
73
+ font-size: 1rem;
74
+ margin: 0 0 1rem 0;
75
+ }
76
+ }
77
+
78
+ .button {
79
+ background-size: 200% auto;
80
+ border-radius: 0.5rem;
81
+ border: 0.5rem soild var(--color-black);
82
+ box-shadow:
83
+ 0.7px 0.7px 1.5px hsl(var(--shadow-color) / 0),
84
+ 1.3px 1.3px 2.8px hsl(var(--shadow-color) / 0.07),
85
+ 2.6px 2.7px 5.6px hsl(var(--shadow-color) / 0.14);
86
+ cursor: pointer;
87
+ font-size: 0.9rem;
88
+ margin: 0;
89
+ padding: 0.2rem 0.5rem;
90
+ transition: 0.1s;
91
+
92
+ &:hover {
93
+ box-shadow:
94
+ 0.7px 0.7px 1.5px hsl(var(--shadow-color) / 0),
95
+ 1.3px 1.3px 2.8px hsl(var(--shadow-color) / 0.07);
96
+ transform: scale(0.95);
97
+ }
98
+ }
99
+
100
+ .secure {
101
+ background-color: var(--color-green);
102
+ color: var(--color-white);
103
+
104
+ .signature::before {
105
+ content: "\1F512";
106
+ margin-right: 0.5rem;
107
+ }
108
+ }
109
+
110
+ .insecure {
111
+ background-color: var(--color-red);
112
+ color: var(--color-white);
113
+
114
+ .signature::before {
115
+ content: "\1F513";
116
+ margin-right: 0.5rem;
117
+ }
118
+ }
119
+
32
120
  .header {
121
+ align-items: center;
33
122
  display: flex;
123
+ flex-wrap: wrap;
34
124
  justify-content: space-between;
35
- margin: 1rem 0 1rem 0;
125
+ margin: 1rem 0 2rem 0;
36
126
 
37
127
  .title {
128
+ align-items: center;
129
+ display: flex;
130
+ gap: 0.5rem;
38
131
  margin: 0;
39
132
  }
40
133
 
@@ -45,46 +138,28 @@
45
138
  }
46
139
  }
47
140
 
141
+ .overview {
142
+ display: flex;
143
+ align-items: center;
144
+ justify-content: space-between;
145
+ margin-bottom: 0.5rem;
146
+ }
147
+
148
+ .owner {
149
+ display: flex;
150
+ gap: 0.5rem;
151
+ }
152
+
48
153
  .actions {
49
154
  display: flex;
50
- justify-content: flex-end;
51
155
  gap: 0.5rem;
52
- margin-bottom: 0.5rem;
53
156
  }
54
157
 
55
158
  .toggle {
56
159
  background-color: var(--color-white);
57
- border: 0.13rem solid var(--color-carbon);
58
- border-radius: 0.5rem;
160
+ border: 0.15rem solid var(--color-smoke);
59
161
  color: var(--color-black);
60
- cursor: pointer;
61
- padding: 0.2rem;
62
- font-size: 0.9rem;
63
162
  width: 5rem;
64
- transition: border-color .2s ease-in;
65
-
66
- &:hover {
67
- border-color: var(--color-black);
68
- }
69
- }
70
-
71
- .normal {
72
- border-width: var(--border-width);
73
- border-style: solid;
74
- border-color: transparent;
75
- border-bottom-color: var(--color-ghost);
76
- }
77
-
78
- .alert {
79
- border: var(--border-width) solid var(--color-orange);
80
- }
81
-
82
- .error {
83
- border: var(--border-width) solid var(--color-red);
84
- }
85
-
86
- .avatar {
87
- border-radius: 50%;
88
163
  }
89
164
 
90
165
  .columns {
@@ -284,36 +359,12 @@
284
359
  font-size: 0.9rem;
285
360
  }
286
361
 
287
- .item {
362
+ .line {
288
363
  align-self: start;
289
364
  display: flex;
290
365
  gap: 0.5rem;
291
366
  margin: 0;
292
- }
293
-
294
- .pill {
295
- border-radius: 0.5rem;
296
- padding: 0.1rem 0.4rem;
297
- }
298
-
299
- .secure {
300
- background-color: var(--color-green);
301
- color: var(--color-white);
302
-
303
- .signature::before {
304
- content: "\1F512";
305
- margin-right: 0.5rem;
306
- }
307
- }
308
-
309
- .insecure {
310
- background-color: var(--color-red);
311
- color: var(--color-white);
312
-
313
- .signature::before {
314
- content: "\1F513";
315
- margin-right: 0.5rem;
316
- }
367
+ word-break: break-word;
317
368
  }
318
369
 
319
370
  .at {
@@ -370,7 +421,7 @@
370
421
  font-family: var(--font-family);
371
422
  font-style: italic;
372
423
  justify-content: center;
373
- margin-top: 2rem;
424
+ margin-top: 1rem;
374
425
  }
375
426
 
376
427
  .link {
@@ -10,20 +10,23 @@ module Milestoner
10
10
  class Context < Hanami::View::Context
11
11
  extend Forwardable
12
12
 
13
- include Import[:input]
13
+ include Import[:settings]
14
14
 
15
15
  delegate %i[
16
+ build_stylesheet
16
17
  generator_label
17
18
  generator_uri
18
19
  generator_version
19
20
  project_author
20
21
  project_description
21
- project_generator
22
22
  project_label
23
23
  project_name
24
- project_uri
24
+ project_uri_home
25
+ project_uri_icon
26
+ project_uri_logo
27
+ project_uri_version
25
28
  project_version
26
- ] => :input
29
+ ] => :settings
27
30
 
28
31
  def project_slug
29
32
  [project_name, project_version].compact.join("_").tr ".", Core::EMPTY_STRING
@@ -1,45 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "hanami/view"
4
- require "refinements/string"
5
4
 
6
5
  module Milestoner
7
6
  module Views
8
7
  module Milestones
9
- # Produces release notes in HTML format.
8
+ # Renders release notes.
10
9
  class Show < Hanami::View
11
- using Refinements::String
10
+ include Import[:settings]
12
11
 
13
12
  config.default_context = Context.new
14
13
  config.part_namespace = Parts
15
- config.paths = Container[:configuration].build_template_paths
14
+ config.paths = Container[:settings].build_template_paths
16
15
  config.template = "milestones/show"
17
16
 
18
- expose :commits
19
- expose :uri, default: Container[:configuration].project_uri
20
- expose :at, default: Time.now.utc
21
- expose(:date) { |at| at.strftime "%Y-%m-%d" }
22
- expose(:datetime) { |at| at.strftime "%Y-%m-%dT%H:%M:%S%z" }
23
-
24
- expose :total_commits do |commits|
25
- total = commits.size
26
- "#{total} commit".pluralize "s", total
27
- end
28
-
29
- expose :total_files do |commits|
30
- total = commits.sum(&:files_changed)
31
- "#{total} file".pluralize "s", total
32
- end
33
-
34
- expose :total_deletions do |commits|
35
- total = commits.sum(&:deletions)
36
- "#{total} deletion".pluralize "s", total
37
- end
38
-
39
- expose :total_insertions do |commits|
40
- total = commits.sum(&:insertions)
41
- "#{total} insertion".pluralize "s", total
42
- end
17
+ expose :tag
43
18
  end
44
19
  end
45
20
  end
@@ -6,22 +6,22 @@ require "refinements/array"
6
6
  module Milestoner
7
7
  module Views
8
8
  module Parts
9
- # Provides presentation for an individual commit.
9
+ # Represents an individual commit.
10
10
  # :reek:RepeatedConditional
11
11
  class Commit < Hanami::View::Part
12
- include Import[:configuration, :sanitizer]
12
+ include Import[:settings, :sanitizer]
13
13
 
14
14
  using Refinements::Array
15
15
 
16
16
  def initialize(**)
17
17
  super
18
- @prefixes = configuration.commit_categories.pluck :label
18
+ @prefixes = settings.commit_categories.pluck :label
19
19
  @authored_at = Time.at(value.authored_at.to_i).utc
20
20
  end
21
21
 
22
- def avatar_url(user) = format configuration.avatar_uri, id: user.external_id
22
+ def avatar_url(user) = format settings.avatar_uri, id: user.external_id
23
23
 
24
- def profile_url(user) = format configuration.profile_uri, id: user.handle
24
+ def profile_url(user) = format settings.profile_uri, id: user.handle
25
25
 
26
26
  def kind
27
27
  if prefixes.include? prefix then "normal"
@@ -31,9 +31,9 @@ module Milestoner
31
31
  end
32
32
 
33
33
  def emoji
34
- configuration.commit_categories
35
- .find { |category| category.fetch(:label) == prefix }
36
- .then { |category| category ? category.fetch(:emoji) : "🔶" }
34
+ settings.commit_categories
35
+ .find { |category| category.fetch(:label) == prefix }
36
+ .then { |category| category ? category.fetch(:emoji) : "🔶" }
37
37
  end
38
38
 
39
39
  def icon
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "hanami/view"
4
+ require "refinements/string"
5
+
6
+ module Milestoner
7
+ module Views
8
+ module Parts
9
+ # Represents an individual tag.
10
+ class Tag < Hanami::View::Part
11
+ include Import[:settings]
12
+
13
+ using Refinements::String
14
+
15
+ decorate :commits
16
+
17
+ def avatar_url(user) = format settings.avatar_uri, id: user.external_id
18
+
19
+ def committed_at fallback: Time.now.utc
20
+ value.committed_at.then { |at| at ? Time.at(at) : fallback }
21
+ end
22
+
23
+ def committed_date = committed_at.strftime "%Y-%m-%d"
24
+
25
+ def committed_datetime = committed_at.strftime "%Y-%m-%dT%H:%M:%S%z"
26
+
27
+ def empty? = value.commits.empty?
28
+
29
+ def profile_url(user) = format settings.profile_uri, id: user.handle
30
+
31
+ def security = value.signature ? "🔒 Tag (valid)" : "🔓 Tag (invalid)"
32
+
33
+ def total_commits
34
+ value.commits.size.then { |total| "#{total} commit".pluralize "s", total }
35
+ end
36
+
37
+ def total_files
38
+ value.commits.sum(&:files_changed).then { |total| "#{total} file".pluralize "s", total }
39
+ end
40
+
41
+ def total_deletions
42
+ value.commits.sum(&:deletions).then { |total| "#{total} deletion".pluralize "s", total }
43
+ end
44
+
45
+ def total_insertions
46
+ value.commits.sum(&:insertions).then { |total| "#{total} insertion".pluralize "s", total }
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
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 = "17.11.0"
5
+ spec.version = "18.0.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/milestoner"
@@ -26,20 +26,21 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency "asciidoctor", "~> 2.0"
27
27
  spec.add_dependency "cff", "~> 1.1"
28
28
  spec.add_dependency "cogger", "~> 0.21"
29
- spec.add_dependency "containable", "~> 0.0"
29
+ spec.add_dependency "containable", "~> 0.2"
30
30
  spec.add_dependency "core", "~> 1.3"
31
31
  spec.add_dependency "dry-monads", "~> 1.6"
32
32
  spec.add_dependency "dry-schema", "~> 1.13"
33
- spec.add_dependency "etcher", "~> 1.6"
34
- spec.add_dependency "gitt", "~> 3.2"
33
+ spec.add_dependency "etcher", "~> 2.0"
34
+ spec.add_dependency "gitt", "~> 3.6"
35
35
  spec.add_dependency "hanami-view", "~> 2.1"
36
- spec.add_dependency "infusible", "~> 3.5"
36
+ spec.add_dependency "infusible", "~> 3.8"
37
37
  spec.add_dependency "lode", "~> 1.4"
38
38
  spec.add_dependency "redcarpet", "~> 3.6"
39
39
  spec.add_dependency "refinements", "~> 12.5"
40
- spec.add_dependency "runcom", "~> 11.0"
40
+ spec.add_dependency "rss", "~> 0.3"
41
+ spec.add_dependency "runcom", "~> 11.5"
41
42
  spec.add_dependency "sanitize", "~> 6.1"
42
- spec.add_dependency "sod", "~> 0.8"
43
+ spec.add_dependency "sod", "~> 0.12"
43
44
  spec.add_dependency "spek", "~> 3.0"
44
45
  spec.add_dependency "versionaire", "~> 13.0"
45
46
  spec.add_dependency "zeitwerk", "~> 2.6"
data.tar.gz.sig CHANGED
Binary file