automatic 12.4.0 → 12.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/Gemfile +1 -0
  2. data/README.md +8 -5
  3. data/Rakefile +1 -1
  4. data/VERSION +1 -1
  5. data/automatic.gemspec +32 -9
  6. data/bin/automatic +3 -3
  7. data/bin/automatic-config +34 -17
  8. data/config/feed2console.yml +1 -2
  9. data/config/html2console.yml +16 -0
  10. data/doc/ChangeLog +38 -3
  11. data/doc/PLUGINS +191 -14
  12. data/doc/PLUGINS.ja +187 -10
  13. data/doc/README +70 -42
  14. data/doc/README.ja +64 -58
  15. data/lib/automatic/opml.rb +2 -1
  16. data/lib/automatic/pipeline.rb +3 -3
  17. data/lib/automatic/recipe.rb +6 -1
  18. data/lib/automatic.rb +6 -6
  19. data/plugins/extract/link.rb +32 -0
  20. data/plugins/filter/ignore.rb +7 -16
  21. data/plugins/filter/image_link.rb +37 -0
  22. data/plugins/filter/{image.rb → image_source.rb} +6 -7
  23. data/plugins/filter/reverse.rb +3 -4
  24. data/plugins/filter/tumblr_resize.rb +3 -4
  25. data/plugins/notify/ikachan.rb +1 -2
  26. data/plugins/publish/console.rb +0 -1
  27. data/plugins/publish/dump.rb +24 -0
  28. data/plugins/publish/google_calendar.rb +0 -2
  29. data/plugins/publish/hatena_bookmark.rb +2 -3
  30. data/plugins/store/{store_database.rb → database.rb} +32 -7
  31. data/plugins/store/full_text.rb +5 -5
  32. data/plugins/store/link.rb +47 -0
  33. data/plugins/store/permalink.rb +7 -7
  34. data/plugins/store/target.rb +41 -0
  35. data/plugins/subscription/feed.rb +0 -1
  36. data/plugins/subscription/uri.rb +31 -0
  37. data/script/build +18 -4
  38. data/spec/fixtures/extractLink.html +14 -0
  39. data/spec/fixtures/filterImageLink.html +34 -0
  40. data/spec/fixtures/publishDump.html +14 -0
  41. data/{config/default.yml → spec/fixtures/sampleRecipe.yml} +8 -10
  42. data/spec/fixtures/storeLink.html +34 -0
  43. data/spec/fixtures/storeLink2.html +36 -0
  44. data/spec/fixtures/storeTarget.html +11 -0
  45. data/spec/fixtures/storeTarget2.html +11 -0
  46. data/spec/lib/automatic/pipeline_spec.rb +27 -14
  47. data/spec/lib/automatic/recipe_spec.rb +35 -0
  48. data/spec/lib/automatic_spec.rb +21 -14
  49. data/spec/plugins/extract/link_spec.rb +38 -0
  50. data/spec/plugins/filter/ignore_spec.rb +59 -3
  51. data/spec/plugins/filter/image_link_spec.rb +51 -0
  52. data/spec/plugins/filter/{image_spec.rb → image_source_spec.rb} +29 -9
  53. data/spec/plugins/filter/reverse_spec.rb +0 -1
  54. data/spec/plugins/filter/tumblr_resize_spec.rb +7 -0
  55. data/spec/plugins/publish/console_spec.rb +9 -2
  56. data/spec/plugins/publish/dump_spec.rb +32 -0
  57. data/spec/plugins/publish/google_calendar_spec.rb +2 -1
  58. data/spec/plugins/publish/hatena_bookmark_spec.rb +2 -1
  59. data/spec/plugins/publish/mail_spec.rb +9 -1
  60. data/spec/plugins/publish/smtp_spec.rb +9 -1
  61. data/spec/plugins/store/full_text_spec.rb +15 -5
  62. data/spec/plugins/store/link_spec.rb +47 -0
  63. data/spec/plugins/store/permalink_spec.rb +9 -2
  64. data/spec/plugins/store/target_link_spec.rb +17 -3
  65. data/spec/plugins/store/target_spec.rb +41 -0
  66. data/spec/plugins/subscription/feed_spec.rb +14 -4
  67. data/spec/plugins/subscription/uri_spec.rb +43 -0
  68. data/spec/spec_helper.rb +31 -8
  69. data/spec/user_dir/plugins/store/mock.rb +4 -0
  70. data/test/integration/test_activerecord.yml +1 -1
  71. data/test/integration/test_fulltext.yml +1 -1
  72. data/test/integration/test_get_image.yml +26 -0
  73. data/test/integration/test_hatenabookmark.yml +1 -1
  74. data/test/integration/test_ignore.yml +1 -1
  75. data/test/integration/test_ignore2.yml +1 -1
  76. data/test/integration/test_image2local.yml +1 -1
  77. data/test/integration/test_reverse.yml +1 -1
  78. data/test/integration/test_tumblr2local.yml +1 -1
  79. metadata +45 -9
  80. data/spec/lib/pipeline_spec.rb +0 -67
  81. data/test/integration/test_mail.yml +0 -21
