time_crisis 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  ---
2
+ :build:
2
3
  :minor: 3
3
- :patch: 1
4
+ :patch: 2
4
5
  :major: 0
5
- :build:
@@ -186,6 +186,11 @@ module TimeCrisis
186
186
  def tomorrow
187
187
  advance(:days => 1)
188
188
  end
189
+
190
+ if instance_methods.include?('plus_without_duration')
191
+ undef_method :+
192
+ alias_method :+, :plus_without_duration
193
+ end
189
194
 
190
195
  def plus_with_duration(other) #:nodoc:
191
196
  if TimeCrisis::Duration === other
@@ -196,6 +201,11 @@ module TimeCrisis
196
201
  end
197
202
  alias_method :plus_without_duration, :+
198
203
  alias_method :+, :plus_with_duration
204
+
205
+ if instance_methods.include?('minus_without_duration')
206
+ undef_method :-
207
+ alias_method :-, :minus_without_duration
208
+ end
199
209
 
200
210
  def minus_with_duration(other) #:nodoc:
201
211
  if TimeCrisis::Duration === other
@@ -206,13 +216,18 @@ module TimeCrisis
206
216
  end
207
217
  alias_method :minus_without_duration, :-
208
218
  alias_method :-, :minus_with_duration
209
-
219
+
210
220
  def minus_with_coercion(other)
211
221
  other = other.comparable_time if other.respond_to?(:comparable_time)
212
222
  minus_without_coercion(other)
213
223
  end
214
224
  alias_method :minus_without_coercion, :-
215
225
  alias_method :-, :minus_with_coercion
226
+
227
+ if instance_methods.include?('compare_without_coercion')
228
+ undef_method :<=>
229
+ alias_method :<=>, :compare_without_coercion
230
+ end
216
231
 
217
232
  def compare_with_coercion(other)
218
233
  other = other.comparable_time if other.respond_to?(:comparable_time)
@@ -10,6 +10,11 @@ module TimeCrisis
10
10
  :long => "%B %d, %Y %H:%M",
11
11
  :rfc822 => lambda { |time| time.strftime("%a, %d %b %Y %H:%M:%S #{time.formatted_offset(false)}") }
12
12
  }
13
+
14
+ if instance_methods.include?('to_default_s')
15
+ undef_method :to_s
16
+ alias_method :to_s, :to_default_s
17
+ end
13
18
 
14
19
  def to_formatted_s(format = :default)
15
20
  if formatter = DATE_FORMATS[format]
@@ -24,6 +29,11 @@ module TimeCrisis
24
29
  def formatted_offset(colon = true, alternate_utc_string = nil)
25
30
  utc? && alternate_utc_string || TimeCrisis::TimeZone.seconds_to_utc_offset(utc_offset, colon)
26
31
  end
32
+
33
+ if instance_methods.include?('default_inspect')
34
+ undef_method :inspect
35
+ alias_method :inspect, :default_inspect
36
+ end
27
37
 
28
38
  def readable_inspect
29
39
  "#<TimeCrisis::Time #{self.to_s(:rfc822)}>"
@@ -2,6 +2,11 @@ if RUBY_VERSION < '1.9'
2
2
  module TimeCrisis
3
3
  class Time
4
4
  class << self
5
+ if respond_to?(:_original_load)
6
+ undef_method :_load
7
+ alias_method :_load, :_original_load
8
+ end
9
+
5
10
  alias_method :_original_load, :_load
6
11
  def _load(marshaled_time)
7
12
  time = _original_load(marshaled_time)
@@ -9,6 +14,11 @@ if RUBY_VERSION < '1.9'
9
14
  utc ? time.utc : time
10
15
  end
11
16
  end
17
+
18
+ if respond_to?(:_original_dump)
19
+ undef_method :_dump
20
+ alias_method :_dump, :_original_dump
21
+ end
12
22
 
13
23
  alias_method :_original_dump, :_dump
14
24
  def _dump(*args)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{time_crisis}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Travis Tilley"]
12
- s.date = %q{2009-12-28}
12
+ s.date = %q{2009-12-31}
13
13
  s.description = %q{date and time related extensions}
14
14
  s.email = %q{ttilley@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: time_crisis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Tilley
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-28 00:00:00 -05:00
12
+ date: 2009-12-31 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15