radfish 0.1.1 → 0.1.3
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/lib/radfish/cli.rb +8 -1
- data/lib/radfish/core/system.rb +4 -0
- data/lib/radfish/version.rb +1 -1
- data/radfish.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f57d68f93828e6ae9d3721da829aa6c667660ce2995e5f133bb30b9575db4e0
|
4
|
+
data.tar.gz: 443f6020c0c9d017248044db6e4073c2144ef03c0856e2dc646a483dde1664e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c7beb6bb2104a5955af53c23fcb3d61443996301b60b7b215fdbf3fd71a540e3aca19d43f8dc81fc8d8cb5af4ecf21edbfcdd580797707bfa1b748377bdba55
|
7
|
+
data.tar.gz: 5d352457420a2bc1c71bc6026eb36f847eda5929a611058acad25e43e07199bab22e699f8653c3e2e974505c9cea5ae786a555aaef7e99c7981c293dfcd996ea
|
data/lib/radfish/cli.rb
CHANGED
@@ -74,6 +74,13 @@ module Radfish
|
|
74
74
|
when 'status', 'state'
|
75
75
|
status = client.power_status
|
76
76
|
output_result({ power_status: status }, "Power Status: #{status}", status == 'On' ? :green : :yellow)
|
77
|
+
when 'consumption', 'usage', 'watts'
|
78
|
+
begin
|
79
|
+
watts = client.power_consumption_watts
|
80
|
+
output_result({ power_consumption_watts: watts }, "Power Consumption: #{watts}W", :green)
|
81
|
+
rescue NotImplementedError
|
82
|
+
error "Power consumption not supported for this vendor"
|
83
|
+
end
|
77
84
|
when 'on'
|
78
85
|
result = client.power_on
|
79
86
|
output_result({ success: result }, result ? "System powered on" : "Failed to power on")
|
@@ -96,7 +103,7 @@ module Radfish
|
|
96
103
|
output_result({ success: result }, result ? "Power cycle initiated" : "Failed to power cycle")
|
97
104
|
else
|
98
105
|
error "Unknown power command: #{subcommand}"
|
99
|
-
puts "Available: status, on, off, force-off, restart, force-restart, cycle"
|
106
|
+
puts "Available: status, on, off, force-off, restart, force-restart, cycle, consumption"
|
100
107
|
puts "Use --force flag with 'off' or 'restart' to skip graceful shutdown"
|
101
108
|
end
|
102
109
|
end
|
data/lib/radfish/core/system.rb
CHANGED
@@ -34,6 +34,10 @@ module Radfish
|
|
34
34
|
def power_consumption
|
35
35
|
raise NotImplementedError, "Adapter must implement #power_consumption"
|
36
36
|
end
|
37
|
+
|
38
|
+
def power_consumption_watts
|
39
|
+
raise NotImplementedError, "Adapter must implement #power_consumption_watts"
|
40
|
+
end
|
37
41
|
end
|
38
42
|
end
|
39
43
|
end
|
data/lib/radfish/version.rb
CHANGED
data/radfish.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_dependency "faraday-multipart", "~> 1.0"
|
35
35
|
spec.add_dependency "nokogiri", "~> 1.14"
|
36
36
|
spec.add_dependency "colorize", ">= 0.8"
|
37
|
-
spec.add_dependency "activesupport", "
|
37
|
+
spec.add_dependency "activesupport", ">= 7.0"
|
38
38
|
|
39
39
|
spec.add_development_dependency "rspec", "~> 3.0"
|
40
40
|
spec.add_development_dependency "webmock", "~> 3.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radfish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Siegel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-08-
|
11
|
+
date: 2025-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -98,14 +98,14 @@ dependencies:
|
|
98
98
|
name: activesupport
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '7.0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '7.0'
|
111
111
|
- !ruby/object:Gem::Dependency
|