si 0.1.4 → 0.3.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 +7 -0
- data/.github/workflows/ruby.yml +33 -0
- data/.gitignore +1 -1
- data/Gemfile +3 -0
- data/README.md +21 -10
- data/lib/si/constants.rb +17 -17
- data/lib/si/minimal.rb +2 -1
- data/lib/si/module.rb +48 -34
- data/lib/si/patch.rb +11 -11
- data/lib/si/version.rb +3 -1
- data/lib/si.rb +1 -2
- data/si.gemspec +9 -10
- data/test/test_si.rb +100 -66
- metadata +9 -15
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5504e33c6ff5bd548c433862a31d08370e2696928c7348326174799b35f6b836
|
4
|
+
data.tar.gz: defc061bb3cb96a3d54768ce99392713308244305ca5d84277ca675481da3575
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f23c952660cd2c9bfad5f20916dbf6c73da4161b7aab7152adba78737b7b8fc6ed188ae70d4f6ee9c7129a430009e62a5a03c86f44fa12f47f9de8f959cd1556
|
7
|
+
data.tar.gz: 5396036c1b5fddd02fd4ecccc9be9a1c200782e4d0048d1067b9ad345a9a59e2ca44ad70c977d35b1a6be9249d57128f82e0c1ee4e69a7917621bb313234aea8
|
@@ -0,0 +1,33 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [master]
|
6
|
+
pull_request:
|
7
|
+
branches: [master]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby: ['2.6', '2.7', '3.0', '3.1', '3.2']
|
16
|
+
|
17
|
+
steps:
|
18
|
+
- uses: actions/checkout@v3
|
19
|
+
|
20
|
+
- name: Set up Ruby
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
24
|
+
bundler-cache: true
|
25
|
+
|
26
|
+
- name: Update the RubyGems system software
|
27
|
+
run: gem update --system
|
28
|
+
|
29
|
+
- name: Update Bundler
|
30
|
+
run: bundle update --bundler
|
31
|
+
|
32
|
+
- name: Install dependencies
|
33
|
+
run: bundle install
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -45,31 +45,42 @@ require 'si'
|
|
45
45
|
|
46
46
|
#### Options
|
47
47
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
| Option | Default | Description |
|
49
|
+
| ------------ | --------- | ----------------------------------------------------------------------------------------------------------- |
|
50
|
+
| `:length` | 3 | Number of digits |
|
51
|
+
| `:base` | 1000 | For [binary prefix](http://en.wikipedia.org/wiki/Binary_prefix), set this to 1024 instead of default 1000 |
|
52
|
+
| `:space` | `''` | Space between number and prefix. Set to `' '` to get `9.88 T` instead of `9.88T` |
|
53
|
+
| `:min_exp` | -8 | Down to <strong>y</strong>octo |
|
54
|
+
| `:max_exp` | 8 | Up to <strong>Y</strong>otta |
|
52
55
|
|
53
56
|
```ruby
|
54
|
-
9876543210000.si(:
|
57
|
+
9876543210000.si(length: 5) # '9.8765T'
|
55
58
|
|
56
59
|
# For convenience, a single Fixnum is recognized as :length value
|
57
60
|
9876543210000.si(5) # '9.8765T'
|
58
61
|
```
|
59
62
|
|
60
|
-
### `
|
63
|
+
### `si_bytes`
|
61
64
|
|
62
|
-
|
65
|
+
Formats the number of bytes using SI prefixes (base 1000).
|
63
66
|
|
64
67
|
```ruby
|
65
|
-
13255342817.
|
68
|
+
13255342817.si_bytes # '13.3GB'
|
69
|
+
```
|
70
|
+
|
71
|
+
### `bin_bytes`
|
72
|
+
|
73
|
+
Formats the number of bytes using binary prefixes (base 1024).
|
74
|
+
|
75
|
+
```ruby
|
76
|
+
13255342817.bin_bytes # '12.3GiB'
|
66
77
|
```
|
67
78
|
|
68
79
|
## SI module methods: convert / revert
|
69
80
|
|
70
81
|
```ruby
|
71
|
-
SI.convert(9876543210000, :
|
72
|
-
SI.revert('100k', :
|
82
|
+
SI.convert(9876543210000, length: 5) # '9.8765T'
|
83
|
+
SI.revert('100k', base: 1024) # 102400.0
|
73
84
|
```
|
74
85
|
|
75
86
|
## Avoiding monkey-patching
|
data/lib/si/constants.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module SI
|
4
4
|
PREFIXES = {
|
@@ -10,22 +10,22 @@ module SI
|
|
10
10
|
-3 => 'n',
|
11
11
|
-2 => 'μ',
|
12
12
|
-1 => 'm',
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
}
|
13
|
+
0 => '',
|
14
|
+
1 => 'k',
|
15
|
+
2 => 'M',
|
16
|
+
3 => 'G',
|
17
|
+
4 => 'T',
|
18
|
+
5 => 'P',
|
19
|
+
6 => 'E',
|
20
|
+
7 => 'Z',
|
21
|
+
8 => 'Y'
|
22
|
+
}.freeze
|
23
23
|
|
24
24
|
DEFAULT = {
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
|
25
|
+
length: 3,
|
26
|
+
base: 1000,
|
27
|
+
space: '',
|
28
|
+
min_exp: -8,
|
29
|
+
max_exp: 8
|
30
|
+
}.freeze
|
30
31
|
end
|
31
|
-
|
data/lib/si/minimal.rb
CHANGED
data/lib/si/module.rb
CHANGED
@@ -1,63 +1,77 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module SI
|
2
4
|
class << self
|
3
|
-
def convert
|
4
|
-
options = { :
|
5
|
+
def convert(num, options = {})
|
6
|
+
options = { length: options } if options.is_a?(Numeric)
|
5
7
|
options = DEFAULT.merge(options)
|
6
|
-
length,
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
denom
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
8
|
+
space, length, min_exp, max_exp = options.values_at(:space, :length, :min_exp, :max_exp)
|
9
|
+
raise ArgumentError, 'Invalid length' if length < 2
|
10
|
+
|
11
|
+
return num.is_a?(Float) ? "0.#{'0' * (length - 1)}" : '0' if num.zero?
|
12
|
+
|
13
|
+
base = options[:base].to_f
|
14
|
+
minus = num.negative? ? '-' : ''
|
15
|
+
nump = num.abs
|
16
|
+
|
17
|
+
PREFIXES.keys.sort.reverse.select { |exp| (min_exp..max_exp).include?(exp) }.each do |exp|
|
18
|
+
denom = base**exp
|
19
|
+
next unless nump >= denom || exp == min_exp
|
20
|
+
|
21
|
+
val = nump / denom
|
22
|
+
val = SI.round val, [length - val.to_i.to_s.length, 0].max
|
23
|
+
val = val.to_i if exp.zero? && !num.is_a?(Float)
|
24
|
+
val = val.to_s.ljust(length + 1, '0') if val.is_a?(Float)
|
25
|
+
|
26
|
+
return "#{minus}#{val}#{space}#{PREFIXES[exp]}"
|
26
27
|
end
|
27
28
|
|
28
29
|
nil
|
29
30
|
end
|
30
31
|
|
31
|
-
def revert
|
32
|
-
options = Hash[
|
33
|
-
pair = PREFIXES.to_a.find { |
|
32
|
+
def revert(str, options = {})
|
33
|
+
options = Hash[DEFAULT.select { |k, _v| k == :base }].merge(options)
|
34
|
+
pair = PREFIXES.to_a.find { |_k, v| !v.empty? && str =~ /[0-9]#{v}$/ }
|
34
35
|
|
35
36
|
if pair
|
36
|
-
str[0...-1].to_f * (options[:base]
|
37
|
+
str[0...-1].to_f * (options[:base]**pair.first)
|
37
38
|
else
|
38
39
|
str.to_f
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|
42
43
|
if (RUBY_VERSION.split('.')[0, 2].map(&:to_i) <=> [1, 8]) == 1
|
43
|
-
def round
|
44
|
+
def round(val, ndigits)
|
44
45
|
val.round ndigits
|
45
46
|
end
|
46
47
|
else
|
47
|
-
def round
|
48
|
-
exp = (10
|
48
|
+
def round(val, ndigits)
|
49
|
+
exp = (10**ndigits).to_f
|
49
50
|
val = ((val * exp).round / exp)
|
50
|
-
ndigits
|
51
|
+
ndigits.zero? ? val.to_i : val
|
51
52
|
end
|
52
53
|
end
|
53
54
|
end
|
54
55
|
|
55
|
-
def si
|
56
|
+
def si(options = {})
|
56
57
|
SI.convert(self, options)
|
57
58
|
end
|
58
59
|
|
59
|
-
|
60
|
-
|
60
|
+
# Deprecated. Only kept for backward compatibility.
|
61
|
+
def si_byte(length = 3)
|
62
|
+
"#{SI.convert(self, length: length, base: 1024, min_exp: 0)}B"
|
63
|
+
end
|
64
|
+
|
65
|
+
def si_bytes(options = {})
|
66
|
+
options = { length: options } if options.is_a?(Numeric)
|
67
|
+
options = { base: 1000, length: 3, min_exp: 0 }.merge(options)
|
68
|
+
"#{SI.convert(self, options)}B"
|
61
69
|
end
|
62
|
-
end
|
63
70
|
|
71
|
+
def bin_bytes(options = {})
|
72
|
+
options = { length: options } if options.is_a?(Numeric)
|
73
|
+
options = { base: 1024, length: 3, min_exp: 0 }.merge(options)
|
74
|
+
result = SI.convert(self, options)
|
75
|
+
result.match?(/[0-9]$/) ? "#{result}B" : "#{result}iB"
|
76
|
+
end
|
77
|
+
end
|
data/lib/si/patch.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
|
2
|
-
include SI
|
3
|
-
end
|
1
|
+
# frozen_string_literal: true
|
4
2
|
|
5
|
-
|
6
|
-
include SI
|
7
|
-
end
|
3
|
+
original_verbosity = $VERBOSE
|
8
4
|
|
9
|
-
|
10
|
-
include SI
|
11
|
-
end
|
5
|
+
$VERBOSE = nil
|
12
6
|
|
13
|
-
|
14
|
-
|
7
|
+
%i[Float Fixnum Bignum Rational Integer].each do |const|
|
8
|
+
next unless Object.const_defined?(const)
|
9
|
+
|
10
|
+
Object.const_get(const).class_eval do
|
11
|
+
include SI
|
12
|
+
end
|
15
13
|
end
|
14
|
+
|
15
|
+
$VERBOSE = original_verbosity
|
data/lib/si/version.rb
CHANGED
data/lib/si.rb
CHANGED
data/si.gemspec
CHANGED
@@ -1,17 +1,16 @@
|
|
1
|
-
|
2
|
-
require File.expand_path('../lib/si/version', __FILE__)
|
1
|
+
require File.expand_path('lib/si/version', __dir__)
|
3
2
|
|
4
3
|
Gem::Specification.new do |gem|
|
5
|
-
gem.authors = [
|
6
|
-
gem.email = [
|
7
|
-
gem.description =
|
8
|
-
gem.summary =
|
9
|
-
gem.homepage =
|
4
|
+
gem.authors = ['Junegunn Choi']
|
5
|
+
gem.email = ['junegunn.c@gmail.com']
|
6
|
+
gem.description = 'Formats a number with SI prefix'
|
7
|
+
gem.summary = 'Formats a number with SI prefix (metric prefix)'
|
8
|
+
gem.homepage = 'https://github.com/junegunn/si'
|
10
9
|
|
11
10
|
gem.files = `git ls-files`.split($\)
|
12
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
11
|
+
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
13
12
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
-
gem.name =
|
15
|
-
gem.require_paths = [
|
13
|
+
gem.name = 'si'
|
14
|
+
gem.require_paths = ['lib']
|
16
15
|
gem.version = SI::VERSION
|
17
16
|
end
|
data/test/test_si.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
2
|
+
# frozen_string_literal: true
|
3
3
|
|
4
4
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
5
5
|
require 'test/unit'
|
@@ -46,31 +46,31 @@ class TestSI < Test::Unit::TestCase
|
|
46
46
|
1.23457m
|
47
47
|
12.3457m
|
48
48
|
123.457m
|
49
|
-
|
49
|
+
|
50
50
|
1.23457
|
51
51
|
12.3457
|
52
52
|
123.457
|
53
|
-
|
53
|
+
|
54
54
|
1.23457k
|
55
55
|
12.3457k
|
56
56
|
123.457k
|
57
|
-
|
57
|
+
|
58
58
|
1.23457M
|
59
59
|
12.3457M
|
60
60
|
123.457M
|
61
|
-
|
61
|
+
|
62
62
|
1.23457G
|
63
63
|
12.3457G
|
64
64
|
123.457G
|
65
|
-
|
65
|
+
|
66
66
|
1.23457T
|
67
67
|
12.3457T
|
68
68
|
123.457T
|
69
|
-
|
69
|
+
|
70
70
|
1.23457P
|
71
71
|
12.3457P
|
72
72
|
123.457P
|
73
|
-
|
73
|
+
|
74
74
|
1.23457E
|
75
75
|
12.3457E
|
76
76
|
123.457E
|
@@ -91,14 +91,14 @@ class TestSI < Test::Unit::TestCase
|
|
91
91
|
123456700Y
|
92
92
|
1234567000Y
|
93
93
|
].each do |ret|
|
94
|
-
assert_equal ret, val.si(:
|
95
|
-
assert_equal '-' + ret, (-val).si(:
|
94
|
+
assert_equal ret, val.si(length: 6)
|
95
|
+
assert_equal '-' + ret, (-val).si(length: 6)
|
96
96
|
val *= 10
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
100
100
|
def test_si_base
|
101
|
-
val =
|
101
|
+
val = 807_936
|
102
102
|
%w[
|
103
103
|
789k
|
104
104
|
789M
|
@@ -107,86 +107,121 @@ class TestSI < Test::Unit::TestCase
|
|
107
107
|
807936T
|
108
108
|
827326464T
|
109
109
|
].each do |ret|
|
110
|
-
assert_equal ret, val.si(:
|
110
|
+
assert_equal ret, val.si(base: 1024, max_exp: 4)
|
111
111
|
val *= 1024
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
115
|
-
def
|
115
|
+
def test_bin_bytes
|
116
|
+
{
|
117
|
+
1_234_132 => '1.18MiB',
|
118
|
+
123_004_132 => '117MiB',
|
119
|
+
123_004_999_132 => '115GiB',
|
120
|
+
555_123_004_999_132 => '505TiB',
|
121
|
+
5_555_123_004_999_132 => '4.93PiB',
|
122
|
+
3_335_555_123_004_999_132 => '2.89EiB',
|
123
|
+
0.001 => '0.00B',
|
124
|
+
0.005 => '0.01B',
|
125
|
+
0.01 => '0.01B',
|
126
|
+
0.1 => '0.10B',
|
127
|
+
0 => '0B',
|
128
|
+
1 => '1B',
|
129
|
+
1.0 => '1.00B',
|
130
|
+
1.01 => '1.01B',
|
131
|
+
10 => '10B',
|
132
|
+
10.0 => '10.0B',
|
133
|
+
100 => '100B',
|
134
|
+
100.0 => '100B',
|
135
|
+
0.0 => '0.00B',
|
136
|
+
0.123412 => '0.12B',
|
137
|
+
0.0123412 => '0.01B',
|
138
|
+
0.00123412 => '0.00B'
|
139
|
+
}.each do |val, ret|
|
140
|
+
assert_equal ret, val.bin_bytes
|
141
|
+
|
142
|
+
if val.zero?
|
143
|
+
assert_equal ret, (-val).bin_bytes
|
144
|
+
else
|
145
|
+
assert_equal "-#{ret}", (-val).bin_bytes
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
def test_si_bytes
|
116
151
|
{
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
0.001
|
124
|
-
0.005
|
125
|
-
0.01
|
126
|
-
0.1
|
127
|
-
0
|
128
|
-
1
|
129
|
-
1.0
|
130
|
-
1.01
|
131
|
-
10
|
132
|
-
10.0
|
133
|
-
100
|
134
|
-
100.0
|
135
|
-
0.0
|
136
|
-
0.123412
|
137
|
-
0.0123412
|
138
|
-
0.00123412
|
152
|
+
1_234_132 => '1.23MB',
|
153
|
+
123_004_132 => '123MB',
|
154
|
+
123_004_999_132 => '123GB',
|
155
|
+
555_123_004_999_132 => '555TB',
|
156
|
+
5_555_123_004_999_132 => '5.56PB',
|
157
|
+
3_335_555_123_004_999_132 => '3.34EB',
|
158
|
+
0.001 => '0.00B',
|
159
|
+
0.005 => '0.01B',
|
160
|
+
0.01 => '0.01B',
|
161
|
+
0.1 => '0.10B',
|
162
|
+
0 => '0B',
|
163
|
+
1 => '1B',
|
164
|
+
1.0 => '1.00B',
|
165
|
+
1.01 => '1.01B',
|
166
|
+
10 => '10B',
|
167
|
+
10.0 => '10.0B',
|
168
|
+
100 => '100B',
|
169
|
+
100.0 => '100B',
|
170
|
+
0.0 => '0.00B',
|
171
|
+
0.123412 => '0.12B',
|
172
|
+
0.0123412 => '0.01B',
|
173
|
+
0.00123412 => '0.00B'
|
139
174
|
}.each do |val, ret|
|
140
|
-
assert_equal ret, val.
|
175
|
+
assert_equal ret, val.si_bytes
|
141
176
|
|
142
|
-
if val
|
143
|
-
assert_equal ret, (-val).
|
177
|
+
if val.zero?
|
178
|
+
assert_equal ret, (-val).si_bytes
|
144
179
|
else
|
145
|
-
assert_equal
|
180
|
+
assert_equal "-#{ret}", (-val).si_bytes
|
146
181
|
end
|
147
182
|
end
|
148
183
|
end
|
149
184
|
|
150
185
|
def test_readme
|
151
186
|
{
|
152
|
-
0.009
|
153
|
-
0.09
|
154
|
-
0.9
|
155
|
-
9
|
156
|
-
98
|
157
|
-
987
|
158
|
-
9876
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
187
|
+
0.009 => '9.00m',
|
188
|
+
0.09 => '90.0m',
|
189
|
+
0.9 => '900m',
|
190
|
+
9 => '9',
|
191
|
+
98 => '98',
|
192
|
+
987 => '987',
|
193
|
+
9876 => '9.88k',
|
194
|
+
98_765 => '98.8k',
|
195
|
+
987_654 => '988k',
|
196
|
+
9_876_543 => '9.88M',
|
197
|
+
98_765_432 => '98.8M',
|
198
|
+
987_654_321 => '988M',
|
199
|
+
9_876_543_210 => '9.88G',
|
200
|
+
98_765_432_100 => '98.8G',
|
201
|
+
987_654_321_000 => '988G',
|
202
|
+
9_876_543_210_000 => '9.88T'
|
168
203
|
}.each do |val, ret|
|
169
204
|
assert_equal ret, val.si
|
170
205
|
end
|
171
206
|
|
172
|
-
assert_equal '9.8765T',
|
173
|
-
assert_equal '12.3GB',
|
207
|
+
assert_equal '9.8765T', 9_876_543_210_000.si(length: 5)
|
208
|
+
assert_equal '12.3GB', 13_255_342_817.si_byte
|
174
209
|
end
|
175
210
|
|
176
211
|
def test_edge_cases
|
177
|
-
assert_equal '9.
|
212
|
+
assert_equal '9.0000 T', 9_000_000_000_001.si(length: 5, space: ' ')
|
178
213
|
end
|
179
214
|
|
180
215
|
def test_shortcut
|
181
|
-
assert_equal '123.5M',
|
216
|
+
assert_equal '123.5M', 123_450_000.si(4)
|
182
217
|
end
|
183
218
|
|
184
219
|
def test_module_methods
|
185
|
-
assert_equal '9.8765T',
|
186
|
-
assert_equal
|
187
|
-
assert_equal
|
188
|
-
assert_equal
|
189
|
-
assert_equal 9.8765 * 1024
|
220
|
+
assert_equal '9.8765T', SI.convert(9_876_543_210_000, length: 5)
|
221
|
+
assert_equal 9_876_500_000_000, SI.revert('9.8765T')
|
222
|
+
assert_equal 9_876_500_000, SI.revert('9.8765G')
|
223
|
+
assert_equal 9_876_500, SI.revert('9.8765M')
|
224
|
+
assert_equal 9.8765 * 1024**2, SI.revert('9.8765M', base: 1024)
|
190
225
|
assert_equal 0.0000098765, SI.revert('9.8765μ')
|
191
226
|
assert_equal 0.0098765, SI.revert('9.8765m')
|
192
227
|
assert_equal 9.8765, SI.revert('9.8765')
|
@@ -195,7 +230,7 @@ class TestSI < Test::Unit::TestCase
|
|
195
230
|
end
|
196
231
|
|
197
232
|
def test_rational
|
198
|
-
assert_equal '12.345n', (
|
233
|
+
assert_equal '12.345n', (12_345 * (10**-12)).si(5)
|
199
234
|
end
|
200
235
|
|
201
236
|
def test_zero
|
@@ -212,4 +247,3 @@ class TestSI < Test::Unit::TestCase
|
|
212
247
|
assert_raise(ArgumentError) { 123.si(1) }
|
213
248
|
end
|
214
249
|
end
|
215
|
-
|
metadata
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: si
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Junegunn Choi
|
9
|
-
autorequire:
|
10
8
|
bindir: bin
|
11
9
|
cert_chain: []
|
12
|
-
date:
|
10
|
+
date: 2025-06-27 00:00:00.000000000 Z
|
13
11
|
dependencies: []
|
14
12
|
description: Formats a number with SI prefix
|
15
13
|
email:
|
@@ -18,7 +16,8 @@ executables: []
|
|
18
16
|
extensions: []
|
19
17
|
extra_rdoc_files: []
|
20
18
|
files:
|
21
|
-
- .
|
19
|
+
- ".github/workflows/ruby.yml"
|
20
|
+
- ".gitignore"
|
22
21
|
- Gemfile
|
23
22
|
- LICENSE
|
24
23
|
- README.md
|
@@ -33,28 +32,23 @@ files:
|
|
33
32
|
- test/test_si.rb
|
34
33
|
homepage: https://github.com/junegunn/si
|
35
34
|
licenses: []
|
36
|
-
|
35
|
+
metadata: {}
|
37
36
|
rdoc_options: []
|
38
37
|
require_paths:
|
39
38
|
- lib
|
40
39
|
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
40
|
requirements:
|
43
|
-
- -
|
41
|
+
- - ">="
|
44
42
|
- !ruby/object:Gem::Version
|
45
43
|
version: '0'
|
46
44
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
47
|
-
none: false
|
48
45
|
requirements:
|
49
|
-
- -
|
46
|
+
- - ">="
|
50
47
|
- !ruby/object:Gem::Version
|
51
48
|
version: '0'
|
52
49
|
requirements: []
|
53
|
-
|
54
|
-
|
55
|
-
signing_key:
|
56
|
-
specification_version: 3
|
50
|
+
rubygems_version: 3.6.2
|
51
|
+
specification_version: 4
|
57
52
|
summary: Formats a number with SI prefix (metric prefix)
|
58
53
|
test_files:
|
59
54
|
- test/test_si.rb
|
60
|
-
has_rdoc:
|