milestoner 18.10.0 → 18.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/lib/milestoner/builders/feed.rb +0 -1
  4. data/lib/milestoner/builders/stream.rb +0 -4
  5. data/lib/milestoner/builders/web.rb +1 -0
  6. data/lib/milestoner/commits/categorizer.rb +1 -1
  7. data/lib/milestoner/commits/enricher.rb +3 -1
  8. data/lib/milestoner/commits/enrichers/author.rb +1 -1
  9. data/lib/milestoner/commits/enrichers/body.rb +1 -1
  10. data/lib/milestoner/commits/enrichers/colleague.rb +1 -1
  11. data/lib/milestoner/commits/enrichers/container.rb +2 -0
  12. data/lib/milestoner/commits/enrichers/format.rb +1 -1
  13. data/lib/milestoner/commits/enrichers/issue.rb +1 -1
  14. data/lib/milestoner/commits/enrichers/milestone.rb +1 -1
  15. data/lib/milestoner/commits/enrichers/note.rb +1 -1
  16. data/lib/milestoner/commits/enrichers/review.rb +1 -1
  17. data/lib/milestoner/commits/enrichers/time.rb +20 -0
  18. data/lib/milestoner/commits/tagger.rb +2 -2
  19. data/lib/milestoner/commits/versioner.rb +1 -1
  20. data/lib/milestoner/configuration/transformers/gems/description.rb +1 -1
  21. data/lib/milestoner/configuration/transformers/gems/label.rb +1 -1
  22. data/lib/milestoner/configuration/transformers/gems/name.rb +1 -1
  23. data/lib/milestoner/configuration/transformers/gems/uri.rb +1 -1
  24. data/lib/milestoner/configuration/transformers/generator/label.rb +1 -1
  25. data/lib/milestoner/configuration/transformers/generator/uri.rb +1 -1
  26. data/lib/milestoner/configuration/transformers/generator/version.rb +1 -1
  27. data/lib/milestoner/configuration/transformers/project/author.rb +1 -1
  28. data/lib/milestoner/container.rb +2 -0
  29. data/lib/milestoner/models/commit.rb +7 -0
  30. data/lib/milestoner/templates/layouts/page.html.erb +2 -2
  31. data/lib/milestoner/views/parts/commit.rb +3 -3
  32. data/lib/milestoner/views/parts/tag.rb +15 -9
  33. data/lib/milestoner/views/scopes/tag_signature.rb +1 -1
  34. data/milestoner.gemspec +3 -2
  35. data.tar.gz.sig +0 -0
  36. metadata +19 -4
  37. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b389a16997d8a440f4e285a4c20d1706626d459c07fd68d113aa9a396c72da30
4
- data.tar.gz: dc5a979e11bba17abd97a33f1a922bd1bf89ea18704184f3fb032cc42f5e4092
3
+ metadata.gz: e9ed4141a024a3afb6dd224f6d8f6e52db2c189bfc7ff121d39d29bf0423abb9
4
+ data.tar.gz: 966e8a280416c847a955b4ed3f674c42ea1ccebe7b8a1c8e8a48012df5743c26
5
5
  SHA512:
6
- metadata.gz: 2facc291d2ea624770dd201a1c0fbdfba6ea61051ed8e7627aca7840a13586bb57b71bda8dcc5fffa4afe7cd6b2145fd0cbed438fdd229f95c3cd9875565e100
7
- data.tar.gz: 7bf0e4674c1dabb6d36667c053cb2f9cbaab89b01e0e8d71b3bae4d1799677effea0876cfc88d2d32a1011de10b799c04e9857892444895269248de3cd1dadba
6
+ metadata.gz: '04963da39631d44ed1617b4e341c846a270359002cd2ab1b4728e2fce374fc0f96ea335bba338d0f005a07cb07ad2f5fd69864a901652d8418d0ab42c78d990d'
7
+ data.tar.gz: 9c8a92faff3f870ccf7ba95bb2d5bf889273952465ed4ce6931c9386c578e50f042651bbc853acfc20d6fdc1dddf553e67ffa66d356eb0199434cd68d5a9c11a
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry/monads"
4
3
  require "refinements/pathname"
5
4
 
6
5
  module Milestoner
@@ -1,15 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "refinements/pathname"
4
-
5
3
  module Milestoner
6
4
  module Builders
7
5
  # Builds I/O stream output.
8
6
  class Stream
9
7
  include Milestoner::Import[:settings, :logger, :io]
10
8
 
11
- using Refinements::Pathname
12
-
13
9
  def initialize(tagger: Commits::Tagger.new, view: Views::Milestones::Show.new, **)
14
10
  @tagger = tagger
15
11
  @view = view
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "refinements/array"
3
4
  require "refinements/pathname"
4
5
 
5
6
  module Milestoner
@@ -12,9 +12,9 @@ module Milestoner
12
12
  using Refinements::Array
13
13
 
14
14
  def initialize(collector: Collector.new, **)
15
- @collector = collector
16
15
  super(**)
17
16
 
17
+ @collector = collector
18
18
  @labels = settings.commit_categories.pluck :label
19
19
  @pattern = labels.empty? ? // : Regexp.union(labels)
20
20
  end
@@ -12,21 +12,23 @@ module Milestoner
12
12
  :author,
13
13
  :body,
14
14
  :collaborators,
15
+ :created_at,
15
16
  :format,
16
17
  :issue,
17
18
  :milestone,
18
19
  :notes,
19
20
  :review,
20
21
  :signers,
22
+ :updated_at,
21
23
  :uri
22
24
  ]
23
25
 
24
26
  include Dry::Monads[:result]
25
27
 
26
28
  def initialize(categorizer: Commits::Categorizer.new, model: Models::Commit, **)
29
+ super(**)
27
30
  @categorizer = categorizer
28
31
  @model = model
29
- super(**)
30
32
  end
31
33
 
32
34
  def call min: Collector::MIN, max: Collector::MAX
@@ -8,8 +8,8 @@ module Milestoner
8
8
  include Milestoner::Import[:cache]
9
9
 
10
10
  def initialize(model: Models::User, **)
11
- @model = model
12
11
  super(**)
12
+ @model = model
13
13
  end
14
14
 
15
15
  def call commit
@@ -8,9 +8,9 @@ module Milestoner
8
8
  include Milestoner::Import[:settings]
9
9
 
10
10
  def initialize(key: "Format", renderer: Renderers::Universal.new, **)
11
+ super(**)
11
12
  @key = key
12
13
  @renderer = renderer
13
- super(**)
14
14
  end
15
15
 
16
16
  def call commit
@@ -10,9 +10,9 @@ module Milestoner
10
10
  include Milestoner::Import[:cache]
11
11
 
12
12
  def initialize(key:, parser: Gitt::Parsers::Person.new, **)
13
+ super(**)
13
14
  @key = key
14
15
  @parser = parser
15
- super(**)
16
16
  end
17
17
 
18
18
  def call(commit) = commit.find_trailers(key).bind { |trailers| users_for(trailers).compact }
@@ -12,12 +12,14 @@ module Milestoner
12
12
  register(:author) { Author.new }
13
13
  register(:body) { Body.new }
14
14
  register(:collaborators) { Colleague.new key: "Co-authored-by" }
15
+ register(:created_at) { Time.new key: :authored_at }
15
16
  register(:format) { Format.new }
16
17
  register(:issue) { Issue.new }
17
18
  register(:milestone) { Milestone.new }
18
19
  register(:notes) { Note.new }
19
20
  register(:review) { Review.new }
20
21
  register(:signers) { Colleague.new key: "Signed-off-by" }
22
+ register(:updated_at) { Time.new key: :committed_at }
21
23
  register(:uri) { URI.new }
22
24
  end
23
25
  end
@@ -8,8 +8,8 @@ module Milestoner
8
8
  include Milestoner::Import[:settings]
9
9
 
10
10
  def initialize(key: "Format", **)
11
- @key = key
12
11
  super(**)
12
+ @key = key
13
13
  end
14
14
 
15
15
  def call(commit) = commit.trailer_value_for(key).value_or(settings.commit_format)
@@ -8,9 +8,9 @@ module Milestoner
8
8
  include Milestoner::Import[:settings]
9
9
 
10
10
  def initialize(key: "Issue", model: Models::Link, **)
11
+ super(**)
11
12
  @key = key
12
13
  @model = model
13
- super(**)
14
14
  end
15
15
 
16
16
  def call commit
@@ -8,9 +8,9 @@ module Milestoner
8
8
  include Milestoner::Import[:settings]
9
9
 
10
10
  def initialize(key: "Milestone", default: "unknown", **)
11
+ super(**)
11
12
  @key = key
12
13
  @default = default
13
- super(**)
14
14
  end
15
15
 
16
16
  def call(commit) = commit.trailer_value_for(key).value_or(default)
@@ -8,9 +8,9 @@ module Milestoner
8
8
  include Milestoner::Import[:settings]
9
9
 
10
10
  def initialize(key: "Format", renderer: Renderers::Universal.new, **)
11
+ super(**)
11
12
  @key = key
12
13
  @renderer = renderer
13
- super(**)
14
14
  end
