hackmac 1.10.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 +78 -13
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/bin/gfxmon +30 -21
- data/hackmac.gemspec +5 -4
- data/lib/hackmac/asset_tools.rb +0 -2
- data/lib/hackmac/kext_upgrader.rb +0 -2
- data/lib/hackmac/oc_upgrader.rb +0 -4
- data/lib/hackmac/plist.rb +0 -2
- 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 -439
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,20 +1,78 @@
|
|
|
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
|
+
|
|
20
|
+
## 2025-10-26 v1.11.0
|
|
21
|
+
|
|
22
|
+
- Reduced minimum sleep duration in gfxmon from **1** second to **0.01**
|
|
23
|
+
seconds
|
|
24
|
+
- Changed sleep duration calculation in gfxmon to use `.to_f` instead of
|
|
25
|
+
`.to_i` for sub-second precision
|
|
26
|
+
- Updated `Hackmac::Graph` parameter handling:
|
|
27
|
+
- Clarified documentation for `color` and `color_secondary` parameters to
|
|
28
|
+
indicate `nil` values derive colors from the title
|
|
29
|
+
- Set default value for `sleep` parameter to **5** seconds
|
|
30
|
+
- Added `@raise [TypeError]` documentation for `sleep` parameter
|
|
31
|
+
- Converted `sleep` parameter to `Float` and validated it's non-negative
|
|
32
|
+
- Added validation and normalization for graph constructor parameters:
|
|
33
|
+
- Validated `adjust_brightness` to be either `:lighten` or `:darken`
|
|
34
|
+
- Converted `adjust_brightness` to symbol using `to_sym`
|
|
35
|
+
- Ensured `adjust_brightness_percentage` is a `Float`
|
|
36
|
+
- Fixed typo in error message for `resolution` parameter
|
|
37
|
+
- Added `-f` and `-b` command-line options to `gfxmon` for foreground and
|
|
38
|
+
background colors
|
|
39
|
+
- Default foreground color is `:white` and background color is `:black`
|
|
40
|
+
- Updated `Hackmac::Graph` class to accept `foreground_color` and
|
|
41
|
+
`background_color` parameters
|
|
42
|
+
- Modified rendering logic to use `@background_color` instead of hardcoded
|
|
43
|
+
`0` for background color
|
|
44
|
+
- Updated help text to document the new `-f` and `-b` options
|
|
45
|
+
- Added `-r` command-line option to `gfxmon` with values `single` or `double`
|
|
46
|
+
- Default resolution is `:double`
|
|
47
|
+
- Updated `Hackmac::Graph` class to accept and validate `resolution`
|
|
48
|
+
parameter
|
|
49
|
+
- Used spaces (`' '`) for `:single` resolution to display lower resolution
|
|
50
|
+
- Added `ArgumentError` validation for invalid resolution values
|
|
51
|
+
- Updated help text to document the new `-r` option
|
|
52
|
+
- Removed redundant `@return` tags from documentation
|
|
53
|
+
|
|
3
54
|
## 2025-10-25 v1.10.0
|
|
4
55
|
|
|
5
56
|
- Added `-C` command line option to specify secondary color for terminal
|
|
6
|
-
|
|
57
|
+
graphs, accepting color values between **0** - **255**
|
|
7
58
|
- Updated `Hackmac::Graph.new` call to include `color_secondary:` parameter
|
|
8
59
|
- Modified `usage` method to document the new `-C` option
|
|
9
60
|
- Maintained backward compatibility with existing `-c` color option
|
|
10
|
-
- Added support for `color_secondary`, `adjust_brightness`, and
|
|
11
|
-
|
|
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
|
|
12
65
|
- Updated `draw_graph` to use secondary colors for improved visual contrast
|
|
13
|
-
- Modified `Hackmac::Graph::Display#initialize` to accept `color` and
|
|
14
|
-
|
|
15
|
-
-
|
|
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
|
|
16
72
|
- Default `foreground_color` to **:white** and `background_color` to **:black**
|
|
17
|
-
- 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
|
|
18
76
|
|
|
19
77
|
## 2025-10-25 v1.9.1
|
|
20
78
|
|
|
@@ -40,13 +98,17 @@
|
|
|
40
98
|
- Added fractional pixel blending for visual appeal
|
|
41
99
|
- Used `color.to_rgb_triple.to_hsl_triple.lighten(15)` for background shading
|
|
42
100
|
- Added fallback handling for color conversion errors with `rescue color`
|
|
43
|
-
- Supported terminal graphics with 2px vertical resolution using Unicode
|
|
101
|
+
- Supported terminal graphics with 2px vertical resolution using Unicode
|
|
102
|
+
characters
|
|
44
103
|
- Updated `@display.at(iy, x)` calls with color styling for graph rendering
|
|
45
104
|
- Removed duplicate `pick_color` method
|
|
46
|
-
- 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
|
|
47
108
|
- Updated module documentation with project description and features
|
|
48
109
|
- Refactored Graph formatters into separate `Hackmac::Graph::Formatters` module
|
|
49
|
-
- 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`
|
|
50
112
|
|
|
51
113
|
## 2025-10-15 v1.8.8
|
|
52
114
|
|
|
@@ -82,10 +144,13 @@
|
|
|
82
144
|
- Refactor version comparison styling into reusable `styler` lambda
|
|
83
145
|
- Extract version formatting logic into separate `formatter` lambda
|
|
84
146
|
- Update `Tabulo::Table` configuration to use the new lambda functions
|
|
85
|
-
- Improve version display logic to handle **nil** version comparisons
|
|
86
|
-
|
|
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
|
|
87
151
|
- Updated `static.yml` workflow to use array syntax for branch specification
|
|
88
|
-
- Added `github_workflows` configuration to `Rakefile` for `static.yml`
|
|
152
|
+
- Added `github_workflows` configuration to `Rakefile` for `static.yml`
|
|
153
|
+
workflow
|
|
89
154
|
|
|
90
155
|
## 2025-10-15 v1.8.7
|
|
91
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
|
|
@@ -32,7 +31,12 @@ require 'amatch'
|
|
|
32
31
|
require 'search_ui'
|
|
33
32
|
include SearchUI
|
|
34
33
|
|
|
35
|
-
$opts = go 'c:C:m:n:jlh', defaults: {
|
|
34
|
+
$opts = go 'c:C:m:n:f:b:r:jlh', defaults: {
|
|
35
|
+
?n => 5,
|
|
36
|
+
?r => :double,
|
|
37
|
+
?f => :white,
|
|
38
|
+
?b => :black,
|
|
39
|
+
}
|
|
36
40
|
|
|
37
41
|
# The usage method displays command-line usage information and options
|
|
38
42
|
#
|
|
@@ -47,13 +51,16 @@ def usage
|
|
|
47
51
|
|
|
48
52
|
OPTIONS are
|
|
49
53
|
|
|
50
|
-
-h
|
|
51
|
-
-l
|
|
52
|
-
-j
|
|
53
|
-
-n SECONDS
|
|
54
|
-
-m METRIC
|
|
55
|
-
-c COLOR
|
|
56
|
-
-C COLOR
|
|
54
|
+
-h this help
|
|
55
|
+
-l output GPU performance data as list
|
|
56
|
+
-j output GPU performance data as json
|
|
57
|
+
-n SECONDS measure every SECONDS
|
|
58
|
+
-m METRIC output graph for performance METRIC
|
|
59
|
+
-c COLOR output graph in this terminal COLOR (between 0 - 255)
|
|
60
|
+
-C COLOR output graph using secondary color COLOR
|
|
61
|
+
-f COLOR foreground color (used for text)
|
|
62
|
+
-b COLOR background color (used for background)
|
|
63
|
+
-r RESOLUTION is either single or double (uses half blocks)
|
|
57
64
|
|
|
58
65
|
EOT
|
|
59
66
|
0
|
|
@@ -86,7 +93,7 @@ end
|
|
|
86
93
|
# @param ps [ Hash ] a hash containing string keys and numeric or string values to be displayed
|
|
87
94
|
def list(ps)
|
|
88
95
|
max = ps.keys.max_by(&:size)&.size&.to_i
|
|
89
|
-
include
|
|
96
|
+
include Graphina::Graph::Formatters
|
|
90
97
|
puts ps.sort_by(&:first).map { |n, v|
|
|
91
98
|
c = derive_color_from_string(n)
|
|
92
99
|
("%-#{max}s" % n).color(15).on_color(c) + " " + ("%12s" % send(derive_formatter(n), v)).bold
|
|
@@ -169,25 +176,27 @@ end
|
|
|
169
176
|
#
|
|
170
177
|
# @return [ void ] Returns nothing but initiates the graphical display loop for system metrics
|
|
171
178
|
#
|
|
172
|
-
# @see
|
|
179
|
+
# @see Graphina::Graph
|
|
173
180
|
# @see choose_metric
|
|
174
181
|
# @see derive_formatter
|
|
175
182
|
def display_graph
|
|
176
183
|
if metric = choose_metric(ps)
|
|
177
|
-
sleep_duration = [
|
|
184
|
+
sleep_duration = [ 0.01, $opts[?n].to_f ].max
|
|
178
185
|
format_value = derive_formatter(metric)
|
|
179
|
-
graph =
|
|
180
|
-
title:
|
|
181
|
-
sleep:
|
|
182
|
-
value:
|
|
183
|
-
|
|
184
|
-
|
|
186
|
+
graph = Graphina::Graph.new(
|
|
187
|
+
title: metric,
|
|
188
|
+
sleep: sleep_duration,
|
|
189
|
+
value: -> _ { ps[metric] || 0 },
|
|
190
|
+
true_coloring: ENV['COLORTERM'] =~ /\A(truecolor|24bit)\z/,
|
|
191
|
+
color: $opts[?c],
|
|
192
|
+
color_secondary: $opts[?C],
|
|
193
|
+
foreground_color: $opts[?f],
|
|
194
|
+
background_color: $opts[?b],
|
|
195
|
+
resolution: $opts[?r],
|
|
185
196
|
format_value:
|
|
186
197
|
)
|
|
187
198
|
graph.start
|
|
188
199
|
end
|
|
189
|
-
ensure
|
|
190
|
-
graph&.stop
|
|
191
200
|
end
|
|
192
201
|
|
|
193
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/asset_tools.rb
CHANGED
|
@@ -48,8 +48,6 @@ module Hackmac
|
|
|
48
48
|
#
|
|
49
49
|
# @param name [ String ] the path to the compressed file to be decompressed
|
|
50
50
|
#
|
|
51
|
-
# @return [ void ] Returns nothing, but performs system decompression operations
|
|
52
|
-
#
|
|
53
51
|
# @raise [ RuntimeError ] raised when the file extension is not supported or
|
|
54
52
|
# decompression commands fail
|
|
55
53
|
def decompress(name)
|
|
@@ -47,8 +47,6 @@ module Hackmac
|
|
|
47
47
|
# installation paths, and performing the actual file replacement after user
|
|
48
48
|
# confirmation
|
|
49
49
|
#
|
|
50
|
-
# @return [ void ] Returns nothing but performs file system operations and
|
|
51
|
-
# user interaction
|
|
52
50
|
# @raise [ RuntimeError ] raised when a remote download fails or when no
|
|
53
51
|
# source is defined for the kext
|
|
54
52
|
def perform
|
data/lib/hackmac/oc_upgrader.rb
CHANGED
|
@@ -28,8 +28,6 @@ module Hackmac
|
|
|
28
28
|
#
|
|
29
29
|
# @param mdev [ String ] the mount device identifier for the EFI partition
|
|
30
30
|
# @param config [ Object ] the configuration object containing OpenCore settings including the EFI path
|
|
31
|
-
#
|
|
32
|
-
# @return [ void ] Returns nothing but initializes instance variables for the upgrade process
|
|
33
31
|
def initialize(mdev:, config:)
|
|
34
32
|
@config = config
|
|
35
33
|
mount_path = Pathname.new('/Volumes').join(mdev)
|
|
@@ -45,8 +43,6 @@ module Hackmac
|
|
|
45
43
|
# operations to replace existing EFI files after ensuring
|
|
46
44
|
# the installation directory is properly configured
|
|
47
45
|
#
|
|
48
|
-
# @return [ void ] Returns nothing but performs file system operations and
|
|
49
|
-
# user interaction
|
|
50
46
|
# @raise [ RuntimeError ] raised when a remote download fails or when no
|
|
51
47
|
# source is defined for the OpenCore upgrade
|
|
52
48
|
def perform
|
data/lib/hackmac/plist.rb
CHANGED
|
@@ -26,8 +26,6 @@ module Hackmac
|
|
|
26
26
|
# \@plist instance variable for later access through other methods.
|
|
27
27
|
#
|
|
28
28
|
# @param cmd [Array<String>] command and arguments to execute
|
|
29
|
-
#
|
|
30
|
-
# @return [void] Returns nothing, but sets the @plist instance variable
|
|
31
29
|
def plist(*cmd)
|
|
32
30
|
@plist = ::Plist.parse_xml(`#{Shellwords.join(cmd)}`)
|
|
33
31
|
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
|