allocine 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,18 +9,17 @@ Dépendances:
9
9
 
10
10
  (sudo) gem install activesupport vegas sinatra
11
11
 
12
- Dépendances optionnelles (mais recommandées, nécessite `curl`)
12
+ Dépendances optionelles (mais recommandées, nécéssite `curl`)
13
13
 
14
14
  (sudo) gem install curb zlib
15
15
 
16
16
  Via RubyGems:
17
17
 
18
- (sudo) gem sources -r http://gemcutter.org
19
18
  (sudo) gem install allocine
20
19
 
21
20
  Ou via git:
22
21
 
23
- $ git clone git://github.com/Florian95/allocine.git
22
+ git clone git://github.com/webs/allocine.git
24
23
 
25
24
  ## Utilisation
26
25
 
@@ -48,7 +47,7 @@ Une petite application Sinatra est fournie. Pour la démarrer,
48
47
  - [Issues][4]
49
48
  - [Try it live!][5]
50
49
 
51
- Mis a disposition sous licence MIT. (c) 2008 Jordan Bracco[7], Florian Lamache[8], Sunny Ripert[9].
50
+ Mis a disposition sous licence MIT. (c) 2008 [Jordan Bracco][7], [Florian Lamache][8], [Sunny Ripert][9].
52
51
 
53
52
  [1]: http://webs.github.com/allocine
54
53
  [2]: http://github.com/webs/allocine
data/Rakefile CHANGED
@@ -8,16 +8,18 @@ begin
8
8
  gem.summary = %Q{Parser for Allocine.fr}
9
9
  gem.description = %Q{Get data about movies and shows on allocine.fr}
10
10
  gem.email = "jordan@bracco.name"
11
- gem.homepage = "http://github.com/florian95/allocine"
11
+ gem.homepage = "http://code.webs.ly/allocine"
12
12
  gem.authors = ["Jordan Bracco", "Florian Lamache", "Sunny Ripert"]
13
- #gem.rubyforge_project = "allocine"
14
- gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
13
+ gem.rubyforge_project = "allocine"
14
+ gem.add_development_dependency "rspec", ">= 0"
15
15
  gem.add_dependency("activesupport", ["> 0.0.0"])
16
+ gem.add_dependency("vegas", ["> 0.0.0"])
17
+ gem.add_dependency("sinatra", ["> 0.0.0"])
16
18
  end
17
19
  Jeweler::GemcutterTasks.new
18
- # Jeweler::RubyforgeTasks.new do |rubyforge|
19
- # rubyforge.doc_task = "rdoc"
20
- # end
20
+ Jeweler::RubyforgeTasks.new do |rubyforge|
21
+ rubyforge.doc_task = "rdoc"
22
+ end
21
23
  rescue LoadError
22
24
  puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
23
25
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -5,13 +5,15 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{allocine}
8
- s.version = "0.4.1"
8
+ s.version = "0.4.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jordan Bracco", "Florian Lamache", "Sunny Ripert"]
12
- s.date = %q{2009-11-19}
12
+ s.date = %q{2010-02-14}
13
+ s.default_executable = %q{allocine-web}
13
14
  s.description = %q{Get data about movies and shows on allocine.fr}
14
15
  s.email = %q{jordan@bracco.name}
16
+ s.executables = ["allocine-web"]
15
17
  s.extra_rdoc_files = [
16
18
  "LICENSE",
17
19
  "README.md"
@@ -24,9 +26,18 @@ Gem::Specification.new do |s|
24
26
  "Rakefile",
25
27
  "VERSION",
26
28
  "allocine.gemspec",
29
+ "bin/allocine-web",
27
30
  "lib/allocine.rb",
28
31
  "lib/allocine/movie.rb",
29
32
  "lib/allocine/show.rb",
33
+ "lib/allocine/sinatra.rb",
34
+ "lib/allocine/sinatra/index.haml",
35
+ "lib/allocine/sinatra/layout.haml",
36
+ "lib/allocine/sinatra/movie.haml",
37
+ "lib/allocine/sinatra/results.haml",
38
+ "lib/allocine/sinatra/search.haml",
39
+ "lib/allocine/sinatra/show.haml",
40
+ "lib/allocine/sinatra/stylesheet.sass",
30
41
  "lib/allocine/web.rb",
31
42
  "lib/allocine/web/curb.rb",
32
43
  "lib/allocine/web/open_uri.rb",
@@ -35,9 +46,10 @@ Gem::Specification.new do |s|
35
46
  "spec/movie_spec.rb",
36
47
  "spec/show_spec.rb"
37
48
  ]
