imdb 0.3.0 → 0.4.0
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.
- data/History.txt +7 -1
- data/README.rdoc +24 -1
- data/lib/imdb.rb +1 -1
- data/lib/imdb/cli.rb +8 -4
- metadata +3 -3
data/History.txt
CHANGED
data/README.rdoc
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
= imdb
|
2
2
|
|
3
|
+
The code, issue tracker and wiki can be found at:
|
4
|
+
|
3
5
|
* http://github.com/ariejan/imdb
|
4
6
|
|
5
7
|
== DESCRIPTION:
|
@@ -8,10 +10,16 @@ This packages allows you to easy access publicly available data from IMDB.
|
|
8
10
|
|
9
11
|
== FEATURES/PROBLEMS:
|
10
12
|
|
11
|
-
|
13
|
+
IMDB currently features the following:
|
14
|
+
|
15
|
+
* Querying details movie info
|
16
|
+
* Searching for movies
|
17
|
+
* Command-line utility included.
|
12
18
|
|
13
19
|
== SYNOPSIS:
|
14
20
|
|
21
|
+
Movies:
|
22
|
+
|
15
23
|
i = Imdb::Movie.new("0095016")
|
16
24
|
|
17
25
|
i.title
|
@@ -19,6 +27,21 @@ This packages allows you to easy access publicly available data from IMDB.
|
|
19
27
|
i.cast_member.first
|
20
28
|
#=> "Bruce Willis"
|
21
29
|
|
30
|
+
Searching:
|
31
|
+
|
32
|
+
i = Imdb::Search.new("Star Trek")
|
33
|
+
|
34
|
+
i.movies.size
|
35
|
+
#=> 97
|
36
|
+
|
37
|
+
Using the command line utility is quite easy:
|
38
|
+
|
39
|
+
$ imdb Star Trek
|
40
|
+
|
41
|
+
or to get movie info
|
42
|
+
|
43
|
+
$ imdb 0095016
|
44
|
+
|
22
45
|
== REQUIREMENTS:
|
23
46
|
|
24
47
|
All required gems are installed automagically through RubyGems.
|
data/lib/imdb.rb
CHANGED
data/lib/imdb/cli.rb
CHANGED
@@ -75,16 +75,20 @@ module Imdb
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def self.display_movie_details(movie)
|
78
|
+
title = "#{movie.title} (#{movie.year})"
|
79
|
+
id = "ID #{movie.id}"
|
80
|
+
|
78
81
|
@stdout.puts
|
79
|
-
@stdout.puts "#{
|
80
|
-
@stdout.puts "=" *
|
82
|
+
@stdout.puts "#{title}#{" " * (75 - 1 - title.length - id.length)}#{id} "
|
83
|
+
@stdout.puts "=" * 75
|
81
84
|
@stdout.puts "Rating: #{movie.rating}"
|
82
85
|
@stdout.puts "Duration: #{movie.length} minutes"
|
83
86
|
@stdout.puts "Directed by: #{movie.director.join(", ")}"
|
84
87
|
@stdout.puts "Cast: #{movie.cast_members[0..4].join(", ")}"
|
85
88
|
@stdout.puts "Genre: #{movie.genres.join(", ")}"
|
86
|
-
@stdout.puts "#{movie.plot}"
|
87
|
-
@stdout.puts "
|
89
|
+
@stdout.puts "Plot: #{movie.plot}"
|
90
|
+
@stdout.puts "IMDB URL: #{movie.url}"
|
91
|
+
@stdout.puts "=" * 75
|
88
92
|
@stdout.puts
|
89
93
|
end
|
90
94
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ariejan de Vroom
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-14 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -84,7 +84,7 @@ files:
|
|
84
84
|
- spec/spec_helper.rb
|
85
85
|
- tasks/rspec.rake
|
86
86
|
has_rdoc: true
|
87
|
-
homepage:
|
87
|
+
homepage: "The code, issue tracker and wiki can be found at:"
|
88
88
|
post_install_message:
|
89
89
|
rdoc_options:
|
90
90
|
- --main
|