buzztools 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/buzztools/extend_bignum.rb +15 -3
- data/lib/buzztools/extend_fixnum.rb +3 -0
- data/lib/buzztools/extend_time.rb +26 -0
- data/lib/buzztools/to_nil.rb +6 -0
- data/lib/buzztools/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1eaae1e1dab86ea0752de2655f0a62b0f20662ac
|
4
|
+
data.tar.gz: 113bda67b24d33fddcc40cbc4336c71acbcbe601
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03b1c16af683d35b6aaf30f396b902cee0b89df02c58a7c2017c696bf7524558c90f59bc118ce6744f1fc42cbfff087fd0d099caa3e7d932edeabf04aea0e28b
|
7
|
+
data.tar.gz: cb5dd2f7db57b298bfdbe41c8e1037d9c39dd711e1a91cb484007991383877e917ab1599b707c34e7c543eba0629d6c14e4cdf9bbec0758ae06c65e4f8f1d005
|
@@ -4,8 +4,20 @@ Bignum.class_eval do
|
|
4
4
|
self==0 ? false : true
|
5
5
|
end
|
6
6
|
|
7
|
+
def to_ms # eg. for 1.minute.to_ms
|
8
|
+
self*1000.0
|
9
|
+
end
|
10
|
+
|
7
11
|
end
|
8
12
|
|
9
|
-
|
10
|
-
|
11
|
-
|
13
|
+
Float.class_eval do
|
14
|
+
|
15
|
+
def to_b(aDefault=false)
|
16
|
+
self==0 ? false : true
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_ms # eg. for 1.minute.to_ms
|
20
|
+
self*1000.0
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
@@ -91,4 +91,30 @@ Time.class_eval do
|
|
91
91
|
def self.from_ms(aMilliseconds)
|
92
92
|
at(aMilliseconds/1000.0)
|
93
93
|
end
|
94
|
+
|
95
|
+
def iso8601ms
|
96
|
+
iso8601(3)
|
97
|
+
end
|
98
|
+
|
99
|
+
def zoneless
|
100
|
+
(self + self.utc_offset).utc
|
101
|
+
end
|
102
|
+
|
103
|
+
# sets the zone without affecting the hour or day
|
104
|
+
def to_zone(aHours)
|
105
|
+
self.in_time_zone(aHours)+self.utc_offset-aHours.to_i.hours
|
106
|
+
end
|
94
107
|
end
|
108
|
+
|
109
|
+
if defined? ActiveSupport::TimeWithZone
|
110
|
+
ActiveSupport::TimeWithZone.class_eval do
|
111
|
+
def zoneless
|
112
|
+
(self + self.utc_offset).utc
|
113
|
+
end
|
114
|
+
|
115
|
+
# sets the zone without affecting the hour or day
|
116
|
+
def to_zone(aHours)
|
117
|
+
self.in_time_zone(aHours)+self.utc_offset-aHours.to_i.hours
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
data/lib/buzztools/to_nil.rb
CHANGED
data/lib/buzztools/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buzztools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gary McGhee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: '0'
|
89
89
|
requirements: []
|
90
90
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.4.
|
91
|
+
rubygems_version: 2.4.6
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: reusable function library
|