compact_time 0.1.0 → 0.1.1
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 +5 -4
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e703a5f85306423fbb95f83cb1898413e2d91f97
|
4
|
+
data.tar.gz: 67dfc7223a1ad0be29420eda8e43c9cbc5f0b7c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a50e727d40639833706494b89b72daef6581b922e8655a4cd2b5487e75937e0addb58689c2a0b25befddefd66de2d192abf681e96fb59451382486050379c4ad
|
7
|
+
data.tar.gz: 41f84ba50824d99cdc2c955b4cb91fd73395be744fc466013eaa8ce12961a40e800222ea7a85f199b9b9b6df49a37bc0315dd68229b5b47bfcd8e1a3c985cdd6
|
data/lib/compact_time.rb
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
class Time
|
4
4
|
def till_now; self.class.now - self end
|
5
|
-
def compact_array; [cpt_year % 100, cpt_season, cpt_week, cpt_day, hour, min] end
|
6
|
-
def compact; "%02d%s-%
|
7
|
-
def full_array; [cpt_year, cpt_season, cpt_week, cpt_day, hour, min, sec, usec] end
|
8
|
-
def full; "%
|
5
|
+
def compact_array; [cpt_year % 100, cpt_season, cpt_week, cpt_day, hour, min, cpt_offset] end
|
6
|
+
def compact; "%02d%s-%02d%s-T%02d%02d%s" % compact_array end
|
7
|
+
def full_array; [cpt_year, cpt_season, cpt_week, cpt_day, hour, min, cpt_offset, sec, usec] end
|
8
|
+
def full; "%d%s-%02d%s-T%02d%02d%s-S%02d%06d" % full_array end
|
9
9
|
|
10
10
|
private
|
11
11
|
Alph = %w[dummy A B C D E F G]
|
@@ -13,4 +13,5 @@ class Time
|
|
13
13
|
def cpt_season; Alph[strftime("%V").to_i.-(1)./(13).+(1)] end
|
14
14
|
def cpt_week; strftime("%V").to_i.-(1).%(13).+(1) end
|
15
15
|
def cpt_day; Alph[strftime("%u").to_i] end
|
16
|
+
def cpt_offset; strftime("%z") end
|
16
17
|
end
|
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.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sawa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: ''
|
14
14
|
email: []
|
@@ -26,17 +26,17 @@ require_paths:
|
|
26
26
|
- lib
|
27
27
|
required_ruby_version: !ruby/object:Gem::Requirement
|
28
28
|
requirements:
|
29
|
-
- -
|
29
|
+
- - ">="
|
30
30
|
- !ruby/object:Gem::Version
|
31
31
|
version: '0'
|
32
32
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
|
-
- -
|
34
|
+
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: '0'
|
37
37
|
requirements: []
|
38
38
|
rubyforge_project:
|
39
|
-
rubygems_version: 2.
|
39
|
+
rubygems_version: 2.1.5
|
40
40
|
signing_key:
|
41
41
|
specification_version: 4
|
42
42
|
summary: Compact way of expressing time
|