automatic 14.12.2 → 26.09

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 (177) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +669 -83
  3. data/VERSION +1 -1
  4. data/assets/siteinfo/items_all.json +60300 -52138
  5. data/automatic.gemspec +110 -248
  6. data/bin/automatic +20 -139
  7. data/config/feed2console.yml +10 -4
  8. data/config/feed2markdown.yml +41 -0
  9. data/doc/AI_TUTORIAL.md +542 -0
  10. data/doc/BASIC_DESIGN.md +547 -0
  11. data/doc/COPYING.LESSER +165 -0
  12. data/doc/DEPLOYMENT.md +830 -0
  13. data/doc/LICENSE.md +14 -0
  14. data/doc/PLUGINS.md +2015 -0
  15. data/doc/PLUGIN_DEVELOPMENT.md +86 -0
  16. data/doc/POLICY.md +962 -0
  17. data/doc/QUICKSTART.md +260 -0
  18. data/doc/RELEASING.md +394 -0
  19. data/doc/REQUIREMENTS.md +556 -0
  20. data/doc/VERSIONS +266 -0
  21. data/lib/automatic/cli.rb +270 -0
  22. data/lib/automatic/environment.rb +31 -5
  23. data/lib/automatic/feed_maker.rb +65 -25
  24. data/lib/automatic/feed_parser.rb +51 -35
  25. data/lib/automatic/http.rb +107 -0
  26. data/lib/automatic/log.rb +49 -18
  27. data/lib/automatic/opml.rb +3 -1
  28. data/lib/automatic/pipeline.rb +73 -32
  29. data/lib/automatic/recipe.rb +100 -17
  30. data/lib/automatic/version.rb +14 -1
  31. data/lib/automatic.rb +93 -20
  32. data/plugins/custom_feed/svn_log.rb +73 -32
  33. data/plugins/custom_feed/web.rb +348 -0
  34. data/plugins/filter/absolute_uri.rb +43 -27
  35. data/plugins/filter/accept.rb +38 -45
  36. data/plugins/filter/batch.rb +97 -0
  37. data/plugins/filter/claude.rb +217 -0
  38. data/plugins/filter/clear.rb +12 -8
  39. data/plugins/filter/description_link.rb +66 -51
  40. data/plugins/filter/full_feed.rb +170 -52
  41. data/plugins/filter/gemini.rb +216 -0
  42. data/plugins/filter/github_feed.rb +38 -26
  43. data/plugins/filter/ignore.rb +33 -44
  44. data/plugins/filter/image.rb +36 -25
  45. data/plugins/filter/image_source.rb +75 -52
  46. data/plugins/filter/join.rb +105 -0
  47. data/plugins/filter/kimi.rb +216 -0
  48. data/plugins/filter/limit.rb +57 -0
  49. data/plugins/filter/one.rb +19 -26
  50. data/plugins/filter/open_ai.rb +198 -0
  51. data/plugins/filter/present.rb +75 -0
  52. data/plugins/filter/rand.rb +16 -17
  53. data/plugins/filter/sakura_ai.rb +205 -0
  54. data/plugins/filter/sanitize.rb +29 -34
  55. data/plugins/filter/sort.rb +20 -27
  56. data/plugins/filter/tumblr_resize.rb +31 -23
  57. data/plugins/notify/ikachan.rb +86 -48
  58. data/plugins/provide/fluentd.rb +43 -24
  59. data/plugins/publish/amazon_s3.rb +79 -40
  60. data/plugins/publish/console.rb +19 -16
  61. data/plugins/publish/console_link.rb +20 -17
  62. data/plugins/publish/eject.rb +48 -26
  63. data/plugins/publish/fluentd.rb +50 -30
  64. data/plugins/publish/hatena_bookmark.rb +88 -71
  65. data/plugins/publish/instapaper.rb +69 -59
  66. data/plugins/publish/markdown.rb +278 -0
  67. data/plugins/publish/memcached.rb +35 -29
  68. data/plugins/store/database.rb +50 -48
  69. data/plugins/store/digest.rb +212 -0
  70. data/plugins/store/file.rb +107 -68
  71. data/plugins/store/full_text.rb +31 -28
  72. data/plugins/store/permalink.rb +18 -22
  73. data/plugins/subscription/feed.rb +34 -21
  74. data/plugins/subscription/link.rb +31 -32
  75. data/plugins/subscription/text.rb +40 -45
  76. data/plugins/subscription/tumblr.rb +55 -44
  77. data/plugins/subscription/xml.rb +40 -36
  78. metadata +112 -321
  79. data/Gemfile +0 -38
  80. data/Rakefile +0 -59
  81. data/doc/ChangeLog +0 -303
  82. data/doc/PLUGINS +0 -750
  83. data/doc/PLUGINS.ja +0 -753
  84. data/doc/README +0 -511
  85. data/doc/README.ja +0 -519
  86. data/plugins/filter/google_news.rb +0 -50
  87. data/plugins/publish/google_calendar.rb +0 -84
  88. data/plugins/publish/hipchat.rb +0 -46
  89. data/plugins/publish/pocket.rb +0 -45
  90. data/plugins/publish/twitter.rb +0 -58
  91. data/plugins/subscription/chan_toru.rb +0 -57
  92. data/plugins/subscription/g_guide.rb +0 -57
  93. data/plugins/subscription/pocket.rb +0 -51
  94. data/plugins/subscription/twitter.rb +0 -69
  95. data/plugins/subscription/twitter_search.rb +0 -50
  96. data/plugins/subscription/weather.rb +0 -33
  97. data/script/build +0 -84
  98. data/spec/fixtures/sampleFeeds.tsv +0 -1
  99. data/spec/fixtures/sampleFeeds2.tsv +0 -2
  100. data/spec/fixtures/sampleRecipe.yml +0 -24
  101. data/spec/lib/automatic/log_spec.rb +0 -32
  102. data/spec/lib/automatic/pipeline_spec.rb +0 -68
  103. data/spec/lib/automatic/recipe_spec.rb +0 -40
  104. data/spec/lib/automatic_spec.rb +0 -99
  105. data/spec/plugins/custom_feed/svn_log_spec.rb +0 -31
  106. data/spec/plugins/filter/absolute_uri_spec.rb +0 -61
  107. data/spec/plugins/filter/accept_spec.rb +0 -331
  108. data/spec/plugins/filter/clear_spec.rb +0 -49
  109. data/spec/plugins/filter/description_link_spec.rb +0 -138
  110. data/spec/plugins/filter/full_feed_spec.rb +0 -129
  111. data/spec/plugins/filter/github_feed_spec.rb +0 -55
  112. data/spec/plugins/filter/google_news_spec.rb +0 -69
  113. data/spec/plugins/filter/ignore_spec.rb +0 -328
  114. data/spec/plugins/filter/image_source_spec.rb +0 -89
  115. data/spec/plugins/filter/image_spec.rb +0 -65
  116. data/spec/plugins/filter/one_spec.rb +0 -71
  117. data/spec/plugins/filter/rand_spec.rb +0 -52
  118. data/spec/plugins/filter/sanitize_spec.rb +0 -153
  119. data/spec/plugins/filter/sort_spec.rb +0 -189
  120. data/spec/plugins/filter/tumblr_resize_spec.rb +0 -109
  121. data/spec/plugins/notify/ikachan_spec.rb +0 -58
  122. data/spec/plugins/provide/fluentd_spec.rb +0 -49
  123. data/spec/plugins/publish/amazon_s3_spec.rb +0 -40
  124. data/spec/plugins/publish/console_spec.rb +0 -30
  125. data/spec/plugins/publish/eject_spec.rb +0 -40
  126. data/spec/plugins/publish/fluentd_spec.rb +0 -40
  127. data/spec/plugins/publish/google_calendar_spec.rb +0 -83
  128. data/spec/plugins/publish/hatena_bookmark_spec.rb +0 -134
  129. data/spec/plugins/publish/hipchat_spec.rb +0 -69
  130. data/spec/plugins/publish/instapaper_spec.rb +0 -82
  131. data/spec/plugins/publish/memcached_spec.rb +0 -63
  132. data/spec/plugins/publish/pocket_spec.rb +0 -51
  133. data/spec/plugins/publish/twitter_spec.rb +0 -73
  134. data/spec/plugins/store/file_spec.rb +0 -58
  135. data/spec/plugins/store/full_text_spec.rb +0 -152
  136. data/spec/plugins/store/permalink_spec.rb +0 -206
  137. data/spec/plugins/subscription/chan_toru_spec.rb +0 -56
  138. data/spec/plugins/subscription/feed_spec.rb +0 -71
  139. data/spec/plugins/subscription/g_guide_spec.rb +0 -82
  140. data/spec/plugins/subscription/link_spec.rb +0 -72
  141. data/spec/plugins/subscription/pocket_spec.rb +0 -57
  142. data/spec/plugins/subscription/text_spec.rb +0 -84
  143. data/spec/plugins/subscription/tumblr_spec.rb +0 -74
  144. data/spec/plugins/subscription/twitter_search_spec.rb +0 -57
  145. data/spec/plugins/subscription/twitter_spec.rb +0 -73
  146. data/spec/plugins/subscription/weather_spec.rb +0 -44
  147. data/spec/plugins/subscription/xml_spec.rb +0 -84
  148. data/spec/spec_helper.rb +0 -106
  149. data/spec/user_dir/plugins/store/mock.rb +0 -16
  150. data/test/fixtures/sampleOPML.xml +0 -11
  151. data/test/integration/test_absoluteurl.yml +0 -25
  152. data/test/integration/test_activerecord.yml +0 -24
  153. data/test/integration/test_add_pocket.yml +0 -26
  154. data/test/integration/test_chan_toru.yml +0 -21
  155. data/test/integration/test_descriptionlink.yml +0 -21
  156. data/test/integration/test_fluentd.yml +0 -22
  157. data/test/integration/test_fulltext.yml +0 -30
  158. data/test/integration/test_google_news.yml +0 -21
  159. data/test/integration/test_googlealert.yml +0 -21
  160. data/test/integration/test_hatenabookmark.yml +0 -30
  161. data/test/integration/test_ignore.yml +0 -25
  162. data/test/integration/test_ignore2.yml +0 -22
  163. data/test/integration/test_image2local.yml +0 -33
  164. data/test/integration/test_instapaper.yml +0 -26
  165. data/test/integration/test_link2local.yml +0 -34
  166. data/test/integration/test_one.yml +0 -23
  167. data/test/integration/test_pocket.yml +0 -22
  168. data/test/integration/test_rand.yml +0 -21
  169. data/test/integration/test_sanitize.yml +0 -23
  170. data/test/integration/test_sort.yml +0 -36
  171. data/test/integration/test_svnlog.yml +0 -15
  172. data/test/integration/test_text2feed.yml +0 -36
  173. data/test/integration/test_tumblr2local.yml +0 -43
  174. data/test/integration/test_twitter_search.yml +0 -22
  175. data/test/integration/test_weather.yml +0 -19
  176. data/test/integration/test_xml2fluentd.yml +0 -21
  177. data/vendor/.gitkeep +0 -0