@@ -0,0 +1,47 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Name:: Automatic::Plugin::Store::Link
3
+ # Author:: 774 <http://id774.net>
4
+ # Created:: Jun 13, 2012
5
+ # Updated:: Jun 13, 2012
6
+ # Copyright:: 774 Copyright (c) 2012
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 'store/link'
12
+
13
+ require 'pathname'
14
+
15
+ describe Automatic::Plugin::StoreLink do
16
+ before do
17
+ @db_filename = "test_link.db"
18
+ db_path = Pathname(AutomaticSpec.db_dir).cleanpath+"#{@db_filename}"
19
+ db_path.delete if db_path.exist?
20
+ Automatic::Plugin::StoreLink.new({"db" => @db_filename}).run
21
+ end
22
+
23
+ it "should store 14 record for the new link" do
24
+ instance = Automatic::Plugin::StoreLink.new({"db" => @db_filename},
25
+ AutomaticSpec.generate_pipeline {
26
+ link "storeLink.html"
27
+ }
28
+ )
29
+
30
+ lambda {
31
+ instance.run.should have(14).items
32
+ }.should change(Automatic::Plugin::Link, :count).by(14)
33
+ end
34
+
35
+ it "should not store record for the existent link" do
36
+ instance = Automatic::Plugin::StoreLink.new({"db" => @db_filename},
37
+ AutomaticSpec.generate_pipeline {
38
+ link "storeLink2.html"
39
+ }
40
+ )
41
+
42
+ instance.run.should have(15).items
43
+ lambda {
44
+ instance.run.should have(0).items
45
+ }.should change(Automatic::Plugin::Link, :count).by(0)
46
+ end
47
+ end
@@ -1,3 +1,9 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Name:: Automatic::Plugin::Store::Link
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.
1
7
 
2
8
  require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
3
9
 
@@ -18,7 +24,7 @@ describe Automatic::Plugin::StorePermalink do
18
24
  AutomaticSpec.generate_pipeline {
19
25
  feed { item "http://github.com" }
20
26
  })
21
-
27
+
22
28
  lambda {
23
29
  instance.run.should have(1).feed
24
30
  }.should change(Automatic::Plugin::Permalink, :count).by(1)
@@ -28,7 +34,8 @@ describe Automatic::Plugin::StorePermalink do
28
34
  instance = Automatic::Plugin::StorePermalink.new({"db" => @db_filename},
29
35
  AutomaticSpec.generate_pipeline {
30
36
  feed { item "http://github.com" }
31
- })
37
+ }
38
+ )
32
39
 
33
40
  instance.run.should have(1).feed
