feed2email 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +7 -25
- data/lib/feed2email/mail.rb +10 -4
- data/lib/feed2email/version.rb +1 -1
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -23,31 +23,23 @@ $ gem install feed2email
|
|
23
23
|
|
24
24
|
## Configuration
|
25
25
|
|
26
|
-
|
26
|
+
Through a [YAML][] file at `~/.feed2email/config.yml`.
|
27
27
|
|
28
28
|
There are two ways to send mail: SMTP and Sendmail. If `config.yml` contains options for both, feed2email will use SMTP.
|
29
29
|
|
30
30
|
[YAML]: http://en.wikipedia.org/wiki/YAML
|
31
31
|
|
32
|
-
###
|
32
|
+
### Format
|
33
33
|
|
34
|
-
|
34
|
+
Each line in the configuration file contains a key-value pair. Each key-value pair is separated with a colon: `foo: bar`
|
35
35
|
|
36
|
-
|
36
|
+
### Generic options
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
smtp_host: mail.example.org
|
41
|
-
smtp_port: 587
|
42
|
-
smtp_user: johndoe
|
43
|
-
smtp_pass: 12345
|
44
|
-
smtp_tls: true
|
45
|
-
smtp_auth: login
|
46
|
-
~~~
|
38
|
+
* `recipient` (required) is the email address to send email to
|
39
|
+
* `send_delay` (optional) is the number of seconds to wait between each email to avoid SMTP server throttling errors (default is `10`; use `0` to turn off)
|
47
40
|
|
48
|
-
|
41
|
+
### SMTP
|
49
42
|
|
50
|
-
* `recipient` is the email address to send updates to
|
51
43
|
* `smtp_host` is the SMTP service hostname to connect to
|
52
44
|
* `smtp_port` is the SMTP service port to connect to
|
53
45
|
* `smtp_user` is the username of your mail account
|
@@ -61,16 +53,6 @@ A short explanation of the available options:
|
|
61
53
|
|
62
54
|
For this method you need to have [Sendmail][] setup and working in your system. It is also possible to use [a program with a Sendmail-compatible interface][msmtp].
|
63
55
|
|
64
|
-
Assuming you have everything setup and working, here's a sample `config.yml` file:
|
65
|
-
|
66
|
-
~~~ yaml
|
67
|
-
recipient: johndoe@example.org
|
68
|
-
sendmail_path: /usr/sbin/sendmail
|
69
|
-
~~~
|
70
|
-
|
71
|
-
A short explanation of the available options:
|
72
|
-
|
73
|
-
* `recipient` is the email address to send updates to
|
74
56
|
* `sendmail_path` (optional) is the path to the Sendmail binary (default is `/usr/sbin/sendmail`)
|
75
57
|
|
76
58
|
[Sendmail]: http://en.wikipedia.org/wiki/Sendmail
|
data/lib/feed2email/mail.rb
CHANGED
@@ -5,10 +5,9 @@ module Feed2Email
|
|
5
5
|
end
|
6
6
|
|
7
7
|
def send
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
$config['smtp_pass']
|
8
|
+
sleep $config['send_delay'] || 10 # avoid Net::SMTPServerBusy errors
|
9
|
+
|
10
|
+
if smtp_config_present?
|
12
11
|
send_with_smtp
|
13
12
|
else
|
14
13
|
send_with_sendmail
|
@@ -94,6 +93,13 @@ module Feed2Email
|
|
94
93
|
$config['sendmail_path'] || '/usr/sbin/sendmail'
|
95
94
|
end
|
96
95
|
|
96
|
+
def smtp_config_present?
|
97
|
+
$config['smtp_host'] &&
|
98
|
+
$config['smtp_port'] &&
|
99
|
+
$config['smtp_user'] &&
|
100
|
+
$config['smtp_pass']
|
101
|
+
end
|
102
|
+
|
97
103
|
def subject
|
98
104
|
@entry.title
|
99
105
|
end
|
data/lib/feed2email/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: feed2email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-06-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: feedzirra
|
@@ -81,7 +81,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
81
|
version: '0'
|
82
82
|
segments:
|
83
83
|
- 0
|
84
|
-
hash:
|
84
|
+
hash: 1285304786354070987
|
85
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
86
|
none: false
|
87
87
|
requirements:
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
segments:
|
92
92
|
- 0
|
93
|
-
hash:
|
93
|
+
hash: 1285304786354070987
|
94
94
|
requirements: []
|
95
95
|
rubyforge_project:
|
96
96
|
rubygems_version: 1.8.23
|