15
15
 
16
16
  def call commit
@@ -8,8 +8,8 @@ module Milestoner
8
8
  include Milestoner::Import[:settings]
9
9
 
10
10
  def initialize(model: Models::Link, **)
11
- @model = model
12
11
  super(**)
12
+ @model = model
13
13
  end
14
14
 
15
15
  def call(*) = model[id: "All", uri: format(settings.review_uri, id: nil)]
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Milestoner
4
+ module Commits
5
+ module Enrichers
6
+ # Enriches raw time as a Time instance.
7
+ class Time
8
+ def initialize key:
9
+ @key = key
10
+ end
11
+
12
+ def call(commit) = ::Time.at commit.public_send(key).to_i
13
+
14
+ private
15
+
16
+ attr_reader :key
17
+ end
18
+ end
19
+ end
20
+ end
@@ -18,9 +18,9 @@ module Milestoner
18
18
  using Refinements::Struct
19
19
 
20
20
  def initialize(enricher: Commits::Enricher.new, model: Models::Tag, **)
21
+ super(**)
21
22
  @enricher = enricher
22
23
  @model = model
23
- super(**)
24
24
  end
25
25
 
26
26
  def call
@@ -91,7 +91,7 @@ module Milestoner
91
91
  author_enricher.call tag.with(author_name: tag.author_name || settings.project_author)
92
92
  end
93
93
 
94
- def committed_at(at) = at ? Time.at(at.to_i).utc : settings.loaded_at
94
+ def committed_at(at) = at ? Time.at(at.to_i) : settings.loaded_at
95
95
  end
96
96
  end
97
97
  end
@@ -16,9 +16,9 @@ module Milestoner
16
16
  DEFAULTS = {trailer_key: "Milestone", fallback: Versionaire::Version.new}.freeze
17
17
 
18
18
  def initialize(defaults: DEFAULTS, collector: Collector.new, **)
19
+ super(**)
19
20
  @defaults = defaults
20
21
  @collector = collector
21
- super(**)
22
22
  end
23
23
 
24
24
  def call
@@ -13,9 +13,9 @@ module Milestoner
13
13
  include Dry::Monads[:result]
14
14
 
15
15
  def initialize(key = :project_description, path: "#{Pathname.pwd.basename}.gemspec", **)
16
+ super(**)
16
17
  @key = key
17
18
  @path = path
18
- super(**)
19
19
  end
20
20
 
21
21
  def call attributes
@@ -13,9 +13,9 @@ module Milestoner
13
13
  include Dry::Monads[:result]
14
14
 
15
15
  def initialize(key = :project_label, path: "#{Pathname.pwd.basename}.gemspec", **)
16
+ super(**)
16
17
  @key = key
17
18
  @path = path
18
- super(**)
19
19
  end
20
20
 
21
21
  def call attributes
@@ -13,9 +13,9 @@ module Milestoner
13
13
  include Dry::Monads[:result]
14
14
 
15
15
  def initialize(key = :project_name, path: "#{Pathname.pwd.basename}.gemspec", **)
16
+ super(**)
16
17
  @key = key
17
18
  @path = path
18
- super(**)
19
19
  end
20
20
 
21
21
  def call attributes
@@ -13,9 +13,9 @@ module Milestoner
13
13
  include Dry::Monads[:result]
14
14
 
15
15
  def initialize(key = :project_uri, path: "#{Pathname.pwd.basename}.gemspec", **)
16
+ super(**)
16
17
  @key = key
17
18
  @path = path
18
- super(**)
19
19
  end
20
20
 
21
21
  def call attributes
@@ -12,8 +12,8 @@ module Milestoner
12
12
  include Dry::Monads[:result]
13
13
 
14
14
  def initialize(key = :generator_label, **)
15
- @key = key
16
15
  super(**)
16
+ @key = key
17
17
  end
18
18
 
19
19
  def call attributes
@@ -12,8 +12,8 @@ module Milestoner
12
12
  include Dry::Monads[:result]
13
13
 
14
14
  def initialize(key = :generator_uri, **)
15
- @key = key
16
15
  super(**)
16
+ @key = key
17
17
  end
18
18
 
19
19
  def call attributes
@@ -12,8 +12,8 @@ module Milestoner
12
12
  include Dry::Monads[:result]
13
13
 
14
14
  def initialize(key = :generator_version, **)
15
- @key = key
16
15
  super(**)
16
+ @key = key
17
17
  end
18
18
 
19
19
  def call attributes
@@ -12,8 +12,8 @@ module Milestoner
12
12
  include Dry::Monads[:result]
13
13
 
14
14
  def initialize(key = :project_author, **)
