imdb_lists 2.0.2 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -35,9 +35,10 @@ The `movies` method returns a list of movies.
35
35
  - **genres** (Array< String >) A list of genres.
36
36
  - **votes** (Fixnum) The amount of votes.
37
37
  - **released_at** (Time) When was the movie released?
38
- - **details** Url to a [IMDb details](http://www.imdb.com/title/tt0095016/) page.
39
- - **created_at** When was it added to the given list?
40
-
38
+ - **details** (String) Url to a [IMDb details](http://www.imdb.com/title/tt0095016/) page.
39
+ - **created_at** (Time) When was it added to the given list?
40
+ - **order** (Fixnum) Where is the movie?
41
+
41
42
  #### Only for [vote lists](http://www.imdb.com/user/ur10777143/ratings)
42
43
 
43
44
  - **you_rated** (Fixnum) Your rating, from 0.0 to 10.0.
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "imdb_lists"
6
- s.version = "2.0.2"
6
+ s.version = "2.1.0"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Linus Oleander"]
9
9
  s.email = ["linus@oleander.nu"]
@@ -27,7 +27,8 @@ class ImdbLists
27
27
  :genres,
28
28
  :votes,
29
29
  :released_at,
30
- :details
30
+ :details,
31
+ :order
31
32
  )
32
33
  end
33
34
 
@@ -124,7 +125,8 @@ class ImdbLists
124
125
  movie[11].split(", ").map(&:titleize), # genres
125
126
  movie[12].to_i, # votes
126
127
  parse_time(movie[13]), # released_at
127
- movie[14] # details
128
+ movie[14], # details
129
+ movie[0].to_i # order
128
130
  )
129
131
  end
130
132
 
@@ -147,7 +149,8 @@ class ImdbLists
147
149
  movie[12].split(", ").map(&:titleize), # genres
148
150
  movie[13].to_i, # votes
149
151
  parse_time(movie[14]), # released_at
150
- movie[15] # details
152
+ movie[15], # details
153
+ movie[0].to_i # order
151
154
  )
152
155
  end
153
156
 
@@ -33,7 +33,7 @@ describe ImdbLists do
33
33
  end
34
34
 
35
35
  it "should have a list of movies" do
36
- @list.movies.each do |movie|
36
+ @list.movies.each_with_index do |movie, index|
37
37
  movie.id.should match(/tt\d{7}/)
38
38
  movie.created_at.should be_instance_of(Time)
39
39
  movie.title.should_not be_empty
@@ -46,6 +46,7 @@ describe ImdbLists do
46
46
  movie.votes.should > 1
47
47
  movie.released_at.should be_instance_of(Time)
48
48
  movie.details.should match(/^((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$/)
49
+ movie.order.should eq(index + 1)
49
50
  end
50
51
  end
51
52
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: imdb_lists
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 2.0.2
5
+ version: 2.1.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Linus Oleander
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-09-20 00:00:00 Z
13
+ date: 2011-09-23 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client