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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9ed4141a024a3afb6dd224f6d8f6e52db2c189bfc7ff121d39d29bf0423abb9
4
- data.tar.gz: 966e8a280416c847a955b4ed3f674c42ea1ccebe7b8a1c8e8a48012df5743c26
3
+ metadata.gz: cb9c88f85ee84022276a2ef4f5ebb9a4c1f6cd63551fb7e67ae485b625330441
4
+ data.tar.gz: 0ae364c293ad1b41cd5176fc072d063c6d07e8cc43e9d4b68bd74a6b054d66b9
5
5
  SHA512:
6
- metadata.gz: '04963da39631d44ed1617b4e341c846a270359002cd2ab1b4728e2fce374fc0f96ea335bba338d0f005a07cb07ad2f5fd69864a901652d8418d0ab42c78d990d'
7
- data.tar.gz: 9c8a92faff3f870ccf7ba95bb2d5bf889273952465ed4ce6931c9386c578e50f042651bbc853acfc20d6fdc1dddf553e67ffa66d356eb0199434cd68d5a9c11a
6
+ metadata.gz: 7158fa4011bcb552f0f812c9018263125d82181c0cfe2db6b552ec073c68a1943d9755d251f9b755edcca37c8d987feef8f12fb94c7d5912704cf5dbd13b4e4a
7
+ data.tar.gz: b8f252c5994c5e7b14949016a6a3ad8a41ac1ea71edad6477bc0a4afa07a0c5dd93623a041d8fd51593e99b514e844cab35df85d4d5ef187bbf5790295335aaf
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -56,41 +56,41 @@ The following are screenshots of using this gem to render release notes for the
56
56
 
57
57
  === ASCII Doc
58
58
 
59
- image:https://alchemists.io/images/projects/milestoner/screenshots/build-ascii_doc-collapsed.png[Release Notes,width=1160,height=831,role=focal_point]
59
+ image:https://alchemists.io/images/projects/milestoner/screenshots/build-ascii_doc-collapsed.png[Release Notes,width=924,height=1224,role=focal_point]
60
60
 
61
- image:https://alchemists.io/images/projects/milestoner/screenshots/build-ascii_doc-expanded.png[Release Notes,width=1160,height=1335,role=focal_point]
61
+ image:https://alchemists.io/images/projects/milestoner/screenshots/build-ascii_doc-expanded.png[Release Notes,width=924,height=1552,role=focal_point]
62
62
 
63
63
  * *Command*: `milestoner build --format ascii_doc`
64
64
  * *Renderer*: {ascii_doc_link}
65
65
 
66
66
  === Feed
67
67
 
68
- image:https://alchemists.io/images/projects/milestoner/screenshots/build-feed-collapsed.png[Release Notes,width=1275,height=954,role=focal_point]
68
+ image:https://alchemists.io/images/projects/milestoner/screenshots/build-feed-collapsed.png[Release Notes,width=1450,height=972,role=focal_point]
69
69
 
70
- image:https://alchemists.io/images/projects/milestoner/screenshots/build-feed-expanded.png[Release Notes,width=1275,height=1613,role=focal_point]
70
+ image:https://alchemists.io/images/projects/milestoner/screenshots/build-feed-expanded.png[Release Notes,width=1350,height=1731,role=focal_point]
71
71
 
72
72
  * *Command*: `milestoner build --format feed`
73
73
  * *Renderer*: {net_news_wire_link}
74
74
 
75
75
  === Markdown Format
76
76
 
77
- image:https://alchemists.io/images/projects/milestoner/screenshots/build-markdown.png[Release Notes,width=796,height=703,role=focal_point]
77
+ image:https://alchemists.io/images/projects/milestoner/screenshots/build-markdown.png[Release Notes,width=967,height=919,role=focal_point]
78
78
 
79
79
  * *Command*: `milestoner build --format markdown`
80
80
  * *Renderer*: {marked_link}
81
81
 
82
82
  === Stream
83
83
 
84
- image:https://alchemists.io/images/projects/milestoner/screenshots/build-stream.png[Release Notes,width=566,height=320,role=focal_point]
84
+ image:https://alchemists.io/images/projects/milestoner/screenshots/build-stream.png[Release Notes,width=1001,height=407,role=focal_point]
85
85
 
