diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c091839 --- /dev/null +++ b/.gitignore @@ -0,0 +1,50 @@ +# Compiled source # +################### +*.com +*.class +*.dll +*.exe +*.o +*.so +*.pyc + +# Numerous always-ignore extensions +################### +*.diff +*.err +*.orig +*.log +*.rej +*.swo +*.swp +*.vi +*~ + +*.sass-cache +# Folders to ignore +################### +.hg +.svn +.CVS +# OS or Editor folders +################### +.DS_Store +Icon? +Thumbs.db +ehthumbs.db +nbproject +.cache +.project +.settings +.tmproj +*.esproj +*.sublime-project +*.sublime-workspace +# Dreamweaver added files +################### +_notes +dwsync.xml +# Komodo +################### +*.komodoproject +.komodotools diff --git a/README b/README index 08ba61b..013f9ec 100644 --- a/README +++ b/README @@ -20,7 +20,7 @@ To create a RSS/Atom feed to suck from: :delete_preview => true, # optional: delete all posts from a feed, before it´s sucked (default -> true) :url => 'http://example.com/posts.atom') -To create it but sucking from XML resouce index: +To create it but sucking from XML resouce index: FeedsuckerFeed.create( :title => 'XML resource index example', diff --git a/rails_generators/feedsucker/feedsucker_generator.rb b/rails_generators/feedsucker/feedsucker_generator.rb index cad003a..0c3889c 100755 --- a/rails_generators/feedsucker/feedsucker_generator.rb +++ b/rails_generators/feedsucker/feedsucker_generator.rb @@ -11,7 +11,7 @@ def manifest def file_name 'create_feedsucker_tables' end - + protected # Override with your own usage banner. def banner diff --git a/rails_generators/feedsucker/templates/tasks.rake b/rails_generators/feedsucker/templates/tasks.rake index 803b8cf..18e4a89 100644 --- a/rails_generators/feedsucker/templates/tasks.rake +++ b/rails_generators/feedsucker/templates/tasks.rake @@ -1,6 +1,6 @@ namespace :feedsucker do desc "Suck (fetch & load) every FeedsuckerFeed source stored at DB" task :suck_all => :environment do - FeedsuckerFeed.suck_all! + FeedsuckerFeed.suck_all! end end diff --git a/spec/models/feedsucker_feed_spec.rb b/spec/models/feedsucker_feed_spec.rb index 99c9ca8..45b55bc 100644 --- a/spec/models/feedsucker_feed_spec.rb +++ b/spec/models/feedsucker_feed_spec.rb @@ -1,10 +1,10 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') module FeedsuckerMacros - def self.included(receiver) - receiver.extend ExampleGroupMethods + def self.included(receiver) + receiver.extend ExampleGroupMethods end - + module ExampleGroupMethods def it_should_suck_all_posts_if_no_number_is_given it "should suck all the posts if no number is given" do @@ -12,8 +12,8 @@ def it_should_suck_all_posts_if_no_number_is_given @feed.posts.size.should == 5 posts = FeedsuckerFeed.find_by_title(@feed.title).posts posts.size.should == 5 - posts.first.url.should == 'http://example.com/last-blog/last-post' - posts.first.title.should == 'Last Post Title' + posts.first.url.should == 'http://example.com/last-blog/last-post' + posts.first.title.should == 'Last Post Title' posts.last.title.should == 'First Post Title' end end @@ -24,10 +24,10 @@ def it_should_suck_only_the_right_number_of_posts @feed.suck! FeedsuckerFeed.find_by_title(@feed.title).posts.size.should == 2 @feed.posts.size.should == @feed.number_of_posts - @feed.posts.first.title.should == 'Last Post Title' + @feed.posts.first.title.should == 'Last Post Title' end end - + def it_should_suck_all_the_posts_if_we_ask_more_posts_than_the_feed_has it "should suck all the posts if we ask more posts than the feed has" do @feed.update_attribute(:number_of_posts, 12) @@ -53,7 +53,7 @@ def it_should_not_replace_html_entities @feed.posts.first.content.include?('á').should be_true end end - + def it_should_not_repeat_old_post_when_not_delete_preview it "should_not_repeat_old_post_when_not_delete_preview" do @feed.suck! @@ -63,13 +63,13 @@ def it_should_not_repeat_old_post_when_not_delete_preview @feed.posts.size.should == 5 end end - + def it_should_add_new_post_when_not_delete_preview it "it_should_add_new_post_when_not_delete_preview" do @feed.suck! @feed.posts.size.should == 5 @feed.update_attribute(:delete_preview, false) - FakeWeb.register_uri(:get, @feed.url, :body => File.read(RSS_FILE_2_PATH)) + FakeWeb.register_uri(:get, @feed.url, :body => File.read(RSS_FILE_2_PATH)) @feed.suck! @feed.posts.size.should == 7 end @@ -79,12 +79,12 @@ def it_should_add_new_post_when_not_delete_preview_in_xml @feed.suck! @feed.posts.size.should == 5 @feed.update_attribute(:delete_preview, false) - FakeWeb.register_uri(:get, @feed.url, :body => File.read(XML_FILE_2_PATH)) + FakeWeb.register_uri(:get, @feed.url, :body => File.read(XML_FILE_2_PATH)) @feed.suck! @feed.posts.size.should == 6 end end - + end end @@ -111,7 +111,7 @@ def it_should_add_new_post_when_not_delete_preview_in_xml describe FeedsuckerFeed, ' with an XML feed' do include FeedsuckerMacros - + XML_FILE_PATH = (File.dirname(__FILE__) + '/../resources/example.xml') XML_FILE_2_PATH = (File.dirname(__FILE__) + '/../resources/example_2.xml') before(:each) do diff --git a/spec/models/feedsucker_post_spec.rb b/spec/models/feedsucker_post_spec.rb index 9ac9c32..ff85c9d 100644 --- a/spec/models/feedsucker_post_spec.rb +++ b/spec/models/feedsucker_post_spec.rb @@ -1,8 +1,8 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') module FeedsuckerPostMacros - def self.included(receiver) - receiver.extend ExampleGroupMethods + def self.included(receiver) + receiver.extend ExampleGroupMethods end module ExampleGroupMethods @@ -11,7 +11,7 @@ def before_do @feed_post = FeedsuckerPost.new end end - + def it_should_strip_standard_tags(field) it 'should strip "standard" tags' do @feed_post.send "#{field}=", "

Tengo el corazón contento, lleno de alegría.

" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 86405a3..cfdb912 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,8 +1,8 @@ begin - require File.dirname(__FILE__) + '/../../../../spec/spec_helper' + require File.dirname(__FILE__) + '/../../../../spec/spec_helper' require 'fakeweb' -rescue LoadError +rescue LoadError puts "You need to install rspec in your base app and the fakeweb gem in order to run the plugin specs" - exit + exit end