before_and_after 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -0
- data/VERSION +1 -1
- data/before_and_after.gemspec +1 -1
- data/lib/before_and_after.rb +8 -2
- metadata +2 -2
data/README.md
CHANGED
@@ -22,6 +22,10 @@ Credits goes to whoever wrote this. http://www.dzone.com/snippets/and-after-ruby
|
|
22
22
|
|
23
23
|
## Changelog
|
24
24
|
|
25
|
+
**1.0.3**
|
26
|
+
|
27
|
+
- Yet another try to get ActiveSupport::TimeWithZone to work with before_and_after
|
28
|
+
|
25
29
|
**1.0.2**
|
26
30
|
|
27
31
|
- Fixed problem with ActiveSupport::TimeWithZone between not behaving the same as Time#between
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.3
|
data/before_and_after.gemspec
CHANGED
data/lib/before_and_after.rb
CHANGED
@@ -25,6 +25,7 @@ module BeforeAndAfter
|
|
25
25
|
#
|
26
26
|
def within_last?(time_span)
|
27
27
|
now = Time.now.utc
|
28
|
+
puts "#{self.utc} #{now}"
|
28
29
|
self.utc.between?(now - time_span, now)
|
29
30
|
end
|
30
31
|
|
@@ -34,9 +35,14 @@ module BeforeAndAfter
|
|
34
35
|
#
|
35
36
|
def within_coming?(time_span)
|
36
37
|
now = Time.now.utc
|
38
|
+
puts "#{self.utc} #{now}"
|
37
39
|
self.utc.between?(now, now + time_span)
|
38
40
|
end
|
39
|
-
|
40
41
|
end
|
41
42
|
|
42
|
-
Time.send :include , BeforeAndAfter
|
43
|
+
Time.send :include , BeforeAndAfter
|
44
|
+
|
45
|
+
begin
|
46
|
+
ActiveSupport::TimeWithZone.send :include , BeforeAndAfter
|
47
|
+
rescue => e
|
48
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: before_and_after
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -111,7 +111,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
111
|
version: '0'
|
112
112
|
segments:
|
113
113
|
- 0
|
114
|
-
hash:
|
114
|
+
hash: -4407723987409584694
|
115
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|