graphina 0.5.0 → 0.6.0

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: d37dab7bd01fb67e724888f84fe62699ee0c79d4bdac9f31592ace93e1a9bf1f
4
- data.tar.gz: bb57b3238a9c2d4463a68c2439352d56dff89f6f199ecd0cc824e0dd1d07e114
3
+ metadata.gz: 34d6c2359a026420a4d0994c99cdc961de57d1bc2b94bc2fd0b1d5e00f9069e6
4
+ data.tar.gz: d313432adb111b829637d896712df4d87393cae8a96f3161f30930908a19dec9
5
5
  SHA512:
6
- metadata.gz: 681cd41758cd8e7aece8eaa74582be26d5120b4c63e4631cc1d118fe8c552f1685c925a2df52927e1e5c60c8cfa6b4a0fbeb0a2e5adc6dea71a61cab3490412a
7
- data.tar.gz: 8a86b1b96110c65d02e5f66dbb7a39433132bcb4218709d7cfeec3ce8360b12e566fff3cfaa2240b6415d176d9dd6198ddccba75ec5f59fd8d7b28bb45095977
6
+ metadata.gz: 58e6f2e36923dd6132fd2a2705467a7227ec84e58e1cc24a5548cdf9d132cc41561781f3ac285398e0065c17e31f62708818c1c80c51d41b277b63f387927483
7
+ data.tar.gz: 58b912ea40cb79e670238d411ee8ebea3c4d6827e1d5032c9756f8a79eabfa96cbaab2e114870e3bcd8a112704073dc54ad07151526c4d323766fa3807c4cc89
data/CHANGES.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-11-19 v0.6.0
4
+
5
+ ### Fixes
6
+
7
+ - Corrected typo in `Graph#initialize` documentation: "determineicolor" to
8
+ "determine color".
9
+ - Fixed missing periods in `Display` class documentation to resolve run-on
10
+ sentences.
11
+
12
+ ### Improvements
13
+
14
+ - Removed unused `normalize_value` method from `Graphina::Graph`.
15
+ - Replaced `else` clause with explicit `when :single` in
16
+ `Graphina::Graph#draw_graph` to explicitly support the `:single` resolution
17
+ mode.
18
+ - Added descriptive header comments to `lib/graphina/version.rb`.
19
+ - Removed redundant Vim modeline comments from `Gemfile` and `Rakefile`.
20
+
21
+ ### Build & CI
22
+
23
+ - Updated `rubygems_version` to **4.0.24** in `graphina.gemspec`.
24
+ - Updated `gem_hadar` development dependency requirement to `>= 2.24.1` in
25
+ `graphina.gemspec`.
26
+
27
+ ### Documentation
28
+
29
+ - Added missing `@raise` documentation for `adjust_brightness` in
30
+ `Graph#initialize`.
31
+ - Added YARD documentation for the private `Graph#perform` method.
32
+ - Added missing `@raise` documentation for dimension mismatch in `Display#-`.
33
+ - Added `@attr` documentation for `Panel#title` accessor.
34
+ - Added documentation for the `true_coloring` parameter in
35
+ `Graphina::Graph#initialize`.
36
+ - Rewrote `.contexts/yard.md` from a cheatsheet into a documentation guide for
37
+ AI assistants, including a complete `Document` class example and rules for
38
+ generating YARD comments.
39
+
3
40
  ## 2026-01-12 v0.5.0
4
41
 
5
42
  - Added `CHANGES.md` file to track version history and changes
data/Gemfile CHANGED
@@ -1,5 +1,3 @@
1
- # vim: set filetype=ruby et sw=2 ts=2:
2
-
3
1
  source 'https://rubygems.org'
4
2
 
5
3
  gemspec
data/Rakefile CHANGED
@@ -1,5 +1,3 @@
1
- # vim: set filetype=ruby et sw=2 ts=2:
2
-
3
1
  require 'gem_hadar'
4
2
 
5
3
  GemHadar do
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.6.0
data/graphina.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: graphina 0.5.0 ruby lib
2
+ # stub: graphina 0.6.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "graphina".freeze
6
- s.version = "0.5.0".freeze
6
+ s.version = "0.6.0".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
@@ -18,12 +18,12 @@ Gem::Specification.new do |s|
18
18
  s.licenses = ["MIT".freeze]
19
19
  s.rdoc_options = ["--title".freeze, "Graphina - Gem for creating terminal-based data visualizations with real-time\ngraphical displays using Unicode characters and ANSI styling.\n".freeze, "--main".freeze, "README.md".freeze]
20
20
  s.required_ruby_version = Gem::Requirement.new(">= 3.1".freeze)
21
- s.rubygems_version = "4.0.3".freeze
21
+ s.rubygems_version = "4.0.24".freeze
22
22
  s.summary = "Gem for creating terminal-based data visualizations with real-time graphical displays using Unicode characters and ANSI styling.".freeze
23
23
 
24
24
  s.specification_version = 4
25
25
 
26
- s.add_development_dependency(%q<gem_hadar>.freeze, [">= 2.16.2".freeze])
26
+ s.add_development_dependency(%q<gem_hadar>.freeze, [">= 2.24.1".freeze])
27
27
  s.add_development_dependency(%q<debug>.freeze, ["~> 1.0".freeze])
28
28
  s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.49".freeze])
29
29
  s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.11".freeze])
