automatic 13.2.0 → 13.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/Gemfile +2 -2
  2. data/README.md +15 -3
  3. data/Rakefile +1 -1
  4. data/VERSION +1 -1
  5. data/automatic.gemspec +3 -5
  6. data/bin/automatic +104 -15
  7. data/doc/ChangeLog +9 -0
  8. data/doc/PLUGINS +4 -1
  9. data/doc/PLUGINS.ja +4 -1
  10. data/doc/README +27 -31
  11. data/doc/README.ja +24 -28
  12. data/lib/automatic/feed_parser.rb +1 -1
  13. data/lib/automatic.rb +3 -3
  14. data/plugins/filter/absolute_uri.rb +11 -10
  15. data/plugins/filter/full_feed.rb +16 -14
  16. data/plugins/filter/ignore.rb +18 -16
  17. data/plugins/filter/image.rb +14 -18
  18. data/plugins/filter/image_source.rb +11 -10
  19. data/plugins/filter/tumblr_resize.rb +11 -10
  20. data/plugins/notify/ikachan.rb +4 -4
  21. data/plugins/publish/google_calendar.rb +1 -1
  22. data/plugins/publish/hatena_bookmark.rb +15 -4
  23. data/plugins/publish/instapaper.rb +12 -3
  24. data/plugins/store/target_link.rb +1 -1
  25. data/plugins/subscription/feed.rb +1 -1
  26. data/plugins/subscription/google_reader_star.rb +9 -6
  27. data/plugins/subscription/link.rb +13 -12
  28. data/plugins/subscription/tumblr.rb +13 -12
  29. data/plugins/subscription/twitter.rb +19 -18
  30. data/script/build +14 -12
  31. data/spec/lib/automatic_spec.rb +3 -3
  32. data/spec/plugins/filter/full_feed_spec.rb +88 -5
  33. data/spec/plugins/filter/ignore_spec.rb +2 -1
  34. data/spec/plugins/filter/sort_spec.rb +1 -1
  35. data/spec/plugins/publish/hatena_bookmark_spec.rb +63 -1
  36. data/spec/plugins/publish/instapaper_spec.rb +18 -6
  37. data/spec/plugins/store/target_link_spec.rb +3 -3
  38. data/spec/plugins/subscription/feed_spec.rb +1 -1
  39. data/spec/plugins/subscription/google_reader_star_spec.rb +30 -1
  40. data/spec/plugins/subscription/link_spec.rb +1 -1
  41. data/spec/plugins/subscription/tumblr_spec.rb +1 -1
  42. data/spec/plugins/subscription/twitter_spec.rb +1 -1
  43. data/spec/spec_helper.rb +13 -3
  44. data/test/integration/test_googlestar.yml +13 -0
  45. metadata +2 -5
  46. data/bin/automatic-config +0 -111
  47. data/script/bootstrap +0 -117
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
- # Version:20120317
1
+ # Version:20130322
2
2
 
3
- source :rubygems
3
+ source "http://rubygems.org"
4
4
  source "http://gems.github.com"
5
5
 
6
6
  gem 'sqlite3'
data/README.md CHANGED
@@ -17,11 +17,23 @@ See doc/README file.
17
17
  Get Started
18
18
  -----------
19
19
 
20
- Installation.
20
+ ``` html
21
+ [Stable]
22
+ $ gem install automatic
23
+ $ automatic scaffold
24
+ (Make ~/.automatic on your home directory.)
25
+ $ automatic -c ~/.automatic/config/example/feed2console.yml
26
+ (This process will be output my blog feed to your terminal.)
27
+ ```
21
28
 
22
29
  ``` html
23
- gem install automatic
24
- automatic-config scaffold
30
+ [Development]
31
+ $ git clone git://github.com/id774/automaticruby.git
32
+ $ cd automaticruby
33
+ $ bundle install --path vendor/gems
34
+ $ bin/automatic scaffold
35
+ $ bin/automatic -c ~/.automatic/config/example/feed2console.yml
36
+ (The same as above.)
25
37
  ```
