icheckmovies 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -8,10 +8,11 @@ Get easy access to any public [ICheckMovies](http://www.icheckmovies.com/) [list
8
8
 
9
9
  ``` ruby
10
10
  require "icheckmovies"
11
- result = ICheckMovies.fetch("http://www.icheckmovies.com/list/the+best+1000+movies+ever+made/")
11
+ check = ICheckMovies.fetch("http://www.icheckmovies.com/list/the+best+1000+movies+ever+made/")
12
12
 
13
- result.movies.count # => 1002
14
- result.movies.first.title # => À nous la liberté
13
+ check.name # => The Best 1,000 Movies Ever Made
14
+ check.movies.count # => 1002
15
+ check.movies.first.title # => À nous la liberté
15
16
  ```
16
17
 
17
18
  ## Data to work with
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "icheckmovies"
6
- s.version = "0.5.0"
6
+ s.version = "0.5.1"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Linus Oleander"]
9
9
  s.email = ["linus@oleander.nu"]
@@ -14,7 +14,7 @@ class ICheckMovies
14
14
  end
15
15
 
16
16
  def movies
17
- content.css("li.movie").map do |movie|
17
+ @_movies ||= content.css("li.movie").map do |movie|
18
18
  @movie.new(
19
19
  movie.at_css("a.optionIMDB").attr("href"),
20
20
  movie.at_css("h2 a").content,
@@ -30,4 +30,9 @@ describe ICheckMovies do
30
30
  it "should have a name" do
31
31
  @check.name.should eq("The Best 1,000 Movies Ever Made top movies")
32
32
  end
33
+
34
+ it "should cache #movies" do
35
+ @check.instance_eval { @movie.should_receive(:new).exactly(1002).times }
36
+ 2.times { @check.movies }
37
+ end
33
38
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: icheckmovies
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.5.0
5
+ version: 0.5.1
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-21 00:00:00 Z
13
+ date: 2011-09-22 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client