34
41
  lambda {
@@ -1,8 +1,9 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Name:: Automatic::Plugin::CustomFeed::SVNFLog
3
3
  # Author:: kzgs
4
+ # 774 <http://id774.net>
4
5
  # Created:: Mar 4, 2012
5
- # Updated:: Mar 4, 2012
6
+ # Updated:: Jun 14, 2012
6
7
  # Copyright:: kzgs Copyright (c) 2012
7
8
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
9
 
@@ -20,10 +21,23 @@ describe Automatic::Plugin::StoreTargetLink do
20
21
  { "path" => dir },
21
22
  AutomaticSpec.generate_pipeline {
22
23
  feed { item "http://digithoughts.com/rss" }
23
- })
24
-
24
+ }
25
+ )
25
26
  instance.run.should have(1).feed
26
27
  (Pathname(dir)+"rss").should be_exist
27
28
  end
28
29
  end
30
+
31
+ it "should error during file download" do
32
+ Dir.mktmpdir do |dir|
33
+ instance = Automatic::Plugin::StoreTargetLink.new(
34
+ { "path" => dir },
35
+ AutomaticSpec.generate_pipeline {
36
+ feed { item "aaa" }
37
+ }
38
+ )
39
+ instance.run.should have(1).feed
40
+ end
41
+ end
42
+
29
43
  end
@@ -0,0 +1,41 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Name:: Automatic::Plugin::Store::Target
3
+ # Author:: 774 <http://id774.net>
4
+ # Created:: Jun 13, 2012
5
+ # Updated:: Jun 14, 2012
6
+ # Copyright:: 774 Copyright (c) 2012
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 'store/target'
12
+
13
+ require 'tmpdir'
14
+ require 'pathname'
15
+
16
+ describe Automatic::Plugin::StoreTarget do
17
+ it "should store the target link" do
18
+ Dir.mktmpdir do |dir|
19
+ instance = Automatic::Plugin::StoreTarget.new(
20
+ { "path" => dir },
21
+ AutomaticSpec.generate_pipeline {
22
+ link "storeTarget.html"
23
+ }
24
+ )
25
+ instance.run.should have(1).item
26
+ (Pathname(dir)+"Eila_omote.jpg").should be_exist
27
+ end
28
+ end
29
+
30
+ it "should error during file download" do
31
+ Dir.mktmpdir do |dir|
32
+ instance = Automatic::Plugin::StoreTarget.new(
33
+ { "path" => dir },
34
+ AutomaticSpec.generate_pipeline {
35
+ link "storeTarget2.html"
36
+ }
37
+ )
38
+ instance.run.should have(1).items
39
+ end
40
+ end
41
+ end
@@ -1,3 +1,10 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Name:: Automatic::Plugin::Subscription::Feed
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
+
1
8
  require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
2
9
 
3
10
  require 'subscription/feed'
@@ -6,16 +13,18 @@ describe Automatic::Plugin::SubscriptionFeed do
6
13
  context "with empty feeds" do
7
14
  subject {
8
15
  Automatic::Plugin::SubscriptionFeed.new(
9
- { 'feeds' => [] })
16
+ { 'feeds' => [] }
17
+ )
10
18
  }
11
-
19
+
12
20
  its(:run) { should be_empty }
13
21
  end
14
22
 
15
23
  context "with feeds whose invalid URL" do
16
24
  subject {
17
25
  Automatic::Plugin::SubscriptionFeed.new(
18
- { 'feeds' => ["invalid_url"] })
26
+ { 'feeds' => ["invalid_url"] }
27
+ )
19
28
  }
20
29
 
21
30
  its(:run) { should be_empty }
@@ -27,7 +36,8 @@ describe Automatic::Plugin::SubscriptionFeed do
27
36
  Automatic::Plugin::SubscriptionFeed.new(
28
37
  { 'feeds' => [
29
38
  "https://github.com/id774/automaticruby/commits/master.atom"]
30
- })
39
+ }
40
+ )
31
41
  }
