rails-timeago 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,10 +37,9 @@ module Rails
37
37
  time_options = Rails::Timeago.default_options
38
38
 
39
39
  time_options = time_options.merge html_options.extract!(*time_options.keys.select{|k| html_options.include?(k)})
40
- html_options.merge! :title => I18n.l(time, :format => time_options[:format])
41
-
42
40
  return time_options[:default] if time.nil?
43
-
41
+
42
+ html_options.merge! :title => I18n.l(time, :format => time_options[:format])
44
43
  time_options[:limit] = time_options[:limit].call if time_options[:limit].is_a?(Proc)
45
44
 
46
45
  if time_options[:force] or time_options[:limit].nil? or time_options[:limit] < time
@@ -3,7 +3,7 @@ module Rails
3
3
  module VERSION
4
4
  MAJOR = 1
5
5
  MINOR = 1
6
- PATCH = 0
6
+ PATCH = 1
7
7
 
8
8
  def self.to_s
9
9
  [MAJOR, MINOR, PATCH].join '.'
data/spec/timeago_spec.rb CHANGED
@@ -81,4 +81,8 @@ describe Rails::Timeago::Helper do
81
81
  @stub.timeago_tag(time, :limit => 4.days.ago).
82
82
  should_not =~ /<time.*data-time-ago=".*".*>.*<\/time>/
83
83
  end
84
+
85
+ it "should return default string if time is nil" do
86
+ @stub.timeago_tag(nil).should == '-'
87
+ end
84
88
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-timeago
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &15835140 !ruby/object:Gem::Requirement
16
+ requirement: &12945340 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *15835140
24
+ version_requirements: *12945340
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: actionpack
27
- requirement: &15834280 !ruby/object:Gem::Requirement
27
+ requirement: &12944560 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.1'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *15834280
35
+ version_requirements: *12944560
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &15833840 !ruby/object:Gem::Requirement
38
+ requirement: &12944120 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *15833840
46
+ version_requirements: *12944120
47
47
  description: jQuery Timeago helper for Rails 3
48
48
  email:
49
49
  - jan.graichen@altimos.de