automatic 13.5.0 → 13.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -2,8 +2,8 @@
2
2
  # Name:: Automatic::Plugin::Filter::FullFeed
3
3
  # Author:: 774 <http://id774.net>
4
4
  # Created:: Jan 24, 2013
5
- # Updated:: Mar 24, 2013
6
- # Copyright:: 774 Copyright (c) 2013
5
+ # Updated:: May 23, 2013
6
+ # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
@@ -38,9 +38,7 @@ describe Automatic::Plugin::FilterFullFeed do
38
38
  subject.instance_variable_get(:@pipeline)[0].items[0].link.
39
39
  should == "http://matome.naver.jp/odai/2129948007339738701/2129948085139809603"
40
40
  subject.instance_variable_get(:@pipeline)[0].items[0].description.
41
- should ==
42
- "<div class=\"LyMain\" role=\"main\" data-na=\"NA:main\">\r\n\t<div class=\"ArMain02\" data-na=\"NA:comment\">\r\n\r\n\r\n<script>\r\nvar COMMENT_TARGET_ID = \"PSImipbkFp746BTYcGvB8iizlwODIqiioNZ\";\r\nvar COMMENT_TYPE_CODE = \"R\";\r\nvar COMMENT_ITEM_TOTAL = 0;\r\n</script><a name=\"comment\"></a>\r\n<div id=\"ancMTMComment\" class=\"MdMTMComment01\">\r\n\r\n\t<h2 class=\"mdMTMComment01Ttl\">このまとめへのコメント<span class=\"mdMTMComment01CounterWrap\">(<span class=\"mdMTMComment01Counter\">0</span>)</span>\n</h2>\r\n\r\n\t<div class=\"MdCommentForm01\">\r\n\t<p class=\"mdCommentForm01Input\"><textarea class=\"mdCommentForm01InputTxt\" placeholder=\"追加するコメントを入力\"></textarea></p>\r\n\t<p class=\"mdCommentForm01Btn\"><span class=\"MdBtn01Post01\"><input type=\"button\" value=\"書き込む\" class=\"mdBtn01Post01Btn\" data-na=\"NC:save\"></span></p>\r\n\t</div>\r\n\r\n\t<ul class=\"MdCommentList01\"><!-- /.MdCommentList01 --></ul>\n<div class=\"MdPagination04\" data-na=\"NA:pager\">\r\n\r\n\r\n\r\n\t\t<strong>1</strong>\r\n<!--/MdPagination04-->\n</div>\r\n\r\n<script type=\"text/javascript\">\r\n$(function() {\r\n nj.Bootloader.done(\"nj.matome.comment\", function() {\r\n var cl = $(\"ul.MdCommentList01\").mtmCommentSet({\"encryptId\" : COMMENT_TARGET_ID, \"typeCode\": COMMENT_TYPE_CODE});\r\n $(\".MdPagination04\").njPageNavi({\"item\":0,\"onClickEvent\" : function(e, n){cl.mtmCommentSet(\"setArgs\",{\"page\":n});cl.mtmCommentSet(\"getComment\");}});\r\n });\r\n});\r\n</script><!--/.MdMTMComment01-->\n</div>\r\n\t<!--/ArMain02-->\n</div>\r\n<!--/LyMain-->\n</div>"
43
-
41
+ should match(/このまとめを見る/)
44
42
  }
45
43
  end
46
44
  end
@@ -95,7 +93,7 @@ describe Automatic::Plugin::FilterFullFeed do
95
93
  root_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", ".."))
96
94
  dir = (File.expand_path('~/.automatic/assets/siteinfo'))
97
95
  if File.directory?(dir)
98
- puts "Removing #{dir}"
96
+ Automatic::Log.puts(:info, "Removing #{dir}")
99
97
  FileUtils.rm_r(dir)
100
98
  end
101
99
  return dir, root_dir
