heatmap-builder 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6493e6ea0c3c5fd533269a55e6cb18c8df0a65ddad86aab5061c6d5cf57c5586
4
- data.tar.gz: fd5ae27f32ec084c3414d8f26a7def6c45bedef66b7266423ddd9fc3ec3df458
3
+ metadata.gz: 0f006a56b299216059137becde5d805a8fbae08d278e1aa68b662b4e64a27b7a
4
+ data.tar.gz: 0e097df66509cdca44181c0192e69dbb708d3b90fc9af6770ba98b82111832bb
5
5
  SHA512:
6
- metadata.gz: 1424b3fc448ef0d2a0afac402f87617fc981a179cc5fad4a6883585950f41a885b052680da36ec203bc071fab010c336b9c362b6c72ecbbc5680643f47d938ff
7
- data.tar.gz: 8702e0d38c802162393f0185b6e485e504203a119115f4d92e43e72b583d32202bf61c6264b7e5df9ae3a6b77ac7526d92d2b21a253ac0893695ef0348109e7f
6
+ metadata.gz: 74ecc4f39d96812726c341ff229b23f475deac6549926e87cacc2f00c67bf3e08f4b46d36afb3460bcd5ab489c87e7dfd28f76b8e6cbbac4b09d926bee4cac4a
7
+ data.tar.gz: 5137fe4a1e2159abc11ab0db8ed9d17154b5d775e5b7c35d8a9952aa5a9a0a73aa5a2c3372deb95957b1dcd8ca82098f49ff0cc4466a934ab6b8a57d23fe3f49
data/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.4] - 2026-06-29
11
+
12
+ ### Fixed
13
+ - Silenced "literal string will be frozen in the future" warnings emitted when
14
+ building SVG output. The hand-rolled mutable string buffers in `Calendar` were
15
+ replaced with `map`/`flat_map`/`filter_map` + `join` (matching how `build`
16
+ already assembles SVG fragments), and every file under `lib/` carries the
17
+ `# frozen_string_literal: true` magic comment. This makes the gem forward
18
+ compatible with Ruby's upcoming frozen-string-literal default.
19
+
10
20
  ## [0.4.3] - 2026-06-15
11
21
 
12
22
  ### Fixed
@@ -109,7 +119,8 @@ Initial release with core heatmap visualization capabilities.
109
119
  - Support for custom start of week (Monday/Sunday)
110
120
  - SVG output format for perfect scaling
111
121
 
112
- [Unreleased]: https://github.com/dreikanter/heatmap-builder/compare/v0.4.3...HEAD
122
+ [Unreleased]: https://github.com/dreikanter/heatmap-builder/compare/v0.4.4...HEAD
123
+ [0.4.4]: https://github.com/dreikanter/heatmap-builder/compare/v0.4.3...v0.4.4
113
124
  [0.4.3]: https://github.com/dreikanter/heatmap-builder/compare/v0.4.2...v0.4.3
114
125
  [0.4.2]: https://github.com/dreikanter/heatmap-builder/compare/v0.4.1...v0.4.2
115
126
  [0.4.1]: https://github.com/dreikanter/heatmap-builder/compare/v0.4.0...v0.4.1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- heatmap-builder (0.4.3)
4
+ heatmap-builder (0.4.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require_relative "heatmap_builder/version"
2
4
  require_relative "heatmap_builder/svg_helpers"
3
5
  require_relative "heatmap_builder/color_helpers"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "date"
2
4
  require_relative "svg_helpers"
3
5
  require_relative "color_helpers"
@@ -263,13 +265,11 @@ module HeatmapBuilder
263
265
  end
264
266
 
265
267
  def calendar_cells_svg
266
- svg = ""
267
- column_layout.each do |col|
268
- col[:days].each do |date, day_index|
269
- svg << render_cell(date, col[:index], day_index, col[:x_offset])
268
+ column_layout.flat_map do |col|
269
+ col[:days].map do |date, day_index|
270
+ render_cell(date, col[:index], day_index, col[:x_offset])
270
271
  end
271
- end
272
- svg
272
+ end.join
273
273
  end
274
274
 
275
275
  def render_cell(current_date, column_index, day_index, x_offset)
@@ -329,31 +329,22 @@ module HeatmapBuilder
329
329
  def day_labels_svg
330
330
  return "" unless options[:show_day_labels]
331
331
 
332
- day_names = day_names_for_week_start
333
- svg = ""
334
-
335
- day_names.each_with_index do |day_name, index|
332
+ day_names_for_week_start.map.with_index do |day_name, index|
336
333
  y = month_label_offset + index * (options[:cell_size] + options[:cell_spacing]) + options[:cell_size] / 2 + options[:font_size] * FONT_VERTICAL_CENTER_RATIO
337
- svg << svg_text(
334
+ svg_text(
338
335
  day_name,
339
336
  x: options[:font_size], y: y,
340
337
  font_size: options[:font_size], fill: LABEL_COLOR
341
338
  )
342
- end
343
-
344
- svg
339
+ end.join
345
340
  end
346
341
 
347
342
  def month_labels_svg
348
343
  return "" unless options[:show_month_labels]
349
344
 
350
- svg = ""
351
- column_layout.each do |col|
352
- if col[:first_of_month]
353
- svg << month_label_at(col[:index], col[:x_offset], col[:month_date])
354
- end
355
- end
356
- svg
345
+ column_layout.filter_map do |col|
346
+ month_label_at(col[:index], col[:x_offset], col[:month_date]) if col[:first_of_month]
347
+ end.join
357
348
  end
358
349
 
359
350
  # A week carries its month's label only when every one of its seven days
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module HeatmapBuilder
2
4
  module ColorHelpers
3
5
  class << self
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module HeatmapBuilder
2
4
  module SvgHelpers
3
5
  private
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module HeatmapBuilder
2
4
  module ValueConversion
3
5
  private
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module HeatmapBuilder
2
- VERSION = "0.4.3"
4
+ VERSION = "0.4.4"
3
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heatmap-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Musayev
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2026-06-24 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bundler
@@ -129,7 +128,6 @@ metadata:
129
128
  homepage_uri: https://github.com/dreikanter/heatmap-builder
130
129
  source_code_uri: https://github.com/dreikanter/heatmap-builder.git
131
130
  changelog_uri: https://github.com/dreikanter/heatmap-builder/blob/main/CHANGELOG.md
132
- post_install_message:
133
131
  rdoc_options: []
134
132
  require_paths:
135
133
  - lib
@@ -144,8 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
142
  - !ruby/object:Gem::Version
145
143
  version: '0'
146
144
  requirements: []
147
- rubygems_version: 3.5.22
148
- signing_key:
145
+ rubygems_version: 3.6.9
149
146
  specification_version: 4
150
147
  summary: Generate SVG heatmap visualizations
151
148
  test_files: []