feedzirra 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6547ea21e91fd542899dbb76260595526c269d70
4
- data.tar.gz: 4b34a18d37afb06519846075bedaac411770e084
3
+ metadata.gz: 2b9482eade1fb00eec35c6cf8b71b6ce1b0b8199
4
+ data.tar.gz: 18bf9c94569d01f234df54eb32d86eea088e2c00
5
5
  SHA512:
6
- metadata.gz: 7d45bc2899f40f6e3bbe1ac2173deca01e403522b08e8fd2c468df8ea96624f72c948b2d10f266de08f9dee61a27bec9af8294dac83a4aeac6a142cf42c1533f
7
- data.tar.gz: 1813e66fa65f47b612befc1be51aefca816e9cf6a2553790abdd31a515ce5e98d2fc8acdba37e71a656fee8bd090ae3a4afa853b228c42882667176bfd1857fd
6
+ metadata.gz: 6689203d7096ab57b71a720006247e5157bc813f7ba474936083d261e9d3bf22034c1d6c62fa64ba08a0190d5fb538cee7a1c0a9dabfc6c76671067b54d25b4e
7
+ data.tar.gz: 5ebe8cb8ee64a3f95ef50327e456f2c8127d63d9d976abe60a2107d3610fc064d80559dbda7e351b4b188922c4a5d2d8c4547104a80cce3bac8502c66d1c3d43
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Feedzirra Changelog
2
2
 
3
+ ## 0.7.1
4
+
5
+ * Bugfix
6
+ * Don't use entry id for updating when feed doesn't provide it [[#205][]]
7
+
8
+ [#205]: https://github.com/pauldix/feedzirra/pull/205
9
+
3
10
  ## 0.7.0
4
11
 
5
12
  * General
@@ -86,7 +86,11 @@ module Feedzirra
86
86
  latest_entry = self.entries.first
87
87
  found_new_entries = []
88
88
  feed.entries.each do |entry|
89
- break if entry.entry_id == latest_entry.entry_id || entry.url == latest_entry.url
89
+ if entry.entry_id.nil? && latest_entry.entry_id.nil?
90
+ break if entry.url == latest_entry.url
91
+ else
92
+ break if entry.entry_id == latest_entry.entry_id || entry.url == latest_entry.url
93
+ end
90
94
  found_new_entries << entry
91
95
  end
92
96
  found_new_entries
@@ -1,3 +1,3 @@
1
1
  module Feedzirra
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
@@ -169,7 +169,10 @@ describe Feedzirra::FeedUtilities do
169
169
  end
170
170
  end
171
171
 
172
- describe "changing the url of an existing entry" do
172
+ describe "#update_from_feed" do
173
+ let(:recent_entry_id) { 'entry_id' }
174
+ let(:old_entry_id) { nil }
175
+
173
176
  before(:each) do
174
177
  # I'm using the Atom class when I know I should be using a different one. However, this update_from_feed
175
178
  # method would only be called against a feed item.
@@ -182,11 +185,12 @@ describe Feedzirra::FeedUtilities do
182
185
 
183
186
  @old_entry = Feedzirra::Parser::AtomEntry.new
184
187
  @old_entry.url = "http://pauldix.net/old.html"
188
+ @old_entry.entry_id = old_entry_id
185
189
  @old_entry.published = (Time.now - 10).to_s
186
190
 
187
191
  @entry = Feedzirra::Parser::AtomEntry.new
188
192
  @entry.published = (Time.now + 10).to_s
189
- @entry.entry_id = "entry_id"
193
+ @entry.entry_id = recent_entry_id
190
194
  @entry.url = "http://pauldix.net/entry.html"
191
195
 
192
196
  # only difference is a changed url
@@ -200,15 +204,27 @@ describe Feedzirra::FeedUtilities do
200
204
  @updated_feed.entries << @old_entry
201
205
  end
202
206
 
203
- it "should not put the complete feed into new_entries" do
204
- @feed.update_from_feed(@updated_feed)
207
+ context "changing the url of an existing entry" do
208
+ it "should not put the complete feed into new_entries" do
209
+ @feed.update_from_feed(@updated_feed)
210
+ @feed.new_entries.should_not include(@entry_changed_url)
211
+ @feed.new_entries.should_not include(@old_entry)
212
+ @feed.new_entries.size.should == 0
213
+ @feed.new_entries.size.should_not == 2
214
+ end
215
+ end
205
216
 
206
- @feed.new_entries.should_not include(@entry_changed_url)
207
- @feed.new_entries.should_not include(@old_entry)
217
+ context "feed not have entry id and only difference is a url" do
218
+ let(:recent_entry_id) { nil }
219
+ let(:old_entry_id) { nil }
208
220
 
209
- # don't return complete feed
210
- @feed.new_entries.size.should == 0
211
- @feed.new_entries.size.should_not == 2
221
+ it "should put the complete feed into new_entries" do
222
+ @feed.update_from_feed(@updated_feed)
223
+ @feed.new_entries.should include(@entry_changed_url)
224
+ @feed.new_entries.should include(@old_entry)
225
+ @feed.new_entries.size.should == 2
226
+ @feed.new_entries.size.should_not == 0
227
+ end
212
228
  end
213
229
  end
214
230
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feedzirra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Dix
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-01-02 00:00:00.000000000 Z
14
+ date: 2014-02-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: sax-machine