automatic 14.12.2 → 26.08

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 (172) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +635 -83
  3. data/VERSION +1 -1
  4. data/automatic.gemspec +109 -248
  5. data/bin/automatic +20 -139
  6. data/config/feed2console.yml +10 -4
  7. data/config/feed2markdown.yml +41 -0
  8. data/doc/AI_TUTORIAL.md +518 -0
  9. data/doc/BASIC_DESIGN.md +516 -0
  10. data/doc/COPYING.LESSER +165 -0
  11. data/doc/DEPLOYMENT.md +824 -0
  12. data/doc/LICENSE.md +14 -0
  13. data/doc/PLUGINS.md +1875 -0
  14. data/doc/PLUGIN_DEVELOPMENT.md +86 -0
  15. data/doc/POLICY.md +857 -0
  16. data/doc/QUICKSTART.md +256 -0
  17. data/doc/RELEASING.md +381 -0
  18. data/doc/REQUIREMENTS.md +526 -0
  19. data/doc/VERSIONS +208 -0
  20. data/lib/automatic/cli.rb +248 -0
  21. data/lib/automatic/environment.rb +31 -5
  22. data/lib/automatic/feed_maker.rb +10 -9
  23. data/lib/automatic/feed_parser.rb +51 -35
  24. data/lib/automatic/http.rb +107 -0
  25. data/lib/automatic/log.rb +49 -18
  26. data/lib/automatic/opml.rb +3 -1
  27. data/lib/automatic/pipeline.rb +63 -32
  28. data/lib/automatic/recipe.rb +56 -17
  29. data/lib/automatic/version.rb +14 -1
  30. data/lib/automatic.rb +78 -20
  31. data/plugins/custom_feed/svn_log.rb +73 -32
  32. data/plugins/custom_feed/web.rb +348 -0
  33. data/plugins/filter/absolute_uri.rb +43 -27
  34. data/plugins/filter/accept.rb +38 -45
  35. data/plugins/filter/claude.rb +217 -0
  36. data/plugins/filter/clear.rb +12 -8
  37. data/plugins/filter/description_link.rb +49 -51
  38. data/plugins/filter/full_feed.rb +158 -52
  39. data/plugins/filter/gemini.rb +216 -0
  40. data/plugins/filter/github_feed.rb +38 -26
  41. data/plugins/filter/ignore.rb +33 -44
  42. data/plugins/filter/image.rb +36 -25
  43. data/plugins/filter/image_source.rb +58 -52
  44. data/plugins/filter/join.rb +107 -0
  45. data/plugins/filter/one.rb +19 -26
  46. data/plugins/filter/open_ai.rb +198 -0
  47. data/plugins/filter/rand.rb +16 -17
  48. data/plugins/filter/sakura_ai.rb +205 -0
  49. data/plugins/filter/sanitize.rb +29 -34
  50. data/plugins/filter/sort.rb +20 -27
  51. data/plugins/filter/tumblr_resize.rb +31 -23
  52. data/plugins/notify/ikachan.rb +86 -48
  53. data/plugins/provide/fluentd.rb +43 -24
  54. data/plugins/publish/amazon_s3.rb +73 -40
  55. data/plugins/publish/console.rb +19 -16
  56. data/plugins/publish/console_link.rb +20 -17
  57. data/plugins/publish/eject.rb +48 -26
  58. data/plugins/publish/fluentd.rb +50 -30
  59. data/plugins/publish/hatena_bookmark.rb +88 -71
  60. data/plugins/publish/instapaper.rb +69 -59
  61. data/plugins/publish/markdown.rb +278 -0
  62. data/plugins/publish/memcached.rb +35 -29
  63. data/plugins/store/database.rb +50 -48
  64. data/plugins/store/digest.rb +212 -0
  65. data/plugins/store/file.rb +99 -68
  66. data/plugins/store/full_text.rb +32 -25
  67. data/plugins/store/permalink.rb +18 -22
  68. data/plugins/subscription/feed.rb +34 -21
  69. data/plugins/subscription/link.rb +31 -32
  70. data/plugins/subscription/text.rb +32 -46
  71. data/plugins/subscription/tumblr.rb +55 -44
  72. data/plugins/subscription/xml.rb +40 -36
  73. metadata +108 -321
  74. data/Gemfile +0 -38
  75. data/Rakefile +0 -59
  76. data/doc/ChangeLog +0 -303
  77. data/doc/PLUGINS +0 -750
  78. data/doc/PLUGINS.ja +0 -753
  79. data/doc/README +0 -511
  80. data/doc/README.ja +0 -519
  81. data/plugins/filter/google_news.rb +0 -50
  82. data/plugins/publish/google_calendar.rb +0 -84
  83. data/plugins/publish/hipchat.rb +0 -46
  84. data/plugins/publish/pocket.rb +0 -45
  85. data/plugins/publish/twitter.rb +0 -58
  86. data/plugins/subscription/chan_toru.rb +0 -57
  87. data/plugins/subscription/g_guide.rb +0 -57
  88. data/plugins/subscription/pocket.rb +0 -51
  89. data/plugins/subscription/twitter.rb +0 -69
  90. data/plugins/subscription/twitter_search.rb +0 -50
  91. data/plugins/subscription/weather.rb +0 -33
  92. data/script/build +0 -84
  93. data/spec/fixtures/sampleFeeds.tsv +0 -1
  94. data/spec/fixtures/sampleFeeds2.tsv +0 -2
  95. data/spec/fixtures/sampleRecipe.yml +0 -24
  96. data/spec/lib/automatic/log_spec.rb +0 -32
  97. data/spec/lib/automatic/pipeline_spec.rb +0 -68
  98. data/spec/lib/automatic/recipe_spec.rb +0 -40
  99. data/spec/lib/automatic_spec.rb +0 -99
  100. data/spec/plugins/custom_feed/svn_log_spec.rb +0 -31
  101. data/spec/plugins/filter/absolute_uri_spec.rb +0 -61
  102. data/spec/plugins/filter/accept_spec.rb +0 -331
  103. data/spec/plugins/filter/clear_spec.rb +0 -49
  104. data/spec/plugins/filter/description_link_spec.rb +0 -138
  105. data/spec/plugins/filter/full_feed_spec.rb +0 -129
  106. data/spec/plugins/filter/github_feed_spec.rb +0 -55
  107. data/spec/plugins/filter/google_news_spec.rb +0 -69
  108. data/spec/plugins/filter/ignore_spec.rb +0 -328
  109. data/spec/plugins/filter/image_source_spec.rb +0 -89
  110. data/spec/plugins/filter/image_spec.rb +0 -65
  111. data/spec/plugins/filter/one_spec.rb +0 -71
  112. data/spec/plugins/filter/rand_spec.rb +0 -52
  113. data/spec/plugins/filter/sanitize_spec.rb +0 -153
  114. data/spec/plugins/filter/sort_spec.rb +0 -189
  115. data/spec/plugins/filter/tumblr_resize_spec.rb +0 -109
  116. data/spec/plugins/notify/ikachan_spec.rb +0 -58
  117. data/spec/plugins/provide/fluentd_spec.rb +0 -49
  118. data/spec/plugins/publish/amazon_s3_spec.rb +0 -40
  119. data/spec/plugins/publish/console_spec.rb +0 -30
  120. data/spec/plugins/publish/eject_spec.rb +0 -40
  121. data/spec/plugins/publish/fluentd_spec.rb +0 -40
  122. data/spec/plugins/publish/google_calendar_spec.rb +0 -83
  123. data/spec/plugins/publish/hatena_bookmark_spec.rb +0 -134
  124. data/spec/plugins/publish/hipchat_spec.rb +0 -69
  125. data/spec/plugins/publish/instapaper_spec.rb +0 -82
  126. data/spec/plugins/publish/memcached_spec.rb +0 -63
  127. data/spec/plugins/publish/pocket_spec.rb +0 -51
  128. data/spec/plugins/publish/twitter_spec.rb +0 -73
  129. data/spec/plugins/store/file_spec.rb +0 -58
  130. data/spec/plugins/store/full_text_spec.rb +0 -152
  131. data/spec/plugins/store/permalink_spec.rb +0 -206
  132. data/spec/plugins/subscription/chan_toru_spec.rb +0 -56
  133. data/spec/plugins/subscription/feed_spec.rb +0 -71
  134. data/spec/plugins/subscription/g_guide_spec.rb +0 -82
  135. data/spec/plugins/subscription/link_spec.rb +0 -72
  136. data/spec/plugins/subscription/pocket_spec.rb +0 -57
  137. data/spec/plugins/subscription/text_spec.rb +0 -84
  138. data/spec/plugins/subscription/tumblr_spec.rb +0 -74
  139. data/spec/plugins/subscription/twitter_search_spec.rb +0 -57
  140. data/spec/plugins/subscription/twitter_spec.rb +0 -73
  141. data/spec/plugins/subscription/weather_spec.rb +0 -44
  142. data/spec/plugins/subscription/xml_spec.rb +0 -84
  143. data/spec/spec_helper.rb +0 -106
  144. data/spec/user_dir/plugins/store/mock.rb +0 -16
  145. data/test/fixtures/sampleOPML.xml +0 -11
  146. data/test/integration/test_absoluteurl.yml +0 -25
  147. data/test/integration/test_activerecord.yml +0 -24
  148. data/test/integration/test_add_pocket.yml +0 -26
  149. data/test/integration/test_chan_toru.yml +0 -21
  150. data/test/integration/test_descriptionlink.yml +0 -21
  151. data/test/integration/test_fluentd.yml +0 -22
  152. data/test/integration/test_fulltext.yml +0 -30
  153. data/test/integration/test_google_news.yml +0 -21
  154. data/test/integration/test_googlealert.yml +0 -21
  155. data/test/integration/test_hatenabookmark.yml +0 -30
  156. data/test/integration/test_ignore.yml +0 -25
  157. data/test/integration/test_ignore2.yml +0 -22
  158. data/test/integration/test_image2local.yml +0 -33
  159. data/test/integration/test_instapaper.yml +0 -26
  160. data/test/integration/test_link2local.yml +0 -34
  161. data/test/integration/test_one.yml +0 -23
  162. data/test/integration/test_pocket.yml +0 -22
  163. data/test/integration/test_rand.yml +0 -21
  164. data/test/integration/test_sanitize.yml +0 -23
  165. data/test/integration/test_sort.yml +0 -36
  166. data/test/integration/test_svnlog.yml +0 -15
  167. data/test/integration/test_text2feed.yml +0 -36
  168. data/test/integration/test_tumblr2local.yml +0 -43
  169. data/test/integration/test_twitter_search.yml +0 -22
  170. data/test/integration/test_weather.yml +0 -19
  171. data/test/integration/test_xml2fluentd.yml +0 -21
  172. data/vendor/.gitkeep +0 -0
