hardware_information 1.0.83 → 1.0.84
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/README.md +37 -22
- data/lib/hardware_information/misc/purchased_hardware/purchased_hardware.rb +59 -27
- data/lib/hardware_information/version/version.rb +2 -2
- data/lib/hardware_information/www/purchased_hardware/README.md +3 -0
- data/lib/hardware_information/www/{my_hardware.cgi → purchased_hardware/purchased_hardware.cgi} +1 -1
- data/lib/hardware_information/www/purchased_hardware/purchased_hardware.rb +606 -0
- data/lib/hardware_information/www/{my_hardware_for_sinatra.rb → purchased_hardware/purchased_hardware_for_sinatra.rb} +1 -1
- metadata +8 -7
- data/lib/hardware_information/www/my_hardware.rb +0 -498
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87c4fea0bafa90ad535ff6796f2f5109ad419e9849cb6d8546ddd1816093f4c5
|
4
|
+
data.tar.gz: 32ed180c5d2c37ba28b9b94a7223c5d06a1a9fec31a776936a07fc3200d2e472
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2bbfab124dbb2dc4a34f73a11349f8d672a580ad13d587a8935a34dfb07f63ebe6f7af98a964f8157172e60096ba4fe2885e893d2fbfd8e9a3f767f6456dd93
|
7
|
+
data.tar.gz: e85b7e5e03199a2a29f53458779d2e426fca824fe05f497c4d273e71538f7474446e7b8bcc0e44a1bb273247d6291ac05300b1adf394b96a3bec9e151a36183f
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
[](https://www.ruby-lang.org/en/)
|
3
3
|
[](https://badge.fury.io/rb/hardware_information)
|
4
4
|
|
5
|
-
This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">
|
5
|
+
This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">18.11.2023</span> (dd.mm.yyyy notation), at <span style="color: steelblue; font-weight: bold">08:09:30</span> o'clock.
|
6
6
|
|
7
7
|
# The HardwareInformation Project
|
8
8
|
|
@@ -59,36 +59,51 @@ more useful in general, feel free to drop me an email at any time, via:
|
|
59
59
|
Before that email I used an email account at Google gmail, but in **2021** I
|
60
60
|
decided to slowly abandon gmail, for various reasons. In order to limit the
|
61
61
|
explanation here, allow me to just briefly state that I do not feel as if I
|
62
|
-
want to promote any Google service anymore when the user becomes the
|
63
|
-
product (such as via data collection by upstream services
|
64
|
-
a hugely flawed business model
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
In
|
70
|
-
|
71
|
-
|
62
|
+
want to promote any Google service anymore when the user becomes the end
|
63
|
+
product (such as via data collection by upstream services, including other
|
64
|
+
proxy-services). My feeling is that this is a hugely flawed business model
|
65
|
+
to begin with, and I no longer wish to support this in any way, even if
|
66
|
+
only indirectly so, such as by using services of companies that try to
|
67
|
+
promote this flawed model.
|
68
|
+
|
69
|
+
In regards to responding to emails: please keep in mind that responding
|
70
|
+
may take some time, depending on the amount of work I may have at that
|
71
|
+
moment. So it is not that emails are ignored; it is more that I have not
|
72
|
+
(yet) found the time to read and reply. This means there may be a delay
|
73
|
+
of days, weeks and in some instances also months. There is, unfortunately,
|
74
|
+
not much I can do when I need to prioritise my time investment, but I try
|
75
|
+
to consider <b>all</b> feedback as an opportunity to improve my projects
|
76
|
+
nonetheless.
|
77
|
+
|
78
|
+
In <b>2022</b> rubygems.org decided to make 2FA mandatory for every
|
79
|
+
gem owner eventually:
|
80
|
+
|
81
|
+
see
|
72
82
|
https://blog.rubygems.org/2022/06/13/making-packages-more-secure.html
|
73
83
|
|
74
84
|
Mandatory 2FA will eventually be extended to all rubygems.org developers and
|
75
85
|
maintainers. As I can not use 2FA, for reasons I will skip explaining here,
|
76
|
-
this means that my projects will eventually be
|
77
|
-
|
86
|
+
this means that my projects will eventually be removed, as I no longer
|
87
|
+
have any control over my projects hosted on rubygems.org (because I
|
88
|
+
can not use 2FA).
|
89
|
+
|
78
90
|
At that point, I no longer have any control what is done to my projects
|
79
|
-
since
|
80
|
-
|
81
|
-
that was not the case several years ago
|
91
|
+
since whoever is controlling the gems ecosystem took away our control
|
92
|
+
here. I am not sure at which point ruby became corporate-controlled -
|
93
|
+
that was not the case several years ago, so something has
|
94
|
+
changed.
|
82
95
|
|
83
96
|
Ruby also only allows 2FA users to participate on the issue tracker these
|
84
97
|
days:
|
85
98
|
|
86
99
|
https://bugs.ruby-lang.org/issues/18800
|
87
100
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
101
|
+
But this has been reverted some months ago, so it is no longer applicable.
|
102
|
+
Suffice to say that I do not think that we should only be allowed to
|
103
|
+
interact on the world wide web when some 'authority' authenticated us,
|
104
|
+
such as via mandatory 2FA, so I hope this won't come back again.
|
105
|
+
|
106
|
+
Fighting spam is a noble goal, but when it also means you lock out
|
107
|
+
real human people then this is definitely NOT a good situation
|
108
|
+
to be had.
|
94
109
|
|
@@ -6,15 +6,23 @@
|
|
6
6
|
#
|
7
7
|
# This module has been primarily written to support the old content
|
8
8
|
# shown in the old .cgi file. By having this available as a module
|
9
|
-
# we can, in principle, adapt this easily into sinatra or
|
10
|
-
# well, so we gain more flexibility by using a module here.
|
9
|
+
# or class we can, in principle, adapt this easily into sinatra or
|
10
|
+
# rails as well, so we gain more flexibility by using a module here.
|
11
11
|
# =========================================================================== #
|
12
12
|
# require 'hardware_information/misc/purchased_hardware/purchased_hardware.rb'
|
13
|
+
# HardwareInformation.file_my_hardware
|
13
14
|
# include HardwareInformation::PurchasedHardware
|
14
15
|
# =========================================================================== #
|
15
16
|
class HardwareInformation
|
16
17
|
|
17
|
-
|
18
|
+
# =========================================================================== #
|
19
|
+
# === HardwareInformation.file_my_hardware
|
20
|
+
# =========================================================================== #
|
21
|
+
def self.file_my_hardware
|
22
|
+
'/home/x/data/personal/yaml/my_hardware/my_hardware.yml'
|
23
|
+
end
|
24
|
+
|
25
|
+
module PurchasedHardware # === HardwareInformation::PurchasedHardware
|
18
26
|
|
19
27
|
require 'yaml'
|
20
28
|
|
@@ -37,10 +45,12 @@ module PurchasedHardware
|
|
37
45
|
# ========================================================================= #
|
38
46
|
def self.body_css_style
|
39
47
|
return '
|
40
|
-
border
|
41
|
-
border-
|
42
|
-
color:
|
43
|
-
width:
|
48
|
+
border: 1px solid orange;
|
49
|
+
border-radius: 24px;
|
50
|
+
color: #ceffce;
|
51
|
+
width: 84%;
|
52
|
+
|
53
|
+
'
|
44
54
|
end
|
45
55
|
|
46
56
|
# ========================================================================= #
|
@@ -56,10 +66,35 @@ width: 100%;'
|
|
56
66
|
@total_cost = 0
|
57
67
|
|
58
68
|
# ========================================================================= #
|
59
|
-
# ===
|
69
|
+
# === @hash_yearly_purchases_made
|
70
|
+
# ========================================================================= #
|
71
|
+
@hash_yearly_purchases_made = {}
|
72
|
+
|
73
|
+
# ========================================================================= #
|
74
|
+
# === HardwareInformation::PurchasedHardware.hash_yearly_purchases_made?
|
60
75
|
# ========================================================================= #
|
61
|
-
def self.
|
62
|
-
@
|
76
|
+
def self.hash_yearly_purchases_made?
|
77
|
+
@hash_yearly_purchases_made
|
78
|
+
end
|
79
|
+
|
80
|
+
# ========================================================================= #
|
81
|
+
# === HardwareInformation::PurchasedHardware.add_to_the_total_cost
|
82
|
+
#
|
83
|
+
# Since as of November 2023 we will also keep track of the year in which
|
84
|
+
# the purchase has been made. This is optional though.
|
85
|
+
# ========================================================================= #
|
86
|
+
def self.add_to_the_total_cost(
|
87
|
+
i, optional_year = nil
|
88
|
+
)
|
89
|
+
i = i.to_f
|
90
|
+
@total_cost += i
|
91
|
+
if optional_year
|
92
|
+
if @hash_yearly_purchases_made.has_key? optional_year
|
93
|
+
@hash_yearly_purchases_made[optional_year] += i
|
94
|
+
else
|
95
|
+
@hash_yearly_purchases_made[optional_year] = i
|
96
|
+
end
|
97
|
+
end
|
63
98
|
end; self.instance_eval { alias add_to_total_cost add_to_the_total_cost } # === HardwareInformation::PurchasedHardware.add_to_total_cost
|
64
99
|
|
65
100
|
# ========================================================================= #
|
@@ -74,7 +109,7 @@ width: 100%;'
|
|
74
109
|
#
|
75
110
|
# CSS-related Constants are defined next.
|
76
111
|
# ========================================================================= #
|
77
|
-
MAIN_DIV = '
|
112
|
+
MAIN_DIV = 'pad0_4em mart0_1em'
|
78
113
|
|
79
114
|
# ========================================================================= #
|
80
115
|
# === LINUX_YAML
|
@@ -90,29 +125,17 @@ width: 100%;'
|
|
90
125
|
LINUX_YAML
|
91
126
|
end
|
92
127
|
|
93
|
-
# ========================================================================= #
|
94
|
-
# === HardwareInformation::PurchasedHardware.file_computer_hardware?
|
95
|
-
#
|
96
|
-
# All the important data is stored in the following .yml file:
|
97
|
-
#
|
98
|
-
# bl /home/x/DATA/PC/OS/LINUX/yaml/computer_hardware.yml
|
99
|
-
#
|
100
|
-
# ========================================================================= #
|
101
|
-
def self.file_computer_hardware?
|
102
|
-
'/home/x/data/personal/yaml/my_hardware/my_hardware.yml'
|
103
|
-
end
|
104
|
-
|
105
128
|
# ========================================================================= #
|
106
129
|
# === HardwareInformation::PurchasedHardware.file_my_hardware
|
107
130
|
#
|
108
|
-
#
|
131
|
+
# All the important data is stored in the following .yml file:
|
109
132
|
#
|
110
133
|
# bl /home/x/data/personal/yaml/my_hardware/my_hardware.yml
|
111
134
|
#
|
112
135
|
# ========================================================================= #
|
113
136
|
def self.file_my_hardware
|
114
|
-
|
115
|
-
end
|
137
|
+
'/home/x/data/personal/yaml/my_hardware/my_hardware.yml'
|
138
|
+
end; self.instance_eval { alias file_computer_hardware? file_my_hardware } # === HardwareInformation::PurchasedHardware.file_computer_hardware?
|
116
139
|
|
117
140
|
# ========================================================================= #
|
118
141
|
# === HardwareInformation::PurchasedHardware.my_hardware
|
@@ -166,4 +189,13 @@ width: 100%;'
|
|
166
189
|
return @array_date_bought_at
|
167
190
|
end
|
168
191
|
|
169
|
-
end
|
192
|
+
end
|
193
|
+
|
194
|
+
# =========================================================================== #
|
195
|
+
# === HardwareInformation.my_hardware?
|
196
|
+
# =========================================================================== #
|
197
|
+
def self.my_hardware?
|
198
|
+
return ::HardwareInformation::PurchasedHardware.my_hardware
|
199
|
+
end
|
200
|
+
|
201
|
+
end
|
@@ -9,11 +9,11 @@ class HardwareInformation
|
|
9
9
|
# ========================================================================= #
|
10
10
|
# === VERSION
|
11
11
|
# ========================================================================= #
|
12
|
-
VERSION = '1.0.
|
12
|
+
VERSION = '1.0.84'
|
13
13
|
|
14
14
|
# ========================================================================= #
|
15
15
|
# === LAST_UPDATE
|
16
16
|
# ========================================================================= #
|
17
|
-
LAST_UPDATE = '
|
17
|
+
LAST_UPDATE = '18.11.2023'
|
18
18
|
|
19
19
|
end
|
data/lib/hardware_information/www/{my_hardware.cgi → purchased_hardware/purchased_hardware.cgi}
RENAMED
@@ -2,6 +2,6 @@
|
|
2
2
|
# Encoding: UTF-8
|
3
3
|
# frozen_string_literal: true
|
4
4
|
# =========================================================================== #
|
5
|
-
# http://localhost/programming/ruby/src/hardware_information/lib/hardware_information/www/
|
5
|
+
# http://localhost/programming/ruby/src/hardware_information/lib/hardware_information/www/purchased_hardware/purchased_hardware.cgi
|
6
6
|
# =========================================================================== #
|
7
7
|
require 'cyberweb/evaluate_from_the_same_named_file_then_serve'
|