compact_time 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/compact_time.rb +11 -12
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 413cb68ec83223ef6dd8fc2b076400aeaf258dde
4
- data.tar.gz: 77caae143fbe87d6ba82fb8d44ce1d8644c3dca9
3
+ metadata.gz: 44554cbc05d9b4e1d994a17e74e867db36bc45ce
4
+ data.tar.gz: a50501657f15b4c67e3081bcdd292af67ed5cf55
5
5
  SHA512:
6
- metadata.gz: 03049656dd07eb9ff63b55671795d4e0eb7639c1f0c1cdd6e4f2e484414973f48a59ee329489bcbadf87440e384d64abfcf02646874b7e2ef9757b3e692f263a
7
- data.tar.gz: cb027cdd4778d2968fe4d5faff34e2e83fbd3edaeb0cd61d596fb6c4c63f2c6c4db098cf4c0d857d25ea14d5a3f96caaf77d6ac5df789c908287783fc47938aa
6
+ metadata.gz: 6458be7641028f96bab5c96b29499fe451fd1a051fdf5e604146d333c4a4f1b76b6880d1495413e2077f4024fe08581e5d165a905c431990c049c47bfae43d01
7
+ data.tar.gz: 636980d0bfcc431c275e5c6baf3f8e486864f5032f8725d4f7b406ce6f5c9d1fadf2df7d23e9a9042c068fbdc5b8633c5400774afe48d5a3077376418d148f1a
data/lib/compact_time.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/ruby
2
-
2
+ #frozen-string-literal: true
3
3
  class Time
4
4
  def till_now; self.class.now - self end
5
5
  def compact_array
@@ -9,25 +9,24 @@ class Time
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%02d".freeze % compact_array
12
+ "%02d %s%02d %s%02d%02d" % compact_array
13
13
  end
14
14
  def full
15
- "%d %s%02d %s%02d%02d%s %02d %06d".freeze % full_array
15
+ "%d %s%02d %s%02d%02d%s %02d %06d" % full_array
16
16
  end
17
17
 
18
- private
19
18
  Alph = %w[dummy A B C D E F G]
20
- protected def widow_week?; strftime("%V".freeze).to_i == 53 end
21
- def cpt_year; strftime("%G".freeze).to_i end
22
- def cpt_season
23
- i = strftime("%V".freeze).to_i.-(1)./(13).+(1)
19
+ protected def widow_week?; strftime("%V").to_i == 53 end
20
+ private def cpt_year; strftime("%G").to_i end
21
+ private def cpt_season
22
+ i = strftime("%V").to_i.-(1)./(13).+(1)
24
23
  i -= 1 if widow_week?
25
24
  Alph[i]
26
25
  end
27
- def cpt_week
28
- i = strftime("%V".freeze).to_i.-(1).%(13).+(1)
26
+ private def cpt_week
27
+ i = strftime("%V").to_i.-(1).%(13).+(1)
29
28
  widow_week? ? i + 1 : i
30
29
  end
31
- def cpt_day; Alph[strftime("%u".freeze).to_i] end
32
- def cpt_offset; strftime("%z".freeze) end
30
+ private def cpt_day; Alph[strftime("%u").to_i] end
31
+ private def cpt_offset; strftime("%z") end
33
32
  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.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sawa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-15 00:00:00.000000000 Z
11
+ date: 2015-12-25 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.4.1
39
+ rubygems_version: 2.5.1
40
40
  signing_key:
41
41
  specification_version: 4
42
42
  summary: Compact way of expressing time