milestoner 18.5.0 → 18.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/README.adoc +47 -30
  4. data/lib/milestoner/commits/collector.rb +1 -0
  5. data/lib/milestoner/commits/tagger.rb +2 -0
  6. data/lib/milestoner/configuration/transformers/build/root.rb +1 -1
  7. data/lib/milestoner/syndication/builder.rb +7 -4
  8. data/lib/milestoner/templates/milestones/_avatar.adoc.erb +1 -1
  9. data/lib/milestoner/templates/milestones/_avatar.html.erb +6 -5
  10. data/lib/milestoner/templates/milestones/_avatar.md.erb +1 -2
  11. data/lib/milestoner/templates/milestones/_avatar.xml.erb +1 -5
  12. data/lib/milestoner/templates/milestones/_commit.adoc.erb +6 -20
  13. data/lib/milestoner/templates/milestones/_commit.html.erb +32 -53
  14. data/lib/milestoner/templates/milestones/_commit.md.erb +1 -1
  15. data/lib/milestoner/templates/milestones/_commit.xml.erb +13 -41
  16. data/lib/milestoner/templates/milestones/_content.adoc.erb +1 -0
  17. data/lib/milestoner/templates/milestones/_content.html.erb +1 -0
  18. data/lib/milestoner/templates/milestones/_content.xml.erb +1 -0
  19. data/lib/milestoner/templates/milestones/_logo.adoc.erb +1 -0
  20. data/lib/milestoner/templates/milestones/_logo.html.erb +1 -0
  21. data/lib/milestoner/templates/milestones/_logo.md.erb +3 -0
  22. data/lib/milestoner/templates/milestones/_logo.xml.erb +3 -0
  23. data/lib/milestoner/templates/milestones/_none.adoc.erb +1 -0
  24. data/lib/milestoner/templates/milestones/_none.html.erb +1 -0
  25. data/lib/milestoner/templates/milestones/_none.xml.erb +1 -0
  26. data/lib/milestoner/templates/milestones/_profile.adoc.erb +1 -1
  27. data/lib/milestoner/templates/milestones/_profile.html.erb +1 -5
  28. data/lib/milestoner/templates/milestones/_profile.md.erb +1 -1
  29. data/lib/milestoner/templates/milestones/_profile.xml.erb +1 -5
  30. data/lib/milestoner/templates/milestones/_tag-insecure.html.erb +8 -0
  31. data/lib/milestoner/templates/milestones/_tag-secure.html.erb +13 -0
  32. data/lib/milestoner/templates/milestones/_tag.adoc.erb +3 -3
  33. data/lib/milestoner/templates/milestones/_tag.html.erb +3 -29
  34. data/lib/milestoner/templates/milestones/_tag.md.erb +2 -6
  35. data/lib/milestoner/templates/milestones/_tag.xml.erb +2 -7
  36. data/lib/milestoner/templates/milestones/_user.adoc.erb +1 -0
  37. data/lib/milestoner/templates/milestones/_user.html.erb +1 -0
  38. data/lib/milestoner/templates/milestones/_user.md.erb +1 -0
  39. data/lib/milestoner/templates/milestones/_user.xml.erb +1 -0
  40. data/lib/milestoner/templates/milestones/_users.adoc.erb +3 -0
  41. data/lib/milestoner/templates/milestones/_users.html.erb +7 -0
  42. data/lib/milestoner/templates/milestones/_users.md.erb +3 -0
  43. data/lib/milestoner/templates/milestones/_users.xml.erb +7 -0
  44. data/lib/milestoner/templates/public/page.css.erb +49 -21
  45. data/lib/milestoner/views/context.rb +1 -1
  46. data/lib/milestoner/views/milestones/show.rb +3 -1
  47. data/lib/milestoner/views/parts/commit.rb +27 -3
  48. data/lib/milestoner/views/parts/tag.rb +15 -4
  49. data/lib/milestoner/views/parts/user.rb +32 -0
  50. data/lib/milestoner/views/scope_builder.rb +40 -0
  51. data/lib/milestoner/views/scopes/content.rb +17 -0
  52. data/lib/milestoner/views/scopes/logo.rb +15 -0
  53. data/lib/milestoner/views/scopes/tag_signature.rb +27 -0
  54. data/lib/milestoner/views/scopes/users.rb +14 -0
  55. data/milestoner.gemspec +3 -3
  56. data.tar.gz.sig +0 -0
  57. metadata +33 -11
  58. metadata.gz.sig +0 -0
  59. data/lib/milestoner/templates/milestones/_icon.adoc.erb +0 -1
  60. data/lib/milestoner/templates/milestones/_icon.html.erb +0 -6
  61. data/lib/milestoner/templates/milestones/_icon.md.erb +0 -5
  62. data/lib/milestoner/templates/milestones/_icon.xml.erb +0 -5