@@ -1,65 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Name:: Automatic::Plugin::Filter::Image
3
- # Author:: 774 <http://id774.net>
4
- # Created:: Sep 18, 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/image'
12
-
13
- describe Automatic::Plugin::FilterImage do
14
- context "with feed contain link tag" do
15
- subject {
16
- Automatic::Plugin::FilterImage.new({},
17
- AutomaticSpec.generate_pipeline {
18
- feed {
19
- item "http://id774.net/images/link_1.jpg"
20
- item "http://id774.net/images/link_2.jpg"
21
- item "http://id774.net/images/link_3.JPG"
22
- item "http://id774.net/images/link_4.png"
23
- item "http://id774.net/images/link_5.jpeg"
24
- item "http://id774.net/images/link_6.PNG"
25
- item "http://id774.net/images/link_7.jpega"
26
- item "http://id774.net/images/link_8.gif"
27
- item "http://id774.net/images/link_9.GIF"
28
- item "http://id774.net/images/link_10.tiff"
29
- item nil
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 be_nil
52
- subject.instance_variable_get(:@return_feeds)[0].items[7].link.
53
- should == "http://id774.net/images/link_8.gif"
54
- subject.instance_variable_get(:@return_feeds)[0].items[8].link.
55
- should == "http://id774.net/images/link_9.GIF"
56
- subject.instance_variable_get(:@return_feeds)[0].items[9].link.
57
- should == "http://id774.net/images/link_10.tiff"
58
- subject.instance_variable_get(:@return_feeds)[0].items[10].link.
59
- should be_nil
60
- subject.instance_variable_get(:@return_feeds)[0].items[11].link.
61
- should == "http://id774.net/images/link_11.TIFF"
62
- }
63
- end
64
- end
65
- end
@@ -1,71 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Name:: Automatic::Plugin::Filter::One
3
- # Author:: soramugi <http://soramugi.net>
4
- # Created:: May 8, 2013
5
- # Updated:: May 8, 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/one'
12
-
13
- describe Automatic::Plugin::FilterOne do
14
- context "It should be one" do
15
- subject {
16
- Automatic::Plugin::FilterOne.new(
17
- {},
18
- AutomaticSpec.generate_pipeline {
19
- feed {
20
- item "http://aaa.png"
21
- item "http://bbb.png"
22
- item "http://ccc.png"
23
- item "http://ddd.png"
24
- }
25
- }
26
- )
27
- }
28
-
29
- describe "#run" do
30
- its(:run) { should have(1).feeds }
31
-
32
- specify {
33
- subject.run
34
- subject.instance_variable_get(:@return_feeds)[0].items.
35
- count.should == 1
36
- subject.instance_variable_get(:@return_feeds)[0].items[0].link.
37
- should == 'http://aaa.png'
38
- }
39
- end
40
- end
41
-
42
- context "It should be one last" do
43
- subject {
44
- Automatic::Plugin::FilterOne.new(
45
- {
46
- 'pick' => "last"
47
- },
48
- AutomaticSpec.generate_pipeline {
49
- feed {
50
- item "http://aaa.png"
51
- item "http://bbb.png"
52
- item "http://ccc.png"
53
- item "http://ddd.png"
54
- }
55
- }
56
- )
57
- }
58
-
59
- describe "#run" do
60
- its(:run) { should have(1).feeds }
61
-
62
- specify {
63
- subject.run
64
- subject.instance_variable_get(:@return_feeds)[0].items.
65
- count.should == 1
66
- subject.instance_variable_get(:@return_feeds)[0].items[0].link.
67
- should == 'http://ddd.png'
68
- }
69
- end
70
- end
71
- end
@@ -1,52 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Name:: Automatic::Plugin::Filter::Rand
3
- # Author:: soramugi <http://soramugi.net>
4
- # 774 <http://id774.net>
5
- # Created:: May 6, 2013
6
- # Updated:: Mar 7, 2013
7
- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
8
- # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
9
-
10
- require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
11
-
12
- require 'filter/rand'
13
-
14
- describe Automatic::Plugin::FilterRand do
15
- context "It should be rand" do
16
- subject {
17
- Automatic::Plugin::FilterRand.new(
18
- {},
19
- AutomaticSpec.generate_pipeline {
20
- feed {
21
- item "http://aaa.png"
22
- item "http://bbb.png"
23
- item "http://ccc.png"
24
- item "http://ddd.png"
25
- }
26
- }
27
- )
28
- }
29
-
30
- describe "#run" do
31
- its(:run) { should have(1).feeds }
32
-
33
- specify {
34
- subject.run
35
- link0 = subject.instance_variable_get(:@return_feeds)[0].items[0].link
36
- link1 = subject.instance_variable_get(:@return_feeds)[0].items[1].link
37
- link2 = subject.instance_variable_get(:@return_feeds)[0].items[2].link
38
- link3 = subject.instance_variable_get(:@return_feeds)[0].items[3].link
39
- if link0 != "http://aaa.png"
40
- link0.should_not == "http://aaa.png"
41
- elsif link1 != "http://bbb.png"
42
- link1.should_not == "http://bbb.png"
43
- elsif link2 != "http://ccc.png"
44
- link2.should_not == "http://ccc.png"
45
- else
46
- pending("Plugin returns the origin feed.")
47
- link3.should == "http://ddd.png"
48
- end
49
- }
50
- end
51
- end
52
- end
@@ -1,153 +0,0 @@
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
@@ -1,189 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Name:: Automatic::Plugin::Filter::Sort
3
- # Author:: 774 <http://id774.net>
4
- # Created:: Mar 23, 2012
5
- # Updated:: Jan 23, 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/sort'
12
-
13
- describe Automatic::Plugin::FilterSort do
14
- context "It should be asc sorted" do
15
- subject {
16
- Automatic::Plugin::FilterSort.new(
17
- {
18
- 'sort' => "asc"
19
- },
20
- AutomaticSpec.generate_pipeline {
21
- feed {
22
- item "http://aaa.png", "",
23
- "<img src=\"http://aaa.png\">",
24
- "Fri, 23 Mar 2012 00:10:00 +0000"
25
- item "http://bbb.png", "",
26
- "<img src=\"http://bbb.png\">",
27
- "Sun, 25 Mar 2012 01:05:00 +0000"
28
- item "http://ccc.png", "",
29
- "<img src=\"http://ccc.png\">",
30
- "Thu, 22 Mar 2012 00:15:00 +0000"
31
- item "http://ddd.png", "",
32
- "<img src=\"http://ddd.png\">",
33
- "Fri, 23 Mar 2012 00:00:08 +0000"
34
- item "http://eee.png", "",
35
- "<img src=\"http://eee.png\">",
36
- "Fri, 23 Nov 2012 00:09:00 +0000"
37
- }})}
38
-
39
- describe "#run" do
40
- its(:run) { should have(1).feeds }
41
-
42
- specify {
43
- subject.run
44
- subject.instance_variable_get(:@pipeline)[0].items[0].link.
45
- should == "http://ccc.png"
46
- subject.instance_variable_get(:@pipeline)[0].items[1].link.
47
- should == "http://ddd.png"
48
- subject.instance_variable_get(:@pipeline)[0].items[2].link.
49
- should == "http://aaa.png"
50
- subject.instance_variable_get(:@pipeline)[0].items[3].link.
51
- should == "http://bbb.png"
52
- subject.instance_variable_get(:@pipeline)[0].items[4].link.
53
- should == "http://eee.png"
54
- }
55
- end
56
- end
57
-
58
- context "It should be asc sorted" do
59
- subject {
60
- Automatic::Plugin::FilterSort.new(
61
- {
62
- 'sort' => "asc"
63
- },
64
- AutomaticSpec.generate_pipeline {
65
- feed {
66
- item "http://aaa.png", "",
67
- "<img src=\"http://aaa.png\">",
68
- "Sat, 24 Mar 2012 01:15:00 +0000"
69
- item "http://bbb.png", "",
70
- "<img src=\"http://bbb.png\">",
71
- "Thu, 22 Mar 2012 02:05:00 +0000"
72
- item "http://ccc.png", "",
73
- "<img src=\"http://ccc.png\">",
74
- "Fri, 23 Mar 2012 02:00:00 +0000"
75
- item "http://ddd.png", "",
76
- "<img src=\"http://ddd.png\">",
77
- "Fri, 23 Mar 2012 01:40:00 +0000"
78
- item "http://eee.png", "",
79
- "<img src=\"http://eee.png\">",
80
- "Fri, 23 Nov 2012 00:00:35 +0000"
81
- }})}
82
-
83
- describe "#run" do
84
- its(:run) { should have(1).feeds }
85
-
86
- specify {
87
- subject.run
88
- subject.instance_variable_get(:@pipeline)[0].items[0].link.
89
- should == "http://bbb.png"
90
- subject.instance_variable_get(:@pipeline)[0].items[1].link.
91
- should == "http://ddd.png"
92
- subject.instance_variable_get(:@pipeline)[0].items[2].link.
93
- should == "http://ccc.png"
94
- subject.instance_variable_get(:@pipeline)[0].items[3].link.
95
- should == "http://aaa.png"
96
- subject.instance_variable_get(:@pipeline)[0].items[4].link.
97
- should == "http://eee.png"
98
- }
99
- end
100
- end
101
-
102
- context "It should be desc sorted" do
103
- subject {
104
- Automatic::Plugin::FilterSort.new(
105
- {
106
- 'sort' => "desc"
107
- },
108
- AutomaticSpec.generate_pipeline {
109
- feed {
110
- item "http://aaa.png", "",
111
- "<img src=\"http://aaa.png\">",
112
- "Fri, 23 Mar 2012 00:10:00 +0000"
113
- item "http://bbb.png", "",
114
- "<img src=\"http://bbb.png\">",
115
- "Sun, 25 Mar 2012 01:05:00 +0000"
116
- item "http://ccc.png", "",
117
- "<img src=\"http://ccc.png\">",
118
- "Thu, 22 Mar 2012 00:15:00 +0000"
119
- item "http://ddd.png", "",
120
- "<img src=\"http://ddd.png\">",
121
- "Fri, 23 Mar 2012 00:00:08 +0000"
122
- item "http://eee.png", "",
123
- "<img src=\"http://eee.png\">",
124
- "Fri, 23 Nov 2012 00:09:00 +0000"
125
- }})}
126
-
127
- describe "#run" do
128
- its(:run) { should have(1).feeds }
129
-
130
- specify {
131
- subject.run
132
- subject.instance_variable_get(:@pipeline)[0].items[4].link.
133
- should == "http://ccc.png"
134
- subject.instance_variable_get(:@pipeline)[0].items[3].link.
135
- should == "http://ddd.png"
136
- subject.instance_variable_get(:@pipeline)[0].items[2].link.
137
- should == "http://aaa.png"
138
- subject.instance_variable_get(:@pipeline)[0].items[1].link.
139
- should == "http://bbb.png"
140
- subject.instance_variable_get(:@pipeline)[0].items[0].link.
141
- should == "http://eee.png"
142
- }
143
- end
144
- end
145
-
146
- context "It should be desc sorted" do
147
- subject {
148
- Automatic::Plugin::FilterSort.new(
149
- {
150
- 'sort' => "desc"
151
- },
152
- AutomaticSpec.generate_pipeline {
153
- feed {
154
- item "http://aaa.png", "",
155
- "<img src=\"http://aaa.png\">",
156
- "Sat, 24 Mar 2012 01:15:00 +0000"
157
- item "http://bbb.png", "",
158
- "<img src=\"http://bbb.png\">",
159
- "Thu, 22 Mar 2012 02:05:00 +0000"
160
- item "http://ccc.png", "",
161
- "<img src=\"http://ccc.png\">",
162
- "Fri, 23 Mar 2012 02:00:00 +0000"
163
- item "http://ddd.png", "",
164
- "<img src=\"http://ddd.png\">",
165
- "Fri, 23 Mar 2012 01:40:00 +0000"
166
- item "http://eee.png", "",
167
- "<img src=\"http://eee.png\">",
168
- "Fri, 23 Nov 2012 00:00:35 +0000"
169
- }})}
170
-
171
- describe "#run" do
172
- its(:run) { should have(1).feeds }
173
-
174
- specify {
175
- subject.run
176
- subject.instance_variable_get(:@pipeline)[0].items[4].link.
177
- should == "http://bbb.png"
178
- subject.instance_variable_get(:@pipeline)[0].items[3].link.
179
- should == "http://ddd.png"
180
- subject.instance_variable_get(:@pipeline)[0].items[2].link.
181
- should == "http://ccc.png"
182
- subject.instance_variable_get(:@pipeline)[0].items[1].link.
183
- should == "http://aaa.png"
184
- subject.instance_variable_get(:@pipeline)[0].items[0].link.
185
- should == "http://eee.png"
186
- }
187
- end
188
- end
189
- end
@@ -1,109 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Name:: Automatic::Plugin::Filter::TumblrResize
3
- # Author:: 774 <http://id774.net>
4
- # Updated:: Jun 14, 2012
5
- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
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 'filter/tumblr_resize'
11
-
12
- describe Automatic::Plugin::FilterTumblrResize do
13
- context "with description with filename of tumblr should be renamed 500 to 1280" do
14
- subject {
15
- Automatic::Plugin::FilterTumblrResize.new({},
16
- AutomaticSpec.generate_pipeline {
17
- feed {
18
- item "http://27.media.tumblr.com/tumblr_lzrubkfPlt1qb8vzto1_500.png"
19
- item "http://24.media.tumblr.com/tumblr_m07wttnIdy1qzoj1jo1_400.jpg"
20
- item "http://28.media.tumblr.com/tumblr_m07wtaxxSa1qzoj1jo1_450.jpg"
21
- item "http://29.media.tumblr.com/tumblr_m07wrcDBBF1qzoj1jo1_500.jpg"
22
- }})}
23
-
24
- describe "#run" do
25
- its(:run) { should have(1).feeds }
26
-
27
- specify {
28
- subject.run
29
- subject.instance_variable_get(:@pipeline)[0].items[0].link.
30
- should == "http://27.media.tumblr.com/tumblr_lzrubkfPlt1qb8vzto1_1280.png"
31
- subject.instance_variable_get(:@pipeline)[0].items[1].link.
32
- should == "http://24.media.tumblr.com/tumblr_m07wttnIdy1qzoj1jo1_1280.jpg"
33
- subject.instance_variable_get(:@pipeline)[0].items[2].link.
34
- should == "http://28.media.tumblr.com/tumblr_m07wtaxxSa1qzoj1jo1_450.jpg"
35
- subject.instance_variable_get(:@pipeline)[0].items[3].link.
36
- should == "http://29.media.tumblr.com/tumblr_m07wrcDBBF1qzoj1jo1_1280.jpg"
37
- }
38
- end
39
- end
40
- end
41
-
42
- describe Automatic::Plugin::FilterTumblrResize do
43
- context "with description with filename of tumblr should be renamed 400 to 1280" do
44
- subject {
45
- Automatic::Plugin::FilterTumblrResize.new({},
46
- AutomaticSpec.generate_pipeline {
47
- feed {
48
- item "http://24.media.tumblr.com/tumblr_m07wttnIdy1qzoj1jo1_400.jpg"
49
- }})}
50
-
51
- describe "#run" do
52
- its(:run) { should have(1).feeds }
53
-
54
- specify {
55
- subject.run
56
- subject.instance_variable_get(:@pipeline)[0].items[0].link.
57
- should == "http://24.media.tumblr.com/tumblr_m07wttnIdy1qzoj1jo1_1280.jpg"
58
- }
59
- end
60
- end
61
- end
62
-
63
- describe Automatic::Plugin::FilterTumblrResize do
64
- context "with description with filename of tumblr should be renamed 250 to 1280" do
65
- subject {
66
- Automatic::Plugin::FilterTumblrResize.new({},
67
- AutomaticSpec.generate_pipeline {
68
- feed {
69
- item "http://28.media.tumblr.com/tumblr_m07wtaxxSa1qzoj1jo1_250.jpg"
70
- }})}
71
-
72
- describe "#run" do
73
- its(:run) { should have(1).feeds }
74
-
75
- specify {
76
- subject.run
77
- subject.instance_variable_get(:@pipeline)[0].items[0].link.
78
- should == "http://28.media.tumblr.com/tumblr_m07wtaxxSa1qzoj1jo1_1280.jpg"
79
- }
80
- end
81
- end
82
- end
83
-
84
- describe Automatic::Plugin::FilterTumblrResize do
85
- context "with description with filename of tumblr should be renamed 100 to 1280" do
86
- subject {
87
- Automatic::Plugin::FilterTumblrResize.new({},
88
- AutomaticSpec.generate_pipeline {
89
- feed {
90
- item "http://24.media.tumblr.com/tumblr_m07wt8BRWc1qzoj1jo1_100.jpg"
91
- item "http://25.media.tumblr.com/tumblr_m07wr8RnJ91qzoj1jo1_750.jpg"
92
- item "http://29.media.tumblr.com/tumblr_m07wrcDBBF1qzoj1jo1_75sq.jpg"
93
- }})}
94
-
95
- describe "#run" do
96
- its(:run) { should have(1).feeds }
97
-
98
- specify {
99
- subject.run
100
- subject.instance_variable_get(:@pipeline)[0].items[0].link.
101
- should == "http://24.media.tumblr.com/tumblr_m07wt8BRWc1qzoj1jo1_1280.jpg"
102
- subject.instance_variable_get(:@pipeline)[0].items[1].link.
103
- should == "http://25.media.tumblr.com/tumblr_m07wr8RnJ91qzoj1jo1_750.jpg"
104
- subject.instance_variable_get(:@pipeline)[0].items[2].link.
105
- should == "http://29.media.tumblr.com/tumblr_m07wrcDBBF1qzoj1jo1_1280.jpg"
106
- }
107
- end
108
- end
109
- end