@@ -0,0 +1,54 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Name:: Automatic::Plugin::Filter::GithubFeed
3
+ # Author:: Kohei Hasegawa <http://github.com/banyan>
4
+ # Created:: Jun 6, 2013
5
+ # Updated:: Jun 6, 2013
6
+ # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
7
+ # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
+
9
+ require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
10
+
11
+ require 'filter/github_feed'
12
+
13
+ describe Automatic::Plugin::FilterGithubFeed do
14
+ context "with description with filename of tumblr should be renamed 500 to 1280" do
15
+ subject {
16
+ described_class.new(
17
+ {},
18
+ AutomaticSpec.generate_pipeline {
19
+ feed {
20
+ 2.times do |i|
21
+ @channel.items << Hashie::Mash.new(
22
+ :title => { :content => "title#{i}" },
23
+ :id => { :content => i.to_s },
24
+ :content => { :content => "description#{i}" }
25
+ )
26
+ end
27
+ }
28
+ }
29
+ )
30
+ }
31
+
32
+ describe "#run" do
33
+ its(:run) { should have(1).feeds }
34
+
35
+ specify {
36
+ subject.run
37
+
38
+ subject.instance_variable_get(:@pipeline)[0].items[0].link
39
+ .should == '1'
40
+ subject.instance_variable_get(:@pipeline)[0].items[0].title
41
+ .should == 'title1'
42
+ subject.instance_variable_get(:@pipeline)[0].items[0].description
43
+ .should == 'description1'
44
+
45
+ subject.instance_variable_get(:@pipeline)[0].items[1].link
46
+ .should == '0'
47
+ subject.instance_variable_get(:@pipeline)[0].items[1].title
48
+ .should == 'title0'
49
+ subject.instance_variable_get(:@pipeline)[0].items[1].description
50
+ .should == 'description0'
51
+ }
52
+ end
53
+ end
54
+ end
@@ -2,7 +2,7 @@
2
2
  # Name:: Automatic::Plugin::Filter::Ignore
3
3
  # Author:: 774 <http://id774.net>
4
4
  # Updated:: Jan 19, 2013
5
- # Copyright:: 774 Copyright (c) 2012-2013
5
+ # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
6
6
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
7
7
 
8
8
  require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
@@ -4,7 +4,7 @@
4
4
  # 774 <http://id774.net>
5
5
  # Created:: Mar 1, 2012
6
6
  # Updated:: Jun 14, 2012
7
- # Copyright:: kzgs Copyright (c) 2012
7
+ # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
8
8
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
9
9
 
10
10
  require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
@@ -54,7 +54,7 @@ describe Automatic::Plugin::FilterImageSource do
54
54
  end
55
55
 
56
56
  describe Automatic::Plugin::FilterImageSource do
57
- context "with no data" do
57
+ context "with link to tag image" do
58
58
  subject {
59
59
  Automatic::Plugin::FilterImageSource.new({},
60
60
  AutomaticSpec.generate_pipeline {
@@ -64,12 +64,26 @@ describe Automatic::Plugin::FilterImageSource do
64
64
  }})}
65
65
 
66
66
  describe "#run" do
67
+ before do
68
+ subject.stub!(:rewrite_link).and_return(['http://huge.png'])
69
+ end
70
+
67
71
  its(:run) { should have(1).feeds }
68
72
  specify {
69
73
  subject.run
70
74
  subject.instance_variable_get(:@pipeline)[0].items[0].link.
71
- should nil
75
+ should == 'http://huge.png'
72
76
  }
73
77
  end
78
+
79
+ describe "#imgs" do
80
+ before do
81
+ open = Hashie::Mash.new
82
+ open.read = '<img src="http://a.png"><br /><img src="http://b.png">'
83
+ subject.stub!(:open).and_return(open)
84
+ end
85
+
86
+ its(:run) { subject.run[0].items.length.should == 2 }
87
+ end
74
88
  end
75
89
  end
@@ -3,7 +3,7 @@
3
3
  # Author:: 774 <http://id774.net>
4
4
  # Created:: Sep 18, 2012
5
5
  # Updated:: Sep 18, 2012
6
- # Copyright:: 774 Copyright (c) 2012
6
+ # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
@@ -3,7 +3,7 @@
3
3
  # Author:: soramugi <http://soramugi.net>
4
4
  # Created:: May 8, 2013
5
5
  # Updated:: May 8, 2013
6
- # Copyright:: soramugi Copyright (c) 2013
6
+ # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
@@ -4,7 +4,7 @@
4
4
  # 774 <http://id774.net>
5
5
  # Created:: May 6, 2013
6
6
  # Updated:: Mar 7, 2013
7
- # Copyright:: soramugi Copyright (c) 2013
7
+ # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
8
8
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
9
9
 
10
10
  require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
