hackmac 1.11.0 → 2.0.1

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: f08f36e8e85de7ebec84d0e2f98334ae3f644ef48411852c0299c6b439d19702
4
- data.tar.gz: f2659f7f42f980013730bf9efc6830ee98c3a99d7d1f3a92da5d3505aabf7312
3
+ metadata.gz: 9b629f65f511430e410cca559e31001479cf0b999676decb945870c05ca8a875
4
+ data.tar.gz: f78ed8d52c1f7b7534987d374102c714c1dfaeea85b3f3d890360aa5d1b48cf0
5
5
  SHA512:
6
- metadata.gz: 8fbb05e777bcf29ef66888ee69eb84bbdcc6f741400038e80b20eeff98d54bc6b41e8ab5360619535ac82f3ad58e06568cfb6fae879576c7d00a6e839a9f95f4
7
- data.tar.gz: 143eda42ce454475b6d1f3e3a4a1e0fca43b220ddab12ad029d3a916261913ce4731da9c5ad48bde29de814b4a44a925764ead523b8b12c1d27f54638acf4056
6
+ metadata.gz: a54aa8c3755d1acf55c02fb19bacdc64f6b6768244ed2677daecf4069c851d17cf51ebe527efe73efd8255f949ddb43a8372feb83fc00e6e377af7e3e0e20361
7
+ data.tar.gz: e560214e2e604b9862a7ff2f9bb558646434fea464572db115ccf432c56fe7dcbfaf93b517680e40754a703a10e4a274b7b25f7a0dfa18a010add95d6ef98ac9
data/CHANGES.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changes
2
2
 
3
+ ## 2025-12-16 v2.0.1
4
+
5
+ - Updated `value` proc in `Graphina::Graph.new` call to scale MHz values by
6
+ **1000000**
7
+ - Updated dependency list to use proper version specification `~> 0.3` for
8
+ `graphina`
9
+
10
+ ## 2025-10-27 v2.0.0
11
+
12
+ - Added `graphina` gem as a runtime dependency in `Rakefile`
13
+ - Replace internal `Hackmac::Graph` implementation with dependency on `graphina` **v1.0.0**
14
+ - Update `bin/gfxmon` to require `graphina` and use `Graphina::Graph` instead
15
+ of `Hackmac::Graph`
16
+ - Migrate `Hackmac::Graph::Formatters` to `Graphina::Graph::Formatters`
17
+ - Pass `true_coloring` option directly to `Graphina::Graph.new`
18
+ - Remove `ensure graph&.stop` block as `graphina` handles cleanup internally
19
+ - Update `lib/hackmac.rb` to require `graphina` and remove `hackmac/graph.rb`
20
+ require
21
+ - Delete old `hackmac/graph.rb`, `hackmac/graph/display.rb`,
22
+ `hackmac/graph/display/cell.rb`, and `hackmac/graph/formatters.rb` files
23
+ - Remove default value for option `s` in `gfxmon` script
24
+ - Remove obsolete default value for sleep duration
25
+ - Update `CHANGES.md` with formatted bullet points
26
+
3
27
  ## 2025-10-26 v1.11.0
4
28
 
5
29
  - Reduced minimum sleep duration in gfxmon from **1** second to **0.01**
@@ -37,18 +61,25 @@
37
61
  ## 2025-10-25 v1.10.0
38
62
 
39
63
  - Added `-C` command line option to specify secondary color for terminal
40
- graphs, accepting color values between **0** - **255**
64
+ graphs, accepting color values between **0** - **255**
41
65
  - Updated `Hackmac::Graph.new` call to include `color_secondary:` parameter
42
66
  - Modified `usage` method to document the new `-C` option
43
67
  - Maintained backward compatibility with existing `-c` color option
44
- - Added support for `color_secondary`, `adjust_brightness`, and `adjust_brightness_percentage` parameters in `Hackmac::Graph#initialize`
45
- - Introduced `pick_secondary_color` method to calculate secondary colors based on brightness adjustments
68
+ - Added support for `color_secondary`, `adjust_brightness`, and
69
+ `adjust_brightness_percentage` parameters in `Hackmac::Graph#initialize`
70
+ - Introduced `pick_secondary_color` method to calculate secondary colors based
71
+ on brightness adjustments
46
72
  - Updated `draw_graph` to use secondary colors for improved visual contrast
47
- - Modified `Hackmac::Graph::Display#initialize` to accept `color` and `on_color` parameters
48
- - Configured `@display` and `@old_display` with default color settings in `Hackmac::Graph#reset_display`
49
- - Default `adjust_brightness` to **:lighten** with **15%** brightness adjustment
73
+ - Modified `Hackmac::Graph::Display#initialize` to accept `color` and
74
+ `on_color` parameters
75
+ - Configured `@display` and `@old_display` with default color settings in
76
+ `Hackmac::Graph#reset_display`
77
+ - Default `adjust_brightness` to **:lighten** with **15%** brightness
78
+ adjustment
50
79
  - Default `foreground_color` to **:white** and `background_color` to **:black**
51
- - Added conditional check `if @plist` before extending with `Hashie::Extensions::DeepFind` to prevent `NoMethodError` when `@plist` is nil or undefined
80
+ - Added conditional check `if @plist` before extending with
81
+ `Hashie::Extensions::DeepFind` to prevent `NoMethodError` when `@plist` is
82
+ nil or undefined
52
83
 