86
86
  * *Command*: `milestoner build --format stream`
87
87
  * *Renderer*: {iterm_link}
88
88
 
89
89
  === Web
90
90
 
91
- image:https://alchemists.io/images/projects/milestoner/screenshots/build-web-collapsed.png[Release Notes,width=1296,height=647,role=focal_point]
91
+ image:https://alchemists.io/images/projects/milestoner/screenshots/build-web-collapsed.png[Release Notes,width=1323,height=1048,role=focal_point]
92
92
 
93
- image:https://alchemists.io/images/projects/milestoner/screenshots/build-web-expanded.png[Release Notes,width=1296,height=1032,role=focal_point]
93
+ image:https://alchemists.io/images/projects/milestoner/screenshots/build-web-expanded.png[Release Notes,width=1323,height=1540,role=focal_point]
94
94
 
95
95
  * *Command*: `milestoner build --format web`
96
96
  * *Renderer*: {firefox_link}
@@ -102,9 +102,9 @@ image:https://alchemists.io/images/projects/milestoner/screenshots/build-web-exp
102
102
  ** Example: `0.0.0`.
103
103
  * Defaults to including {git_link} commits since last tag (or initialization of repository) when building release notes. This can be customized further if desired.
104
104
  * Ensures {git_link} commit messages are grouped by prefix, in order defined, for categorization. For more details, see link:https://alchemists.io/projects/git-lint/#_commit_subject_prefix[Git Lint Commit Subject Prefix]. Defaults (can be customized):
105
- ** image:https://alchemists.io/images/projects/milestoner/icons/fixed.png[Fixed] Fixed
106
105
  ** image:https://alchemists.io/images/projects/milestoner/icons/added.png[Added] Added
107
106
  ** image:https://alchemists.io/images/projects/milestoner/icons/updated.png[Updated] Updated
107
+ ** image:https://alchemists.io/images/projects/milestoner/icons/fixed.png[Fixed] Fixed
108
108
  ** image:https://alchemists.io/images/projects/milestoner/icons/removed.png[Removed] Removed
109
109
  ** image:https://alchemists.io/images/projects/milestoner/icons/refactored.png[Refactored] Refactored
110
110
  * Ensures {git_link} commit messages are alphabetically sorted for release note categorization and readability.
@@ -169,19 +169,20 @@ avatar:
169
169
  build:
170
170
  basename: "index"
171
171
  format: "stream"
172
+ index: true
172
173
  layout: "page"
173
174
  max: 1
174
- root: "tmp/milestones"
175
- stylesheet: "page"
175
+ output: "tmp/milestones"
176
+ stylesheet: true
176
177
  tail: "head"
177
178
  commit:
178
179
  categories:
179
- - emoji: "✅"
180
- label: "Fixed"
181
180
  - emoji: "🟢"
182
181
  label: "Added"
183
182
  - emoji: "🔼"
184
183
  label: "Updated"
184
+ - emoji: "✅"
185
+ label: "Fixed"
185
186
  - emoji: "⛔️"
186
187
  label: "Removed"
187
188
  - emoji: "🔁"
@@ -200,6 +201,9 @@ project:
200
201
  version: "%<project_uri_home>s/versions/%<id>s"
201
202
  review:
202
203
  uri: "https://github.com/%<project_owner>s/%<project_name>s/pulls/%<id>s"
204
+ stylesheet:
205
+ path: "page.css"
206
+ uri: "../page"
203
207
  syndication:
204
208
  categories:
205
209
  - label: "Milestones"
@@ -218,6 +222,8 @@ syndication:
218
222
  mime: "application/atom+xml"
219
223
  relation: "self"
220
224
  uri: "%<project_uri_home>s/versions.xml"
225
+ tag:
226
+ subject: "Version %<project_version>s"
221
227
  tracker:
222
228
  uri: "https://github.com/%<project_owner>s/%<project_name>s/issues/%<id>s"
223
229
  ----
@@ -229,10 +235,11 @@ The above can be customized as follows:
229
235
  * `build`: Manages build details.
