timetoday 0.1.5 → 0.1.8

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: 3ce8884791bc4030e812ef5c380c4871d5253d20
4
- data.tar.gz: 1833f3eccba7e4d9ed4cab147fda18a611fa2964
3
+ metadata.gz: f96f86333f7715b31d8929c2debef84c07d61192
4
+ data.tar.gz: c4e7574d5dcdc949765573ea8aceef698174820a
5
5
  SHA512:
6
- metadata.gz: 5ced258ab072303eecf18bee69c5fc5cd8eb9c7eb24798a881950aa226ff4be688fd27b334e417f6f1cfd8e9cab56b20b5e77de43f500710f57b4500f5ee4d14
7
- data.tar.gz: 3a32d9d25676b8ad066482787539bb071a08cdb6067a35141b7c33e96bf0c1d6fd4afd45a674a4f1f6e002f40fe7aa070f8bb469d449e6e3b5139bc6ce72b900
6
+ metadata.gz: 315380504ab6b22483cec7ca08d1108ce22127b93e15f9a9d72535b5cf55c2043042a4ec283a70ec1c03a943ed9579e7dc37913145c9864ffadd74fd1a64835d
7
+ data.tar.gz: 0f4af4e8c7627b5b7d97ea7837a189db2a68f781104037948dcbe16b34b3209866c9e570971051bfbb2b8b9b2f9c328b3679534f17f03d014e535fbba9acabb3
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -4,6 +4,7 @@
4
4
 
5
5
  require 'date'
6
6
  require 'time'
7
+ require 'chronic_duration'
7
8
 
8
9
  class TimeToday
9
10
 
@@ -26,4 +27,8 @@ class TimeToday
26
27
  time_remaining = ((Time.now.to_date + 1).to_time - 1) - t
27
28
  t + rand(time_remaining)
28
29
  end
30
+
31
+ def self.within(duration)
32
+ Time.now + rand(ChronicDuration.parse(duration))
33
+ end
29
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timetoday
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file