32
42
 
33
43
  its(:run) { should have(1).feed }
@@ -0,0 +1,43 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Name:: Automatic::Plugin::Subscription::URI
3
+ # Author:: 774 <http://id774.net>
4
+ # Created:: Jun 12, 2012
5
+ # Updated:: Jun 13, 2012
6
+ # Copyright:: 774 Copyright (c) 2012
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 'subscription/uri'
12
+
13
+ describe Automatic::Plugin::SubscriptionURI do
14
+ context "with empty URLs" do
15
+ subject {
16
+ Automatic::Plugin::SubscriptionURI.new(
17
+ { 'urls' => [] })
18
+ }
19
+ its(:run) { should be_empty }
20
+ end
21
+
22
+ context "with URLs whose invalid URL" do
23
+ subject {
24
+ Automatic::Plugin::SubscriptionURI.new(
25
+ { 'urls' => ["invalid_url"] }
26
+ )
27
+ }
28
+ its(:run) { should be_empty }
29
+ end
30
+
31
+
32
+ context "with URLs whose valid URL" do
33
+ subject {
34
+ Automatic::Plugin::SubscriptionURI.new(
35
+ { 'urls' => [
36
+ "https://github.com/id774/automaticruby"]
37
+ }
38
+ )
39
+ }
40
+
41
+ its(:run) { should have(1).item }
42
+ end
43
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,7 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Name:: Automatic::Spec
3
+ # Updated:: Jun 14, 2012
4
+
1
5
  APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), ".."))
2
6
  $LOAD_PATH.unshift APP_ROOT
3
7
  $LOAD_PATH.unshift File.join(APP_ROOT)
@@ -37,7 +41,7 @@ module AutomaticSpec
37
41
  def generate_pipeline(&block)
38
42
  pipeline_generator = StubPipelineGenerator.new
39
43
  pipeline_generator.instance_eval(&block)
40
- return pipeline_generator.feeds
44
+ return pipeline_generator.pipeline
41
45
  end
42
46
 
43
47
  def root_dir
@@ -45,21 +49,40 @@ module AutomaticSpec
45
49
  end
46
50
 
47
51
  def db_dir
48
- return File.join(root_dir, "db")
52
+ dir = (File.expand_path('~/.automatic/db'))
53
+ if File.directory?(dir)
54
+ return dir
55
+ else
56
+ return File.join(root_dir, "db")
57
+ end
49
58
  end
50
59
  end
51
60
 
52
61
  class StubPipelineGenerator
53
- attr_reader :feeds
62
+ attr_reader :pipeline
54
63
 
55
- def initialize
56
- @feeds = []
64
+ def initialize
65
+ @pipeline = []
57
66
  end
58
67
 
59
68
  def feed(&block)
60
- feed_generator = StubFeedGenerator.new
61
- feed_generator.instance_eval(&block)
62
- @feeds << feed_generator.feed
69
+ generator = StubFeedGenerator.new
70
+ generator.instance_eval(&block)
71
+ @pipeline << generator.feed
72
+ end
73
+
74
+ def html(fixture)
75
+ obj = File.read(File.join(APP_ROOT, "spec",
76
+ "fixtures", fixture))
77
+ @pipeline << obj
78
+ end
79
+
80
+ def link(fixture)
81
+ obj = File.read(File.join(APP_ROOT, "spec",
82
+ "fixtures", fixture))
83
+ require 'extract/link'
84
+ @pipeline << obj
85
+ @pipeline.replace Automatic::Plugin::ExtractLink.new(nil, @pipeline).run
63
86
  end
64
87
  end
65
88
 
@@ -1,3 +1,7 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Name:: Automatic::StoreMock
3
+ # Updated:: Jun 14, 2012
4
+
1
5
  module Automatic::Plugin
2
6
  class StoreMock
3
7
  def initialize(config, pipeline = [])
