theusual 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51de97d541d5c8a0934ea2b4a4390c2f206667e8
4
- data.tar.gz: 222dd58985ce29ef1fc4b72185f572dd0cfe9393
3
+ metadata.gz: 6af68770c8a5f6f30a66ea5dc1288c437e82f39c
4
+ data.tar.gz: 15e247e1587c85d4148d73ae4b7e9fe09d1dc627
5
5
  SHA512:
6
- metadata.gz: fac7e54c933c172e01c740d643b70335123f35cf71fd05ac23ac9e77102df7c7990324757a16ae0fc63139e66e4ebe3fd9a03d49a8e87b0522aeb4aa484b3f18
7
- data.tar.gz: b7919d2c8876305931982515340f2a4eaaf5fbff0df9849a92e4ea2fde4a1d8ec08b81102e470826501ccfc083ed31e5d35f6e83a59c07a0c9c44266080d421d
6
+ metadata.gz: 54c0b663bbe157dc87899136c0fe69f41b048ca68ea1f1ffa069294724603542c5f4980eac736989647e1e1e8e8e4227dcccf29b472c716b9e546a3317d91727
7
+ data.tar.gz: 2f2954952235ae2812cb04e51d45947a48e881a2aabd4a71b0feb72b8c42f1b5f4aaee7b8a13d0a8e88bbfff61d4ca0857ef97c5d20157dfd0693ba46874867f
@@ -1,4 +1,16 @@
1
1
  class Time
2
+
3
+ def self.at_ms ms
4
+ # convert an integer representing Unix time in milliseconds
5
+ ms ? Time.at(ms / 1_000.0).utc : nil
6
+ end
7
+
8
+ def to_ms
9
+ # return the number of milliseconds since the Unix epoc
10
+ (to_f * 1_000).to_i
11
+ end
12
+
13
+
2
14
  def humanize
3
15
  a = (Time.now.utc - self.utc).to_i
4
16
 
@@ -16,4 +28,5 @@ class Time
16
28
  else ((a+180000)/(60*60*24*7)).to_i.to_s + ' weeks ago'
17
29
  end
18
30
  end
31
+
19
32
  end
@@ -1,3 +1,3 @@
1
1
  module TheUsual
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theusual
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Pepper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-04 00:00:00.000000000 Z
11
+ date: 2017-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.5.1
83
+ rubygems_version: 2.6.10
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: TheUsual