compact_time 0.3.0 → 0.4.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 +4 -4
- data/lib/compact_time.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab8bbae86384fd06fe0fa28416f0b0233a2feaf5
|
4
|
+
data.tar.gz: ec100daefd074e068618cd2119df412eb0f5c17f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae27a221f87a8b5dcc4a4825e17bbb84a19a50a7f4634e907e36fec2c1e661fe8335bece324111c74d3bbf4ffed0483cc3164398a7ea4a048903d8d2412b9b05
|
7
|
+
data.tar.gz: 424e19283cbd8d093e58833c0eed0466f845be2dd70a65e376a529a5c957158bc6db7a53af7c527a3ca33a645aee7ff3ceeb1cf0a3cf085d247fd47fececf797
|
data/lib/compact_time.rb
CHANGED
@@ -3,16 +3,16 @@
|
|
3
3
|
class Time
|
4
4
|
def till_now; self.class.now - self end
|
5
5
|
def compact_array
|
6
|
-
[cpt_year % 100, cpt_season, cpt_week, cpt_day, hour, min
|
6
|
+
[cpt_year % 100, cpt_season, cpt_week, cpt_day, hour, min]
|
7
7
|
end
|
8
8
|
def full_array
|
9
9
|
[cpt_year, cpt_season, cpt_week, cpt_day, hour, min, cpt_offset, sec, usec]
|
10
10
|
end
|
11
11
|
def compact
|
12
|
-
"%02d%s %02d%s %02d%
|
12
|
+
"%02d%s %02d%s %02d%02dM".freeze % compact_array
|
13
13
|
end
|
14
14
|
def full
|
15
|
-
"%d%s %02d%s %02d%02d%
|
15
|
+
"%d%s %02d%s %02d%02d%sM %02dS %06d".freeze % full_array
|
16
16
|
end
|
17
17
|
|
18
18
|
private
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compact_time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawa
|
@@ -36,7 +36,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
36
36
|
version: '0'
|
37
37
|
requirements: []
|
38
38
|
rubyforge_project:
|
39
|
-
rubygems_version: 2.4.
|
39
|
+
rubygems_version: 2.4.1
|
40
40
|
signing_key:
|
41
41
|
specification_version: 4
|
42
42
|
summary: Compact way of expressing time
|