compact_time 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/compact_time.rb +12 -4
- 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: 664ae799245faee636b6a8c8f61db8e9b8e278b5
|
4
|
+
data.tar.gz: ae5aa7361afa8961e94734b399a8831ac186b560
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ca17d09d167e26d21aa7ba5b2960237c1c5163d0d4f7d8aa6126d25c323d5cf117a19888884acbdf560db0ec7e9bb57d104322baaae60f28e75d161ce6655ed
|
7
|
+
data.tar.gz: 918f82494c0431e70fe2b1f546dd9526b291246d3877bfaa5d17eb5723fe52a587c5fc5a91e4dccb1df0a73316bcb502b9726f2553c1a62c6ba1f4531381453a
|
data/lib/compact_time.rb
CHANGED
@@ -2,10 +2,18 @@
|
|
2
2
|
|
3
3
|
class Time
|
4
4
|
def till_now; self.class.now - self end
|
5
|
-
def compact_array
|
6
|
-
|
7
|
-
|
8
|
-
def
|
5
|
+
def compact_array
|
6
|
+
[cpt_year % 100, cpt_season, cpt_week, cpt_day, hour, min, cpt_offset]
|
7
|
+
end
|
8
|
+
def full_array
|
9
|
+
[cpt_year, cpt_season, cpt_week, cpt_day, hour, min, cpt_offset, sec, usec]
|
10
|
+
end
|
11
|
+
def compact
|
12
|
+
"%02d%s %02d%s %02d%02d%sT".freeze % compact_array
|
13
|
+
end
|
14
|
+
def full
|
15
|
+
"%d%s %02d%s %02d%02d%sT %02dS %06d".freeze % full_array
|
16
|
+
end
|
9
17
|
|
10
18
|
private
|
11
19
|
Alph = %w[dummy A B C D E F G]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compact_time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ''
|
14
14
|
email: []
|
@@ -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.
|
39
|
+
rubygems_version: 2.4.0
|
40
40
|
signing_key:
|
41
41
|
specification_version: 4
|
42
42
|
summary: Compact way of expressing time
|