@@ -9,7 +9,7 @@ plugins:
9
9
  - module: SubscriptionFeed
10
10
  config:
11
11
  feeds:
12
- - http://blog.id774.net/blogs/feed/
12
+ - http://blog.id774.net/post/feed/
13
13
 
14
14
  - module: FilterIgnore
15
15
  config:
@@ -9,7 +9,7 @@ plugins:
9
9
  - module: SubscriptionFeed
10
10
  config:
11
11
  feeds:
12
- - http://blog.id774.net/blogs/feed/
12
+ - http://blog.id774.net/post/feed/
13
13
 
14
14
  - module: FilterIgnore
15
15
  config:
@@ -0,0 +1,26 @@
1
+ global:
2
+ timezone: Asia/Tokyo
3
+ cache:
4
+ base: /tmp
5
+ log:
6
+ level: info
7
+
8
+ plugins:
9
+ - module: SubscriptionURI
10
+ config:
11
+ urls:
12
+ - http://reblog.id774.net/
13
+
14
+ - module: ExtractLink
15
+
16
+ - module: FilterImageLink
17
+
18
+ - module: StoreLink
19
+ config:
20
+ db: test_link.db
21
+
22
+ - module: StoreTarget
23
+ config:
24
+ path: /tmp
25
+ interval: 2
26
+
@@ -9,7 +9,7 @@ plugins:
9
9
  - module: SubscriptionFeed
10
10
  config:
11
11
  feeds:
12
- - http://blog.id774.net/blogs/feed/
12
+ - http://blog.id774.net/post/feed/
13
13
 
14
14
  - module: FilterIgnore
15
15
  config:
@@ -9,7 +9,7 @@ plugins:
9
9
  - module: SubscriptionFeed
10
10
  config:
11
11
  feeds:
12
- - http://blog.id774.net/blogs/feed/
12
+ - http://blog.id774.net/post/feed/
13
13
 
14
14
  - module: FilterIgnore
15
15
  config:
@@ -9,7 +9,7 @@ plugins:
9
9
  - module: SubscriptionFeed
10
10
  config:
11
11
  feeds:
12
- - http://blog.id774.net/blogs/feed/
12
+ - http://blog.id774.net/post/feed/
13
13
 
14
14
  - module: FilterIgnore
15
15
  config:
@@ -15,7 +15,7 @@ plugins:
15
15
  config:
16
16
  db: test_image.db
17
17
 
18
- - module: FilterImage
18
+ - module: FilterImageSource
19
19
 
20
20
  - module: StoreTargetLink
21
21
  config:
@@ -9,7 +9,7 @@ plugins:
9
9
  - module: SubscriptionFeed
10
10
  config:
11
11
  feeds:
12
- - http://blog.id774.net/blogs/feed/
12
+ - http://blog.id774.net/post/feed/
13
13
 
14
14
  - module: FilterReverse
15
15
 
@@ -15,7 +15,7 @@ plugins:
15
15
  config:
16
16
  db: test_tumblr.db
17
17
 
18
- - module: FilterImage
18
+ - module: FilterImageSource
19
19
 
20
20
  - module: FilterTumblrResize
21
21
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: automatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.4.0
4
+ version: 12.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-30 00:00:00.000000000 Z
12
+ date: 2012-06-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sqlite3
@@ -139,6 +139,22 @@ dependencies:
139
139
  - - ! '>='
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: nokogiri
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
150
+ type: :runtime
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
142
158
  - !ruby/object:Gem::Dependency
143
159
  name: cucumber
144
160
  requirement: !ruby/object:Gem::Requirement
@@ -203,8 +219,8 @@ files:
203
219
  - automatic.gemspec
204
220
  - bin/automatic
205
221
  - bin/automatic-config
206
- - config/default.yml
207
222
  - config/feed2console.yml
223
+ - config/html2console.yml
208
224
  - db/.gitkeep
