rss2mail 0.0.4 → 0.0.5

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/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to rss2mail version 0.0.4
5
+ This documentation refers to rss2mail version 0.0.5
6
6
 
7
7
 
8
8
  == DESCRIPTION
data/lib/rss2mail/feed.rb CHANGED
@@ -122,6 +122,7 @@ module RSS2Mail
122
122
  }
123
123
 
124
124
  # only keep the last 100 entries
125
+ feed[:sent].uniq!
125
126
  feed[:sent].slice!(0...-100)
126
127
 
127
128
  log "#{sent} items sent"
@@ -131,14 +132,17 @@ module RSS2Mail
131
132
  private
132
133
 
133
134
  def get(reload = reload)
135
+ conditions = {}
136
+
134
137
  if reload
135
138
  @content = nil
136
- conditions = {}
137
139
  else
138
- conditions = case
139
- when etag = feed[:etag] then { 'If-None-Match' => etag }
140
- when mtime = feed[:mtime] then { 'If-Modified-Since' => mtime }
141
- else {}
140
+ if etag = feed[:etag]
141
+ conditions['If-None-Match'] = etag
142
+ end
143
+
144
+ if mtime = feed[:mtime]
145
+ conditions['If-Modified-Since'] = mtime
142
146
  end
143
147
  end
144
148
 
@@ -146,10 +150,16 @@ module RSS2Mail
146
150
 
147
151
  begin
148
152
  open(feed[:url], conditions) { |uri|
149
- case
150
- when etag = uri.meta['etag'] then feed[:etag] = etag
151
- when mtime = uri.last_modified then feed[:mtime] = mtime.rfc822
152
- else feed[:updated] = Time.now
153
+ if etag = uri.meta['etag']
154
+ feed[:etag] = etag
155
+ end
156
+
157
+ if mtime = uri.last_modified
158
+ feed[:mtime] = mtime.rfc822
159
+ end
160
+
161
+ unless etag || mtime
162
+ feed[:updated] = Time.now
153
163
  end
154
164
 
155
165
  @content ||= uri.read
@@ -4,7 +4,7 @@ module RSS2Mail
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 0
7
- TINY = 4
7
+ TINY = 5
8
8
 
9
9
  class << self
10
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rss2mail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Wille
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-29 00:00:00 +02:00
12
+ date: 2009-10-26 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -63,16 +63,16 @@ extra_rdoc_files:
63
63
  - ChangeLog
64
64
  - README
65
65
  files:
66
- - lib/rss2mail.rb
66
+ - lib/rss2mail/rss.rb
67
67
  - lib/rss2mail/version.rb
68
68
  - lib/rss2mail/util.rb
69
- - lib/rss2mail/rss.rb
70
69
  - lib/rss2mail/feed.rb
70
+ - lib/rss2mail.rb
71
71
  - bin/rss2mail
72
- - COPYING
73
72
  - Rakefile
74
- - README
73
+ - COPYING
75
74
  - ChangeLog
75
+ - README
76
76
  - templates/plain.erb
77
77
  - templates/html.erb
78
78
  - example/feeds.yaml
@@ -82,15 +82,15 @@ licenses: []
82
82
 
83
83
  post_install_message:
84
84
  rdoc_options:
85
- - --inline-source
85
+ - --main
86
+ - README
87
+ - --line-numbers
86
88
  - --title
87
89
  - rss2mail Application documentation
90
+ - --inline-source
91
+ - --all
88
92
  - --charset
89
93
  - UTF-8
90
- - --all
91
- - --main
92
- - README
93
- - --line-numbers
94
94
  require_paths:
95
95
  - lib
96
96
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  requirements: []
109
109
 
110
110
  rubyforge_project: rss2mail
111
- rubygems_version: 1.3.4
111
+ rubygems_version: 1.3.5
112
112
  signing_key:
113
113
  specification_version: 3
114
114
  summary: Send RSS feeds as e-mail