rss2mail 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README +4 -5
- data/Rakefile +4 -1
- data/lib/rss2mail/app.rb +4 -3
- data/lib/rss2mail/cli.rb +14 -32
- data/lib/rss2mail/version.rb +1 -1
- metadata +63 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 017417bfb43b6f08d3d3c796a060ea0acf87f5de
|
4
|
+
data.tar.gz: 7f7368f9f3d2bf056d4252fbf79cf1c24b4f27ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 437ecbd3b9f6bb2fb5a1087f0ee8f3bc0371531216c3e5bcd9d6725d0690fc22da8447215de6b2d6adfa89b6bd7c2629ef923bef8b2b4a65866fb2fc117600f5
|
7
|
+
data.tar.gz: c896efbe7131abe1ba37a88a1ec9af9cd6c9fb4bac427aea5a4a483953f8cccc953a6926474b2ed4b18b742ac7f0e89b5b87d1e837935b7b6d91c649afc9bd5d
|
data/README
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
== VERSION
|
4
4
|
|
5
|
-
This documentation refers to rss2mail version 0.4.
|
5
|
+
This documentation refers to rss2mail version 0.4.1
|
6
6
|
|
7
7
|
|
8
8
|
== DESCRIPTION
|
@@ -13,10 +13,9 @@ recipients. See <tt>example/</tt> directory for a sample configuration file.
|
|
13
13
|
|
14
14
|
== LINKS
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
RubyGem:: http://rubygems.org/gems/rss2mail
|
16
|
+
Documentation:: https://blackwinter.github.io/rss2mail/
|
17
|
+
Source code:: https://github.com/blackwinter/rss2mail
|
18
|
+
RubyGem:: https://rubygems.org/gems/rss2mail
|
20
19
|
|
21
20
|
|
22
21
|
== AUTHORS
|
data/Rakefile
CHANGED
@@ -13,7 +13,10 @@ begin
|
|
13
13
|
:license => %q{AGPL-3.0},
|
14
14
|
:homepage => :blackwinter,
|
15
15
|
:extra_files => FileList['templates/*'].to_a,
|
16
|
-
:dependencies => %w[
|
16
|
+
:dependencies => %w[
|
17
|
+
cyclops nokogiri ruby-nuggets safe_yaml
|
18
|
+
simple-rss sinatra unidecoder
|
19
|
+
]
|
17
20
|
}
|
18
21
|
}}
|
19
22
|
rescue LoadError => err
|
data/lib/rss2mail/app.rb
CHANGED
@@ -26,14 +26,14 @@
|
|
26
26
|
###############################################################################
|
27
27
|
#++
|
28
28
|
|
29
|
-
require 'yaml'
|
30
29
|
require 'sinatra'
|
31
30
|
require 'rss2mail/util'
|
31
|
+
require 'safe_yaml/load'
|
32
32
|
|
33
33
|
use Rack::Auth::Basic do |user, pass|
|
34
34
|
@auth ||= begin
|
35
35
|
file = File.join(settings.root, 'auth.yaml')
|
36
|
-
File.readable?(file) ?
|
36
|
+
File.readable?(file) ? SafeYAML.load_file(file) : {}
|
37
37
|
end
|
38
38
|
|
39
39
|
@auth[user] == pass
|
@@ -74,7 +74,8 @@ def prepare
|
|
74
74
|
user = request.env['REMOTE_USER'] or error(400)
|
75
75
|
|
76
76
|
@feeds_file = File.join(settings.root, 'feeds.d', "#{user}.yaml")
|
77
|
-
@feeds = File.readable?(@feeds_file) ?
|
77
|
+
@feeds = File.readable?(@feeds_file) ?
|
78
|
+
SafeYAML.load_file(@feeds_file, :deserialize_symbols => true) : {}
|
78
79
|
@targets = @feeds.keys.sort_by { |t, _| t.to_s }
|
79
80
|
end
|
80
81
|
|
data/lib/rss2mail/cli.rb
CHANGED
@@ -24,24 +24,23 @@
|
|
24
24
|
###############################################################################
|
25
25
|
#++
|
26
26
|
|
27
|
-
require '
|
28
|
-
|
27
|
+
require 'cyclops'
|
29
28
|
require 'rss2mail'
|
30
29
|
|
31
30
|
module RSS2Mail
|
32
31
|
|
33
|
-
class CLI <
|
32
|
+
class CLI < Cyclops
|
34
33
|
|
35
34
|
class << self
|
36
35
|
|
37
36
|
def defaults
|
38
37
|
super.merge(
|
39
|
-
:
|
40
|
-
:
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
44
|
-
:
|
38
|
+
files: nil,
|
39
|
+
smtp: nil,
|
40
|
+
lmtp: nil,
|
41
|
+
reload: false,
|
42
|
+
verbose: false,
|
43
|
+
debug: false
|
45
44
|
)
|
46
45
|
end
|
47
46
|
|
@@ -70,7 +69,7 @@ module RSS2Mail
|
|
70
69
|
|
71
70
|
(options.delete(:files) || default_files).each { |feeds_file|
|
72
71
|
feeds = begin
|
73
|
-
|
72
|
+
SafeYAML.load_file(feeds_file, deserialize_symbols: true)
|
74
73
|
rescue Errno::ENOENT
|
75
74
|
warn "Feeds file not found: #{feeds_file}"
|
76
75
|
next
|
@@ -94,44 +93,27 @@ module RSS2Mail
|
|
94
93
|
private
|
95
94
|
|
96
95
|
def opts(opts)
|
97
|
-
opts.
|
96
|
+
opts.option(:directory__DIRECTORY, 'Process all feeds in directory') { |dir|
|
98
97
|
quit "#{dir}: No such file or directory" unless File.directory?(dir)
|
99
98
|
quit "#{dir}: Permission denied" unless File.readable?(dir)
|
100
99
|
|
101
100
|
options[:files] = Dir[File.join(dir, '*.yaml')]
|
102
101
|
}
|
103
102
|
|
104
|
-
opts.separator
|
103
|
+
opts.separator
|
105
104
|
|
106
105
|
%w[smtp lmtp].each { |type|
|
107
106
|
klass = Transport.const_get(type.upcase)
|
108
107
|
|
109
|
-
opts.on("-#{type[0, 1]}", "--#{type} [HOST[:PORT]]",
|
110
|
-
"Send mail through #{type.upcase} server",
|
108
|
+
opts.on("-#{type[0, 1]}", "--#{type} [HOST[:PORT]]", "Send mail through #{type.upcase} server",
|
111
109
|
"[Default host: #{klass::DEFAULT_HOST}, default port: #{klass::DEFAULT_PORT}]") { |host|
|
112
110
|
options[type.to_sym] = host.to_s
|
113
111
|
}
|
114
112
|
}
|
115
113
|
|
116
|
-
opts.separator
|
117
|
-
|
118
|
-
opts.on('-r', '--reload', 'Reload feeds') {
|
119
|
-
options[:reload] = true
|
120
|
-
}
|
121
|
-
end
|
122
|
-
|
123
|
-
def generic_opts(opts)
|
124
|
-
opts.on('-v', '--verbose', 'Be verbose') {
|
125
|
-
options[:verbose] = true
|
126
|
-
}
|
127
|
-
|
128
|
-
opts.on('-D', '--debug', "Print debug output; don't send any mails") {
|
129
|
-
options[:debug] = true
|
130
|
-
}
|
131
|
-
|
132
|
-
opts.separator ''
|
114
|
+
opts.separator
|
133
115
|
|
134
|
-
|
116
|
+
opts.switch(:reload, 'Reload feeds')
|
135
117
|
end
|
136
118
|
|
137
119
|
def default_files
|
data/lib/rss2mail/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rss2mail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Wille
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: cyclops
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: nokogiri
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -24,6 +38,34 @@ dependencies:
|
|
24
38
|
- - ">="
|
25
39
|
- !ruby/object:Gem::Version
|
26
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: ruby-nuggets
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: safe_yaml
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
27
69
|
- !ruby/object:Gem::Dependency
|
28
70
|
name: simple-rss
|
29
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,19 +109,33 @@ dependencies:
|
|
67
109
|
- !ruby/object:Gem::Version
|
68
110
|
version: '0'
|
69
111
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
112
|
+
name: hen
|
71
113
|
requirement: !ruby/object:Gem::Requirement
|
72
114
|
requirements:
|
73
115
|
- - ">="
|
74
116
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0
|
76
|
-
type: :
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rake
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
77
133
|
prerelease: false
|
78
134
|
version_requirements: !ruby/object:Gem::Requirement
|
79
135
|
requirements:
|
80
136
|
- - ">="
|
81
137
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0
|
138
|
+
version: '0'
|
83
139
|
description: Send RSS feeds as e-mail
|
84
140
|
email: jens.wille@gmail.com
|
85
141
|
executables:
|
@@ -114,7 +170,7 @@ metadata: {}
|
|
114
170
|
post_install_message:
|
115
171
|
rdoc_options:
|
116
172
|
- "--title"
|
117
|
-
- rss2mail Application documentation (v0.4.
|
173
|
+
- rss2mail Application documentation (v0.4.1)
|
118
174
|
- "--charset"
|
119
175
|
- UTF-8
|
120
176
|
- "--line-numbers"
|