53
84
  ## 2025-10-25 v1.9.1
54
85
 
@@ -74,13 +105,17 @@
74
105
  - Added fractional pixel blending for visual appeal
75
106
  - Used `color.to_rgb_triple.to_hsl_triple.lighten(15)` for background shading
76
107
  - Added fallback handling for color conversion errors with `rescue color`
77
- - Supported terminal graphics with 2px vertical resolution using Unicode characters
108
+ - Supported terminal graphics with 2px vertical resolution using Unicode
109
+ characters
78
110
  - Updated `@display.at(iy, x)` calls with color styling for graph rendering
79
111
  - Removed duplicate `pick_color` method
80
- - Added YARD documentation for `Hackmac::Config::DEFAULT`, `Hackmac::GithubSource::GITHUB_API_URL`, and `Hackmac::Graph::Display::ANSI` constants
112
+ - Added YARD documentation for `Hackmac::Config::DEFAULT`,
113
+ `Hackmac::GithubSource::GITHUB_API_URL`, and `Hackmac::Graph::Display::ANSI`
114
+ constants
81
115
  - Updated module documentation with project description and features
82
116
  - Refactored Graph formatters into separate `Hackmac::Graph::Formatters` module
83
- - Refactored `Hackmac::Graph::Display::Cell` class into separate file `lib/hackmac/graph/display/cell.rb`
117
+ - Refactored `Hackmac::Graph::Display::Cell` class into separate file
118
+ `lib/hackmac/graph/display/cell.rb`
84
119
 
85
120
  ## 2025-10-15 v1.8.8
86
121
 
@@ -116,10 +151,13 @@
116
151
  - Refactor version comparison styling into reusable `styler` lambda
117
152
  - Extract version formatting logic into separate `formatter` lambda
118
153
  - Update `Tabulo::Table` configuration to use the new lambda functions
119
- - Improve version display logic to handle **nil** version comparisons gracefully
120
- - Replace inline rescue logic with explicit nil checks for better error handling
154
+ - Improve version display logic to handle **nil** version comparisons
155
+ gracefully
156
+ - Replace inline rescue logic with explicit nil checks for better error
157
+ handling
121
158
  - Updated `static.yml` workflow to use array syntax for branch specification
122
- - Added `github_workflows` configuration to `Rakefile` for `static.yml` workflow
159
+ - Added `github_workflows` configuration to `Rakefile` for `static.yml`
160
+ workflow
123
161
 
124
162
  ## 2025-10-15 v1.8.7
125
163
 
data/Rakefile CHANGED
@@ -24,6 +24,7 @@ GemHadar do
24
24
 
25
25
  dependency 'tins', '~>1.14'
26
26
  dependency 'term-ansicolor', '~>1.10'
27
+ dependency 'graphina', '~>0.3'
27
28
  dependency 'complex_config'
28
29
  dependency 'amatch'
29
30
  dependency 'plist'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.11.0
1
+ 2.0.1
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 Hackmac::Graph::Formatters
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 Hackmac::Graph
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, ($opts[?n] || 10).to_f ].max
184
+ sleep_duration = [ 0.01, $opts[?n].to_f ].max
187
185
  format_value = derive_formatter(metric)
188
- graph = Hackmac::Graph.new(
186
+ graph = Graphina::Graph.new(
189
187
  title: metric,
190
188
  sleep: sleep_duration,
191
- value: -> _ { ps[metric] || 0 },
189
+ value: -> _ { (metric =~ /MHz/ ? 1_000_000 : 1) * (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 1.11.0 ruby lib
2
+ # stub: hackmac 2.0.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "hackmac".freeze
6
- s.version = "1.11.0".freeze
6
+ s.version = "2.0.1".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/graph.rb".freeze, "lib/hackmac/graph/display.rb".freeze, "lib/hackmac/graph/display/cell.rb".freeze, "lib/hackmac/graph/formatters.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/graph.rb".freeze, "lib/hackmac/graph/display.rb".freeze, "lib/hackmac/graph/display/cell.rb".freeze, "lib/hackmac/graph/formatters.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]
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]
@@ -26,6 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.add_development_dependency(%q<debug>.freeze, [">= 0".freeze])
27
27
  s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.14".freeze])
28
28
  s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.10".freeze])
29
+ s.add_runtime_dependency(%q<graphina>.freeze, ["~> 0.3".freeze])
29
30
  s.add_runtime_dependency(%q<complex_config>.freeze, [">= 0".freeze])
30
31
  s.add_runtime_dependency(%q<amatch>.freeze, [">= 0".freeze])
31
32
  s.add_runtime_dependency(%q<plist>.freeze, [">= 0".freeze])
@@ -1,6 +1,6 @@
1
1
  module Hackmac
2
2
  # Hackmac version
3
- VERSION = '1.11.0'
3
+ VERSION = '2.0.1'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
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: 1.11.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
@@ -65,6 +65,20 @@ dependencies:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
67
  version: '1.10'
68
+ - !ruby/object:Gem::Dependency
69
+ name: graphina
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '0.3'
75
+ type: :runtime
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '0.3'
68
82
  - !ruby/object:Gem::Dependency
69
83
  name: complex_config
70
84
  requirement: !ruby/object:Gem::Requirement
@@ -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