@@ -0,0 +1,153 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Name:: Automatic::Plugin::Filter::Sanitize
3
+ # Author:: 774 <http://id774.net>
4
+ # Created:: Jun 20, 2013
5
+ # Updated:: Jun 20, 2013
6
+ # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
7
+ # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
+
9
+ require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
10
+
11
+ require 'filter/sanitize'
12
+
13
+ describe Automatic::Plugin::FilterSanitize do
14
+ context "It should be sanitized" do
15
+ subject {
16
+ Automatic::Plugin::FilterSanitize.new(
17
+ {},
18
+ AutomaticSpec.generate_pipeline {
19
+ feed {
20
+ item "http://testsite.org", "hoge",
21
+ "<a>fuga</a>",
22
+ "Mon, 07 Mar 2011 15:54:11 +0900"
23
+ }
24
+ }
25
+ )
26
+ }
27
+
28
+ describe "#run" do
29
+ its(:run) { should have(1).feeds }
30
+
31
+ specify {
32
+ subject.run
33
+ subject.instance_variable_get(:@return_feeds)[0].items.
34
+ count.should == 1
35
+ subject.instance_variable_get(:@return_feeds)[0].items[0].description.
36
+ should == 'fuga'
37
+ }
38
+ end
39
+ end
40
+
41
+ context "It should not be sanitized in basic mode" do
42
+ subject {
43
+ Automatic::Plugin::FilterSanitize.new(
44
+ {
45
+ 'mode' => "basic"
46
+ },
47
+ AutomaticSpec.generate_pipeline {
48
+ feed {
49
+ item "http://testsite.org", "hoge",
50
+ "<a>fuga</a>",
51
+ "Mon, 07 Mar 2011 15:54:11 +0900"
52
+ }
53
+ }
54
+ )
55
+ }
56
+
57
+ describe "#run" do
58
+ its(:run) { should have(1).feeds }
59
+
60
+ specify {
61
+ subject.run
62
+ subject.instance_variable_get(:@return_feeds)[0].items.
63
+ count.should == 1
64
+ subject.instance_variable_get(:@return_feeds)[0].items[0].description.
65
+ should == '<a rel="nofollow">fuga</a>'
66
+ }
67
+ end
68
+ end
69
+
70
+ context "It should not be sanitized in restricted mode" do
71
+ subject {
72
+ Automatic::Plugin::FilterSanitize.new(
73
+ {
74
+ 'mode' => "restricted"
75
+ },
76
+ AutomaticSpec.generate_pipeline {
77
+ feed {
78
+ item "http://testsite.org", "hoge",
79
+ "<a>fuga</a>",
80
+ "Mon, 07 Mar 2011 15:54:11 +0900"
81
+ }
82
+ }
83
+ )
84
+ }
85
+
86
+ describe "#run" do
87
+ its(:run) { should have(1).feeds }
88
+
89
+ specify {
90
+ subject.run
91
+ subject.instance_variable_get(:@return_feeds)[0].items.
92
+ count.should == 1
93
+ subject.instance_variable_get(:@return_feeds)[0].items[0].description.
94
+ should == 'fuga'
95
+ }
96
+ end
97
+ end
98
+
99
+ context "It should not be sanitized in relaxed mode" do
100
+ subject {
101
+ Automatic::Plugin::FilterSanitize.new(
102
+ {
103
+ 'mode' => "relaxed"
104
+ },
105
+ AutomaticSpec.generate_pipeline {
106
+ feed {
107
+ item "http://testsite.org", "hoge",
108
+ "<a>fuga</a>",
109
+ "Mon, 07 Mar 2011 15:54:11 +0900"
110
+ }
111
+ }
112
+ )
113
+ }
114
+
115
+ describe "#run" do
116
+ its(:run) { should have(1).feeds }
117
+
118
+ specify {
119
+ subject.run
120
+ subject.instance_variable_get(:@return_feeds)[0].items.
121
+ count.should == 1
122
+ subject.instance_variable_get(:@return_feeds)[0].items[0].description.
123
+ should == '<a>fuga</a>'
124
+ }
125
+ end
126
+ end
127
+
128
+ context "It should be sanitized" do
129
+ subject {
130
+ Automatic::Plugin::FilterSanitize.new(
131
+ {},
132
+ AutomaticSpec.generate_pipeline {
133
+ feed {
134
+ item "http://testsite.org", "hoge"
135
+ }
136
+ }
137
+ )
138
+ }
139
+
140
+ describe "#run" do
141
+ its(:run) { should have(1).feeds }
142
+
143
+ specify {
144
+ subject.run
145
+ subject.instance_variable_get(:@return_feeds)[0].items.
146
+ count.should == 1
147
+ subject.instance_variable_get(:@return_feeds)[0].items[0].description.
148
+ should == ''
149
+ }
150
+ end
151
+ end
152
+
153
+ end
@@ -3,7 +3,7 @@
3
3
  # Author:: 774 <http://id774.net>
