automatic 13.5.0 → 13.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. data/Gemfile +11 -5
  2. data/README.md +4 -6
  3. data/VERSION +1 -1
  4. data/automatic.gemspec +61 -18
  5. data/doc/ChangeLog +25 -0
  6. data/doc/PLUGINS +202 -12
  7. data/doc/PLUGINS.ja +221 -30
  8. data/doc/README +1 -1
  9. data/doc/README.ja +1 -1
  10. data/lib/automatic.rb +3 -3
  11. data/lib/automatic/feed_parser.rb +2 -2
  12. data/lib/automatic/log.rb +12 -2
  13. data/lib/automatic/pipeline.rb +1 -1
  14. data/lib/automatic/recipe.rb +5 -2
  15. data/plugins/custom_feed/svn_log.rb +3 -3
  16. data/plugins/filter/absolute_uri.rb +8 -4
  17. data/plugins/filter/accept.rb +61 -0
  18. data/plugins/filter/full_feed.rb +4 -5
  19. data/plugins/filter/github_feed.rb +36 -0
  20. data/plugins/filter/ignore.rb +1 -1
  21. data/plugins/filter/image.rb +1 -1
  22. data/plugins/filter/image_source.rb +34 -10
  23. data/plugins/filter/one.rb +1 -1
  24. data/plugins/filter/rand.rb +1 -1
  25. data/plugins/filter/sanitize.rb +50 -0
  26. data/plugins/filter/sort.rb +1 -1
  27. data/plugins/filter/tumblr_resize.rb +1 -1
  28. data/plugins/publish/console.rb +3 -3
  29. data/plugins/publish/console_link.rb +30 -0
  30. data/plugins/publish/eject.rb +42 -0
  31. data/plugins/publish/fluentd.rb +42 -0
  32. data/plugins/publish/google_calendar.rb +3 -3
  33. data/plugins/publish/hatena_bookmark.rb +1 -1
  34. data/plugins/publish/hipchat.rb +45 -0
  35. data/plugins/publish/instapaper.rb +2 -1
  36. data/plugins/publish/memcached.rb +44 -0
  37. data/plugins/publish/pocket.rb +1 -1
  38. data/plugins/publish/twitter.rb +1 -1
  39. data/plugins/store/database.rb +3 -3
  40. data/plugins/store/full_text.rb +2 -2
  41. data/plugins/store/permalink.rb +1 -1
  42. data/plugins/store/target_link.rb +3 -2
  43. data/plugins/subscription/chan_toru.rb +56 -0
  44. data/plugins/subscription/feed.rb +1 -1
  45. data/plugins/subscription/g_guide.rb +48 -0
  46. data/plugins/subscription/google_reader_star.rb +3 -3
  47. data/plugins/subscription/link.rb +2 -2
  48. data/plugins/subscription/pocket.rb +49 -0
  49. data/plugins/subscription/text.rb +3 -12
  50. data/plugins/subscription/tumblr.rb +7 -1
  51. data/plugins/subscription/twitter.rb +1 -1
  52. data/plugins/subscription/twitter_search.rb +50 -0
  53. data/plugins/subscription/weather.rb +7 -41
  54. data/script/build +3 -0
  55. data/spec/fixtures/sampleRecipe.yml +1 -1
  56. data/spec/lib/automatic/log_spec.rb +31 -0
  57. data/spec/lib/automatic/pipeline_spec.rb +1 -1
  58. data/spec/lib/automatic/recipe_spec.rb +1 -1
  59. data/spec/lib/automatic_spec.rb +3 -3
  60. data/spec/plugins/custom_feed/svn_log_spec.rb +1 -1
  61. data/spec/plugins/filter/absolute_uri_spec.rb +1 -1
  62. data/spec/plugins/filter/accept_spec.rb +331 -0
  63. data/spec/plugins/filter/full_feed_spec.rb +4 -6
  64. data/spec/plugins/filter/github_feed_spec.rb +54 -0
  65. data/spec/plugins/filter/ignore_spec.rb +1 -1
  66. data/spec/plugins/filter/image_source_spec.rb +17 -3
  67. data/spec/plugins/filter/image_spec.rb +1 -1
  68. data/spec/plugins/filter/one_spec.rb +1 -1
  69. data/spec/plugins/filter/rand_spec.rb +1 -1
  70. data/spec/plugins/filter/sanitize_spec.rb +153 -0
  71. data/spec/plugins/filter/sort_spec.rb +1 -1
  72. data/spec/plugins/filter/tumblr_resize_spec.rb +1 -1
  73. data/spec/plugins/notify/ikachan_spec.rb +1 -1
  74. data/spec/plugins/publish/console_spec.rb +1 -1
  75. data/spec/plugins/publish/eject_spec.rb +40 -0
  76. data/spec/plugins/publish/fluentd_spec.rb +39 -0
  77. data/spec/plugins/publish/google_calendar_spec.rb +1 -1
  78. data/spec/plugins/publish/hatena_bookmark_spec.rb +1 -1
  79. data/spec/plugins/publish/hipchat_spec.rb +69 -0
  80. data/spec/plugins/publish/instapaper_spec.rb +42 -28
  81. data/spec/plugins/publish/memcached_spec.rb +63 -0
  82. data/spec/plugins/publish/pocket_spec.rb +33 -33
  83. data/spec/plugins/publish/twitter_spec.rb +57 -19
  84. data/spec/plugins/store/full_text_spec.rb +6 -1
  85. data/spec/plugins/store/permalink_spec.rb +18 -19
  86. data/spec/plugins/store/target_link_spec.rb +1 -1
  87. data/spec/plugins/subscription/chan_toru_spec.rb +56 -0
  88. data/spec/plugins/subscription/feed_spec.rb +1 -1
  89. data/spec/plugins/subscription/g_guide_spec.rb +76 -0
  90. data/spec/plugins/subscription/google_reader_star_spec.rb +1 -1
  91. data/spec/plugins/subscription/link_spec.rb +1 -1
  92. data/spec/plugins/subscription/pocket_spec.rb +57 -0
  93. data/spec/plugins/subscription/text_spec.rb +1 -14
  94. data/spec/plugins/subscription/tumblr_spec.rb +3 -2
  95. data/spec/plugins/subscription/twitter_search_spec.rb +57 -0
  96. data/spec/plugins/subscription/twitter_spec.rb +3 -2
  97. data/spec/plugins/subscription/weather_spec.rb +2 -15
  98. data/spec/spec_helper.rb +1 -0
  99. data/test/integration/test_chan_toru.yml +19 -0
  100. data/test/integration/test_fluentd.yml +20 -0
  101. data/test/integration/test_pocket.yml +21 -0
  102. data/test/integration/test_sanitize.yml +22 -0
  103. data/test/integration/test_twitter_search.yml +21 -0
  104. metadata +145 -24
  105. data/plugins/publish/mail.rb +0 -64
  106. data/plugins/publish/smtp.rb +0 -48
  107. data/spec/plugins/publish/mail_spec.rb +0 -53
  108. data/spec/plugins/publish/smtp_spec.rb +0 -49
@@ -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