dohutil 0.2.14 → 0.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab1cdc5f0dc7ef1e62bfe0e7e21b8f71ef80f81e
4
- data.tar.gz: a1df1a39ac5e4aba7ffd2ad2bb032df1f167c73a
3
+ metadata.gz: e2de6b7bc26a1564bbbd0264d949e62c47ed5c9e
4
+ data.tar.gz: 5d44a1d2bf47503018e9e2b8800d339bf92e382a
5
5
  SHA512:
6
- metadata.gz: ea2dc5c47c49461859ab39c0aa19b1f2664db13ec17de8562534386c6e5c29c7d14dc8ae4748648f597636aefd530e0645bd8f95bde3929d12e4bda8f29d06db
7
- data.tar.gz: 22c516d08bda2d33f562e2947c0c8cca32b19c2056ba72ba0939c662ba7252b280a8c23c5b4f9cf8ab4136cd8d56899c7de610ac20679e40259e64a9da9a5be0
6
+ metadata.gz: 9d3d281cc7588f75162046022593780ee0e41f468fff0e93c845c013485461934fe90c25a3e8d2b71d2585377f2941d44071797eb8f073bc78331c207203568e
7
+ data.tar.gz: a4e3c947bd80b804e1db9de21de298d3d59156a1ace88eca34d3c5b8590952d678ad4067c56963690b58c59b175a6a6d51a9ca51eb160788e36639c117bc34fc
@@ -7,6 +7,11 @@ class DateTime
7
7
  SECONDS_IN_DAY = Rational(1, 60 * 60 * 24)
8
8
  end
9
9
 
10
+ def self.zow
11
+ obj = now
12
+ new(obj.year, obj.month, obj.mday, obj.hour, obj.min, obj.sec, 0)
13
+ end
14
+
10
15
  def self.seconds_to_days(seconds)
11
16
  seconds.to_f * SECONDS_IN_DAY #.to_f
12
17
  end
@@ -26,6 +31,11 @@ class DateTime
26
31
  end
27
32
 
28
33
  class Time
34
+ def self.zow
35
+ obj = now
36
+ new(obj.year, obj.month, obj.mday, obj.hour, obj.min, obj.sec, 0)
37
+ end
38
+
29
39
  def next_second(n = 1)
30
40
  self + n
31
41
  end
@@ -9,7 +9,7 @@ def current_date(dflt = Date.today)
9
9
  @current_date_stack.last.to_date
10
10
  end
11
11
 
12
- def current_datetime(dflt = DateTime.now)
12
+ def current_datetime(dflt = DateTime.zow)
13
13
  return dflt if @current_date_stack.empty?
14
14
  cdo = @current_date_stack.last
15
15
  return cdo if cdo.respond_to?(:hour)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dohutil
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.14
4
+ version: 0.2.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Makani Mason
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-12 00:00:00.000000000 Z
12
+ date: 2013-06-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dohroot
@@ -77,7 +77,6 @@ files:
77
77
  - lib/dohutil/core_ext/force_deep_copy.rb
78
78
  - lib/dohutil/core_ext/hash.rb
79
79
  - lib/dohutil/core_ext/inspect.rb
80
- - lib/dohutil/core_ext/random.rb
81
80
  - lib/dohutil/core_ext/string.rb
82
81
  - lib/dohutil/current_date.rb
83
82
  - lib/dohutil/env.rb
@@ -109,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
108
  version: '0'
110
109
  requirements: []
111
110
  rubyforge_project:
112
- rubygems_version: 2.0.2
111
+ rubygems_version: 2.0.3
113
112
  signing_key:
114
113
  specification_version: 4
115
114
  summary: assorted tiny utilities
@@ -1,8 +0,0 @@
1
- class Random
2
- def self.current_seed
3
- curseed = Random.srand(0)
4
- Random.srand(curseed)
5
- curseed
6
- end
7
- end
8
-