automatic 13.5.0 → 13.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +11 -5
- data/README.md +4 -6
- data/VERSION +1 -1
- data/automatic.gemspec +61 -18
- data/doc/ChangeLog +25 -0
- data/doc/PLUGINS +202 -12
- data/doc/PLUGINS.ja +221 -30
- data/doc/README +1 -1
- data/doc/README.ja +1 -1
- data/lib/automatic.rb +3 -3
- data/lib/automatic/feed_parser.rb +2 -2
- data/lib/automatic/log.rb +12 -2
- data/lib/automatic/pipeline.rb +1 -1
- data/lib/automatic/recipe.rb +5 -2
- data/plugins/custom_feed/svn_log.rb +3 -3
- data/plugins/filter/absolute_uri.rb +8 -4
- data/plugins/filter/accept.rb +61 -0
- data/plugins/filter/full_feed.rb +4 -5
- data/plugins/filter/github_feed.rb +36 -0
- data/plugins/filter/ignore.rb +1 -1
- data/plugins/filter/image.rb +1 -1
- data/plugins/filter/image_source.rb +34 -10
- data/plugins/filter/one.rb +1 -1
- data/plugins/filter/rand.rb +1 -1
- data/plugins/filter/sanitize.rb +50 -0
- data/plugins/filter/sort.rb +1 -1
- data/plugins/filter/tumblr_resize.rb +1 -1
- data/plugins/publish/console.rb +3 -3
- data/plugins/publish/console_link.rb +30 -0
- data/plugins/publish/eject.rb +42 -0
- data/plugins/publish/fluentd.rb +42 -0
- data/plugins/publish/google_calendar.rb +3 -3
- data/plugins/publish/hatena_bookmark.rb +1 -1
- data/plugins/publish/hipchat.rb +45 -0
- data/plugins/publish/instapaper.rb +2 -1
- data/plugins/publish/memcached.rb +44 -0
- data/plugins/publish/pocket.rb +1 -1
- data/plugins/publish/twitter.rb +1 -1
- data/plugins/store/database.rb +3 -3
- data/plugins/store/full_text.rb +2 -2
- data/plugins/store/permalink.rb +1 -1
- data/plugins/store/target_link.rb +3 -2
- data/plugins/subscription/chan_toru.rb +56 -0
- data/plugins/subscription/feed.rb +1 -1
- data/plugins/subscription/g_guide.rb +48 -0
- data/plugins/subscription/google_reader_star.rb +3 -3
- data/plugins/subscription/link.rb +2 -2
- data/plugins/subscription/pocket.rb +49 -0
- data/plugins/subscription/text.rb +3 -12
- data/plugins/subscription/tumblr.rb +7 -1
- data/plugins/subscription/twitter.rb +1 -1
- data/plugins/subscription/twitter_search.rb +50 -0
- data/plugins/subscription/weather.rb +7 -41
- data/script/build +3 -0
- data/spec/fixtures/sampleRecipe.yml +1 -1
- data/spec/lib/automatic/log_spec.rb +31 -0
- data/spec/lib/automatic/pipeline_spec.rb +1 -1
- data/spec/lib/automatic/recipe_spec.rb +1 -1
- data/spec/lib/automatic_spec.rb +3 -3
- data/spec/plugins/custom_feed/svn_log_spec.rb +1 -1
- data/spec/plugins/filter/absolute_uri_spec.rb +1 -1
- data/spec/plugins/filter/accept_spec.rb +331 -0
- data/spec/plugins/filter/full_feed_spec.rb +4 -6
- data/spec/plugins/filter/github_feed_spec.rb +54 -0
- data/spec/plugins/filter/ignore_spec.rb +1 -1
- data/spec/plugins/filter/image_source_spec.rb +17 -3
- data/spec/plugins/filter/image_spec.rb +1 -1
- data/spec/plugins/filter/one_spec.rb +1 -1
- data/spec/plugins/filter/rand_spec.rb +1 -1
- data/spec/plugins/filter/sanitize_spec.rb +153 -0
- data/spec/plugins/filter/sort_spec.rb +1 -1
- data/spec/plugins/filter/tumblr_resize_spec.rb +1 -1
- data/spec/plugins/notify/ikachan_spec.rb +1 -1
- data/spec/plugins/publish/console_spec.rb +1 -1
- data/spec/plugins/publish/eject_spec.rb +40 -0
- data/spec/plugins/publish/fluentd_spec.rb +39 -0
- data/spec/plugins/publish/google_calendar_spec.rb +1 -1
- data/spec/plugins/publish/hatena_bookmark_spec.rb +1 -1
- data/spec/plugins/publish/hipchat_spec.rb +69 -0
- data/spec/plugins/publish/instapaper_spec.rb +42 -28
- data/spec/plugins/publish/memcached_spec.rb +63 -0
- data/spec/plugins/publish/pocket_spec.rb +33 -33
- data/spec/plugins/publish/twitter_spec.rb +57 -19
- data/spec/plugins/store/full_text_spec.rb +6 -1
- data/spec/plugins/store/permalink_spec.rb +18 -19
- data/spec/plugins/store/target_link_spec.rb +1 -1
- data/spec/plugins/subscription/chan_toru_spec.rb +56 -0
- data/spec/plugins/subscription/feed_spec.rb +1 -1
- data/spec/plugins/subscription/g_guide_spec.rb +76 -0
- data/spec/plugins/subscription/google_reader_star_spec.rb +1 -1
- data/spec/plugins/subscription/link_spec.rb +1 -1
- data/spec/plugins/subscription/pocket_spec.rb +57 -0
- data/spec/plugins/subscription/text_spec.rb +1 -14
- data/spec/plugins/subscription/tumblr_spec.rb +3 -2
- data/spec/plugins/subscription/twitter_search_spec.rb +57 -0
- data/spec/plugins/subscription/twitter_spec.rb +3 -2
- data/spec/plugins/subscription/weather_spec.rb +2 -15
- data/spec/spec_helper.rb +1 -0
- data/test/integration/test_chan_toru.yml +19 -0
- data/test/integration/test_fluentd.yml +20 -0
- data/test/integration/test_pocket.yml +21 -0
- data/test/integration/test_sanitize.yml +22 -0
- data/test/integration/test_twitter_search.yml +21 -0
- metadata +145 -24
- data/plugins/publish/mail.rb +0 -64
- data/plugins/publish/smtp.rb +0 -48
- data/spec/plugins/publish/mail_spec.rb +0 -53
- data/spec/plugins/publish/smtp_spec.rb +0 -49
data/plugins/publish/smtp.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
# Name:: Automatic::Plugin::Publish::Smtp
|
3
|
-
# Author:: kzgs
|
4
|
-
# Created:: Mar 17, 2012
|
5
|
-
# Updated:: Mar 17, 2012
|
6
|
-
# Copyright:: kzgs Copyright (c) 2012
|
7
|
-
# License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
|
8
|
-
|
9
|
-
module Automatic::Plugin
|
10
|
-
class PublishSmtp
|
11
|
-
require 'action_mailer'
|
12
|
-
|
13
|
-
def initialize(config, pipeline=[])
|
14
|
-
@config = config
|
15
|
-
@pipeline = pipeline
|
16
|
-
end
|
17
|
-
|
18
|
-
def run
|
19
|
-
Mailer.smtp_settings = default_setting.update(
|
20
|
-
{
|
21
|
-
:port => @config["port"],
|
22
|
-
})
|
23
|
-
Mailer.raise_delivery_errors = true
|
24
|
-
@pipeline.each { |feeds|
|
25
|
-
unless feeds.nil?
|
26
|
-
feeds.items.each { |feed|
|
27
|
-
Mailer.notify(@config, feed)
|
28
|
-
}
|
29
|
-
end
|
30
|
-
}
|
31
|
-
@pipeline
|
32
|
-
end
|
33
|
-
|
34
|
-
def default_setting
|
35
|
-
return {}
|
36
|
-
end
|
37
|
-
|
38
|
-
class Mailer < ActionMailer::Base
|
39
|
-
def notify(option, feed)
|
40
|
-
m = mail(:subject => option["subject"],
|
41
|
-
:to => option["mailto"],
|
42
|
-
:from => option["mailfrom"])
|
43
|
-
m.body = feed.link
|
44
|
-
m.deliver
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
# Name:: Automatic::Plugin::Publish::Mail
|
3
|
-
# Author:: 774 <http://id774.net>
|
4
|
-
# Updated:: Jun 14, 2012
|
5
|
-
# Copyright:: 774 Copyright (c) 2012
|
6
|
-
# License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
|
7
|
-
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
|
9
|
-
|
10
|
-
require 'publish/mail'
|
11
|
-
require 'mocksmtpd'
|
12
|
-
|
13
|
-
describe Automatic::Plugin::PublishMail do
|
14
|
-
before do
|
15
|
-
@pipeline = AutomaticSpec.generate_pipeline {
|
16
|
-
feed { item "http://github.com",
|
17
|
-
'aaa',
|
18
|
-
'bbb\n',
|
19
|
-
'Mon, 30 Jan 2012 13:22:29 +0900'
|
20
|
-
}
|
21
|
-
}
|
22
|
-
end
|
23
|
-
|
24
|
-
subject {
|
25
|
-
Automatic::Plugin::PublishMail.new({
|
26
|
-
"port" => 25,
|
27
|
-
"mailto" => "<to@example.com>",
|
28
|
-
"mailfrom" => "<from@example.com>",
|
29
|
-
"subject" => "test"
|
30
|
-
}, @pipeline)
|
31
|
-
}
|
32
|
-
|
33
|
-
it "should mail to smtp server" do
|
34
|
-
smtpd = SMTPServer.new({
|
35
|
-
:Port => 10025,
|
36
|
-
:MailHook => lambda { |sender| sender.should == "<from@example.com>" },
|
37
|
-
:DataHook => lambda { |tmpf, sender, recipients|
|
38
|
-
tmpf.should include("github.com")
|
39
|
-
sender.should == "<from@example.com>"
|
40
|
-
recipients.should == ["<to@example.com>"]
|
41
|
-
}
|
42
|
-
}
|
43
|
-
)
|
44
|
-
Thread.start {
|
45
|
-
smtpd.start
|
46
|
-
}
|
47
|
-
loop do
|
48
|
-
break if smtpd.status == :Running
|
49
|
-
end
|
50
|
-
subject.run
|
51
|
-
smtpd.shutdown
|
52
|
-
end
|
53
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
# Name:: Automatic::Plugin::Publish::Mail
|
3
|
-
# Author:: 774 <http://id774.net>
|
4
|
-
# Updated:: Jun 14, 2012
|
5
|
-
# Copyright:: 774 Copyright (c) 2012
|
6
|
-
# License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
|
7
|
-
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
|
9
|
-
|
10
|
-
require 'publish/smtp'
|
11
|
-
require 'mocksmtpd'
|
12
|
-
|
13
|
-
describe Automatic::Plugin::PublishSmtp do
|
14
|
-
before do
|
15
|
-
@pipeline = AutomaticSpec.generate_pipeline {
|
16
|
-
feed { item "http://github.com" }
|
17
|
-
}
|
18
|
-
end
|
19
|
-
|
20
|
-
subject {
|
21
|
-
Automatic::Plugin::PublishSmtp.new({
|
22
|
-
"port" => 10025,
|
23
|
-
"mailto" => "to@example.com",
|
24
|
-
"mailfrom" => "from@example.com",
|
25
|
-
"subject" => "test"
|
26
|
-
}, @pipeline)
|
27
|
-
}
|
28
|
-
|
29
|
-
it "should mail to smtp server" do
|
30
|
-
smtpd = SMTPServer.new({
|
31
|
-
:Port => 10025,
|
32
|
-
:MailHook => lambda { |sender| sender.should == "from@example.com" },
|
33
|
-
:DataHook => lambda { |tmpf, sender, recipients|
|
34
|
-
tmpf.should include("github.com")
|
35
|
-
sender.should == "from@example.com"
|
36
|
-
recipients.should == ["to@example.com"]
|
37
|
-
}
|
38
|
-
}
|
39
|
-
)
|
40
|
-
Thread.start {
|
41
|
-
smtpd.start
|
42
|
-
}
|
43
|
-
loop do
|
44
|
-
break if smtpd.status == :Running
|
45
|
-
end
|
46
|
-
subject.run
|
47
|
-
smtpd.shutdown
|
48
|
-
end
|
49
|
-
end
|