@@ -1,11 +1,11 @@
1
1
  <% if tag.empty? %>
2
- = pass:[ ]<% if project_uri_logo %>image:<%= project_uri_logo %>[Logo,50,50]pass:[ ]<% end %>link:<%= project_uri_home %>[<%= project_label %>] (<%= tag.committed_date %>)
2
+ = pass:[ ]<%= scope(:logo).call.strip %>link:<%= project_uri_home %>[<%= project_label %>] (<%= tag.committed_date %>)
3
3
 
4
4
  *<%= tag.total_commits %>. <%= tag.total_files %>. <%= tag.total_deletions %>. <%= tag.total_insertions %>.*
5
5
  <% else %>
6
- = pass:[ ]<% if project_uri_logo %>image:<%= project_uri_logo %>[Logo,50,50]pass:[ ]<% end %>link:<%= project_uri_home %>[<%= project_label %>] <%= tag.version %> (<%= tag.committed_date %>)
6
+ = pass:[ ]<%= scope(:logo).call.strip %>link:<%= project_uri_home %>[<%= project_label %>] <%= tag.version %> (<%= tag.committed_date %>)
7
7
 
8
- <%= 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 %>
8
+ <%= render :user, user: tag.author %> | <%= tag.security %>
9
9
 
10
10
  <% tag.commits.each do |commit| %><%= commit.render :commit %><% end %>
11
11
 
@@ -1,9 +1,7 @@
1
1
  <article class="milestone">
2
2
  <header class="header">
3
3
  <h1 class="title">
4
- <% if project_uri_logo %>
5
- <img src="<%= project_uri_logo %>" alt="Logo" width="30" height="30">
6
- <% end %>
4
+ <%= scope(:logo).call %>
7
5
 
8
6
  <a href="<%= project_uri_home %>" class="label"><%= project_label %></a>
9
7
 
@@ -21,34 +19,10 @@
21
19
  <section class="body" x-data="{open: false}">
22
20
  <div class="overview">
23
21
  <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) %>
22
+ <%= render :user, user: tag.author %>
26
23
  </div>
27
24
 
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 %>
25
+ <%= scope(:tag_signature, tag:).call %>
52
26
 
53
27
  <div class="actions">
54
28
  <button class="button toggle" x-on:click="open = true">Expand</button>
@@ -1,8 +1,4 @@
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 %>
1
+ <%= scope(:logo).call %>
6
2
 
7
3
  <% if tag.empty? %>
8
4
  # [<%= project_label %>](<%= project_uri_home %>) (<%= tag.committed_date %>)
@@ -10,7 +6,7 @@
10
6
  **<%= tag.total_commits %>. <%= tag.total_files %>. <%= tag.total_deletions %>. <%= tag.total_insertions %>.**
11
7
  <% else %>
12
8
  # [<%= project_label %>](<%= project_uri_home %>) <%= tag.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 %>
9
+ <%= render :user, user: tag.author %> | <%= tag.security %>
14
10
 
15
11
  <% tag.commits.each do |commit| %><%= commit.render :commit %><% end %>