26
38
 
27
39
  Specify any recipe with -c option.
data/Rakefile CHANGED
@@ -37,7 +37,7 @@ Jeweler::Tasks.new do |gem|
37
37
  end
38
38
  Jeweler::RubygemsDotOrgTasks.new
39
39
 
40
- if /^1\.9\./ =~ RUBY_VERSION
40
+ unless /^1\.8\./ =~ RUBY_VERSION
41
41
  desc "Run RSpec code examples with simplecov"
42
42
  task :simplecov do
43
43
  ENV['COVERAGE'] = "on"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 13.2.0
1
+ 13.4.1
data/automatic.gemspec CHANGED
@@ -5,14 +5,14 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "automatic"
8
- s.version = "13.2.0"
8
+ s.version = "13.4.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["id774"]
12
- s.date = "2013-02-13"
12
+ s.date = "2013-04-10"
13
13
  s.description = "Ruby General Automation Framework"
14
14
  s.email = "idnanashi@gmail.com"
15
- s.executables = ["automatic", "automatic-config"]
15
+ s.executables = ["automatic"]
16
16
  s.extra_rdoc_files = [
17
17
  "README.md"
18
18
  ]
@@ -24,7 +24,6 @@ Gem::Specification.new do |s|
24
24
  "assets/siteinfo/items_all.json",
25
25
  "automatic.gemspec",
26
26
  "bin/automatic",
27
- "bin/automatic-config",
28
27
  "config/feed2console.yml",
29
28
  "db/.gitkeep",
30
29
  "doc/AUTHORS",
@@ -65,7 +64,6 @@ Gem::Specification.new do |s|
65
64
  "plugins/subscription/link.rb",
66
65
  "plugins/subscription/tumblr.rb",
67
66
  "plugins/subscription/twitter.rb",
68
- "script/bootstrap",
69
67
  "script/build",
70
68
  "spec/fixtures/sampleRecipe.yml",
71
69
  "spec/lib/automatic/pipeline_spec.rb",
data/bin/automatic CHANGED
@@ -3,26 +3,111 @@
3
3
  # Name:: Automatic::Ruby
4
4
  # Author:: 774 <http://id774.net>
5
5
  # Created:: Feb 18, 2012
6
- # Updated:: Jan 22, 2013
7
- # Copyright:: 774 Copyright (c) 2012
6
+ # Updated:: Apr 10, 2013
7
+ # Copyright:: 774 Copyright (c) 2012-2013
8
8
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
9
9
 
10
10
  root_dir = File.expand_path("..", File.dirname(__FILE__))
11
11
  $:.unshift root_dir
12
12
  $:.unshift root_dir + '/lib'
13
+
13
14
  require 'automatic'
15
+ require 'rubygems'
14
16
  require 'optparse'
17
+ require 'fileutils'
18
+ require 'feedbag'
19
+ require 'pp'
15
20
 
16
21
  recipe_path = ""
