hackmac 1.11.0 → 2.0.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 +4 -4
- data/CHANGES.md +44 -13
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/bin/gfxmon +6 -9
- data/hackmac.gemspec +5 -4
- data/lib/hackmac/version.rb +1 -1
- data/lib/hackmac.rb +1 -1
- metadata +15 -9
- data/lib/hackmac/graph/display/cell.rb +0 -48
- data/lib/hackmac/graph/display.rb +0 -494
- data/lib/hackmac/graph/formatters.rb +0 -111
- data/lib/hackmac/graph.rb +0 -457
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b9a78a4affa5e3748802d602390e29fcac535f2a08c69abf40aa59278ed9ddb7
|
|
4
|
+
data.tar.gz: 385b9c1eaad255962d26f6a07949fb12706a5a2bd8c6aa2034d6e9e81c695ec4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6ec6736545274424f1c28de0ed5c41ffedd13a778ff0ba12eb0b20b828c2664c0862ea777036a73893506d88413b6e4c8a6ae163c04ffe0118f88eaea14b2b4e
|
|
7
|
+
data.tar.gz: d5e653eab0be39f092f8cefd7db8bb0cb675cb9f1631971dbcc123ef427f3231971b3fe9514c31372ed2921d7f1c9020acd9dd75c5d55d8af9844ff0d5b0462b
|
data/CHANGES.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2025-10-27 v2.0.0
|
|
4
|
+
|
|
5
|
+
- Added `graphina` gem as a runtime dependency in `Rakefile`
|
|
6
|
+
- Replace internal `Hackmac::Graph` implementation with dependency on `graphina` **v1.0.0**
|
|
7
|
+
- Update `bin/gfxmon` to require `graphina` and use `Graphina::Graph` instead
|
|
8
|
+
of `Hackmac::Graph`
|
|
9
|
+
- Migrate `Hackmac::Graph::Formatters` to `Graphina::Graph::Formatters`
|
|
10
|
+
- Pass `true_coloring` option directly to `Graphina::Graph.new`
|
|
11
|
+
- Remove `ensure graph&.stop` block as `graphina` handles cleanup internally
|
|
12
|
+
- Update `lib/hackmac.rb` to require `graphina` and remove `hackmac/graph.rb`
|
|
13
|
+
require
|
|
14
|
+
- Delete old `hackmac/graph.rb`, `hackmac/graph/display.rb`,
|
|
15
|
+
`hackmac/graph/display/cell.rb`, and `hackmac/graph/formatters.rb` files
|
|
16
|
+
- Remove default value for option `s` in `gfxmon` script
|
|
17
|
+
- Remove obsolete default value for sleep duration
|
|
18
|
+
- Update `CHANGES.md` with formatted bullet points
|
|
19
|
+
|
|
3
20
|
## 2025-10-26 v1.11.0
|
|
4
21
|
|
|
5
22
|
- Reduced minimum sleep duration in gfxmon from **1** second to **0.01**
|
|
@@ -37,18 +54,25 @@
|
|
|
37
54
|
## 2025-10-25 v1.10.0
|
|
38
55
|
|
|
39
56
|
- Added `-C` command line option to specify secondary color for terminal
|
|
40
|
-
|
|
57
|
+
graphs, accepting color values between **0** - **255**
|
|
41
58
|
- Updated `Hackmac::Graph.new` call to include `color_secondary:` parameter
|
|
42
59
|
- Modified `usage` method to document the new `-C` option
|
|
43
60
|
- Maintained backward compatibility with existing `-c` color option
|
|
44
|
-
- Added support for `color_secondary`, `adjust_brightness`, and
|
|
45
|
-
|
|
61
|
+
- Added support for `color_secondary`, `adjust_brightness`, and
|
|
62
|
+
`adjust_brightness_percentage` parameters in `Hackmac::Graph#initialize`
|
|
63
|
+
- Introduced `pick_secondary_color` method to calculate secondary colors based
|
|
64
|
+
on brightness adjustments
|
|
46
65
|
- Updated `draw_graph` to use secondary colors for improved visual contrast
|
|
47
|
-
- Modified `Hackmac::Graph::Display#initialize` to accept `color` and
|
|
48
|
-
|
|
49
|
-
-
|
|
66
|
+
- Modified `Hackmac::Graph::Display#initialize` to accept `color` and
|
|
67
|
+
`on_color` parameters
|
|
68
|
+
- Configured `@display` and `@old_display` with default color settings in
|
|
69
|
+
`Hackmac::Graph#reset_display`
|
|
70
|
+
- Default `adjust_brightness` to **:lighten** with **15%** brightness
|
|
71
|
+
adjustment
|
|
50
72
|
- Default `foreground_color` to **:white** and `background_color` to **:black**
|
|
51
|
-
- Added conditional check `if @plist` before extending with
|
|
73
|
+
- Added conditional check `if @plist` before extending with
|
|
74
|
+
`Hashie::Extensions::DeepFind` to prevent `NoMethodError` when `@plist` is
|
|
75
|
+
nil or undefined
|
|
52
76
|
|
|
53
77
|
## 2025-10-25 v1.9.1
|
|
54
78
|
|
|
@@ -74,13 +98,17 @@
|
|
|
74
98
|
- Added fractional pixel blending for visual appeal
|
|
75
99
|
- Used `color.to_rgb_triple.to_hsl_triple.lighten(15)` for background shading
|
|
76
100
|
- Added fallback handling for color conversion errors with `rescue color`
|
|
77
|
-
- Supported terminal graphics with 2px vertical resolution using Unicode
|
|
101
|
+
- Supported terminal graphics with 2px vertical resolution using Unicode
|
|
102
|
+
characters
|
|
78
103
|
- Updated `@display.at(iy, x)` calls with color styling for graph rendering
|
|
79
104
|
- Removed duplicate `pick_color` method
|
|
80
|
-
- Added YARD documentation for `Hackmac::Config::DEFAULT`,
|
|
105
|
+
- Added YARD documentation for `Hackmac::Config::DEFAULT`,
|
|
106
|
+
`Hackmac::GithubSource::GITHUB_API_URL`, and `Hackmac::Graph::Display::ANSI`
|
|
107
|
+
constants
|
|
81
108
|
- Updated module documentation with project description and features
|
|
82
109
|
- Refactored Graph formatters into separate `Hackmac::Graph::Formatters` module
|
|
83
|
-
- Refactored `Hackmac::Graph::Display::Cell` class into separate file
|
|
110
|
+
- Refactored `Hackmac::Graph::Display::Cell` class into separate file
|
|
111
|
+
`lib/hackmac/graph/display/cell.rb`
|
|
84
112
|
|
|
85
113
|
## 2025-10-15 v1.8.8
|
|
86
114
|
|
|
@@ -116,10 +144,13 @@
|
|
|
116
144
|
- Refactor version comparison styling into reusable `styler` lambda
|
|
117
145
|
- Extract version formatting logic into separate `formatter` lambda
|
|
118
146
|
- Update `Tabulo::Table` configuration to use the new lambda functions
|
|
119
|
-
- Improve version display logic to handle **nil** version comparisons
|
|
120
|
-
|
|
147
|
+
- Improve version display logic to handle **nil** version comparisons
|
|
148
|
+
gracefully
|
|
149
|
+
- Replace inline rescue logic with explicit nil checks for better error
|
|
150
|
+
handling
|
|
121
151
|
- Updated `static.yml` workflow to use array syntax for branch specification
|
|
122
|
-
- Added `github_workflows` configuration to `Rakefile` for `static.yml`
|
|
152
|
+
- Added `github_workflows` configuration to `Rakefile` for `static.yml`
|
|
153
|
+
workflow
|
|
123
154
|
|
|
124
155
|
## 2025-10-15 v1.8.7
|
|
125
156
|
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2.0.0
|
data/bin/gfxmon
CHANGED
|
@@ -20,11 +20,10 @@
|
|
|
20
20
|
# gfxmon -m "Temperature(C)" # Show specific metric
|
|
21
21
|
|
|
22
22
|
require 'term/ansicolor'
|
|
23
|
-
Term::ANSIColor.true_coloring = ENV['COLORTERM'] =~ /\A(truecolor|24bit)\z/
|
|
24
|
-
include Term::ANSIColor
|
|
25
23
|
class String
|
|
26
24
|
include Term::ANSIColor
|
|
27
25
|
end
|
|
26
|
+
require 'graphina'
|
|
28
27
|
require 'hackmac'
|
|
29
28
|
include Hackmac
|
|
30
29
|
include Tins::GO
|
|
@@ -33,7 +32,6 @@ require 'search_ui'
|
|
|
33
32
|
include SearchUI
|
|
34
33
|
|
|
35
34
|
$opts = go 'c:C:m:n:f:b:r:jlh', defaults: {
|
|
36
|
-
?s => true,
|
|
37
35
|
?n => 5,
|
|
38
36
|
?r => :double,
|
|
39
37
|
?f => :white,
|
|
@@ -95,7 +93,7 @@ end
|
|
|
95
93
|
# @param ps [ Hash ] a hash containing string keys and numeric or string values to be displayed
|
|
96
94
|
def list(ps)
|
|
97
95
|
max = ps.keys.max_by(&:size)&.size&.to_i
|
|
98
|
-
include
|
|
96
|
+
include Graphina::Graph::Formatters
|
|
99
97
|
puts ps.sort_by(&:first).map { |n, v|
|
|
100
98
|
c = derive_color_from_string(n)
|
|
101
99
|
("%-#{max}s" % n).color(15).on_color(c) + " " + ("%12s" % send(derive_formatter(n), v)).bold
|
|
@@ -178,17 +176,18 @@ end
|
|
|
178
176
|
#
|
|
179
177
|
# @return [ void ] Returns nothing but initiates the graphical display loop for system metrics
|
|
180
178
|
#
|
|
181
|
-
# @see
|
|
179
|
+
# @see Graphina::Graph
|
|
182
180
|
# @see choose_metric
|
|
183
181
|
# @see derive_formatter
|
|
184
182
|
def display_graph
|
|
185
183
|
if metric = choose_metric(ps)
|
|
186
|
-
sleep_duration = [ 0.01,
|
|
184
|
+
sleep_duration = [ 0.01, $opts[?n].to_f ].max
|
|
187
185
|
format_value = derive_formatter(metric)
|
|
188
|
-
graph =
|
|
186
|
+
graph = Graphina::Graph.new(
|
|
189
187
|
title: metric,
|
|
190
188
|
sleep: sleep_duration,
|
|
191
189
|
value: -> _ { ps[metric] || 0 },
|
|
190
|
+
true_coloring: ENV['COLORTERM'] =~ /\A(truecolor|24bit)\z/,
|
|
192
191
|
color: $opts[?c],
|
|
193
192
|
color_secondary: $opts[?C],
|
|
194
193
|
foreground_color: $opts[?f],
|
|
@@ -198,8 +197,6 @@ def display_graph
|
|
|
198
197
|
)
|
|
199
198
|
graph.start
|
|
200
199
|
end
|
|
201
|
-
ensure
|
|
202
|
-
graph&.stop
|
|
203
200
|
end
|
|
204
201
|
|
|
205
202
|
case
|
data/hackmac.gemspec
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
# stub: hackmac
|
|
2
|
+
# stub: hackmac 2.0.0 ruby lib
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "hackmac".freeze
|
|
6
|
-
s.version = "
|
|
6
|
+
s.version = "2.0.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]
|
|
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
|
|
|
12
12
|
s.description = "This ruby gem provides some useful tools for working with a Hackintosh.".freeze
|
|
13
13
|
s.email = "flori@ping.de".freeze
|
|
14
14
|
s.executables = ["efi".freeze, "gfxmon".freeze, "usb".freeze]
|
|
15
|
-
s.extra_rdoc_files = ["README.md".freeze, "lib/hackmac.rb".freeze, "lib/hackmac/asset_tools.rb".freeze, "lib/hackmac/config.rb".freeze, "lib/hackmac/disks.rb".freeze, "lib/hackmac/github_source.rb".freeze, "lib/hackmac/
|
|
16
|
-
s.files = ["CHANGES.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/efi".freeze, "bin/gfxmon".freeze, "bin/usb".freeze, "hackmac.gemspec".freeze, "img/gfxmon.png".freeze, "lib/hackmac.rb".freeze, "lib/hackmac/asset_tools.rb".freeze, "lib/hackmac/config.rb".freeze, "lib/hackmac/disks.rb".freeze, "lib/hackmac/github_source.rb".freeze, "lib/hackmac/
|
|
15
|
+
s.extra_rdoc_files = ["README.md".freeze, "lib/hackmac.rb".freeze, "lib/hackmac/asset_tools.rb".freeze, "lib/hackmac/config.rb".freeze, "lib/hackmac/disks.rb".freeze, "lib/hackmac/github_source.rb".freeze, "lib/hackmac/ioreg.rb".freeze, "lib/hackmac/kext.rb".freeze, "lib/hackmac/kext_upgrader.rb".freeze, "lib/hackmac/oc.rb".freeze, "lib/hackmac/oc_upgrader.rb".freeze, "lib/hackmac/oc_validator.rb".freeze, "lib/hackmac/plist.rb".freeze, "lib/hackmac/url_download.rb".freeze, "lib/hackmac/utils.rb".freeze, "lib/hackmac/version.rb".freeze]
|
|
16
|
+
s.files = ["CHANGES.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "VERSION".freeze, "bin/efi".freeze, "bin/gfxmon".freeze, "bin/usb".freeze, "hackmac.gemspec".freeze, "img/gfxmon.png".freeze, "lib/hackmac.rb".freeze, "lib/hackmac/asset_tools.rb".freeze, "lib/hackmac/config.rb".freeze, "lib/hackmac/disks.rb".freeze, "lib/hackmac/github_source.rb".freeze, "lib/hackmac/hackmac.yml".freeze, "lib/hackmac/ioreg.rb".freeze, "lib/hackmac/kext.rb".freeze, "lib/hackmac/kext_upgrader.rb".freeze, "lib/hackmac/oc.rb".freeze, "lib/hackmac/oc_upgrader.rb".freeze, "lib/hackmac/oc_validator.rb".freeze, "lib/hackmac/plist.rb".freeze, "lib/hackmac/url_download.rb".freeze, "lib/hackmac/utils.rb".freeze, "lib/hackmac/version.rb".freeze]
|
|
17
17
|
s.homepage = "http://github.com/flori/hackmac".freeze
|
|
18
18
|
s.licenses = ["MIT".freeze]
|
|
19
19
|
s.rdoc_options = ["--title".freeze, "Hackmac - Some useful tools for working with a Hackintosh".freeze, "--main".freeze, "README.md".freeze]
|
|
@@ -32,4 +32,5 @@ Gem::Specification.new do |s|
|
|
|
32
32
|
s.add_runtime_dependency(%q<tabulo>.freeze, [">= 0".freeze])
|
|
33
33
|
s.add_runtime_dependency(%q<search_ui>.freeze, [">= 0".freeze])
|
|
34
34
|
s.add_runtime_dependency(%q<hashie>.freeze, [">= 0".freeze])
|
|
35
|
+
s.add_runtime_dependency(%q<graphina>.freeze, [">= 0".freeze])
|
|
35
36
|
end
|
data/lib/hackmac/version.rb
CHANGED
data/lib/hackmac.rb
CHANGED
|
@@ -14,6 +14,7 @@ end
|
|
|
14
14
|
require 'json'
|
|
15
15
|
require 'pathname'
|
|
16
16
|
require 'tins/xt'
|
|
17
|
+
require 'graphina'
|
|
17
18
|
require 'hackmac/version'
|
|
18
19
|
require 'hackmac/plist'
|
|
19
20
|
require 'hackmac/disks'
|
|
@@ -28,4 +29,3 @@ require 'hackmac/oc_upgrader'
|
|
|
28
29
|
require 'hackmac/oc_validator'
|
|
29
30
|
require 'hackmac/config'
|
|
30
31
|
require 'hackmac/utils'
|
|
31
|
-
require 'hackmac/graph'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hackmac
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Frank
|
|
@@ -149,6 +149,20 @@ dependencies:
|
|
|
149
149
|
- - ">="
|
|
150
150
|
- !ruby/object:Gem::Version
|
|
151
151
|
version: '0'
|
|
152
|
+
- !ruby/object:Gem::Dependency
|
|
153
|
+
name: graphina
|
|
154
|
+
requirement: !ruby/object:Gem::Requirement
|
|
155
|
+
requirements:
|
|
156
|
+
- - ">="
|
|
157
|
+
- !ruby/object:Gem::Version
|
|
158
|
+
version: '0'
|
|
159
|
+
type: :runtime
|
|
160
|
+
prerelease: false
|
|
161
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
162
|
+
requirements:
|
|
163
|
+
- - ">="
|
|
164
|
+
- !ruby/object:Gem::Version
|
|
165
|
+
version: '0'
|
|
152
166
|
description: This ruby gem provides some useful tools for working with a Hackintosh.
|
|
153
167
|
email: flori@ping.de
|
|
154
168
|
executables:
|
|
@@ -163,10 +177,6 @@ extra_rdoc_files:
|
|
|
163
177
|
- lib/hackmac/config.rb
|
|
164
178
|
- lib/hackmac/disks.rb
|
|
165
179
|
- lib/hackmac/github_source.rb
|
|
166
|
-
- lib/hackmac/graph.rb
|
|
167
|
-
- lib/hackmac/graph/display.rb
|
|
168
|
-
- lib/hackmac/graph/display/cell.rb
|
|
169
|
-
- lib/hackmac/graph/formatters.rb
|
|
170
180
|
- lib/hackmac/ioreg.rb
|
|
171
181
|
- lib/hackmac/kext.rb
|
|
172
182
|
- lib/hackmac/kext_upgrader.rb
|
|
@@ -194,10 +204,6 @@ files:
|
|
|
194
204
|
- lib/hackmac/config.rb
|
|
195
205
|
- lib/hackmac/disks.rb
|
|
196
206
|
- lib/hackmac/github_source.rb
|
|
197
|
-
- lib/hackmac/graph.rb
|
|
198
|
-
- lib/hackmac/graph/display.rb
|
|
199
|
-
- lib/hackmac/graph/display/cell.rb
|
|
200
|
-
- lib/hackmac/graph/formatters.rb
|
|
201
207
|
- lib/hackmac/hackmac.yml
|
|
202
208
|
- lib/hackmac/ioreg.rb
|
|
203
209
|
- lib/hackmac/kext.rb
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
class Hackmac::Graph::Display
|
|
2
|
-
# A cell representation for terminal display with character, color,
|
|
3
|
-
# background color, and styling attributes
|
|
4
|
-
#
|
|
5
|
-
# The Cell class encapsulates the properties of a single character cell in
|
|
6
|
-
# a terminal display, including its visual characteristics such as the
|
|
7
|
-
# displayed character, text color, background color, and styling
|
|
8
|
-
# attributes. It provides methods to compare cells and convert them to
|
|
9
|
-
# their string representation with ANSI escape codes for terminal
|
|
10
|
-
# rendering.
|
|
11
|
-
class Cell < Struct.new(:char, :color, :on_color, :styles)
|
|
12
|
-
# The == method compares two Cell objects for equality by their internal
|
|
13
|
-
# array representation
|
|
14
|
-
#
|
|
15
|
-
# This method checks if the current Cell instance is equal to another
|
|
16
|
-
# Cell instance by comparing their underlying array representations
|
|
17
|
-
# returned by to_a
|
|
18
|
-
#
|
|
19
|
-
# @param other [ Hackmac::Graph::Display::Cell ] the other Cell object to
|
|
20
|
-
# compare against
|
|
21
|
-
#
|
|
22
|
-
# @return [ Boolean ] true if both cells have identical char, color,
|
|
23
|
-
# on_color, and styles values, false otherwise
|
|
24
|
-
def ==(other)
|
|
25
|
-
to_a == other.to_a
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
# The to_s method converts a Cell object into its string representation
|
|
29
|
-
# with ANSI styling
|
|
30
|
-
#
|
|
31
|
-
# This method constructs a formatted string that includes the cell's
|
|
32
|
-
# character along with its color, background color, and text style
|
|
33
|
-
# attributes using ANSI escape sequences. The resulting string is
|
|
34
|
-
# suitable for display in terminal environments that support ANSI colors.
|
|
35
|
-
#
|
|
36
|
-
# @return [ String ] a formatted string containing the cell's visual
|
|
37
|
-
# representation with appropriate ANSI styling codes for terminal
|
|
38
|
-
# rendering
|
|
39
|
-
def to_s
|
|
40
|
-
result = +''
|
|
41
|
-
result << ANSI.color(color)
|
|
42
|
-
result << ANSI.on_color(on_color)
|
|
43
|
-
styles.each { |s| result << ANSI.send(s) }
|
|
44
|
-
result << char
|
|
45
|
-
result << ANSI.reset
|
|
46
|
-
end
|
|
47
|
-
end
|
|
48
|
-
end
|