ur-product 0.9.5 → 0.9.7

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.
Files changed (3) hide show
  1. data/lib/ur/product.rb +4 -2
  2. data/lib/ur/search.rb +4 -0
  3. metadata +4 -4
data/lib/ur/product.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'time'
2
+
1
3
  # Module for Utbildningsradion AB (http://ur.se/)
2
4
  module UR
3
5
  # A product can be a tv show, a radio program or even a website
@@ -202,9 +204,9 @@ module UR
202
204
  def humanized_duration
203
205
  if matched = duration.match(/^(\d\d):(\d\d):(\d\d)/)
204
206
  (full,h,m,s) = matched.to_a
205
- if h == '00'
207
+ if h == '00' && m != '00'
206
208
  "#{m.to_i} minuter"
207
- elsif h == '00' && m == '00'
209
+ elsif h == '00'
208
210
  'Under en minut'
209
211
  else
210
212
  "#{h.to_i}:#{m}"
data/lib/ur/search.rb CHANGED
@@ -55,5 +55,9 @@ module UR
55
55
  def next_page
56
56
  (ok? && !@solr.docs.nil?) ? @solr.docs.next_page : 0
57
57
  end
58
+
59
+ def current_page
60
+ @solr.docs.current_page
61
+ end
58
62
  end
59
63
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ur-product
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
4
+ hash: 53
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 5
10
- version: 0.9.5
9
+ - 7
10
+ version: 0.9.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Peter Hellberg
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-24 00:00:00 +02:00
18
+ date: 2010-06-29 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency