rss2mail 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to rss2mail version 0.0.8
5
+ This documentation refers to rss2mail version 0.0.9
6
6
 
7
7
 
8
8
  == DESCRIPTION
data/bin/rss2mail CHANGED
@@ -26,17 +26,14 @@
26
26
  ###############################################################################
27
27
  #++
28
28
 
29
- require 'optparse'
30
29
  require 'yaml'
31
-
32
- require 'rubygems'
30
+ require 'optparse'
33
31
  require 'nuggets/env/user_home'
34
32
 
35
- base = File.expand_path(File.join(File.dirname(__FILE__), '..'))
36
- $: << File.join(base, 'lib')
37
-
38
33
  require 'rss2mail'
39
34
 
35
+ base = File.expand_path('../..', __FILE__)
36
+
40
37
  USAGE = "Usage: #{$0} [options] <target>"
41
38
  abort USAGE if ARGV.empty?
42
39
 
data/lib/rss2mail/feed.rb CHANGED
@@ -24,10 +24,7 @@
24
24
  ###############################################################################
25
25
  #++
26
26
 
27
- require 'open-uri'
28
27
  require 'erb'
29
-
30
- require 'rubygems'
31
28
  require 'nuggets/file/which'
32
29
  require 'nuggets/string/evaluate'
33
30
 
data/lib/rss2mail/rss.rb CHANGED
@@ -26,10 +26,8 @@
26
26
  ###############################################################################
27
27
  #++
28
28
 
29
- require 'open-uri'
30
29
  require 'rss'
31
-
32
- require 'rubygems'
30
+ require 'open-uri'
33
31
  require 'simple-rss'
34
32
  require 'unidecode'
35
33
  require 'nuggets/util/i18n'
@@ -56,6 +54,10 @@ module RSS2Mail
56
54
 
57
55
  attr_reader :content, :rss
58
56
 
57
+ def self.parse(url, *args)
58
+ new(open(url), *args)
59
+ end
60
+
59
61
  def initialize(content, simple = false)
60
62
  @content = content
61
63
  @simple = simple
@@ -90,7 +92,9 @@ module RSS2Mail
90
92
  end
91
93
 
92
94
  def link
93
- @link ||= value_for(:link, :href)
95
+ @link ||= value_for([:links, :link], :href) { |field, value|
96
+ field == :links ? value.find { |link| link.rel == 'alternate' } : value
97
+ }
94
98
  end
95
99
 
96
100
  def description(unescape_html = false)
data/lib/rss2mail/util.rb CHANGED
@@ -24,10 +24,8 @@
24
24
  ###############################################################################
25
25
  #++
26
26
 
27
- require 'open-uri'
28
27
  require 'uri'
29
-
30
- require 'rubygems'
28
+ require 'open-uri'
31
29
  require 'hpricot'
32
30
 
33
31
  module RSS2Mail
@@ -4,7 +4,7 @@ module RSS2Mail
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 0
7
- TINY = 8
7
+ TINY = 9
8
8
 
9
9
  class << self
10
10
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rss2mail
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jens Wille
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-29 00:00:00 Z
18
+ date: 2011-05-24 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: simple-rss
@@ -102,14 +102,14 @@ licenses: []
102
102
 
103
103
  post_install_message:
104
104
  rdoc_options:
105
- - --line-numbers
106
105
  - --main
107
106
  - README
108
107
  - --charset
109
108
  - UTF-8
110
- - --all
111
109
  - --title
112
- - rss2mail Application documentation (v0.0.8)
110
+ - rss2mail Application documentation (v0.0.9)
111
+ - --all
112
+ - --line-numbers
113
113
  require_paths:
114
114
  - lib
115
115
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  requirements: []
134
134
 
135
135
  rubyforge_project: rss2mail
136
- rubygems_version: 1.7.2
136
+ rubygems_version: 1.8.3
137
137
  signing_key:
138
138
  specification_version: 3
139
139
  summary: Send RSS feeds as e-mail