repo.or.cz
/
god.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
fix byte-centric sugar (kb is canonical not bytes); make god binary pid generation...
[god.git]
/
lib
/
god
/
sugar.rb
blob
1179557239708601800c1b64fcbf3beb5a9882c5
1
class Numeric
2
def seconds
3
self
4
end
5
6
alias :second :seconds
7
8
def minutes
9
self * 60
10
end
11
12
alias :minute :minutes
13
14
def hours
15
self * 3600
16
end
17
18
alias :hour :hours
19
20
def days
21
self * 86400
22
end
23
24
alias :day :days
25
26
def kilobytes
27
self
28
end
29
30
alias :kilobyte :kilobytes
31
32
def megabytes
33
self * 1024
34
end
35
36
alias :megabyte :megabytes
37
38
def gigabytes
39
self * (1024 ** 2)
40
end
41
42
alias :gigabyte :gigabytes
43
44
def percent
45
self
46
end
47
end