<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -5,3 +5,4 @@ log/*.log
 public/stylesheets/*.css
 tmp/**/*
 nbproject/**/*
+vendor/rails/</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,13 +1,14 @@
 class Movie &lt; ActiveRecord::Base 
   named_scope :most_voted, :order =&gt; &quot;votes desc&quot;
   named_scope :best_rated, :order =&gt; &quot;rating desc&quot;
-  # named_scope :with_most_torrent
-  
+
+  before_validation :sanitize_title
+
   has_many :torrents
   
   validates_presence_of :title, :imdb_id
   validates_uniqueness_of :imdb_id
-  validates_numericality_of [:votes,:rating, :year]
+  validates_numericality_of [:votes,:rating, :year], :allow_nil =&gt; true
 
   def update_torrent
     Mininova.new.from_imdb(imdb_id)[:results][0..5].each do |torrent|
@@ -15,13 +16,8 @@ class Movie &lt; ActiveRecord::Base
     end
   end
 
-  def self.fake_movies
-    {:query=&gt;{:month=&gt;6, :year=&gt;2008}, :results=&gt;[{:imdb_id=&gt;&quot;0960144&quot;, :title=&gt;&quot;You Don't Mess with the Zohan&quot;}, {:imdb_id=&gt;&quot;0416044&quot;, :title=&gt;&quot;Mongol&quot;},
-        {:imdb_id=&gt;&quot;0441773&quot;, :title=&gt;&quot;Kung Fu Panda&quot;}, {:imdb_id=&gt;&quot;0803057&quot;, :title=&gt;&quot;The Promotion&quot;}, {:imdb_id=&gt;&quot;0829098&quot;, :title=&gt;&quot;When Did You Last See Your Father?&quot;},
-        {:imdb_id=&gt;&quot;0985593&quot;, :title=&gt;&quot;Miss Conception&quot;}, {:imdb_id=&gt;&quot;0800080&quot;, :title=&gt;&quot;The Incredible Hulk&quot;}, {:imdb_id=&gt;&quot;0949731&quot;, :title=&gt;&quot;The Happening&quot;}, {:imdb_id=&gt;&quot;0414426&quot;, :title=&gt;&quot;Quid Pro Quo&quot;},
-        {:imdb_id=&gt;&quot;0923600&quot;, :title=&gt;&quot;Baghead&quot;}, {:imdb_id=&gt;&quot;1093842&quot;, :title=&gt;&quot;My Winnipeg&quot;}, {:imdb_id=&gt;&quot;0425061&quot;, :title=&gt;&quot;Get Smart&quot;}, {:imdb_id=&gt;&quot;0811138&quot;, :title=&gt;&quot;The Love Guru&quot;},
-        {:imdb_id=&gt;&quot;0846308&quot;, :title=&gt;&quot;Kit Kittredge: An American Girl&quot;}, {:imdb_id=&gt;&quot;0940585&quot;, :title=&gt;&quot;Brick Lane&quot;}, {:imdb_id=&gt;&quot;0910970&quot;, :title=&gt;&quot;WALL&amp;#183;E&quot;},
-        {:imdb_id=&gt;&quot;0493464&quot;, :title=&gt;&quot;Wanted&quot;}, {:imdb_id=&gt;&quot;1204298&quot;, :title=&gt;&quot;Gunnin' for That #1 Spot&quot;}, {:imdb_id=&gt;&quot;0889134&quot;, :title=&gt;&quot;Finding Amanda&quot;}]}
+  def sanitize_title
+    title.strip!
   end
 
 end</diff>
      <filename>app/models/movie.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 class Torrent &lt; ActiveRecord::Base
+  validates_numericality_of :size, :greater_than =&gt; 500.megabytes
   belongs_to :movie
   
 end</diff>
      <filename>app/models/torrent.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,11 +2,11 @@ module IMDB
   class NowPlaying
     def movies(year, month)
       uri = &quot;#{BASE_URI}/nowplaying/%04d/%02d&quot; % [year, month]
-      doc = Hpricot(open(uri, HEADERS))
+      doc = Hpricot(open(uri, HEADERS)) # open-uri - biblioteka standardowa
       results = []
       (doc / &quot;a.title&quot;).each do |a|
         result = {}
-        match = a[&quot;href&quot;].match(/\/title\/tt(\d+)/)
+        match = a[&quot;href&quot;].match(/\/title\/tt(\d+)/)  # match - dost&#281;pne w klasie String
         result[:imdb_id] = match[1] if match
         result[:title] = a.inner_html
         results &lt;&lt; result unless result.empty?</diff>
      <filename>backends/imdb/lib/now_playing.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,8 +10,6 @@ describe IMDB::NowPlaying, &quot;with 2009-07 fixture&quot; do
   it &quot;should parse HTML and return hash with query&quot; do
     result = @now_playing.movies(2009, 07)
     result.should include(:query)
-    result[:query].should include(:month)
-    result[:query].should include(:year)
   end
 
   it &quot;should parse HTML and return hash with results&quot; do</diff>
      <filename>backends/imdb/spec/lib/now_playing_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,8 @@ class MoviePoleMain &lt; Wx::Frame
     @refresh.disable
     Thread.new do
       begin
-        @feed = FeedNormalizer::FeedNormalizer.parse open(&quot;http://apidock.com/notes.rss&quot;)
+        @feed = FeedNormalizer::FeedNormalizer.parse open(&quot;http://localhost:3000/movies.rss&quot;)
+	   puts @feed
         @feed_list.selection = -1 # due to problems with changing list with selection
         @feed_list.set @feed.entries.map(&amp;:title)
       ensure</diff>
      <filename>clients/wxruby/movie_pole_main.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>app/views/movies/_movie.erb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>b3bf43a07b70002cf95b4ab47cef239b2738d72c</id>
    </parent>
  </parents>
  <author>
    <name>marek</name>
    <email>marek@.(none)</email>
  </author>
  <url>http://github.com/ncr/movie_pole/commit/9c60b21338bc11d91025368f0743c384dbfbb057</url>
  <id>9c60b21338bc11d91025368f0743c384dbfbb057</id>
  <committed-date>2008-12-15T10:04:02-08:00</committed-date>
  <authored-date>2008-12-15T10:04:02-08:00</authored-date>
  <message>after presentation</message>
  <tree>f70c7fc7882ded82053d0b49df5300ae7ee29a1e</tree>
  <committer>
    <name>marek</name>
    <email>marek@.(none)</email>
  </committer>
</commit>