38
- s.homepage = %q{http://github.com/florian95/allocine}
49
+ s.homepage = %q{http://code.webs.ly/allocine}
39
50
  s.rdoc_options = ["--charset=UTF-8"]
40
51
  s.require_paths = ["lib"]
52
+ s.rubyforge_project = %q{allocine}
41
53
  s.rubygems_version = %q{1.3.5}
42
54
  s.summary = %q{Parser for Allocine.fr}
43
55
  s.test_files = [
@@ -52,15 +64,21 @@ Gem::Specification.new do |s|
52
64
  s.specification_version = 3
53
65
 
54
66
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
55
- s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
67
+ s.add_development_dependency(%q<rspec>, [">= 0"])
56
68
  s.add_runtime_dependency(%q<activesupport>, ["> 0.0.0"])
69
+ s.add_runtime_dependency(%q<vegas>, ["> 0.0.0"])
70
+ s.add_runtime_dependency(%q<sinatra>, ["> 0.0.0"])
57
71
  else
58
- s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
72
+ s.add_dependency(%q<rspec>, [">= 0"])
59
73
  s.add_dependency(%q<activesupport>, ["> 0.0.0"])
74
+ s.add_dependency(%q<vegas>, ["> 0.0.0"])
75
+ s.add_dependency(%q<sinatra>, ["> 0.0.0"])
60
76
  end
61
77
  else
62
- s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
78
+ s.add_dependency(%q<rspec>, [">= 0"])
63
79
  s.add_dependency(%q<activesupport>, ["> 0.0.0"])
80
+ s.add_dependency(%q<vegas>, ["> 0.0.0"])
81
+ s.add_dependency(%q<sinatra>, ["> 0.0.0"])
64
82
  end
65
83
  end
66
84
 
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby -rrubygems
2
+ require "vegas"
3
+ require File.expand_path(File.dirname(__FILE__) + '/../lib/allocine/sinatra.rb')
4
+
5
+ Vegas::Runner.new(Allocine::SinatraApp, 'allocine')
@@ -20,9 +20,11 @@ end
20
20
  module Allocine
21
21
  MOVIE_SEARCH_URL = "http://www.allocine.fr/recherche/1/?q=%s"
22
22
  MOVIE_DETAIL_URL = "http://www.allocine.fr/film/fichefilm_gen_cfilm=%s.html"
23
+ MOVIE_PRESS_URL = "http://www.allocine.fr/film/revuedepresse_gen_cfilm=%s.html"
23
24
  SHOW_SEARCH_URL = "http://www.allocine.fr/recherche/6/?q=%s"
24
25
  SHOW_DETAIL_URL = "http://www.allocine.fr/series/ficheserie_gen_cserie=%s.html"
25
26
 
27
+
26
28
  # Make a search on movies
27
29
  def self.find_movie(search)
28
30
  Allocine::Movie.find(search)
@@ -33,12 +35,13 @@ module Allocine
33
35
  Allocine::Show.find(search)
34
36
  end
35
37
 
36
- # Returns the first result
38
+ # Returns the first movie
37
39
  def self.lucky_movie(search)
38
40
  Allocine::Movie.lucky_find(search)
39
41
  end
40
42
 
43
+ # Returns the first show
41
44
  def self.lucky_show(search)
42
45
  Allocine::Show.lucky_find(search)
43
46
  end
44
- end
47
+ end
@@ -1,6 +1,7 @@
1
1
  module Allocine
2
2
  class Movie
3
- attr_accessor :title, :directors, :trailer, :press_rate, :nat, :genres, :out_date, :duree, :production_date, :original_title, :actors, :synopsis, :image, :interdit
3
+ attr_accessor :id, :title, :directors, :trailer, :press_rate, :nat, :genres, :out_date, :duree, :production_date, :original_title, :actors, :synopsis, :image, :interdit
4
+
4
5
 
5
6
  def self.find(search)
6
7
  search = ActiveSupport::Multibyte.proxy_class.new(search.to_s).mb_chars.normalize(:kd).gsub(/[^\x00-\x7F]/n,'').downcase.to_s.
@@ -39,7 +40,23 @@ class Movie
39
40
  new(results.first)
40
41
  end
41
42
 
43
+ def press_reviews
44
+ data = Allocine::Web.new(MOVIE_PRESS_URL % self.id).data.gsub(/\r|\n|\t/,"")
45
+ reviews = Array.new
46
+
47
+ while data =~ /<div class="rubric"><div class="titlebar vmargin20t novmarginb"><a id="pressreview(.*?)" class="anchor"><\/a>(.*?)<\/p><\/div><div class="rubric">/i
48
+ pressreviewid, content = $1, $2
49
+ data.gsub!(/<a id="pressreview#{pressreviewid}" class="anchor">/, "")
50
+ content =~ /<h2><a href="\/critique\/fichepresse_gen_cpresse=(.*?).html">(.*?)<\/a><\/h2><span><img.*?stareval n([0-9]{1}?)0 on4.*?\/><\/span><\/div><p class="lighten">(.*?)<\/p><p>(.*?)<\/p>/
51
+ # 1 : ID, 2 : Journal, 3 : Note, 4 : Auteur, 5 : Critique
52
+ reviews << [$1, $2, $3, $4, $5] unless $2.nil? || $3.nil?
53
+ end
54
+
55
+ reviews
56
+ end
57
+
42
58
  def initialize(id, debug=false)
59
+ self.id = id
43
60
  regexps = {
44
61
  :title => '<div class="titlebar"><h1>(.*?)<\/h1>',
45
62
  :directors => 'Réalisé par <span .*?><a .*?>(.*?)<\/a><\/span>',
@@ -47,7 +64,7 @@ class Movie
47
64
  :genres => 'Genre : (.*?)<br\/>',
48
65
  :out_date => 'Date de sortie cinéma : <span .*?><a .*?>(.*?)<\/a><\/span>',
49
66
  :duree => 'Durée :(.*?) min',
50
- :production_date => 'Année de production : <a .*?>(.*?)<\/a><br \/>',
67
+ :production_date => 'Année de production.*?<a .*?>(.*?)<\/a>.*?<br \/>',
51
68
  :original_title => 'Titre original : <span .*?><em>(.*?)<\/em><\/span>',
52
69
  :actors => 'Avec (.*?), <a class=',
53
70
  :synopsis => '<p><span class="bold">Synopsis : </span>(.*?)</p>',
@@ -30,15 +30,14 @@ class Show
30
30
  #TODO : New Regex for new version.
31
31
  regexps = {
32
32
  :title => '<title>(.*?)<\/title>',
33
- :created_by => '<h4>Série créée par <a .*?>(.*?)</a>',
34
- :producters => '<h4>Producteurs : (.*?)</h4>',
35
- :nat => '<span style=\'font-weight:bold\'>Nationalité</span> : (.*?)</h5>',
36
- :genres => '<span style=\'font-weight:bold\'>Genre</span> : (.*?)&nbsp;&nbsp;',
37
- :duree => '<span style=\'font-weight:bold\'>Format</span> : (.+?).&nbsp;',
38
- :original_title => '<h4><b>Titre original : </b></h4><h4 style="color:#D20000"><b>(.*?)</b></h4>',
39
- :actors => '<h4>Avec : (.*?)&nbsp;&nbsp;',
40
- :synopsis => '<h5><span style=\'font-weight:bold\'>Synopsis</span>&nbsp;&nbsp;&nbsp;.*?<br />(.*?)</h5>',
41
- :image => '<td><div id=\'divM\' .*?><img src=\'(.*?)\' style=\'border:1px solid black;.*?>',
33
+ :created_by => 'Créée par (.*?)</span>',
34
+ :nat => 'Série.*?<a href=\'/film/tous/pays-[0-9]+/\'>(.*?)<\/a>\.',
35
+ :genres => 'Genre.*<a href=\'/series/toutes/genre-[0-9]+/\'>(.*?)<\/a>.',
36
+ :duree => 'Format :(.*?)</p>',
37
+ :original_title => 'Titre original : <span .*?><em>(.*?)<\/em><\/span>',
38
+ :actors => 'Avec : (.*?)&nbsp;&nbsp;',
39
+ :synopsis => '<p class="">.*?<span class="bold">Synopsis :</span>(.*?)</p>',
40
+ :image => '<div class="poster"><em class="imagecontainer"><a .*?><img src=\'(.*?)\'alt=".*?"title=".*?"\/><img .*?><\/a><\/em>',
42
41
  }
43
42
  data = Allocine::Web.new(SHOW_DETAIL_URL % id).data.gsub(/\r|\n|\t/,"")
44
43
  regexps.each do |reg|
@@ -0,0 +1,68 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../allocine.rb')
2
+ require 'sinatra/base'
3
+ require 'haml'
4
+
5
+ module Allocine
6
+ class SinatraApp < Sinatra::Base
7
+ set :app_file, __FILE__
8
+ set :views, Proc.new { File.join(root, "sinatra") }
9
+
10
+ get '/' do
11
+ headers 'Content-Type' => 'text/html; charset=utf-8'
12
+ unless params[:q] && !params[:q].empty?
13
+ @title = "Allocine"
14
+ @hide_headers = true
15
+ haml :index
16
+ else
17
+ @title = "Allocine &mdash; Recherche '" + params[:q] + "'"
18
+ @script = "<script>
19
+ $(document).ready(function(){
20
+ $('#movie_search').load('/parts/movie/#{params[:q].gsub(/\W/, '+')}');
21
+ $('#show_search').load('/parts/show/#{params[:q].gsub(/\W/, '+')}');
22
+ });
23
+ </script>"
24
+ haml :search
25
+ end
26
+ end
27
+
28
+ get '/movie/:id' do
29
+ headers 'Content-Type' => 'text/html; charset=utf-8'
30
+ @movie = Allocine::Movie.new(params[:id])
31
+ @title = @movie.title
32
+ haml :movie
33
+ end
34
+
35
+ get '/show/:id' do
36
+ headers 'Content-Type' => 'text/html; charset=utf-8'
37
+ @show = Allocine::Show.new(params[:id])
38
+ @title = @show.title
39
+ haml :show
40
+ end
41
+
42
+ get '/main.css' do
43
+ headers 'Content-Type' => 'text/css; charset=utf-8'
44
+ sass :stylesheet
45
+ end
46
+
47
+ get '/parts/movie/:search' do
48
+ @results = Allocine::Movie.find(params[:search])
49
+ @type = "movie"
50
+ if @results.empty?
51
+ "<p>Aucuns films ne correspondent à votre recherche."
52
+ else
53
+ haml :results, :layout => false
54
+ end
55
+ end
56
+
57
+ get '/parts/show/:search' do
58
+ @results = Allocine::Show.find(params[:search])
59
+ @type = "show"
60
+ if @results.empty?
61
+ "<p>Aucunes séries ne correspondent à votre recherche."
62
+ else
63
+ haml :results, :layout => false
64
+ end
65
+ end
66
+
67
+ end
68
+ end
@@ -0,0 +1,7 @@
1
+ %h2
2
+ Chercher sur Allocine
3
+ %br
4
+ %br
5
+ %form{:action=>'/', :method=>'get'}
6
+ %input{:id=>'q', :name=>'q', :size=>'30', :type=>'text', :placeholder=>'Star Trek'}
7
+ %button{:type=>'submit'} OK
@@ -0,0 +1,16 @@
1
+ !!! strict
2
+ %html
3
+ %head
4
+ %title= @title
5
+ %link{:rel => 'stylesheet', :href => '/main.css', :type => 'text/css'}
6
+ %script{:type => 'text/javascript', :src => 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js'}
7
+ = @script if @script
8
+ %body
9
+ #container
10
+ - unless @hide_headers
11
+ #head
12
+ %h1= @title
13
+ #body
14
+ = yield
15
+ #footer
16
+ %a{:href => 'http://code.webs.ly/allocine'} allocine
@@ -0,0 +1,38 @@
1
+ - if @movie.image
2
+ %span.picture
3
+ %img{:src => @movie.image}
4
+
5
+ - if @movie.directors
6
+ %strong Producteurs:
7
+ = @movie.directors
8
+ %br
9
+ - if @movie.nat
10
+ Film
11
+ = @movie.nat
12
+ %br
13
+ - if @movie.genres
14
+ %strong Genres:
15
+ = @movie.genres
16
+ %br
17
+ - if @movie.out_date
18
+ %strong Date de sortie
19
+ = @movie.out_date
20
+ %br
21
+ - if @movie.duree
22
+ %strong Durée
23
+ = @movie.duree
24
+ %br
25
+ - if @movie.production_date
26
+ %strong Date de production
27
+ = @movie.production_date
28
+ %br
29
+ - if @movie.original_title
30
+ %strong Titre original
31
+ = @movie.original_title
32
+ %br
33
+ - if @movie.actors
34
+ %strong Acteurs
35
+ = @movie.actors
36
+ %br
37
+ - if @movie.synopsis
38
+ %p= @movie.synopsis
@@ -0,0 +1,4 @@
1
+ %ul
2
+ - @results.each do |result|
3
+ %li
4
+ %a{:href=>"/#{@type}/#{result[0]}"}= result[1]
@@ -0,0 +1,6 @@
1
+ %h3 Films
2
+ %div#movie_search
3
+ Chargement des données en cours...
4
+ %h3 Séries
5
+ %div#show_search
6
+ Chargement des données en cours...
@@ -0,0 +1,35 @@
1
+ - if @show.image
2
+ %span.picture
3
+ %img{:src => @show.image}
4
+
5
+ - if @show.created_by
6
+ %strong Créée par
7
+ = @show.created_by
8
+ %br
9
+ - if @show.producters
10
+ %strong Producteurs
11
+ = @show.producters
12
+ %br
13
+ - if @show.nat
14
+ %strong Nationalité
15
+ = @show.nat
16
+ %br
17
+ - if @show.genres
18
+ %strong Genres
19
+ = @show.genres
20
+ %br
21
+ - if @show.duree
22
+ %strong Durée d'un épîsode
23
+ = @show.duree
24
+ %br
25
+ - if @show.original_title
26
+ %strong Titre Original
27
+ = @show.original_title
28
+ %br
29
+ - if @show.actors
30
+ %strong Acteurs
31
+ = @show.actors
32
+ %br
33
+ - if @show.synopsis
34
+ %br
35
+ = @show.synopsis
@@ -0,0 +1,58 @@
1
+ html
2
+ :color #000
3
+ :font-family Helvetica Neue, Helvetica, Arial, sans-serif
4
+ :padding 0em
5
+ :margin 0em
6
+
7
+
8
+ body
9
+ :line-height 1.4em
10
+ :margin 0px
11
+ :padding 0px
12
+ :font-size .9em
13
+
14
+ a
15
+ :color #000099
16
+
17
+ a:hover
18
+ :color #000099
19
+ :text-decoration none
20
+
21
+ #container
22
+ :width 755px
23
+ :margin 0 auto
24
+ :padding 0px
25
+ :text-align left
26
+ :position relative
27
+
28
+ #head
29
+ :padding 10px
30
+ :padding-top 25px
31
+ :background-color #202020
32
+ :opacity 0.98
33
+ :width 755px
34
+ :color #FFF
35
+
36
+ #body
37
+ :color #000
38
+ :padding-top 10px
39
+ :padding-bottom 10px
40
+
41
+ #footer
42
+ :text-align center
43
+ :border-top 1px solid black
44
+ :padding 1px
45
+ :color grey
46
+ :font-size 12px
47
+
48
+ h2
49
+ :text-align center
50
+ :font-size 25px
51
+
52
+ input
53
+ :font-size 30px
54
+ :text-align center
55
+
56
+ .picture
57
+ :float left
58
+ :padding-right 5px
@@ -6,7 +6,7 @@ describe "Allocine" do
6
6
  end
7
7
 
8
8
  it "find show" do
9
- Allocine.find_show('XFiles').should == {"182"=>"X-Files : Aux fronti\303\250res du r\303\251el", "223"=>"Lost"}
9
+ Allocine.find_show('XFiles').should == {"182"=>"X-Files : Aux frontières du réel", "3004"=>"Dexter", "62"=>"Smallville", "223"=>"Lost, les disparus"}#{"182"=>"X-Files : Aux fronti\303\250res du r\303\251el", "223"=>"Lost"}
10
10
  end
11
11
 
12
12
  it "lucky movie" do
@@ -1,23 +1,23 @@
1
1
  require 'helper'
2
2
 
3
- describe "Allocine Movie (Star Trek - 4854)" do
3
+ describe "Allocine Movie (Sixième Sens - 22092)" do
4
4
 
5
- before(:each) { @movie = Allocine::Movie.new('4854') }
5
+ before(:all) { @movie = Allocine::Movie.new('22092') }
6
6
 
7
7
  it 'should have a title' do
8
- @movie.title.should == "Star Trek : Premier contact"
8
+ @movie.title.should == "Sixième Sens"
9
9
  end
10
10
 
11
11
  it 'should have a synopsis' do
12
- @movie.synopsis.should == "De m\303\251chants extraterrestres, les Borgs, complotent contre les habitants de la Terre. Ils mettent au point une machination diabolique pour d\303\251truire l'humanit\303\251."
12
+ @movie.synopsis.should == "Cole Sear, garconnet de huit ans est hanté par un terrible secret. Son imaginaire est visité par des esprits menaçants. Trop jeune pour comprendre le pourquoi de ces apparitions et traumatisé par ces pouvoirs paranormaux, Cole s'enferme dans une peur maladive et ne veut reveler à personne la cause de son enfermement, à l'exception d'un psychologue pour enfants. La recherche d'une explication rationnelle guidera l'enfant et le thérapeute vers une vérité foudroyante et inexplicable."
13
13
  end
14
14
 
15
15
  it 'should have an original title' do
16
- @movie.original_title.should == "Star Trek: First Contact"
16
+ @movie.original_title.should == "The Sixth Sense"
17
17
  end
18
18
 
19
19
  it 'should have a nationality' do
20
- @movie.nat.should == "am\303\251ricain"
20
+ @movie.nat.should == "américain"
21
21
  end
22
22
 
23
23
  it 'should have a picture' do
@@ -25,27 +25,35 @@ describe "Allocine Movie (Star Trek - 4854)" do
25
25
  end
26
26
 
27
27
  it 'should have a genre' do
28
- @movie.genres.should == "Science fiction"
28
+ @movie.genres.should == "Fantastique,Drame,Thriller"
29
29
  end
30
30
 
31
31
  it 'should have a director' do
32
- @movie.directors.should == "Jonathan Frakes"
32
+ @movie.directors.should == "M. Night Shyamalan"
33
33
  end
34
34
 
35
35
  it 'should have a duration' do
36
- @movie.duree.should == "1h52"
36
+ @movie.duree.should == "1h47"
37
37
  end
38
38
 
39
39
  it 'should have actors' do
40
- @movie.actors.should == "Jonathan Frakes, Patrick Stewart, Brent Spiner"
40
+ @movie.actors.should == "Bruce Willis, Haley Joel Osment, Toni Collette"
41
41
  end
42
42
 
43
43
  it 'should have an out date' do
44
- @movie.out_date.should == "5 mars 1997"
44
+ @movie.out_date.should == "5 janvier 2000"
45
+ end
46
+
47
+ it 'should have a trailer' do
48
+ @movie.trailer.should == "18650495"
49
+ end
50
+
51
+ it 'should have a press rating' do
52
+ @movie.press_rate.should == "3,2"
45
53
  end
46
54
 
47
55
  it 'should have a production date' do
48
- @movie.production_date.should == "1996"
56
+ @movie.production_date.should == "1999"
49
57
  end
50
58
 
51
59
  end
@@ -2,34 +2,30 @@ require 'helper'
2
2
 
3
3
  describe "Allocine Show (Enterprise - 109)" do
4
4
 
5
- before(:each) { @show = Allocine::Show.new('109') }
5
+ before(:all) { @show = Allocine::Show.new('109') }
6
6
 
7
7
  it 'should have a title' do
8
8
  @show.title.should == "Enterprise"
9
9
  end
10
10
 
11
- it 'should have producters' do
12
- @show.producters.should == "J.P. Farrell, Antoinette Stella"
13
- end
14
-
15
11
  it 'should have a genre' do
16
12
  @show.genres.should == "Fantastique"
17
13
  end
18
14
 
19
15
  it 'should have an image' do
20
- @show.image.should == "http://a69.g.akamai.net/n/69/10688/v1/img5.allocine.fr/acmedia/medias/nmedia/18/35/64/59/18415355.jpg"
16
+ @show.image.should == "http://images.allocine.fr/r_160_214/b_1_cfd7e1/medias/nmedia/18/35/64/59/18415355.jpg"
21
17
  end
22
18
 
23
19
  it 'should have a creator' do
24
- @show.created_by.should == "Rick Berman"
20
+ @show.created_by.should == "Brannon Braga, Rick Berman"
25
21
  end
26
22
 
27
23
  it 'should have actors' do
28
- @show.actors.should == "Dominic Keating, Scott Bakula"
24
+ @show.actors.should == "Dominic Keating, Scott Bakula, John Billingsley"
29
25
  end
30
26
 
31
27
  it 'should have a nationality' do
32
- @show.nat.should == "Am\303\251ricaine"
28
+ @show.nat.should == "am\303\251ricaine"
33
29
  end
34
30
 
35
31
  it 'should have a synopsis' do
@@ -37,6 +33,6 @@ describe "Allocine Show (Enterprise - 109)" do
37
33
  end
38
34
 
39
35
  it 'should have a duree' do
40
- @show.duree.should == "42 mn" # \o/
36
+ @show.duree.should == "42mn" # \o/
41
37
  end
42
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allocine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Bracco
@@ -11,11 +11,11 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2009-11-19 00:00:00 +01:00
15
- default_executable:
14
+ date: 2010-02-14 00:00:00 +01:00
15
+ default_executable: allocine-web
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
- name: thoughtbot-shoulda
18
+ name: rspec
19
19
  type: :development
20
20
  version_requirement:
21
21
  version_requirements: !ruby/object:Gem::Requirement
@@ -34,10 +34,30 @@ dependencies:
34
34
  - !ruby/object:Gem::Version
35
35
  version: 0.0.0
36
36
  version:
37
+ - !ruby/object:Gem::Dependency
38
+ name: vegas
39
+ type: :runtime
40
+ version_requirement:
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">"
44
+ - !ruby/object:Gem::Version
45
+ version: 0.0.0
46
+ version:
47
+ - !ruby/object:Gem::Dependency
48
+ name: sinatra
49
+ type: :runtime
50
+ version_requirement:
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">"
54
+ - !ruby/object:Gem::Version
55
+ version: 0.0.0
56
+ version:
37
57
  description: Get data about movies and shows on allocine.fr
38
58
  email: jordan@bracco.name
39
- executables: []
40
-
59
+ executables:
60
+ - allocine-web
41
61
  extensions: []
42
62
 
43
63
  extra_rdoc_files:
@@ -51,9 +71,18 @@ files:
51
71
  - Rakefile
52
72
  - VERSION
53
73
  - allocine.gemspec
74
+ - bin/allocine-web
54
75
  - lib/allocine.rb
55
76
  - lib/allocine/movie.rb
56
77
  - lib/allocine/show.rb
78
+ - lib/allocine/sinatra.rb
79
+ - lib/allocine/sinatra/index.haml
80
+ - lib/allocine/sinatra/layout.haml
81
+ - lib/allocine/sinatra/movie.haml
82
+ - lib/allocine/sinatra/results.haml
83
+ - lib/allocine/sinatra/search.haml
84
+ - lib/allocine/sinatra/show.haml
85
+ - lib/allocine/sinatra/stylesheet.sass
57
86
  - lib/allocine/web.rb
58
87
  - lib/allocine/web/curb.rb
59
88
  - lib/allocine/web/open_uri.rb
@@ -62,7 +91,7 @@ files:
62
91
  - spec/movie_spec.rb
63
92
  - spec/show_spec.rb
64
93
  has_rdoc: true
65
- homepage: http://github.com/florian95/allocine
94
+ homepage: http://code.webs.ly/allocine
66
95
  licenses: []
67
96
 
68
97
  post_install_message:
@@ -84,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
113
  version:
85
114
  requirements: []
86
115
 
87
- rubyforge_project:
116
+ rubyforge_project: allocine
88
117
  rubygems_version: 1.3.5
89
118
  signing_key:
90
119
  specification_version: 3