15
- @key = key
16
15
  super(**)
16
+ @key = key
17
17
  end
18
18
 
19
19
  def call attributes
@@ -7,6 +7,7 @@ require "gitt"
7
7
  require "lode"
8
8
  require "runcom"
9
9
  require "spek"
10
+ require "tone"
10
11
 
11
12
  module Milestoner
12
13
  # Provides a global gem container for injection into other objects.
@@ -68,6 +69,7 @@ module Milestoner
68
69
  register(:spec_loader) { Spek::Loader.new }
69
70
  register(:git) { Gitt::Repository.new }
70
71
  register(:defaults_path) { Pathname(__dir__).join("configuration/defaults.yml") }
72
+ register(:color) { Tone.new }
71
73
  register(:logger) { Cogger.new id: :milestoner }
72
74
  register :io, STDOUT
73
75
  end
@@ -6,9 +6,13 @@ module Milestoner
6
6
  module Models
7
7
  COMMIT_COMMON_ATTRIBUTES = %i[
8
8
  authored_at
9
+ authored_relative_at
9
10
  body
10
11
  body_lines
12
+ committed_at
13
+ committed_relative_at
11
14
  deletions
15
+ encoding
12
16
  files_changed
13
17
  fingerprint
14
18
  fingerprint_key
@@ -22,11 +26,14 @@ module Milestoner
22
26
  COMMIT_ENRICHED_ATTRIBUTES = %i[
23
27
  author
24
28
  collaborators
29
+ created_at
25
30
  format
26
31
  issue
27
32
  milestone
33
+ position
28
34
  review
29
35
  signers
36
+ updated_at
30
37
  uri
31
38
  ].freeze
32
39
 
@@ -32,8 +32,8 @@
32
32
  type="text/css">
33
33
  <% end %>
34
34
 
35
- <script src="https://unpkg.com/alpinejs@3.14.1"
36
- integrity="sha384-l8f0VcPi/M1iHPv8egOnY/15TDwqgbOR1anMIJWvU6nLRgZVLTLSaNqi/TOoT5Fh"
35
+ <script src="https://unpkg.com/alpinejs@3.14.3"
36
+ integrity="sha384-iZD2X8o1Zdq0HR5H/7oa8W30WS4No+zWCKUPD7fHRay9I1Gf+C4F8sVmw7zec1wW"
37
37
  crossorigin="anonymous"
38
38
  defer>
39
39
  </script>
@@ -20,7 +20,7 @@ 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).utc
23
+ @authored_at = Time.at value.authored_at.to_i
24
24
  end
25
25
 
26
26
  def avatar_url user
@@ -89,13 +89,13 @@ module Milestoner
89
89
 
90
90
  def at = authored_at.strftime "%Y-%m-%dT%H:%M:%S%z"
91
91
 
92
- def datetime = authored_at.strftime "%Y-%m-%d (%A) at %H:%M %p %Z"
92
+ def datetime = authored_at.strftime "%Y-%m-%d (%A) %I:%M %p %Z"
93
93
 
94
94
  def weekday = authored_at.strftime "%A"
95
95
 
96
96
  def date = authored_at.strftime "%Y-%m-%d"
97
97
 
98
- def time = authored_at.strftime "%H:%M %p"
98
+ def time = authored_at.strftime "%I:%M %p"
99
99
 
100
100
  def zone = authored_at.strftime "%Z"
101
101
 
@@ -22,7 +22,9 @@ module Milestoner
22
22
  format settings.avatar_uri, id: user.external_id
23
23
  end
24
24
 
25
- def committed_at fallback: Time.now.utc
25
+ def commit_count = value.commits.size
26
+
27
+ def committed_at fallback: Time.now
26
28
  value.committed_at.then { |at| at ? Time.at(at) : fallback }
27
29
  end
28
30
 
@@ -30,6 +32,8 @@ module Milestoner
30
32
 
31
33
  def committed_datetime = committed_at.strftime "%Y-%m-%dT%H:%M:%S%z"
32
34
 
35
+ def deletion_count = value.commits.sum(&:deletions)
36
+
33
37
  def empty? = value.commits.empty?
34
38
 
35
39
  def profile_url user
@@ -39,23 +43,25 @@ module Milestoner
39
43
  format settings.profile_uri, id: user.handle
40
44
  end
41
45
 
46
+ def file_count = value.commits.sum(&:files_changed)
47
+
48
+ def insertion_count = value.commits.sum(&:insertions)
49
+
42
50
  def security = value.signature ? "🔒 Tag (secure)" : "🔓 Tag (insecure)"
43
51
 