17
- parser = OptionParser.new { |parser|
18
- parser.banner = "Usage: automatic [options] arg"
22
+
23
+ def abort_with_usage(subcommand, message)
24
+ top_filename = File.basename($0)
25
+ abort("Usage: #{top_filename} #{subcommand} #{message}")
26
+ end
27
+
28
+ subparsers = {
29
+ 'scaffold' => lambda {|argv|
30
+ Dir::entries(root_dir + '/plugins').sort.each {|path|
31
+ dir = (File.expand_path('~/.automatic/plugins/' + path))
32
+ unless File.exist?(dir)
33
+ FileUtils.mkdir_p(dir)
34
+ puts "Creating #{dir}"
35
+ end
36
+ }
37
+ dir = (File.expand_path('~/.automatic/assets'))
38
+ unless File.exist?(dir)
39
+ FileUtils.mkdir_p(dir)
40
+ FileUtils.cp_r(root_dir + '/assets/siteinfo', dir + '/siteinfo')
41
+ puts "Creating #{dir}"
42
+ end
43
+ dir = (File.expand_path('~/.automatic/config'))
44
+ unless File.exist?(dir)
45
+ FileUtils.mkdir_p(dir)
46
+ FileUtils.cp_r(root_dir + '/config', dir + '/example')
47
+ puts "Creating #{dir}"
48
+ end
49
+ dir = (File.expand_path('~/.automatic/db'))
50
+ unless File.exist?(dir)
51
+ FileUtils.mkdir_p(dir)
52
+ puts "Creating #{dir}"
53
+ end
54
+ },
55
+ 'unscaffold' => lambda {|argv|
56
+ dir = (File.expand_path('~/.automatic'))
57
+ if File.directory?(dir)
58
+ puts "Removing #{dir}"
59
+ FileUtils.rm_r(dir)
60
+ end
61
+ },
62
+ 'autodiscovery' => lambda {|argv|
63
+ url = argv.shift || abort_with_usage("autodiscovery", "<url>")
64
+ pp Feedbag.find(url)
65
+ },
66
+ 'feedparser' => lambda {|argv|
67
+ require 'automatic/feed_parser'
68
+ url = argv.shift || abort_with_usage("feedparser", "<url>")
69
+ rss_results = Automatic::FeedParser.get(url)
70
+ pp rss_results
71
+ },
72
+ 'inspect' => lambda {|argv|
73
+ require 'automatic/feed_parser'
74
+ url = argv.shift || abort_with_usage("inspect", "<url>")
75
+ feeds = Feedbag.find(url)
76
+ pp feeds
77
+ rss_results = Automatic::FeedParser.get(feeds.pop)
78
+ pp rss_results
79
+ },
80
+ 'opmlparser' => lambda {|argv|
81
+ require 'automatic/opml'
82
+ path = argv.shift
83
+ if path.nil?
84
+ abort_with_usage("opmlparser", "<opml path>")
85
+ end
86
+ parser = Automatic::OPML::Parser.new(File.read(path))
87
+ parser.each_outline {|opml, o|
88
+ puts "#{o.xmlUrl}"
89
+ }
90
+ },
91
+ 'log' => lambda {|argv|
92
+ require 'automatic/log'
93
+ level = argv.shift || abort_with_usage("log", "<level> <message>")
94
+ message = ARGV.shift
95
+ Automatic::Log.puts(level, message)
96
+ }
97
+ }
98
+
99
+ parser = OptionParser.new {|parser|
19
100
  parser.version = Automatic.const_get(:VERSION)
20
- parser.separator "options:"
101
+ parser.banner = "Automatic #{parser.version}
102
+ Usage: automatic [options] [subcommand]"
103
+ parser.separator "SubCommands:
104
+ #{subparsers.keys.join(", ")}"
105
+ parser.separator "Options:"
21
106
  parser.on('-c', '--config FILE', String,
22
107
  "recipe YAML file"){|c| recipe_path = c}
23
108
  parser.on('-h', '--help', "show this message") {
24
109
  puts parser
25
- exit
110
+ exit 1
26
111
  }
27
112
  }
28
113
 
@@ -32,18 +117,22 @@ begin
32
117
  rescue OptionParser::ParseError => err
33
118
  $stderr.puts err.message
34
119
  $stderr.puts parser.help
35
- exit 1
120
+ exit 2
36
121
  end
37
122
 
38
- if recipe_path.to_s.empty?
39
- if ENV["AUTOMATIC_RUBY_ENV"] == "test"
40
- recpie_path = File.join(root_dir, 'config/default.yml')
123
+ unless recipe_path.to_s.empty?
124
+ recipe = Automatic::Recipe.new(recipe_path)
125
+ Automatic.run(:recipe => recipe,
126
+ :root_dir => root_dir)
127
+ else
128
+ parser.order!(ARGV)
129
+ unless ARGV.empty?
130
+ Hash.new {|h, k|
131
+ puts "No such subcommand: #{k}"
132
+ exit 1
133
+ }.update(subparsers)[ARGV.shift].call(ARGV)
41
134
  else
42
135
  puts parser
43
- exit 0
136
+ exit 1
44
137
  end
45
138
  end
46
-
47
- recipe = Automatic::Recipe.new(recipe_path)
48
- Automatic.run(:recipe => recipe,
49
- :root_dir => root_dir)
data/doc/ChangeLog CHANGED
@@ -1,3 +1,12 @@
1
+ === 13.4.1 / 2013-04-10
2
+
3
+ * Command automatic-config merged into automatic.
4
+
5
+ * Improvement retry functions.
6
+
7
+ * Running tests on Ruby 2.0.
8
+
9
+
1
10
  === 13.2.0 / 2013-02-13
2
11
 
3
12
  * All subscription and download plugins implemented retry function.
data/doc/PLUGINS CHANGED
@@ -72,6 +72,8 @@ SubscriptionGoogleReaderStar
72
72
  feeds:
73
73
  - FEED
74
74
  - FEED ...
75
+ retry: RETRY_COUNT
76
+ interval: INTERVAL_FOR_RETRY (in seconds.)
75
77
 
76
78
 
77
79
  SubscriptionTwitter
@@ -293,7 +295,8 @@ PublishInstapaper
293
295
  config:
294
296
  email: INSTAPAPER_ACCOUNT
295
297
  password: PASSWORD
296
- interval: INTERVAL
298
+ interval: INTERVAL_FOR_RETRY (in seconds.)
299
+ retry: RETRY_COUNT
297
300
 
298
301
 
299
302
  PublishGoogleCalendar
data/doc/PLUGINS.ja CHANGED
@@ -72,6 +72,8 @@ SubscriptionGoogleReaderStar
72
72
  feeds:
73
73
  - フィード名
74
74
  - フィード名 ...
75
+ retry: エラー時のリトライ回数 (回数, 省略時 0)
76
+ interval: エラー時のリトライ間隔 (秒数, 省略可)
75
77
 
76
78
 
77
79
  SubscriptionTwitter
@@ -293,7 +295,8 @@ PublishInstapaper
293
295
  config:
294
296
  email: Instapaper メールアドレス
295
297
  password: パスワード
296
- interval: 複数の予定の投稿間隔 (秒)
298
+ interval: 複数の予定の投稿間隔, エラー時のリトライ間隔 (秒)
299
+ retry: エラー時のリトライ回数 (回数, 省略時 0)
297
300
 
298
301
 
299
302
  PublishGoogleCalendar
data/doc/README CHANGED
@@ -24,16 +24,19 @@ Installation
24
24
 
25
25
  [Stable]
26
26
  $ gem install automatic
27
-
28
- $ automatic-config scaffold
27
+ $ automatic scaffold
29
28
  (Make ~/.automatic on your home directory.)
29
+ $ automatic -c ~/.automatic/config/example/feed2console.yml
30
+ (This process will be output my blog feed to your terminal.)
30
31
 
31
32
 
32
33
  [Development]
33
34
  $ git clone git://github.com/id774/automaticruby.git
34
-
35
35
  $ cd automaticruby
36
- $ script/bootstrap
36
+ $ bundle install --path vendor/gems
37
+ $ bin/automatic scaffold
38
+ $ bin/automatic -c ~/.automatic/config/example/feed2console.yml
39
+ (The same as above.)
37
40
 
38
41
 
39
42
  ===========
@@ -60,7 +63,7 @@ directory.
60
63
  This is the easy recipe to simply output blog's feed to
61
64
  only console. It can be used to check the operation of
62
65
  this software.
63
- $ automatic -c ~/automatic/config/example/feed2console.yml
66
+ $ automatic -c ~/.automatic/config/example/feed2console.yml
64
67
 
65
68
 
66
69
  =======
@@ -183,8 +186,8 @@ Put your own plug-ins in your home directory.
183
186
  You can automatically generate a sub-directory for your own plug-ins
184
187
  with the following command.
185
188
 
186
- $ automatic-config scaffold
187
- (For a description of automatic-config will be described later.)
189
+ $ automatic scaffold
190
+ (For a description of automatic subcommands will be described later.)
188
191
 
189
192
 
190
193
  ============================
@@ -195,10 +198,7 @@ Directory and file structure
195
198
  +-+ bin
196
199
  | |
197
200
  | +-- automatic
198
- | | The main file for run.
199
- | |
200
- | +-- automatic-config
201
- | The tool for the auxiliary.
201
+ | The main file for run.
202
202
  |
203
203
  +-- config
204
204
  |
@@ -265,11 +265,7 @@ Directory and file structure
265
265
  +-+ script
266
266
  | |
267
267
  | +-- build
268
- | | Run Integration Test that carried out on CI.
269
- | |
270
- | +-- bootstrap
271
- | To set the environment, such as bundle install.
272
- | (Only more than ruby 1.9)
268
+ | Run Integration Test that carried out on CI.
273
269
  |
274
270
  +-- spec
275
271
  | Directory for unit tests (Use RSpec).
@@ -439,44 +435,44 @@ See doc/PLUGINS.
439
435
 
440
436
 
441
437
 
442
- ================
443
- automatic-config
444
- ================
438
+ ===========
439
+ SubCommands
440
+ ===========
445
441
 
446
- automatic-config is the auxiliary tool.
442
+ automatic has the auxiliary tool in subcommands.
447
443
 
448
444
  [Syntax]
449
- $ automatic-config
450
- Show list of sub-command.
445
+ $ automatic
446
+ Show help and list of sub-command.
451
447
 
452
- $ automatic-config scaffold
448
+ $ automatic scaffold
453
449
  Make ~/.automatic directory in your home directory.
454
450
  This operation makes 'plugins', 'db', 'config', 'assets' directories.
455
451
  These takes precedence the origin directory.
456
452
 
457
- $ automatic-config unscaffold
453
+ $ automatic unscaffold
458
454
  Delete ~/.automatic directory.
459
455
 
460
- $ automatic-config autodiscovery <url>
456
+ $ automatic autodiscovery <url>
461
457
  Return the URL of the feed of target detected by auto discovery.
462
458
  (ex.)
463
- $ automatic-config autodiscovery http://blog.id774.net/post
459
+ $ automatic autodiscovery http://blog.id774.net/post
464
460
  ["http://blog.id774.net/post/feed/", "http://blog.id774.net/post/comments/feed/"]
465
461
 
466
- $ automatic-config opmlparser <opml path>
462
+ $ automatic opmlparser <opml path>
467
463
  Output the URLs to parse the OPML file.
468
464
  (ex.)
469
- $ automatic-config opmlparser opml.xml > feeds.txt
465
+ $ automatic opmlparser opml.xml > feeds.txt
470
466
 
471
- $ automatic-config feedparser <url>
467
+ $ automatic feedparser <url>
472
468
  Return the contents to parse the feed.
473
469
 
474
- $ automatic-config inspect <url>
470
+ $ automatic inspect <url>
475
471
  Return the URL of the feed of target detected by auto discovery.
476
472
  Return the contents to parse the first feed further.
477
473
  This inspects verify the target subscriptionable.
478
474
 
479
- $ automatic-config log <level> <message>
475
+ $ automatic log <level> <message>
480
476
  Output log messages in the form of Automatic Ruby.
481
477
 
482
478
 
data/doc/README.ja CHANGED
@@ -25,16 +25,19 @@ $ automatic -v
25
25
 
26
26
  [安定版]
27
27
  $ gem install automatic
28
-
29
- $ automatic-config scaffold
28
+ $ automatic scaffold
30
29
  (ホームディレクトリに ~/.automatic を生成する)
30
+ $ automatic -c ~/.automatic/config/example/feed2console.yml
31
+ (ブログのフィードを入力しターミナルに出力する)
31
32
 
32
33
 
33
34
  [開発版]
34
35
  $ git clone git://github.com/id774/automaticruby.git
35
-
36
36
  $ cd automaticruby
37
- $ script/bootstrap
37
+ $ bundle install --path vendor/gems
38
+ $ bin/automatic scaffold
39
+ $ bin/automatic -c ~/.automatic/config/example/feed2console.yml
40
+ (上記に同じ)
38
41
 
39
42
 
40
43
  ============
@@ -174,10 +177,7 @@ plugins:
174
177
  +- bin
175
178
  | |
176
179
  | +- automatic
177
- | | 実行ファイル本体
178
- | |
179
- | +- automatic-config
180
- | 利用を補助するためのツール
180
+ | 実行ファイル本体
181
181
  |
182
182
  +- config
183
183
  | YAML 形式でプラグインの情報を記述する
@@ -245,11 +245,7 @@ plugins:
245
245
  +- script
246
246
  | |
247
247
  | +- build
248
- | | CI で実施する結合試験をおこなう
249
- | |
250
- | +- bootstrap
251
- | bundle install 等の環境設定をおこなう
252
- | (ruby 1.9 以上のみ)
248
+ | CI で実施する結合試験をおこなう
253
249
  |
254
250
  +- spec
255
251
  | ユニットテスト用ディレクトリ
@@ -446,45 +442,45 @@ doc/PLUGINS.ja を参照
446
442
 
447
443
 
448
444
 
449
- ================
450
- automatic-config
451
- ================
445
+ ============
446
+ サブコマンド
447
+ ============
452
448
 
453
- automatic-config は補助的なツールである。
449
+ automatic コマンドから補助的なツールをサブコマンド経由で実行できる。
454
450
 
455
451
  [書式]
456
- $ automatic-config
457
- サブコマンドの一覧を表示する
452
+ $ automatic
453
+ ヘルプ及びサブコマンドの一覧を表示する
458
454
 
459
- $ automatic-config scaffold
455
+ $ automatic scaffold
460
456
  ホームディレクトリに ~/.automatic ディレクトリを生成する。
461
457
  この操作により ~/.automatic の下に plugins, db, config, assets
462
458
  ディレクトリが生成される。
463
459
  これらは本体のそれぞれのディレクトリよりも優先される。
464
460
 
465
- $ automatic-config unscaffold
461
+ $ automatic unscaffold
466
462
  ホームディレクトリの ~/.automatic ディレクトリを削除する。
467
463
 
468
- $ automatic-config autodiscovery <url>
464
+ $ automatic autodiscovery <url>
469
465
  対象の URL をオートディスカバリで探知しフィードの URL を返す。
470
466
  (例)
471
- $ automatic-config autodiscovery http://blog.id774.net/post
467
+ $ automatic autodiscovery http://blog.id774.net/post
472
468
  ["http://blog.id774.net/post/feed/", "http://blog.id774.net/post/comments/feed/"]
473
469
 
474
- $ automatic-config opmlparser <opml path>
470
+ $ automatic opmlparser <opml path>
475
471
  OPML ファイルを解析し URL を出力する。
476
472
  (例)
477
- $ automatic-config opmlparser opml.xml > feeds.txt
473
+ $ automatic opmlparser opml.xml > feeds.txt
478
474
 
479
- $ automatic-config feedparser <url>
475
+ $ automatic feedparser <url>
480
476
  フィードを解析して内容を返す。
481
477
 
482
- $ automatic-config inspect <url>
478
+ $ automatic inspect <url>
483
479
  対象の URL をオートディスカバリで探知する。
484
480
  さらに最初のフィードの URL を解析して内容を返す。
485
481
  目的のサイトのフィードを購読可能かどうか検証するのに使う。
486
482
 
487
- $ automatic-config log <level> <message>
483
+ $ automatic log <level> <message>
488
484
  Automatic Ruby のログ形式でメッセージを出力する。
489
485
 
490
486
 
@@ -3,7 +3,7 @@
3
3
  # Author:: 774 <http://id774.net>
4
4
  # Created:: Feb 19, 2012
5
5
  # Updated:: Jan 8, 2013
6
- # Copyright:: 774 Copyright (c) 2012
6
+ # Copyright:: 774 Copyright (c) 2012-2013
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  module Automatic
data/lib/automatic.rb CHANGED
@@ -2,8 +2,8 @@
2
2
  # Name:: Automatic::Ruby
3
3
  # Author:: 774 <http://id774.net>
4
4
  # Created:: Feb 18, 2012
5
- # Updated:: Feb 13, 2013
6
- # Copyright:: 774 Copyright (c) 2012
5
+ # Updated:: Apr 10, 2013
6
+ # Copyright:: 774 Copyright (c) 2012-2013
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  module Automatic
@@ -13,7 +13,7 @@ module Automatic
13
13
  require 'automatic/log'
14
14
  require 'automatic/feed_parser'
15
15
 
16
- VERSION = "13.2.0"
16
+ VERSION = "13.4.1"
17
17
  USER_DIR = "/.automatic"
18
18
 
19
19
  class << self
@@ -2,8 +2,8 @@
2
2
  # Name:: Automatic::Plugin::Filter::AbsoluteURI
3
3
  # Author:: 774 <http://id774.net>
4
4
  # Created:: Jun 20, 2012
5
- # Updated:: Sep 18, 2012
6
- # Copyright:: 774 Copyright (c) 2012
5
+ # Updated:: Apr 5, 2013
6
+ # Copyright:: 774 Copyright (c) 2012-2013
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  module Automatic::Plugin
@@ -14,14 +14,6 @@ module Automatic::Plugin
14
14
  @pipeline = pipeline
15
15
  end
16
16
 
17
- def rewrite(string)
18
- if /^http:\/\/.*$/ =~ string
19
- return string
20
- else
21
- return @config['url'] + string
22
- end
23
- end
24
-
25
17
  def run
26
18
  @return_feeds = []
27
19
  @pipeline.each {|feeds|
@@ -35,5 +27,14 @@ module Automatic::Plugin
35
27
  }
36
28
  @return_feeds
37
29
  end
30
+
31
+ private
32
+ def rewrite(string)
33
+ if /^http:\/\/.*$/ =~ string
34
+ return string
35
+ else
36
+ return @config['url'] + string
37
+ end
38
+ end
38
39
  end
39
40
  end
@@ -3,7 +3,7 @@
3
3
  # Author:: progd <http://d.hatena.ne.jp/progd/20120429/automatic_ruby_filter_full_feed>
4
4
  # 774 <http://id774.net>
5
5
  # Created:: Apr 29, 2012
6
- # Updated:: Jan 24, 2013
6
+ # Updated:: Apr 5, 2013
7
7
  # Copyright:: progd
8
8
  # 774 Copyright (c) 2012-2013
9
9
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
@@ -21,6 +21,21 @@ module Automatic::Plugin
21
21
  @siteinfo = get_siteinfo
22
22
  end
23
23
 
24
+ def run
25
+ @return_feeds = []
26
+ @pipeline.each {|feeds|
27
+ unless feeds.nil?
28
+ feeds.items.each {|feed|
29
+ feed = fulltext(feed)
30
+ }
31
+ end
32
+ @return_feeds << feeds
33
+ }
34
+ @return_feeds
35
+ end
36
+
37
+ private
38
+
24
39
  def get_siteinfo
25
40
  Automatic::Log.puts(:info, "Loading siteinfo from #{@config['siteinfo']}")
26
41
  siteinfo = JSON.load(open(File.join(assets_dir, @config['siteinfo'])).read)
@@ -59,18 +74,5 @@ module Automatic::Plugin
59
74
  Automatic::Log.puts(:info, "Fulltext SITEINFO not found: #{feed.link}")
60
75
  return feed
61
76
  end
62
-
63
- def run
64
- @return_feeds = []
65
- @pipeline.each {|feeds|
66
- unless feeds.nil?
67
- feeds.items.each {|feed|
68
- feed = fulltext(feed)
69
- }
70
- end
71
- @return_feeds << feeds
72
- }
73
- @return_feeds
74
- end
75
77
  end
76
78
  end