icheckmovies 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -1
- data/icheckmovies.gemspec +1 -1
- data/lib/icheckmovies.rb +3 -2
- data/spec/icheckmovies_spec.rb +2 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -32,7 +32,8 @@ The `movies` method returns a list of movies.
|
|
32
32
|
- **title** (String) Movie title.
|
33
33
|
- **year** (Fixnum) Release year.
|
34
34
|
- **details** (String) Url to ICheckMovies detail page.
|
35
|
-
|
35
|
+
- **order** (Fixnum) Where is the movie?
|
36
|
+
|
36
37
|
## How do install
|
37
38
|
|
38
39
|
[sudo] gem install icheckmovies
|
data/icheckmovies.gemspec
CHANGED
data/lib/icheckmovies.rb
CHANGED
@@ -6,7 +6,7 @@ class ICheckMovies
|
|
6
6
|
|
7
7
|
def initialize(url)
|
8
8
|
@url = url
|
9
|
-
@movie = Struct.new(:imdb_link, :title, :year, :details, :id)
|
9
|
+
@movie = Struct.new(:imdb_link, :title, :year, :details, :id, :order)
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.fetch(url)
|
@@ -20,7 +20,8 @@ class ICheckMovies
|
|
20
20
|
movie.at_css("h2 a").content,
|
21
21
|
movie.at_css(".year").content.to_i,
|
22
22
|
"http://www.icheckmovies.com" + movie.at_css("a.dvdCoverSmall").attr("href"),
|
23
|
-
movie.at_css("a.optionIMDB").attr("href").match(/(tt\d{7})/).to_a[1]
|
23
|
+
movie.at_css("a.optionIMDB").attr("href").match(/(tt\d{7})/).to_a[1],
|
24
|
+
movie.at_css(".rank").content.to_i
|
24
25
|
)
|
25
26
|
end
|
26
27
|
end
|
data/spec/icheckmovies_spec.rb
CHANGED
@@ -14,12 +14,13 @@ describe ICheckMovies do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should have some accessors" do
|
17
|
-
@check.movies.
|
17
|
+
@check.movies.each_with_index do |movie, index|
|
18
18
|
movie.imdb_link.should match(%r{http://www.imdb.com/title/tt\d{7}/})
|
19
19
|
movie.title.should_not be_empty
|
20
20
|
movie.year.should > 1800
|
21
21
|
movie.details.should match(href_matcher)
|
22
22
|
movie.id.should match(/^tt\d{7}$/)
|
23
|
+
movie.order.should eq(index + 1)
|
23
24
|
end
|
24
25
|
end
|
25
26
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: icheckmovies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.6.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-
|
13
|
+
date: 2011-09-23 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rest-client
|