44
- def total_commits
45
- value.commits.size.then { |total| "#{total} commit".pluralize "s", total }
46
- end
52
+ def total_commits = commit_count.then { |total| "#{total} commit".pluralize "s", total }
47
53
 
48
- def total_files
49
- value.commits.sum(&:files_changed).then { |total| "#{total} file".pluralize "s", total }
50
- end
54
+ def total_files = file_count.then { |total| "#{total} file".pluralize "s", total }
51
55
 
52
56
  def total_deletions
53
- value.commits.sum(&:deletions).then { |total| "#{total} deletion".pluralize "s", total }
57
+ deletion_count.then { |total| "#{total} deletion".pluralize "s", total }
54
58
  end
55
59
 
56
60
  def total_insertions
57
- value.commits.sum(&:insertions).then { |total| "#{total} insertion".pluralize "s", total }
61
+ insertion_count.then { |total| "#{total} insertion".pluralize "s", total }
58
62
  end
63
+
64
+ def uri = format settings.project_uri_version, id: value.version
59
65
  end
60
66
  end
61
67
  end
@@ -8,8 +8,8 @@ module Milestoner
8
8
  # The tag signature specific behavior for partials.
9
9
  class TagSignature < Hanami::View::Scope
10
10
  def initialize(part: Parts::Tag.new(value: Models::Tag.new), **)
11
- @part = part
12
11
  super(**)
12
+ @part = part
13
13
  end
14
14
 
15
15
  def tag = locals.fetch :tag, part
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.10.0"
5
+ spec.version = "18.12.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/milestoner"
@@ -41,8 +41,9 @@ Gem::Specification.new do |spec|
41
41
  spec.add_dependency "rss", "~> 0.3"
42
42
  spec.add_dependency "runcom", "~> 11.10"
43
43
  spec.add_dependency "sanitize", "~> 6.1"
44
- spec.add_dependency "sod", "~> 0.18"
44
+ spec.add_dependency "sod", "~> 0.20"
45
45
  spec.add_dependency "spek", "~> 3.0"
46
+ spec.add_dependency "tone", "~> 1.0"
46
47
  spec.add_dependency "versionaire", "~> 13.10"
47
48
  spec.add_dependency "zeitwerk", "~> 2.7"
48
49
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: milestoner
3
3
  version: !ruby/object:Gem::Version
4
- version: 18.10.0
4
+ version: 18.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -35,7 +35,7 @@ cert_chain:
35
35
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
36
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
37
  -----END CERTIFICATE-----
38
- date: 2024-11-09 00:00:00.000000000 Z
38
+ date: 2024-12-15 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: asciidoctor
@@ -295,14 +295,14 @@ dependencies:
295
295
  requirements:
296
296
  - - "~>"
297
297
  - !ruby/object:Gem::Version
298
- version: '0.18'
298
+ version: '0.20'
299
299
  type: :runtime
300
300
  prerelease: false
301
301
  version_requirements: !ruby/object:Gem::Requirement
302
302
  requirements:
303
303
  - - "~>"
304
304
  - !ruby/object:Gem::Version
305
- version: '0.18'
305
+ version: '0.20'
306
306
  - !ruby/object:Gem::Dependency
307
307
  name: spek
308
308
  requirement: !ruby/object:Gem::Requirement
@@ -317,6 +317,20 @@ dependencies:
317
317
  - - "~>"
318
318
  - !ruby/object:Gem::Version
319
319
  version: '3.0'
320
+ - !ruby/object:Gem::Dependency
321
+ name: tone
322
+ requirement: !ruby/object:Gem::Requirement
323
+ requirements:
324
+ - - "~>"
325
+ - !ruby/object:Gem::Version
326
+ version: '1.0'
327
+ type: :runtime
328
+ prerelease: false
329
+ version_requirements: !ruby/object:Gem::Requirement
330
+ requirements:
331
+ - - "~>"
332
+ - !ruby/object:Gem::Version
333
+ version: '1.0'
320
334
  - !ruby/object:Gem::Dependency
321
335
  name: versionaire
322
336
  requirement: !ruby/object:Gem::Requirement
@@ -398,6 +412,7 @@ files:
398
412
  - lib/milestoner/commits/enrichers/milestone.rb
399
413
  - lib/milestoner/commits/enrichers/note.rb
400
414
  - lib/milestoner/commits/enrichers/review.rb
415
+ - lib/milestoner/commits/enrichers/time.rb
401
416
  - lib/milestoner/commits/enrichers/uri.rb
402
417
  - lib/milestoner/commits/tagger.rb
403
418
  - lib/milestoner/commits/versioner.rb
metadata.gz.sig CHANGED
Binary file