4
4
  # Created:: Mar 23, 2012
5
5
  # Updated:: Jan 23, 2013
6
- # Copyright:: 774 Copyright (c) 2012-2013
6
+ # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
@@ -2,7 +2,7 @@
2
2
  # Name:: Automatic::Plugin::Filter::TumblrResize
3
3
  # Author:: 774 <http://id774.net>
4
4
  # Updated:: Jun 14, 2012
5
- # Copyright:: 774 Copyright (c) 2012
5
+ # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
6
6
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
7
7
 
8
8
  require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
@@ -30,7 +30,7 @@ end
30
30
  describe Automatic::Plugin::Ikachan do
31
31
  describe "#post" do
32
32
  subject {
33
- Automatic::Plugin::Ikachan.new.tap { |ikachan|
33
+ Automatic::Plugin::Ikachan.new.tap {|ikachan|
34
34
  ikachan.params = {
35
35
  "channels" => "#room",
36
36
  "url" => "http://sample.com",
@@ -2,7 +2,7 @@
2
2
  # Name:: Automatic::Plugin::Publish::Console
3
3
  # Author:: 774 <http://id774.net>
4
4
  # Updated:: Jun 14, 2012
5
- # Copyright:: 774 Copyright (c) 2012
5
+ # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
6
6
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
7
7
 
8
8
  require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
@@ -0,0 +1,40 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Name:: Automatic::Plugin::Publish::Eject
3
+ # Author:: soramugi <http://soramugi.net>
4
+ # Created:: Jun 9, 2013
5
+ # Updated:: Jun 9, 2013
6
+ # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
7
+ # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
+
9
+ require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
10
+
11
+ require 'publish/eject'
12
+
13
+ describe Automatic::Plugin::PublishEject do
14
+ before do
15
+ @pipeline = AutomaticSpec.generate_pipeline {
16
+ feed { item "http://github.com" }}
17
+ end
18
+
19
+ subject {
20
+ Automatic::Plugin::PublishEject.new({}, @pipeline)
21
+ }
22
+
23
+ it "should eject of feeds" do
24
+ subject.stub(:eject_cmd).and_return('echo')
25
+ subject.run.should have(1).items
26
+ end
27
+
28
+ subject {
29
+ Automatic::Plugin::PublishEject.new({'interval' => 0}, @pipeline)
30
+ }
31
+
32
+ it "should eject of feeds" do
33
+ subject.stub(:eject_cmd).and_return('echo')
34
+ subject.run.should have(1).items
35
+ end
36
+
37
+ it "should eject_cmd" do
38
+ subject.eject_cmd.should_not == ''
39
+ end
40
+ end
@@ -0,0 +1,39 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Name:: Automatic::Plugin::Publish::Fluentd
3
+ # Author:: 774 <http://id774.net>
4
+ # Created:: Jun 21, 2013
5
+ # Updated:: Jun 21, 2013
6
+ # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
7
+ # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
+
9
+ require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
10
+
11
+ require 'publish/fluentd'
12
+
13
+ describe Automatic::Plugin::PublishFluentd do
14
+ context 'when feed' do
15
+ describe 'should forward the feeds' do
16
+ subject {
17
+ Automatic::Plugin::PublishFluentd.new(
18
+ {
19
+ 'host' => "localhost",
20
+ 'port' => "9999",
21
+ 'tag' => "debug.forward"
22
+ },
23
+ AutomaticSpec.generate_pipeline{
24
+ feed {
25
+ item "http://github.com", "hoge",
26
+ "<a>fuga</a>"
27
+ }
28
+ }
29
+ )
30
+ }
31
+
32
+ its (:run) {
33
+ fluentd = mock("fluentd")
34
+ subject.run.should have(1).feed
35
+ }
36
+ end
37
+
38
+ end
39
+ end
@@ -3,7 +3,7 @@
3
3
  # Author:: kzgs
4
4
  # Created:: Feb 26, 2012
5
5
  # Updated:: Mar 3, 2012
6
- # Copyright:: kzgs Copyright (c) 2012
6
+ # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')