230
236
  ** `basename`: Required. The build file basename. Default: `index`. Used to customize the built file name.
231
237
  ** `format`: Required. The build output format. Default: `stream`. Used to determine what format to build the release notes as. Multiple formats are supported.
238
+ ** `index`: Required. Enables (or disables) building the versions index page for web format only. Default: true.
232
239
  ** `layout`: Required. The {hanami_views_link} layout used when building release notes. Default: page. This can be disabled when using `false` or customized further -- via your own {xdg_link} configuration -- when providing your own templates and/or partials.
233
240
  ** `max`: Required. The maximum number of {git_link} tags to build. Default: 1. By default, you are limited to building release notes for changes (commits) since the last tag but you can increase the maximum to build release notes for as many tags as you like.
234
- ** `root`: Required. The the root build directory. Default: `tmp/milestones`. This can be a relative or absolute path and defaults your current project. The path is automatically created if missing.
235
- ** `stylesheet`: Required. The stylesheet basename which is only used by the _web_ format. Default: `page`. This can be a relative path (i.e. `../page`) which is especially handy when build `max` is set to a number greater than one so the release notes for each tag you build loads the stylesheet properly. The path is automatically created if missing.
241
+ ** `output`: Required. The the directory for all generated output. Default: `tmp/milestones`. This can be a relative or absolute path and defaults to the current working directory. The path is automatically created if missing.
242
+ ** `stylesheet`: Required. Enables (or disables) building the stylesheet for web format only. Default: true.
236
243
  * `commit`: Manages commit categories, emojis, hyperlinks, and formatting.
237
244
  ** `categories`: Required. Defaults to five categories which pairs well with the {git_lint_link} gem. Category order is important with the first taking precedence over the second and so forth. Special characters are allowed for prefixes but should be enclosed in quotes. To disable categories, use an empty array. Example: `categories: []`.
238
245
  *** `emoji`: Required. The emoji associated with the label for output purposes. _Used by the {ascii_doc_link}, {markdown_link}, and stream build formats_. Defaults to the provided emojis.
@@ -263,6 +270,9 @@ The above can be customized as follows:
263
270
  ** `version`: Required. The project version. Dynamically calculated based on the last {git_link} tag of your project and {git_link} `Milestone` commit trailer metadata. The default is: `0.0.0`. For more on this see, the _Automatic Versioning_ section below. You can configure a value but is _not recommended_ since any custom value you supply will be used for _all_ deployments and release notes. You're better off letting this gem compute this for you.
264
271
  * `review`: Manages code review details.
265
272
  ** `uri`: Required. The URI format for linking to code reviews as formatted using {string_formats_link}. Default: GitHub. The `id` is currently a _placeholder_ for future feature support when API support is added. For now this links to _all_ code reviews with the goal to link to individual code reviews based on {git_trailers_link}.
273
+ * `stylesheet`: Manages stylesheet configuration for `web` build format.
274
+ ** `path`: Required. The relative (or absolute) path to where the stylesheet is built. Default: `page.css`. The path is automatically created if non-existing. A relative path is always relative to the build root as configured above.
275
+ ** `uri`: Required. The relative (or absolute) path for linking to the stylesheet within the page layout. Default: "../page".
266
276
  * `syndication`: Manages syndicated feed details when used with the `feed` build format.
267
277
  ** `categories`: Required. Manages category details.
268
278
  *** `label`: Required. The category label. Default: Milestones.
@@ -277,6 +287,8 @@ The above can be customized as follows:
277
287
  *** `mime`: Required. The mime type. Defaults to HTML and XML.
278
288
  *** `relation`: Required. Identifies the relation of the link which can either be `self` (i.e. XML) or `alternate` (i.e. HTML).
279
289
  *** `uri`: Required. The link URI to follow for more information. Defaults to dynamic string formatting based on existing configuration values.
290
+ * `tag`: Required. Manages tag creation.
291
+ ** `subject`: Required. The tag subject. Default: `+Version %<project_version>s+`. Example: "Version 1.2.3". You can use a string literal or include any configuration key for a dynamic subject. In the case of `project_version` this is calculated at runtime.
280
292
  * `tracker`: Required. Manages issue tracker details.
