rails-timeago 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 08dbf630b3df7ad107f4a9c5fa72e7e0ce43816e
4
+ data.tar.gz: 62e26da4e26a50a5c27e4747ebe66fa894a1af09
5
+ SHA512:
6
+ metadata.gz: 510ea356965191fc7cb316d2a8237bcd2e8851a7d9ba59c42547cccc40ce07dcb5b5ff1f32e5d28d2b2833f5d3a64df664be25575f9e7c6e855aac0556797133
7
+ data.tar.gz: b32b96f3ca1483771ecca42063fbd55fd77080b47bc08a7540d860d789be044104160540419134d1477dc30c9f7ec77e63b71d078df3514c0d167d5358815d39
@@ -52,7 +52,7 @@ module Rails
52
52
 
53
53
  def timeago_tag_content(time, time_options = {}) # :nodoc:
54
54
  time = time.to_date if time_options[:date_only]
55
- return time_ago_in_words(time) if time_options[:nojs]
55
+ return time_ago_in_words(time) if time_options[:nojs] and (time_options[:limit].nil? or time_options[:limit] < time)
56
56
 
57
57
  I18n.l time, :format => time_options[:format]
58
58
  end
@@ -3,7 +3,7 @@ module Rails
3
3
  module VERSION
4
4
  MAJOR = 2
5
5
  MINOR = 2
6
- PATCH = 2
6
+ PATCH = 3
7
7
  STAGE = nil
8
8
 
9
9
  def self.to_s
@@ -119,6 +119,15 @@ describe Rails::Timeago::Helper do
119
119
  it "should return default string if time is nil" do
120
120
  @stub.timeago_tag(nil).should == '-'
121
121
  end
122
+
123
+ it 'should respect limit option also in nojs tag content' do
124
+ time = 6.days.ago
125
+
126
+ @stub.timeago_tag(time, :nojs => true, :limit => 5.days.ago).
127
+ should_not =~ /<time.*data-time-ago=".*".*>.*<\/time>/
128
+ @stub.timeago_tag(time, :nojs => true, :limit => 5.days.ago).
129
+ should include(">#{I18n.l time.to_date}<")
130
+ end
122
131
  end
123
132
 
124
133
  context "#timeago_script_tag" do
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-timeago
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
5
- prerelease:
4
+ version: 2.2.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jan Graichen
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-04-01 00:00:00.000000000 Z
11
+ date: 2013-04-21 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activesupport
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - '>='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: actionpack
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - '>='
60
53
  - !ruby/object:Gem::Version
@@ -124,26 +117,25 @@ files:
124
117
  - vendor/assets/javascripts/locales/jquery.timeago.zh-TW.js
125
118
  homepage: https://github.com/jgraichen/rails-timeago
126
119
  licenses: []
120
+ metadata: {}
127
121
  post_install_message:
128
122
  rdoc_options: []
129
123
  require_paths:
130
124
  - lib
131
125
  required_ruby_version: !ruby/object:Gem::Requirement
132
- none: false
133
126
  requirements:
134
127
  - - '>='
135
128
  - !ruby/object:Gem::Version
136
129
  version: '0'
137
130
  required_rubygems_version: !ruby/object:Gem::Requirement
138
- none: false
139
131
  requirements:
140
132
  - - '>='
141
133
  - !ruby/object:Gem::Version
142
134
  version: '0'
143
135
  requirements: []
144
136
  rubyforge_project:
145
- rubygems_version: 1.8.25
137
+ rubygems_version: 2.0.3
146
138
  signing_key:
147
- specification_version: 3
139
+ specification_version: 4
148
140
  summary: A Rails Helper to create time tags usable for jQuery Timeago plugin
149
141
  test_files: []