209
225
  - doc/AUTHORS
210
226
  - doc/COPYING
@@ -221,52 +237,72 @@ files:
221
237
  - lib/automatic/pipeline.rb
222
238
  - lib/automatic/recipe.rb
223
239
  - plugins/custom_feed/svn_log.rb
240
+ - plugins/extract/link.rb
224
241
  - plugins/filter/ignore.rb
225
- - plugins/filter/image.rb
242
+ - plugins/filter/image_link.rb
243
+ - plugins/filter/image_source.rb
226
244
  - plugins/filter/reverse.rb
227
245
  - plugins/filter/tumblr_resize.rb
228
246
  - plugins/notify/ikachan.rb
229
247
  - plugins/publish/console.rb
248
+ - plugins/publish/dump.rb
230
249
  - plugins/publish/google_calendar.rb
231
250
  - plugins/publish/hatena_bookmark.rb
232
251
  - plugins/publish/mail.rb
233
252
  - plugins/publish/smtp.rb
253
+ - plugins/store/database.rb
234
254
  - plugins/store/full_text.rb
255
+ - plugins/store/link.rb
235
256
  - plugins/store/permalink.rb
236
- - plugins/store/store_database.rb
257
+ - plugins/store/target.rb
237
258
  - plugins/store/target_link.rb
238
259
  - plugins/subscription/feed.rb
260
+ - plugins/subscription/uri.rb
239
261
  - script/bootstrap
240
262
  - script/build
263
+ - spec/fixtures/extractLink.html
264
+ - spec/fixtures/filterImageLink.html
265
+ - spec/fixtures/publishDump.html
266
+ - spec/fixtures/sampleRecipe.yml
267
+ - spec/fixtures/storeLink.html
268
+ - spec/fixtures/storeLink2.html
269
+ - spec/fixtures/storeTarget.html
270
+ - spec/fixtures/storeTarget2.html
241
271
  - spec/lib/automatic/pipeline_spec.rb
272
+ - spec/lib/automatic/recipe_spec.rb
242
273
  - spec/lib/automatic_spec.rb
243
- - spec/lib/pipeline_spec.rb
244
274
  - spec/plugins/custom_feed/svn_log_spec.rb
275
+ - spec/plugins/extract/link_spec.rb
245
276
  - spec/plugins/filter/ignore_spec.rb
246
- - spec/plugins/filter/image_spec.rb
277
+ - spec/plugins/filter/image_link_spec.rb
278
+ - spec/plugins/filter/image_source_spec.rb
247
279
  - spec/plugins/filter/reverse_spec.rb
248
280
  - spec/plugins/filter/tumblr_resize_spec.rb
249
281
  - spec/plugins/notify/ikachan_spec.rb
250
282
  - spec/plugins/publish/console_spec.rb
283
+ - spec/plugins/publish/dump_spec.rb
251
284
  - spec/plugins/publish/google_calendar_spec.rb
252
285
  - spec/plugins/publish/hatena_bookmark_spec.rb
253
286
  - spec/plugins/publish/mail_spec.rb
254
287
  - spec/plugins/publish/smtp_spec.rb
255
288
  - spec/plugins/store/full_text_spec.rb
289
+ - spec/plugins/store/link_spec.rb
256
290
  - spec/plugins/store/permalink_spec.rb
257
291
  - spec/plugins/store/target_link_spec.rb
292
+ - spec/plugins/store/target_spec.rb
258
293
  - spec/plugins/subscription/feed_spec.rb
294
+ - spec/plugins/subscription/uri_spec.rb
259
295
  - spec/spec_helper.rb
260
296
  - spec/user_dir/plugins/store/mock.rb
261
297
  - test/fixtures/sampleOPML.xml
262
298
  - test/integration/test_activerecord.yml
263
299
  - test/integration/test_fulltext.yml
300
+ - test/integration/test_get_image.yml
264
301
  - test/integration/test_googlealert.yml