16
12
 
@@ -1,14 +1,9 @@
1
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>
2
+ <%= scope(:logo).call %>
5
3
 
6
4
  <% unless tag.empty? %>
7
5
  <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 %>
6
+ <%= render :user, user: tag.author %> | <%= tag.security %>
12
7
  </p>
13
8
 
14
9
  <% tag.commits.each do |commit| %>
@@ -0,0 +1 @@
1
+ <%= render(:avatar, user:).strip %> <%= render(:profile, user:).strip %>
@@ -0,0 +1 @@
1
+ <%= render :avatar, user: %> <%= render :profile, user: %>
@@ -0,0 +1 @@
1
+ <%= render(:avatar, user:).strip.html_safe %> <%= render(:profile, user:).strip.html_safe %>
@@ -0,0 +1 @@
1
+ <%= render :avatar, user: %> <%= render :profile, user: %>
@@ -0,0 +1,3 @@
1
+ <% users.each do |user| %>
2
+ * <%= render :user, user: %>
3
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <ul class="list">
2
+ <% users.each do |user| %>
3
+ <li class="item">
4
+ <%= render :user, user: %>
5
+ </li>
6
+ <% end %>
7
+ </ul>
@@ -0,0 +1,3 @@
1
+ <% users.each do |user| %>
2
+ - <%= render :user, user: %>
3
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <ul>
2
+ <% users.each do |user| %>
3
+ <li style="display: inline-flex; align-items: center; gap: 0.5rem;">
4
+ <%= render :user, user: %>
5
+ </li>
6
+ <% end %>
7
+ </ul>
@@ -17,6 +17,7 @@
17
17
  --color-ink: hsl(210, 4%, 11%);
18
18
  --color-khaki: hsl(35, 26%, 75%);
19
19
  --color-lime: hsl(82, 100%, 58%);
20
+ --color-pink: hsl(342, 100%, 75%);
20
21
  --color-purple: hsl(259, 60%, 79.4%);
21
22
  --color-red: hsl(0, 100%, 73%);
22
23
  --color-sea: hsl(190, 100%, 60%);
@@ -148,10 +149,14 @@
148
149
  }
149
150
 
150
151
  .o {
151
- color: var(--color-blue);
152
+ color: var(--color-pink);
152
153
  font-weight: bold;
153
154
  }
154
155
 
156
+ .p {
157
+ color: var(--color-pink);
158
+ }
159
+
155
160
  .mf {
156
161
  color: var(--color-ice);
157
162
  }
@@ -201,7 +206,7 @@
201
206
  }
202
207
 
203
208
  .si {
204
- color: var(--color-purple);
209
+ color: var(--color-pink);
205
210
  }
206
211
 
207
212
  .sx {
@@ -365,7 +370,7 @@
365
370
  border-radius: 0.3rem;
366
371
  color: var(--color-white);
367
372
  font-size: 0.95rem;
368
- padding: 0.1rem 0.3rem;
373
+ padding: 0.1rem 0.2rem;
369
374
  }
370
375
 
371
376
  pre:not([class^=language]) {
@@ -381,6 +386,7 @@
381
386
  border-radius: 0.5rem;
382
387
  font-weight: 400;
383
388
  padding: 0.5rem;
389
+ word-break: break-word;
384
390
  }
385
391
 
386
392
  img, video {
@@ -415,6 +421,7 @@
415
421
  }
416
422
 
417
423
  .popover {
424
+ border-color: var(--color-black);
418
425
  border-radius: 0.5rem;
419
426
  padding: 1rem;
420
427
  max-width: calc(100vw - 20%);
@@ -460,21 +467,11 @@
460
467
  .secure {
461
468
  background-color: var(--color-green);
462
469
  color: var(--color-white);
463
-
464
- .signature::before {
465
- content: "\1F512";
466
- margin-right: 0.5rem;
467
- }
468
470
  }
469
471
 
470
472
  .insecure {
471
473
  background-color: var(--color-red);
472
474
  color: var(--color-white);
473
-
474
- .signature::before {
475
- content: "\1F513";
476
- margin-right: 0.5rem;
477
- }
478
475
  }
479
476
 
480
477
  .header {
@@ -562,11 +559,32 @@
562
559
  }
563
560
 
564
561
  &::before {
562
+ color: var(--color-carbon);
565
563
  content: "\25B6";
566
564
  cursor: pointer;
567
565
  width: 0.5rem;
568
566
  }
569
567
 
568
+ &:has(~ * .major)::before {
569
+ color: var(--color-major);
570
+ }
571
+
572
+ &:has(~ * .minor)::before {
573
+ color: var(--color-minor);
574
+ }
575
+
576
+ &:has(~ * .patch)::before {
577
+ color: var(--color-patch);
578
+ }
579
+
580
+ &:has(~ * .rebase)::before {
581
+ color: var(--color-orange);
582
+ }
583
+
584
+ &:has(~ * .invalid)::before {
585
+ color: var(--color-red);
586
+ }
587
+
570
588
  &:hover {
571
589
  background-color: var(--color-powder);
572
590
  }
@@ -622,12 +640,14 @@
622
640
 
623
641
  .tag {
624
642
  align-self: stretch;
643
+ border-radius: 0.3rem;
625
644
  grid-area: tag;
645
+ margin: 1rem 0;
646
+ padding: 0 0.2rem;
626
647
  padding: 0.5rem 0.2rem 0.5rem 0.1rem;
627
648
  text-align: center;
628
649
  text-transform: capitalize;
629
650
  writing-mode: vertical-lr;
630
- padding: 0 0.2rem;
631
651
  }
632
652
 
633
653
  .major {
@@ -675,6 +695,11 @@
675
695
  padding: 0 0.5rem 0.5rem 0.5rem;
676
696
  }
677
697
 
698
+ .content {
699
+ margin: 0 0.5rem;
700
+ word-break: break-word;
701
+ }
702
+
678
703
  .message {
679
704
  background-color: var(--color-grey);
680
705
  border-radius: 0.5rem;
@@ -684,11 +709,6 @@
684
709
  .bar {
685
710
  background-color: var(--color-smoke);
686
711
  }
687
-
688
- .content {
689
- margin: 0 0.5rem;
690
- word-break: break-word;
691
- }
692
712
  }
693
713
 
694
714
  .notes {
@@ -700,9 +720,17 @@
700
720
  .bar {
701
721
  background-color: var(--color-butter);
702
722
  }
723
+ }
703
724
 
704
- .content {
705
- margin: 0 0.5rem;
725
+ .list {
726
+ list-style: none;
727
+ padding: 0;
728
+ margin: 0;
729
+
730
+ .item {
731
+ align-items: center;
732
+ display: flex;
733
+ gap: 0.5rem;
706
734
  }
707
735
  }
708
736
 
@@ -6,7 +6,7 @@ require "hanami/view"
6
6
 
7
7
  module Milestoner
8
8
  module Views
9
- # Provides a common context for all views.
9
+ # The view context.
10
10
  class Context < Hanami::View::Context
11
11
  extend Forwardable
12
12
 
@@ -5,13 +5,15 @@ require "hanami/view"
5
5
  module Milestoner
6
6
  module Views
7
7
  module Milestones
8
- # Renders release notes.
8
+ # The show view.
9
9
  class Show < Hanami::View
10
10
  include Import[:settings]
11
11
 
12
12
  config.default_context = Context.new
13
13
  config.part_namespace = Parts
14
14
  config.paths = Container[:settings].build_template_paths
15
+ config.scope_namespace = Scopes
16
+ config.scope_builder = Milestoner::Views::ScopeBuilder
15
17
  config.template = "milestones/show"
16
18
 
17
19
  expose :tag
@@ -6,22 +6,36 @@ require "refinements/array"
6
6
  module Milestoner
7
7
  module Views
8
8
  module Parts
9
- # Represents an individual commit.
9
+ # The commit presentation logic.
10
10
  # :reek:RepeatedConditional
11
11
  class Commit < Hanami::View::Part
12
12
  include Import[:settings, :sanitizer]
13
13
 
14
14
  using Refinements::Array
15
15
 
16
+ decorate :author, as: :user
17
+ decorate :collaborators, as: :users
18
+ decorate :signers, as: :users
19
+
16
20
  def initialize(**)
17
21
  super
18
22
  @prefixes = settings.commit_categories.pluck :label
19
23
  @authored_at = Time.at(value.authored_at.to_i).utc
20
24
  end
21
25
 
22
- def avatar_url(user) = format settings.avatar_uri, id: user.external_id
26
+ def avatar_url user
27
+ warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
28
+ category: :deprecated
29
+
30
+ format settings.avatar_uri, id: user.external_id
31
+ end
23
32
 
24
- def profile_url(user) = format settings.profile_uri, id: user.handle
33
+ def profile_url user
34
+ warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
35
+ category: :deprecated
36
+
37
+ format settings.profile_uri, id: user.handle
38
+ end
25
39
 
26
40
  def kind
27
41
  if prefixes.include? prefix then "normal"
@@ -61,8 +75,18 @@ module Milestoner
61
75
  value.milestone
62
76
  end
63
77
 
78
+ def popover_id = "po-#{value.sha}"
79
+
64
80
  def security = value.signature == "Good" ? "secure" : "insecure"
65
81
 
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
+
66
90
  def at = authored_at.strftime "%Y-%m-%dT%H:%M:%S%z"
67
91
 
68
92
  def datetime = authored_at.strftime "%Y-%m-%d (%A) at %H:%M %p %Z"
@@ -6,15 +6,21 @@ require "refinements/string"
6
6
  module Milestoner
7
7
  module Views
8
8
  module Parts
9
- # Represents an individual tag.
9
+ # The tag presentation logic.
10
10
  class Tag < Hanami::View::Part
11
11
  include Import[:settings]
12
12
 
13
13
  using Refinements::String
14
14
 
15
15
  decorate :commits
16
+ decorate :author, as: :user
16
17
 
17
- def avatar_url(user) = format settings.avatar_uri, id: user.external_id
18
+ def avatar_url user
19
+ warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
20
+ category: :deprecated
21
+
22
+ format settings.avatar_uri, id: user.external_id
23
+ end
18
24
 
19
25
  def committed_at fallback: Time.now.utc
20
26
  value.committed_at.then { |at| at ? Time.at(at) : fallback }
@@ -26,9 +32,14 @@ module Milestoner
26
32
 
27
33
  def empty? = value.commits.empty?
28
34
 
29
- def profile_url(user) = format settings.profile_uri, id: user.handle
35
+ def profile_url user
36
+ warn "`#{self.class}##{__method__}` is deprecated, use user scope instead.",
37
+ category: :deprecated
38
+
39
+ format settings.profile_uri, id: user.handle
40
+ end
30
41
 
31
- def security = value.signature ? "🔒 Tag (valid)" : "🔓 Tag (invalid)"
42
+ def security = value.signature ? "🔒 Tag (secure)" : "🔓 Tag (insecure)"
32
43
 
33
44
  def total_commits
34
45
  value.commits.size.then { |total| "#{total} commit".pluralize "s", total }
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "hanami/view"
4
+
5
+ module Milestoner
6
+ module Views
7
+ module Parts
8
+ # The user presentation logic.
9
+ class User < Hanami::View::Part
10
+ include Import[:settings]
11
+
12
+ def name = value.name.then { |text| text || "Unknown" }
13
+
14
+ def image_alt = value.name.then { |name| name || "missing" }
15
+
16
+ def avatar_url
17
+ value.name.then do |name|
18
+ return format settings.avatar_uri, id: value.external_id if name
19
+
20
+ "https://alchemists.io/images/projects/milestoner/icons/missing.png"
21
+ end
22
+ end
23
+
24
+ def profile_url
25
+ value.name.then do |name|
26
+ name ? format(settings.profile_uri, id: value.handle) : "/#unknown"
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "hanami/view"
4
+
5
+ module Milestoner
6
+ module Views
7
+ # A scope builder which is meant to replace and fix the default scope builder.
8
+ module ScopeBuilder
9
+ def self.call name = nil, locals:, rendering:
10
+ scope_for(name, rendering).new name:, locals:, rendering:
11
+ end
12
+
13
+ def self.scope_for name, rendering
14
+ case name
15
+ in nil then rendering.config.scope_class
16
+ in Class then name
17
+ else fetch_or_store name, rendering
18
+ end
19
+ end
20
+
21
+ def self.fetch_or_store name, rendering
22
+ config = rendering.config
23
+
24
+ Hanami::View.cache.fetch_or_store name, config do
25
+ constant = constant_for name, rendering
26
+ constant && constant < Hanami::View::Scope ? constant : config.scope_class
27
+ end
28
+ end
29
+
30
+ def self.constant_for name, rendering
31
+ name = rendering.inflector.camelize name.to_s
32
+ namespace = rendering.config.scope_namespace || Object
33
+
34
+ namespace.const_get name if namespace.const_defined? name, false
35
+ end
36
+
37
+ private_class_method :scope_for, :fetch_or_store, :constant_for
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "core"
4
+ require "hanami/view"
5
+
6
+ module Milestoner
7
+ module Views
8
+ module Scopes
9
+ # The content specific behavior for partials.
10
+ class Content < Hanami::View::Scope
11
+ def content = String locals.fetch(:content, Core::EMPTY_STRING)
12
+
13
+ def call = content.empty? ? render("milestones/none") : render("milestones/content")
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "core"
4
+ require "hanami/view"
5
+
6
+ module Milestoner
7
+ module Views
8
+ module Scopes
9
+ # The logo specific behavior for partials.
10
+ class Logo < Hanami::View::Scope
11
+ def call = project_uri_logo ? render("milestones/logo") : Core::EMPTY_STRING
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "hanami/view"
4
+
5
+ module Milestoner
6
+ module Views
7
+ module Scopes
8
+ # The tag signature specific behavior for partials.
9
+ class TagSignature < Hanami::View::Scope
10
+ def initialize(part: Parts::Tag.new(value: Models::Tag.new), **)
11
+ @part = part
12
+ super(**)
13
+ end
14
+
15
+ def tag = locals.fetch :tag, part
16
+
17
+ def call
18
+ tag.signature ? render("milestones/tag-secure") : render("milestones/tag-insecure")
19
+ end
20
+
21
+ private
22
+
23
+ attr_reader :part
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "hanami/view"
4
+
5
+ module Milestoner
6
+ module Views
7
+ module Scopes
8
+ # The users specific behavior for partials.
9
+ class Users < Hanami::View::Scope
10
+ def call = users.any? ? render("milestones/users", users:) : render("milestones/none")
11
+ end
12
+ end
13
+ end
14
+ 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 = "18.5.0"
5
+ spec.version = "18.7.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/milestoner"
@@ -36,8 +36,8 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency "infusible", "~> 3.8"
37
37
  spec.add_dependency "lode", "~> 1.8"
38
38
  spec.add_dependency "redcarpet", "~> 3.6"
39
- spec.add_dependency "refinements", "~> 12.8"
40
- spec.add_dependency "rouge", "~> 4.3"
39
+ spec.add_dependency "refinements", "~> 12.9"
40
+ spec.add_dependency "rouge", "~> 4.4"
41
41
  spec.add_dependency "rss", "~> 0.3"
42
42
  spec.add_dependency "runcom", "~> 11.5"
43
43
  spec.add_dependency "sanitize", "~> 6.1"
data.tar.gz.sig CHANGED
Binary file