281
293
  ** `uri`: Required. The URI format for linking to issues as formatted using {string_formats_link}. Default: GitHub. The `id` is dynamically calculated via the commit `Issue` trailer as linted by {git_lint_link}. When no ID can be found, this will default to _All_ issues.
282
294
 
@@ -341,11 +353,11 @@ Once team member information is stored in your cache, you'll be able to build re
341
353
 
342
354
  If you don't use the cache, your release notes use a question mark (?) and _unknown_ for team members as highlighted below:
343
355
 
344
- image:https://alchemists.io/images/projects/milestoner/screenshots/no_cache.png[Usage,width=916,height=397,role=focal_point]
356
+ image:https://alchemists.io/images/projects/milestoner/screenshots/no_cache.png[Usage,width=978,height=618,role=focal_point]
345
357
 
346
358
  === Build
347
359
 
348
- image:https://alchemists.io/images/projects/milestoner/screenshots/usage-build.png[Usage,width=679,height=437,role=focal_point]
360
+ image:https://alchemists.io/images/projects/milestoner/screenshots/usage-build.png[Usage,width=787,height=675,role=focal_point]
349
361
 
350
362
  The build command allows you to quickly build release notes to check the current status of your project or deploy a new milestone. By default, the build command uses either the default or custom configuration as documented in the _Configuration_ section above. This means, when using the defaults, you can immediately build the release notes for your project in a temporary directory:
351
363
 
@@ -353,8 +365,8 @@ The build command allows you to quickly build release notes to check the current
353
365
  ----
354
366
  milestoner build --format web
355
367
  # 🟢 [milestoner] Building Milestoner (web)...
356
- # 🟢 [milestoner] Built: /Users/bkuhlmann/Engineering/OSS/milestoner/tmp/milestones/page.css.
357
- # 🟢 [milestoner] Built: /Users/bkuhlmann/Engineering/OSS/milestoner/tmp/milestones/index.html.
368
+ # 🟢 [milestoner] Created: /Users/bkuhlmann/Engineering/OSS/milestoner/tmp/milestones/page.css.
369
+ # 🟢 [milestoner] Created: /Users/bkuhlmann/Engineering/OSS/milestoner/tmp/milestones/index.html.
358
370
  ----
359
371
 
360
372
  The above command is so useful that I use the following `msw` (i.e. Milestoner Web) Bash alias to build current release notes or release notes for several tags:
@@ -378,7 +390,7 @@ msw() {
378
390
  open "$path"
379
391
  fi
380
392
  else
381
- milestoner build --max "$max" --stylesheet "../page" --format web
393
+ milestoner build --max "$max" --format web
382
394
 
383
395
  if [[ -d "$root" ]]; then
384
396
  ruby -run -e httpd "tmp/milestones" --port 3030 &
@@ -544,56 +556,58 @@ The quickest way to start customization is to copy the `templates` folder struct
544
556
  ....
545
557
  lib/milestoner/templates
546
558
  ├── layouts
547
- ├── page.adoc.erb
548
- ├── page.html.erb
549
- ├── page.md.erb
550
- ├── page.stream.erb
551
- └── page.xml.erb
559
+ ├── page.adoc.erb
560
+ ├── page.git.erb
561
+ ├── page.html.erb
562
+ ├── page.md.erb
563
+ ├── page.stream.erb
564
+ │ └── page.xml.erb
552
565
  ├── milestones
553
- ├── _avatar.adoc.erb
554
- ├── _avatar.html.erb
555
- ├── _avatar.md.erb
556
- ├── _avatar.xml.erb
557
- ├── _commit.adoc.erb
558
- ├── _commit.html.erb
559
- ├── _commit.md.erb
560
- ├── _commit.stream.erb
561
- ├── _commit.xml.erb
562
- ├── _content.adoc.erb
563
- ├── _content.html.erb
564
- ├── _content.xml.erb
565
- ├── _logo.adoc.erb
566
- ├── _logo.html.erb
567
- ├── _logo.md.erb
568
- ├── _logo.xml.erb
569
- ├── _none.adoc.erb
570
- ├── _none.html.erb
571
- ├── _none.xml.erb
572
- ├── _profile.adoc.erb
573
- ├── _profile.html.erb
574
- ├── _profile.md.erb
575
- ├── _profile.xml.erb
576
- ├── _tag-insecure.html.erb
577
- ├── _tag-secure.html.erb
578
- ├── _tag.adoc.erb
579
- ├── _tag.html.erb
580
- ├── _tag.md.erb
581
- ├── _tag.stream.erb
582
- ├── _tag.xml.erb
583
- ├── _user.adoc.erb
584
- ├── _user.html.erb
585
- ├── _user.md.erb
586
- ├── _user.xml.erb
587
- ├── _users.adoc.erb
588
- ├── _users.html.erb
589
- ├── _users.xml.erb
590
- ├── show.adoc.erb
591
- ├── show.html.erb
592
- ├── show.md.erb
593
- ├── show.stream.erb
594
- └── show.xml.erb
566
+ ├── _avatar.adoc.erb
567
+ ├── _avatar.html.erb
568
+ ├── _avatar.md.erb
569
+ ├── _avatar.xml.erb
570
+ ├── _commit.adoc.erb
571
+ ├── _commit.git.erb
572
+ ├── _commit.html.erb
573
+ ├── _commit.md.erb
574
+ ├── _commit.stream.erb
575
+ ├── _commit.xml.erb
576
+ ├── _content.adoc.erb
577
+ ├── _content.html.erb
578
+ ├── _content.xml.erb
579
+ ├── _logo.adoc.erb
580
+ ├── _logo.html.erb
581
+ ├── _logo.md.erb
582
+ ├── _logo.xml.erb
583
+ ├── _none.adoc.erb
584
+ ├── _none.html.erb
585
+ ├── _none.xml.erb
586
+ ├── _profile.adoc.erb
587
+ ├── _profile.html.erb
588
+ ├── _profile.md.erb
589
+ ├── _profile.xml.erb
590
+ ├── _tag-insecure.html.erb
591
+ ├── _tag-secure.html.erb
592
+ ├── _user.adoc.erb
593
+ ├── _user.html.erb
594
+ ├── _user.md.erb
595
+ ├── _user.xml.erb
596
+ ├── _users.adoc.erb
597
+ ├── _users.html.erb
598
+ ├── _users.md.erb
599
+ ├── _users.xml.erb
600
+ ├── index.adoc.erb
601
+ ├── index.html.erb
602
+ ├── index.md.erb
603
+ ├── show.adoc.erb
604
+ ├── show.git.erb
605
+ ├── show.html.erb
606
+ ├── show.md.erb
607
+ ├── show.stream.erb
608
+ │ └── show.xml.erb
595
609
  └── public
596
- └── page.css.erb
610
+ └── page.css.erb
597
611
  ....
598
612
 
599
613
  This means you could, for example, copy all of Milestoner's default templates to your own {runcom_link} configuration and customize as you see fit. Example (using global configuration):
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Milestoner
4
+ module Builders
5
+ module ADoc
6
+ # Defines ASCII Doc dependencies.
7
+ module Container
8
+ extend Containable
9
+
10
+ register(:indexer) { Indexer.new }
11
+ register(:pager) { Pager.new }
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Milestoner
4
+ module Builders
5
+ module ADoc
6
+ Dependencies = Infusible[Container]
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Milestoner
4
+ module Builders
5
+ module ADoc
6
+ # Builds ASCII Doc index.
7
+ class Indexer
8
+ include Milestoner::Dependencies[:settings, :logger]
9
+
10
+ def initialize(path_resolver: PathResolver, view: Views::Milestones::Index.new, **)
11
+ super(**)
12
+ @path_resolver = path_resolver
13
+ @view = view
14
+ end
15
+
16
+ def call tags
17
+ path_resolver.call settings.build_output.join("index.adoc"), logger: do |path|
18
+ path.write view.call(tags:, layout: settings.build_layout, format: :adoc)
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ attr_reader :path_resolver, :view
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Milestoner
4
+ module Builders
5
+ module ADoc
6
+ # Builds ASCII Doc version.
7
+ class Pager
8
+ include Milestoner::Dependencies[:settings, :logger]
9
+
10
+ def initialize(path_resolver: PathResolver, view: Views::Milestones::Show.new, **)
11
+ super(**)
12
+ @path_resolver = path_resolver
13
+ @view = view
14
+ end
15
+
16
+ def call past, tag, future
17
+ settings.project_version = tag.version
18
+ write past, tag, future
19
+ end
20
+
21
+ private
22
+
23
+ attr_reader :path_resolver, :view
24
+
25
+ def write past, tag, future
26
+ path = settings.build_output.join(tag.version, settings.build_basename).sub_ext ".adoc"
27
+
28
+ path_resolver.call path, logger: do
29
+ path.write view.call(past:, tag:, future:, layout: settings.build_layout, format: :adoc)
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,19 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "refinements/array"
3
4
  require "refinements/pathname"
4
5
 
5
6
  module Milestoner
6
7
  module Builders
7
- # Builds ASCII Doc output.
8
+ # Builds ASCII Doc files.
8
9
  class ASCIIDoc
9
- include Milestoner::Import[:settings, :logger]
10
+ include Milestoner::Dependencies[:settings, :logger]
11
+ include ADoc::Dependencies[:indexer, :pager]
10
12
 
13
+ using Refinements::Array
11
14
  using Refinements::Pathname
12
15
 
13
- def initialize(tagger: Commits::Tagger.new, view: Views::Milestones::Show.new, **)
16
+ def initialize(tagger: Tags::Enricher.new, view: Views::Milestones::Show.new, **)
17
+ super(**)
14
18
  @tagger = tagger
15
19
  @view = view
16
- super(**)
17
20
  end
18
21
 
19
22
  def call
@@ -27,20 +30,9 @@ module Milestoner
27
30
  attr_reader :tagger, :view
28
31
 
29
32
  def build tags
30
- tags.each { |tag| write tag }
31
- settings.build_root
32
- end
33
-
34
- def write tag
35
- path = make_path tag
36
-
37
- path.write view.call(tag:, layout: settings.build_layout, format: :adoc)
38
- logger.info { "Built: #{path}." }
39
- end
40
-
41
- def make_path tag
42
- version = settings.build_max == 1 ? "" : tag.version
43
- settings.build_root.join(version, settings.build_basename).make_ancestors.sub_ext ".adoc"
33
+ indexer.call tags
34
+ tags.ring { |future, present, past| pager.call past, present, future }
35
+ settings.build_output
44
36
  end
45
37
 
46
38
  def failure message
@@ -4,6 +4,6 @@ require "infusible"
4
4
 
5
5
  module Milestoner
6
6
  module Builders
7
- Import = Infusible[Container]
7
+ Dependencies = Infusible[Container]
8
8
  end
9
9
  end
@@ -6,34 +6,25 @@ module Milestoner
6
6
  module Builders
7
7
  # Builds syndicated feed output.
8
8
  class Feed
9
- include Milestoner::Import[:settings, :logger]
9
+ include Milestoner::Dependencies[:logger]
10
10
 
11
11
  using Refinements::Pathname
12
12
 
13
- def initialize(tagger: Commits::Tagger.new, syndicator: Syndication::Builder.new, **)
14
- @tagger = tagger
15
- @syndicator = syndicator
13
+ def initialize(tagger: Tags::Enricher.new, indexer: Syndication::Indexer.new, **)
16
14
  super(**)
15
+ @tagger = tagger
16
+ @indexer = indexer
17
17
  end
18
18
 
19
19
  def call
20
20
  tagger.call
21
- .bind { |tags| syndicator.call tags }
22
- .fmap { |body| write body }
21
+ .bind { |tags| indexer.call tags }
23
22
  .alt_map { |message| failure message }
24
23
  end
25
24
 
26
25
  private
27
26
 
28
- attr_reader :tagger, :syndicator
29
-
30
- def write body
31
- root = settings.build_root
32
- path = root.join(settings.build_basename).make_ancestors.sub_ext(".xml").write body
33
-
34
- logger.info { "Built: #{path}." }
35
- root
36
- end
27
+ attr_reader :tagger, :indexer
37
28
 
38
29
  def failure message
39
30
  logger.error { message }
@@ -1,19 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "refinements/array"
3
4
  require "refinements/pathname"
4
5
 
5
6
  module Milestoner
6
7
  module Builders
7
- # Builds Markdown output.
8
+ # Builds Markdown files.
8
9
  class Markdown
9
- include Milestoner::Import[:settings, :logger]
10
+ include Milestoner::Dependencies[:settings, :logger]
11
+ include MD::Dependencies[:indexer, :pager]
10
12
 
13
+ using Refinements::Array
11
14
  using Refinements::Pathname
12
15
 
13
- def initialize(tagger: Commits::Tagger.new, view: Views::Milestones::Show.new, **)
16
+ def initialize(tagger: Tags::Enricher.new, view: Views::Milestones::Show.new, **)
17
+ super(**)
14
18
  @tagger = tagger
15
19
  @view = view
16
- super(**)
17
20
  end
18
21
 
19
22
  def call
@@ -27,20 +30,9 @@ module Milestoner
27
30
  attr_reader :tagger, :view
28
31
 
29
32
  def build tags
30
- tags.each { |tag| write tag }
31
- settings.build_root
32
- end
33
-
34
- def write tag
35
- path = make_path tag
36
-
37
- path.write view.call(tag:, layout: settings.build_layout, format: :md)
38
- logger.info { "Built: #{path}." }
39
- end
40
-
41
- def make_path tag
42
- version = settings.build_max == 1 ? "" : tag.version
43
- settings.build_root.join(version, settings.build_basename).make_ancestors.sub_ext ".md"
33
+ indexer.call tags
34
+ tags.ring { |future, present, past| pager.call past, present, future }
35
+ settings.build_output
44
36
  end
45
37
 
46
38
  def failure message
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Milestoner
4
+ module Builders
5
+ module MD
6
+ # Defines Markdown dependencies.
7
+ module Container
8
+ extend Containable
9
+
10
+ register(:indexer) { Indexer.new }
11
+ register(:pager) { Pager.new }
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Milestoner
4
+ module Builders
5
+ module MD
6
+ Dependencies = Infusible[Container]
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Milestoner
4
+ module Builders
5
+ module MD
6
+ # Builds Markdown index.
7
+ class Indexer
8
+ include Milestoner::Dependencies[:settings, :logger]
9
+
10
+ def initialize(path_resolver: PathResolver, view: Views::Milestones::Index.new, **)
11
+ super(**)
12
+ @path_resolver = path_resolver
13
+ @view = view
14
+ end
15
+
16
+ def call tags
17
+ path_resolver.call settings.build_output.join("index.md"), logger: do |path|
18
+ path.write view.call(tags:, layout: settings.build_layout, format: :md)
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ attr_reader :path_resolver, :view
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Milestoner
4
+ module Builders
5
+ module MD
6
+ # Builds Markdown version.
7
+ class Pager
8
+ include Milestoner::Dependencies[:settings, :logger]
9
+
10
+ def initialize(path_resolver: PathResolver, view: Views::Milestones::Show.new, **)
11
+ super(**)
12
+ @path_resolver = path_resolver
13
+ @view = view
14
+ end
15
+
16
+ def call past, tag, future
17
+ settings.project_version = tag.version
18
+ write past, tag, future
19
+ end
20
+
21
+ private
22
+
23
+ attr_reader :path_resolver, :view
24
+
25
+ def write past, tag, future
26
+ path = settings.build_output.join(tag.version, settings.build_basename).sub_ext ".md"
27
+
28
+ path_resolver.call path, logger: do
29
+ path.write view.call(past:, tag:, future:, layout: settings.build_layout, format: :md)
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "dry/monads"
4
+ require "refinements/pathname"
5
+
6
+ module Milestoner
7
+ # Safely handles file paths which may or may not exist.
8
+ module Builders
9
+ using Refinements::Pathname
10
+
11
+ PathResolver = lambda do |path, logger:, &block|
12
+ if path.exist?
13
+ logger.warn { "Skipped (exists): #{path}." }
14
+ else
15
+ path.make_ancestors
16
+ block.call path if block
17
+ logger.info { "Created: #{path}." }
18
+ end
19
+
20
+ Dry::Monads::Success path
21
+ end
22
+ end
23
+ end