265
302
  - test/integration/test_hatenabookmark.yml
266
303
  - test/integration/test_ignore.yml
267
304
  - test/integration/test_ignore2.yml
268
305
  - test/integration/test_image2local.yml
269
- - test/integration/test_mail.yml
270
306
  - test/integration/test_reverse.yml
271
307
  - test/integration/test_svnlog.yml
272
308
  - test/integration/test_tumblr2local.yml
@@ -292,7 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
328
  version: '0'
293
329
  requirements: []
294
330
  rubyforge_project:
295
- rubygems_version: 1.8.19
331
+ rubygems_version: 1.8.24
296
332
  signing_key:
297
333
  specification_version: 3
298
334
  summary: Automatic Ruby
@@ -1,67 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # Name:: pipeline_sepc.rb
3
- # Author:: ainame
4
- # Created:: Mar 10, 2012
5
- # Updated:: Mar 10, 2012
6
- # Copyright:: ainame Copyright (c) 2012
7
- # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
-
9
- require File.expand_path(File.join(File.dirname(__FILE__) ,'../spec_helper'))
10
- require 'automatic'
11
- require 'automatic/pipeline'
12
-
13
- TEST_MODULES = ["SubscriptionFeed", "FilterIgnore"] if TEST_MODULES.nil?
14
-
15
- describe Automatic::Pipeline do
16
- describe "in default dir" do
17
- before do
18
- Automatic.root_dir = File.expand_path(File.join(File.dirname(__FILE__), "../../"))
19
- Automatic.user_dir = nil
20
- end
21
-
22
- describe "#load_plugin" do
23
- it "raise no plugin error" do
24
- lambda{
25
- Automatic::Pipeline.load_plugin "FooBar"
26
- }.should raise_exception(Automatic::NoPluginError,
27
- /unknown plugin named FooBar/)
28
- end
29
-
30
- it "correctly load module" do
31
- TEST_MODULES.each do |mod|
32
- Automatic::Pipeline.load_plugin mod.to_s
33
- Automatic::Plugin.const_get(mod).class.should == Class
34
- end
35
- end
36
- end
37
-
38
- describe "#run" do
39
- it "run a recipe with FilterIgnore module" do
40
- plugin = mock("plugin")
41
- plugin.should_receive(:module).and_return("FilterIgnore")
42
- plugin.should_receive(:config)
43
- recipe = mock("recipe")
44
- recipe.should_receive(:each_plugin).and_yield(plugin)
45
- Automatic::Pipeline.run(recipe).should == []
46
- end
47
- end
48
- end
49
-
50
- describe "in user dir" do
51
- before do
52
- Automatic.root_dir = File.expand_path(File.join(File.dirname(__FILE__), "../../"))
53
- Automatic.user_dir = File.expand_path(File.join(File.dirname(__FILE__), "../user_dir/"))
54
- end
55
-
56
- describe "#load_plugin" do
57
- it "correctly load module" do
58
- # StoreMock is the mock class that it return pipeline.
59
- mock = "StoreMock"
60
- Automatic::Pipeline.load_plugin mock
61
- klass = Automatic::Plugin.const_get(mock)
62
- klass.class.should == Class
63
- klass.new(nil, ["mock"]).run.should == "mock"
64
- end
65
- end
66
- end
67
- end
@@ -1,21 +0,0 @@
1
- global:
2
- timezone: Asia/Tokyo
3
- cache:
4
- base: /tmp
5
- log:
6
- level: info
7
-
8
- plugins:
9
- - module: SubscriptionFeed
10
- config:
11
- feeds:
12
- - http://b.hatena.ne.jp/Naruhodius/rss
13
-
14
- - module: PublishMail
15
- config:
16
- port: 25
17
- mailto: plagger.receiver@gmail.com
18
- mailfrom: automatic@harpuia.id774.net
19
-
20
- #- module: PublishConsole
21
-