@@ -1,99 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Name:: Automatic::Ruby
3
- # Author:: kzgs
4
- # 774 <http://id774.net>
5
- # Created:: Mar 9, 2012
6
- # Updated:: Jan 4, 2015
7
- # Copyright:: Copyright (c) 2012-2015 Automatic Ruby Developers.
8
- # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
9
-
10
- require File.expand_path(File.join(File.dirname(__FILE__), '../spec_helper'))
11
-
12
- require 'automatic'
13
-
14
- describe Automatic do
15
- describe "#run" do
16
- describe "with a root dir which has default recipe" do
17
- subject {
18
- Automatic.run(:recipe => "",
19
- :root_dir => APP_ROOT,
20
- :user_dir => APP_ROOT + "/spec/user_dir")
21
- }
22
-
23
- it { expect { subject }.to raise_error }
24
- end
25
- end
26
-
27
- describe "#version" do
28
- subject { Automatic.const_get(:VERSION) }
29
-
30
- it { expect(subject).to eq "14.12.2" }
31
- end
32
-
33
- describe "#(root)_dir" do
34
- subject { Automatic.root_dir }
35
-
36
- it { expect(subject).to eq APP_ROOT }
37
-
38
- end
39
-
40
- describe "#(config)_dir" do
41
- subject { Automatic.config_dir }
42
-
43
- it { expect(subject).to eq APP_ROOT+"/config" }
44
- end
45
-
46
- describe "#user_dir= in test env" do
47
- before(:all) do
48
- Automatic.user_dir = File.join(APP_ROOT, "spec/user_dir")
49
- end
50
-
51
- describe "#user_dir" do
52
- subject { Automatic.user_dir }
53
-
54
- it "return valid value" do
55
- expect(subject).to eq File.join(APP_ROOT, "spec/user_dir")
56
- end
57
- end
58
-
59
- describe "#user_plugins_dir" do
60
- subject { Automatic.user_plugins_dir }
61
-
62
- it "return valid value" do
63
- expect(subject).to eq File.join(APP_ROOT, "spec/user_dir/plugins")
64
- end
65
- end
66
-
67
- after(:all) do
68
- Automatic.user_dir = nil
69
- end
70
- end
71
-
72
- describe "#set_user_dir in other env" do
73
- before(:all) do
74
- ENV["AUTOMATIC_RUBY_ENV"] = "other"
75
- Automatic.user_dir = nil
76
- end
77
-
78
- describe "#user_dir" do
79
- subject { Automatic.user_dir }
80
-
81
- it "return valid value" do
82
- expect(subject).to eq File.expand_path("~/") + "/.automatic"
83
- end
84
- end
85
-
86
- describe "#user_plugins_dir" do
87
- subject { Automatic.user_plugins_dir }
88
-
89
- it "return valid value" do
90
- expect(subject).to eq File.expand_path("~/") + "/.automatic/plugins"
91
- end
92
- end
93
-
94
- after(:all) do
95
- ENV["AUTOMATIC_RUBY_ENV"] = "test"
96
- end
97
- end
98
-
99
- end
@@ -1,31 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Name:: Automatic::Plugin::CustomFeed::SVNFLog
3
- # Author:: kzgs
4
- # Created:: Feb 29, 2012
5
- # Updated:: Nov 3, 2012
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 'custom_feed/svn_log'
12
-
13
- describe Automatic::Plugin::CustomFeedSVNLog do
14
- context "with feeds whose valid URL" do
15
- subject {
16
- Automatic::Plugin::CustomFeedSVNLog.new(
17
- {
18
- 'target' => 'http://svn.apache.org/repos/asf/',
19
- 'fetch_items' => 2
20
- })
21
- }
22
-
23
- its(:run) { should have(1).feed }
24
-
25
- specify {
26
- feed = subject.run[0]
27
- feed.should have(2).items
28
- }
29
- end
30
- end
31
-
@@ -1,61 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Name:: Automatic::Plugin::Filter::AbsoluteURI
3
- # Author:: 774 <http://id774.net>
4
- # Created:: Jun 20, 2012
5
- # Updated:: Sep 18, 2012
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/absolute_uri'
12
-
13
- describe Automatic::Plugin::FilterAbsoluteURI do
14
- context "with feed contain link tag" do
15
- subject {
16
- Automatic::Plugin::FilterAbsoluteURI.new({
17
- 'url' => "http://id774.net/images/",
18
- },
19
- AutomaticSpec.generate_pipeline {
20
- feed {
21
- item "http://id774.net/images/link_1.jpg"
22
- item "link_2.jpg"
23
- item "link_3.JPG"
24
- item "http://id774.net/images/link_4.png"
25
- item "link_5.jpeg"
26
- item "http://id774.net/images/link_6.PNG"
27
- item "link_8.gif"
28
- item "http://id774.net/images/link_9.GIF"
29
- item "link_10.tiff"
30
- item "http://id774.net/images/link_11.TIFF"
31
- }})}
32
-
33
- describe "#run" do
34
- its(:run) { should have(1).feeds }
35
-
36
- specify {
37
- subject.run
38
- subject.instance_variable_get(:@return_feeds)[0].items[0].link.
39
- should == "http://id774.net/images/link_1.jpg"
40
- subject.instance_variable_get(:@return_feeds)[0].items[1].link.
41
- should == "http://id774.net/images/link_2.jpg"
42
- subject.instance_variable_get(:@return_feeds)[0].items[2].link.
43
- should == "http://id774.net/images/link_3.JPG"
44
- subject.instance_variable_get(:@return_feeds)[0].items[3].link.
45
- should == "http://id774.net/images/link_4.png"
46
- subject.instance_variable_get(:@return_feeds)[0].items[4].link.
47
- should == "http://id774.net/images/link_5.jpeg"
48
- subject.instance_variable_get(:@return_feeds)[0].items[5].link.
49
- should == "http://id774.net/images/link_6.PNG"
50
- subject.instance_variable_get(:@return_feeds)[0].items[6].link.
51
- should == "http://id774.net/images/link_8.gif"
52
- subject.instance_variable_get(:@return_feeds)[0].items[7].link.
53
- should == "http://id774.net/images/link_9.GIF"
54
- subject.instance_variable_get(:@return_feeds)[0].items[8].link.
55
- should == "http://id774.net/images/link_10.tiff"
56
- subject.instance_variable_get(:@return_feeds)[0].items[9].link.
57
- should == "http://id774.net/images/link_11.TIFF"
58
- }
59
- end
60
- end
61
- end
@@ -1,331 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Name:: Automatic::Plugin::Filter::Accept
3
- # Author:: soramugi <http://soramugi.net>
4
- # Created:: Jun 4, 2013
5
- # Updated:: Jun 4, 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/accept'
12
-
13
- describe Automatic::Plugin::FilterAccept do
14
-
15
- context "with contain by title" do
16
-
17
- subject {
18
- Automatic::Plugin::FilterAccept.new({
19
- 'title' => [""],
20
- },
21
- AutomaticSpec.generate_pipeline {
22
- feed { item "http://github.com", "foo" }
23
- feed { item "http://google.com", "hi" }
24
- })
25
- }
26
-
27
- describe "#run" do
28
- its(:run) { should have(2).feeds }
29
- end
30
- end
31
-
32
- context "with contain by title" do
33
- subject {
34
- Automatic::Plugin::FilterAccept.new({
35
- 'title' => ["foo"],
36
- },
37
- AutomaticSpec.generate_pipeline {
38
- feed { item "http://github.com", "foo" }
39
- feed { item "http://google.com", "hi" }
40
- feed { item "http://google.com", "hi" }
41
- })
42
- }
43
-
44
- describe "#run" do
45
- its(:run) { should have(1).feeds }
46
- end
47
- end
48
-
49
- context "with contain by title" do
50
- subject {
51
- Automatic::Plugin::FilterAccept.new({
52
- 'title' => ["o"],
53
- },
54
- AutomaticSpec.generate_pipeline {
55
- feed { item "http://github.com", "foo" }
56
- feed { item "http://google.com", "hi" }
57
- })
58
- }
59
-
60
- describe "#run" do
61
- its(:run) { should have(1).feeds }
62
- end
63
- end
64
-
65
- context "with contain by links" do
66
- subject {
67
- Automatic::Plugin::FilterAccept.new({
68
- 'link' => ["comment"],
69
- },
70
- AutomaticSpec.generate_pipeline {
71
- feed { item "http://github.com" }
72
- feed { item "http://google.com" }
73
- })
74
- }
75
-
76
- describe "#run" do
77
- its(:run) { should have(0).feeds }
78
- end
79
- end
80
-
81
- context "with contain by links" do
82
- subject {
83
- Automatic::Plugin::FilterAccept.new({
84
- 'link' => ["comment"],
85
- },
86
- AutomaticSpec.generate_pipeline {
87
- feed { item "http://github.com" }
88
- feed { item "http://google.com/comment" }
89
- })
90
- }
91
-
92
- describe "#run" do
93
- its(:run) { should have(1).feeds }
94
- end
95
- end
96
-
97
- context "with contain by links" do
98
- subject {
99
- Automatic::Plugin::FilterAccept.new({
100
- 'link' => ["hoge"],
101
- },
102
- AutomaticSpec.generate_pipeline {
103
- feed { item "http://github.com" }
104
- feed { item "http://google.com" }
105
- })
106
- }
107
-
108
- describe "#run" do
109
- its(:run) { should have(0).feeds }
110
- end
111
- end
112
-
113
- context "with contain by links" do
114
- subject {
115
- Automatic::Plugin::FilterAccept.new({
116
- 'link' => ["hoge"],
117
- },
118
- AutomaticSpec.generate_pipeline {
119
- feed { item "http://github.com/hoge" }
120
- feed { item "http://google.com" }
121
- })
122
- }
123
-
124
- describe "#run" do
125
- its(:run) { should have(1).feeds }
126
- end
127
- end
128
-
129
- context "with contain by links" do
130
- subject {
131
- Automatic::Plugin::FilterAccept.new({
132
- 'link' => ["github"],
133
- },
134
- AutomaticSpec.generate_pipeline {
135
- feed { item "http://github.com" }
136
- feed { item "http://google.com" }
137
- })
138
- }
139
-
140
- describe "#run" do
141
- its(:run) { should have(1).feeds }
142
- end
143
- end
144
-
145
- context "with contain by links" do
146
- subject {
147
- Automatic::Plugin::FilterAccept.new({
148
- 'link' => [""],
149
- },
150
- AutomaticSpec.generate_pipeline {
151
- feed { item "http://github.com" }
152
- feed { item "http://google.com" }
153
- })
154
- }
155
-
156
- describe "#run" do
157
- its(:run) { should have(2).feeds }
158
- end
159
- end
160
-
161
- context "with contain by description" do
162
- subject {
163
- Automatic::Plugin::FilterAccept.new({
164
- 'description' => ["comment"],
165
- },
166
- AutomaticSpec.generate_pipeline {
167
- feed { item "http://github.com" }
168
- feed { item "http://google.com" }
169
- })
170
- }
171
-
172
- describe "#run" do
173
- its(:run) { should have(0).feeds }
174
- end
175
- end
176
-
177
- context "with contain by description" do
178
- subject {
179
- Automatic::Plugin::FilterAccept.new({
180
- 'description' => [""],
181
- },
182
- AutomaticSpec.generate_pipeline {
183
- feed { item "http://github.com" }
184
- feed { item "http://google.com" }
185
- })
186
- }
187
-
188
- describe "#run" do
189
- its(:run) { should have(2).feeds }
190
- end
191
- end
192
-
193
- context "with contain by description" do
194
- subject {
195
- Automatic::Plugin::FilterAccept.new({
196
- 'description' => ["bbb"],
197
- },
198
- AutomaticSpec.generate_pipeline {
199
- # url, title, description, pubDate, author, source, enclosure
200
- feed {
201
- item "http://hogefuga.com", "",
202
- "aaabbbccc"
203
- }
204
- feed {
205
- item "http://aaabbbccc.com", "",
206
- "hogefugahoge"
207
- }
208
- feed {
209
- item "http://aaabbbccc.com", "",
210
- "aaaccc"
211
- }
212
- feed {
213
- item "http://aaaccc.com", "",
214
- "aaabbbccc"
215
- }
216
- }
217
- )}
218
-
219
- describe "#run" do
220
- its(:run) { should have(2).feeds }
221
- end
222
- end
223
-
224
- context "with contain by description" do
225
- subject {
226
- Automatic::Plugin::FilterAccept.new({
227
- 'description' => ["aaaa"],
228
- },
229
- AutomaticSpec.generate_pipeline {
230
- feed {
231
- item "http://hogefuga.com", "",
232
- "aaaabbbccc"
233
- }
234
- feed {
235
- item "http://aaaabbbccc.com", "",
236
- "hogefugahoge"
237
- }
238
- feed {
239
- item "http://aaabbbccc.com", "",
240
- "aaaaaaaaaacccdd"
241
- }
242
- feed {
243
- item "http://aaaaccc.com", "",
244
- "aabbbccc"
245
- }
246
- feed {
247
- item "http://aaaaccc.com", "",
248
- "aabbbcccdd"
249
- }
250
- }
251
- )}
252
-
253
- describe "#run" do
254
- its(:run) { should have(2).feeds }
255
- end
256
- end
257
-
258
- context "with item base contain by links" do
259
- subject {
260
- Automatic::Plugin::FilterAccept.new({
261
- 'link' => ["dddd"],
262
- },
263
- AutomaticSpec.generate_pipeline {
264
- feed {
265
- item "http://hogefuga.com", "",
266
- "aaaabbbccc"
267
- item "http://hogefuga.com", "",
268
- "aaaabbbcccdddd"
269
- }
270
- feed {
271
- item "http://aaaabbbccc.com", "",
272
- "hogefugahoge"
273
- }
274
- feed {
275
- item "http://aaabbbcccdddd.com", "",
276
- "aaaaaaaaaacccdd"
277
- }
278
- feed {
279
- item "http://aaaaccc.com", "",
280
- "aabbbccc"
281
- item "http://aabbcccdddd.com", "",
282
- "aabbbcccddd"
283
- }
284
- feed {
285
- item "http://cccdddd.com", "",
286
- "aabbbcccdd"
287
- }
288
- }
289
- )}
290
-
291
- describe "#run" do
292
- its(:run) { should have(3).feeds }
293
- end
294
- end
295
-
296
- context "with item base contain by description" do
297
- subject {
298
- Automatic::Plugin::FilterAccept.new({
299
- 'description' => ["aaaa"],
300
- },
301
- AutomaticSpec.generate_pipeline {
302
- feed {
303
- item "http://hogefuga.com", "",
304
- "aaaabbbccc"
305
- }
306
- feed {
307
- item "http://aaaabbbccc.com", "",
308
- "hogefugahoge"
309
- }
310
- feed {
311
- item "http://aaabbbccc.com", "",
312
- "aaaaaaaaaacccdd"
313
- }
314
- feed {
315
- item "http://aaccc.com", "",
316
- "aaaabbbccc"
317
- item "http://aabbccc.com", "",
318
- "aabbbccc"
319
- }
320
- feed {
321
- item "http://cccddd.com", "",
322
- "aabbbcccdd"
323
- }
324
- }
325
- )}
326
-
327
- describe "#run" do
328
- its(:run) { should have(3).feeds }
329
- end
330
- end
331
- end
@@ -1,49 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Name:: Automatic::Plugin::Filter::Clear
3
- # Author:: 774 <http://id774.net>
4
- # Created:: Oct 20, 2014
5
- # Updated:: Oct 20, 2014
6
- # Copyright:: Copyright (c) 2014 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/clear'
12
-
13
- describe Automatic::Plugin::FilterClear do
14
-
15
- context "should be cleared" do
16
- subject {
17
- Automatic::Plugin::FilterClear.new({
18
- },
19
- AutomaticSpec.generate_pipeline {
20
- feed {
21
- item "http://hogefuga.com", "",
22
- "aaaabbbccc"
23
- }
24
- feed {
25
- item "http://aaaabbbccc.com", "",
26
- "hogefugahoge"
27
- }
28
- feed {
29
- item "http://aaabbbccc.com", "",
30
- "aaaaaaaaaacccdd"
31
- }
32
- feed {
33
- item "http://aaccc.com", "",
34
- "aaaabbbccc"
35
- item "http://aabbccc.com", "",
36
- "aabbbccc"
37
- }
38
- feed {
39
- item "http://cccddd.com", "",
40
- "aabbbcccdd"
41
- }
42
- }
43
- )}
44
-
45
- describe "#run" do
46
- its(:run) { should have(0).feeds }
47
- end
48
- end
49
- end
@@ -1,138 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Name:: Automatic::Plugin::Filter::DescriptionLink
3
- # Author:: 774 <http://id774.net>
4
- # Created:: Oct 03, 2014
5
- # Updated:: Oct 03, 2014
6
- # Copyright:: Copyright (c) 2014 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/description_link'
12
-
13
- describe Automatic::Plugin::FilterDescriptionLink do
14
-
15
- context "It should be rewrite link based on the description" do
16
-
17
- subject {
18
- Automatic::Plugin::FilterDescriptionLink.new(
19
- {},
20
- AutomaticSpec.generate_pipeline {
21
- feed {
22
- item "http://test1.id774.net",
23
- "dummy title",
24
- "aaa bbb ccc http://test2.id774.net ddd eee",
25
- "Mon, 07 Mar 2011 15:54:11 +0900"
26
- }
27
- }
28
- )
29
- }
30
-
31
- describe "#run" do
32
- its(:run) { should have(1).feeds }
33
-
34
- specify {
35
- subject.run
36
- subject.instance_variable_get(:@pipeline)[0].items[0].link.
37
- should == "http://test2.id774.net"
38
- subject.instance_variable_get(:@pipeline)[0].items[0].description.
39
- should == "aaa bbb ccc http://test2.id774.net ddd eee"
40
- }
41
- end
42
- end
43
-
44
- context "It should be empty description if clear_description specified" do
45
-
46
- subject {
47
- Automatic::Plugin::FilterDescriptionLink.new({
48
- 'clear_description' => 1,
49
- },
50
- AutomaticSpec.generate_pipeline {
51
- feed {
52
- item "http://test1.id774.net",
53
- "dummy title",
54
- "aaa bbb ccc http://test2.id774.net ddd eee",
55
- "Mon, 07 Mar 2011 15:54:11 +0900"
56
- }
57
- }
58
- )
59
- }
60
-
61
- describe "#run" do
62
- its(:run) { should have(1).feeds }
63
-
64
- specify {
65
- subject.run
66
- subject.instance_variable_get(:@pipeline)[0].items[0].link.
67
- should == "http://test2.id774.net"
68
- subject.instance_variable_get(:@pipeline)[0].items[0].description.
69
- should == ""
70
- }
71
- end
72
- end
73
-
74
- context "It should be got title if get_title specified" do
75
-
76
- subject {
77
- Automatic::Plugin::FilterDescriptionLink.new({
78
- 'get_title' => 1,
79
- },
80
- AutomaticSpec.generate_pipeline {
81
- feed {
82
- item "http://test1.id774.net",
83
- "dummy title",
84
- "aaa bbb ccc http://blog.id774.net/post/2014/10/01/531/ ddd eee",
85
- "Mon, 07 Mar 2011 15:54:11 +0900"
86
- }
87
- }
88
- )
89
- }
90
-
91
- describe "#run" do
92
- its(:run) { should have(1).feeds }
93
-
94
- specify {
95
- subject.run
96
- subject.instance_variable_get(:@pipeline)[0].items[0].link.
97
- should == "http://blog.id774.net/post/2014/10/01/531/"
98
- subject.instance_variable_get(:@pipeline)[0].items[0].title.
99
- should == "二穂様は俺の嫁 | 774::Blog"
100
- subject.instance_variable_get(:@pipeline)[0].items[0].description.
101
- should == "aaa bbb ccc http://blog.id774.net/post/2014/10/01/531/ ddd eee"
102
- }
103
- end
104
- end
105
-
106
- context "It should be handling error if 404 Not Found" do
107
-
108
- subject {
109
- Automatic::Plugin::FilterDescriptionLink.new({
110
- 'get_title' => 1,
111
- },
112
- AutomaticSpec.generate_pipeline {
113
- feed {
114
- item "http://test1.id774.net",
115
- "dummy title",
116
- "aaa bbb ccc http://blog.id774.net/post/2014/10/01/532/ ddd eee",
117
- "Mon, 07 Mar 2011 15:54:11 +0900"
118
- }
119
- }
120
- )
121
- }
122
-
123
- describe "#run" do
124
- its(:run) { should have(1).feeds }
125
-
126
- specify {
127
- subject.run
128
- subject.instance_variable_get(:@pipeline)[0].items[0].link.
129
- should == "http://blog.id774.net/post/2014/10/01/532/"
130
- subject.instance_variable_get(:@pipeline)[0].items[0].title.
131
- should == "dummy title"
132
- subject.instance_variable_get(:@pipeline)[0].items[0].description.
133
- should == "aaa bbb ccc http://blog.id774.net/post/2014/10/01/532/ ddd eee"
134
- }
135
- end
136
- end
137
-
138
- end