automatic 14.1.0 → 14.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -2
  3. data/README.md +2 -2
  4. data/Rakefile +1 -1
  5. data/VERSION +1 -1
  6. data/automatic.gemspec +17 -9
  7. data/bin/automatic +4 -4
  8. data/doc/ChangeLog +27 -0
  9. data/doc/PLUGINS +36 -6
  10. data/doc/PLUGINS.ja +35 -7
  11. data/doc/README +4 -4
  12. data/doc/README.ja +3 -3
  13. data/lib/automatic.rb +2 -1
  14. data/lib/automatic/feed_maker.rb +80 -0
  15. data/lib/automatic/feed_parser.rb +6 -50
  16. data/lib/automatic/recipe.rb +1 -1
  17. data/lib/automatic/version.rb +1 -1
  18. data/plugins/filter/accept.rb +4 -3
  19. data/plugins/filter/github_feed.rb +12 -11
  20. data/plugins/filter/ignore.rb +3 -3
  21. data/plugins/filter/image_source.rb +10 -10
  22. data/plugins/filter/one.rb +4 -3
  23. data/plugins/filter/rand.rb +3 -3
  24. data/plugins/filter/sanitize.rb +2 -3
  25. data/plugins/provide/fluentd.rb +5 -4
  26. data/plugins/publish/amazon_s3.rb +58 -0
  27. data/plugins/publish/fluentd.rb +5 -4
  28. data/plugins/publish/google_calendar.rb +2 -2
  29. data/plugins/publish/hipchat.rb +1 -1
  30. data/plugins/publish/twitter.rb +1 -1
  31. data/plugins/store/database.rb +4 -4
  32. data/plugins/store/file.rb +95 -0
  33. data/plugins/store/full_text.rb +1 -1
  34. data/plugins/store/permalink.rb +1 -1
  35. data/plugins/subscription/feed.rb +2 -2
  36. data/plugins/subscription/g_guide.rb +3 -2
  37. data/plugins/subscription/link.rb +4 -3
  38. data/plugins/subscription/pocket.rb +12 -11
  39. data/plugins/subscription/text.rb +35 -44
  40. data/plugins/subscription/tumblr.rb +3 -3
  41. data/plugins/subscription/twitter.rb +1 -1
  42. data/plugins/subscription/twitter_search.rb +11 -12
  43. data/plugins/subscription/weather.rb +7 -6
  44. data/plugins/subscription/xml.rb +4 -3
  45. data/spec/fixtures/sampleFeeds.tsv +1 -0
  46. data/spec/fixtures/sampleFeeds2.tsv +2 -0
  47. data/spec/lib/automatic/pipeline_spec.rb +4 -4
  48. data/spec/lib/automatic_spec.rb +3 -3
  49. data/spec/plugins/filter/github_feed_spec.rb +9 -8
  50. data/spec/plugins/filter/image_source_spec.rb +7 -7
  51. data/spec/plugins/notify/ikachan_spec.rb +3 -3
  52. data/spec/plugins/provide/fluentd_spec.rb +6 -5
  53. data/spec/plugins/publish/amazon_s3_spec.rb +40 -0
  54. data/spec/plugins/publish/console_spec.rb +3 -3
  55. data/spec/plugins/publish/fluentd_spec.rb +5 -4
  56. data/spec/plugins/publish/google_calendar_spec.rb +5 -5
  57. data/spec/plugins/publish/hatena_bookmark_spec.rb +10 -10
  58. data/spec/plugins/publish/hipchat_spec.rb +6 -6
  59. data/spec/plugins/publish/instapaper_spec.rb +6 -6
  60. data/spec/plugins/publish/memcached_spec.rb +3 -3
  61. data/spec/plugins/publish/pocket_spec.rb +3 -3
  62. data/spec/plugins/publish/twitter_spec.rb +4 -4
  63. data/spec/plugins/store/{target_link_spec.rb → file_spec.rb} +10 -10
  64. data/spec/plugins/subscription/pocket_spec.rb +3 -3
  65. data/spec/plugins/subscription/text_spec.rb +32 -2
  66. data/spec/plugins/subscription/twitter_search_spec.rb +3 -3
  67. data/test/integration/test_fluentd.yml +1 -0
  68. data/test/integration/test_image2local.yml +6 -2
  69. data/test/integration/test_text2feed.yml +8 -0
  70. data/test/integration/test_tumblr2local.yml +6 -0
  71. metadata +26 -7
  72. data/plugins/store/target_link.rb +0 -55
@@ -1,55 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # -*- coding: utf-8 -*-
3
- # Name:: Automatic::Plugin::Store::TargetLink
4
- # Author:: 774 <http://id774.net>
5
- # Created:: Feb 28, 2012
6
- # Updated:: Jan 15, 2014
7
- # Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
8
- # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
9
-
10
- require 'open-uri'
11
-
12
- module Automatic::Plugin
13
- class StoreTargetLink
14
-
15
- def initialize(config, pipeline=[])
16
- @config = config
17
- @pipeline = pipeline
18
- end
19
-
20
- def run
21
- @pipeline.each {|feeds|
22
- unless feeds.nil?
23
- feeds.items.each {|feed|
24
- unless feed.link.nil?
25
- Automatic::Log.puts("info", "Downloading: #{feed.link}")
26
- FileUtils.mkdir_p(@config['path']) unless FileTest.exist?(@config['path'])
27
- retries = 0
28
- retry_max = @config['retry'].to_i || 0
29
- begin
30
- retries += 1
31
- wget(feed.link)
32
- sleep ||= @config['interval'].to_i
33
- rescue
34
- Automatic::Log.puts("error", "ErrorCount: #{retries}, Fault during file download.")
35
- sleep ||= @config['interval'].to_i
36
- retry if retries <= retry_max
37
- end
38
- end
39
- }
40
- end
41
- }
42
- @pipeline
43
- end
44
-
45
- private
46
- def wget(url)
47
- filename = url.split(/\//).last
48
- open(url) {|source|
49
- open(File.join(@config['path'], filename), "w+b") { |o|
50
- o.print source.read
51
- }
52
- }
53
- end
54
- end
55
- end