@@ -3,8 +3,8 @@ class Graphina::Graph
3
3
  # styling support
4
4
  #
5
5
  # The Display class provides functionality for creating and managing
6
- # terminal-based visual displays It handles cell-level rendering with support
7
- # for colors, background colors, and text styles The class maintains internal
6
+ # terminal-based visual displays. It handles cell-level rendering with support
7
+ # for colors, background colors, and text styles. The class maintains internal
8
8
  # state for cursor position and formatting attributes while providing methods
9
9
  # to manipulate individual cells and render complete display grids to the
10
10
  # terminal
@@ -113,6 +113,9 @@ class Graphina::Graph
113
113
  #
114
114
  # @return [ String ] a string containing ANSI escape sequences for
115
115
  # rendering only the changed cells
116
+ #
117
+ # @raise [ ArgumentError ] raised when the old display dimensions don't
118
+ # match the current display dimensions
116
119
  def -(old)
117
120
  dimensions != old.dimensions and raise ArgumentError,
118
121
  "old dimensions #{old.dimensions.inspect} don't match #{dimensions.inspect}"
@@ -53,8 +53,9 @@ class Graphina::Graph
53
53
  # @param format_value [ Proc, Symbol, nil ] formatting strategy for
54
54
  # displaying values
55
55
  # @param sleep [ Numeric ] time in seconds between updates
56
+ # @param true_coloring [ Boolean ] enable true coloring support
56
57
  # @param color [ Object, Proc, nil ] color or proc or nil. nil
57
- # determineicolor dynamically from the title
58
+ # determine color dynamically from the title
58
59
  # @param color_secondary [ Object, nil ] secondary color or nil
59
60
  # for enhanced visuals, nil derives secondary color from (primary) color
60
61
  # @param adjust_brightness [ Symbol ] the method to call on the color for
@@ -70,6 +71,7 @@ class Graphina::Graph
70
71
  # @raise [ ArgumentError ] if the sleep parameter is negative
71
72
  # @raise [ TypeError ] if the sleep parameter is not numeric
72
73
  # @raise [ ArgumentError ] if the resolution parameter is not :single or :double
74
+ # @raise [ ArgumentError ] if the adjust_brightness parameter is not :lighten or :darken
73
75
  def initialize(
74
76
  title:,
75
77
  value: -> i { 0 },
@@ -172,7 +174,7 @@ class Graphina::Graph
172
174
  else
173
175
  @display.at(iy, x).on_color(color).color(color_secondary).write(?▄)
174
176
  end
175
- else
177
+ when :single
176
178
  @display.at(iy, x).on_color(color).color(color_secondary).write(' ')
177
179
  end
178
180
  end
@@ -237,6 +239,10 @@ class Graphina::Graph
237
239
  stop
238
240
  end
239
241
 
242
+ # The perform method is a thin wrapper around Kernel#print that
243
+ # centralizes all terminal output through a single call site.
244
+ #
245
+ # @param a [ Array ] the arguments to print to the terminal
240
246
  def perform(*a)
241
247
  print(*a)
242
248
  end
@@ -395,28 +401,6 @@ class Graphina::Graph
395
401
  end
396
402
  end
397
403
 
398
-
399
- # The normalize_value method converts a value to its appropriate numeric
400
- # representation
401
- #
402
- # This method takes an input value and normalizes it to either a Float or
403
- # Integer type depending on its original form. If the value is already a
404
- # Float, it is returned as-is. For all other types, the method attempts to
405
- # convert the value to an integer using to_i
406
- #
407
- # @param value [ Object ] the value to be normalized
408
- #
409
- # @return [ Float, Integer ] the normalized numeric value as either a Float
410
- # or Integer
411
- def normalize_value(value)
412
- case value
413
- when Float
414
- value
415
- else
416
- value.to_i
417
- end
418
- end
419
-
420
404
  # The full_reset method performs a complete reset of the display and terminal
421
405
  # state
422
406
  #
@@ -88,6 +88,10 @@ class Graphina::Panel
88
88
  end
89
89
  end
90
90
 
91
+ # The title accessor method provides read and write access to the title
92
+ # attribute
93
+ #
94
+ # @attr [ String ] title the title to display at the bottom of the graph
91
95
  attr_accessor :title
92
96
 
93
97
  # The interval reader method provides access to the interval attribute that
@@ -1,6 +1,11 @@
1
+ # Version information for the Graphina gem.
2
+ #
3
+ # This module is auto-generated by GemHadar and exposes the
4
+ # current release version as a set of constants. Do not edit it
5
+ # by hand; it is rewritten on every `rake version` invocation.
1
6
  module Graphina
2
- # Graphina version
3
- VERSION = '0.5.0'
7
+ # The current version of the Graphina gem as a String.
8
+ VERSION = '0.6.0'
4
9
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
10
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
11
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphina
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 2.16.2
18
+ version: 2.24.1
19
19
  type: :development
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: 2.16.2
25
+ version: 2.24.1
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: debug
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  - !ruby/object:Gem::Version
183
183
  version: '0'
184
184
  requirements: []
185
- rubygems_version: 4.0.3
185
+ rubygems_version: 4.0.24
186
186
  specification_version: 4
187
187
  summary: Gem for creating terminal-based data visualizations with real-time graphical
188
188
  displays using Unicode characters and ANSI styling.