automatic 13.12.0 → 14.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 90595ee77c762cb364af9cfd822d89d1d17d0306
4
- data.tar.gz: 48e69a16b6577e239df8e265a09562aa379b383d
3
+ metadata.gz: b43a1a794a8175f7d650b1b92ca118486fe0d86d
4
+ data.tar.gz: 47d449093ef8dd0ce5a51638d8fad105333a14de
5
5
  SHA512:
6
- metadata.gz: df3741889e34f71522aab02de4929a4f04edb922a38ed0abb2027352229b1f2291a15b6dd6d54d64ba57e0c7e142d9cd23207f936ae70f4ce262aa4340b899a7
7
- data.tar.gz: 877ddcfa68ca1ceec2b69f40dcc98136ee6979dfe019874ecf4d81f0d21aa1ecdefe1c8269bee9a78647ee7dea49c71d3f3c9a26d48170aa8831945198a3fce1
6
+ metadata.gz: 5c291f8190dfc97b1995bc306ccce1be8460257481baef90f3132bfd8c8f3fc45afd6bfd02e61df420f3a8a3c9c8e447309c380de1bba3037104aaee1a3b8967
7
+ data.tar.gz: e19eb66e353be6b34926c6c1e584ed4c28f50e15797cc9cd4819696cf9bf86a88cab59e7a51d31967d6dd7554f4c6857f2e77bb2ebf26c59af7bd48a9e9077d3
data/Gemfile CHANGED
@@ -1,35 +1,36 @@
1
- # Version:20131125
1
+ # Version:20140124
2
2
 
3
3
  source "http://rubygems.org"
4
4
  source "http://gems.github.com"
5
5
 
6
- gem 'json'
7
- gem 'sqlite3'
8
- gem 'activesupport', '~>4.0.0'
9
- gem 'activerecord', '~>4.0.0'
10
- gem 'hashie'
11
- gem 'gcalapi'
12
- gem 'xml-simple'
13
- gem 'feedbag'
14
- gem 'nokogiri'
15
- gem 'sanitize'
16
- gem 'twitter', '~>4.8.1'
17
- gem 'weather_hacker'
18
- gem 'pocket-ruby'
19
- gem 'hipchat'
20
- gem 'fluent-logger'
21
- gem 'dalli'
6
+ gem 'json', '~> 1.8.1'
7
+ gem 'sqlite3', '~> 1.3.8'
8
+ gem 'activesupport', '~> 4.0.2'
9
+ gem 'activerecord', '~> 4.0.2'
10
+ gem 'hashie', '~> 2.0.5'
11
+ gem 'gcalapi', '~> 0.1.2'
12
+ gem 'xml-simple', '~> 1.1.3'
13
+ gem 'feedbag', '~> 0.9.2'
14
+ gem 'nokogiri', '~> 1.6.1'
15
+ gem 'sanitize', '~> 2.1.0'
16
+ gem 'faraday', '~> 0.8.9'
17
+ gem 'twitter', '~> 4.8.1'
18
+ gem 'pocket-ruby', '~> 0.0.4'
19
+ gem 'weather_hacker', '~> 0.1.7'
20
+ gem 'hipchat', '~> 1.0.1'
21
+ gem 'fluent-logger', '~> 0.4.7'
22
+ gem 'dalli', '~> 2.7.0'
22
23
 
23
24
  group :test do
24
- gem 'rspec', '~> 2.14.0'
25
+ gem 'rspec', '~> 2.14.1'
25
26
  gem 'rcov', :platforms => :mri_18
26
- gem 'simplecov'
27
- gem 'simplecov-rcov'
28
- gem 'koseki-mocksmtpd'
27
+ gem 'simplecov', '~> 0.8.2'
28
+ gem 'simplecov-rcov', '~> 0.2.3'
29
+ gem 'koseki-mocksmtpd', '~> 0.0.3'
29
30
  end
30
31
 
31
32
  group :development do
32
- gem "cucumber"
33
+ gem 'cucumber'
33
34
  gem 'bundler'
34
35
  gem 'builder'
35
36
  gem "jeweler"
data/README.md CHANGED
@@ -75,7 +75,7 @@ For more info, refer to the document (doc/README).
75
75
  Environment
76
76
  -----------
77
77
 
78
- Ruby 1.9 - 2.0. See Gemfile.
78
+ Ruby 1.9 - 2.1. See Gemfile.
79
79
 
80
80
 
81
81
  Development
data/VERSION CHANGED
@@ -1 +1 @@
1
- 13.12.0
1
+ 14.1.0
data/automatic.gemspec CHANGED
@@ -2,15 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: automatic 13.12.0 ruby lib
5
+ # stub: automatic 14.1.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "automatic"
9
- s.version = "13.12.0"
9
+ s.version = "14.1.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
12
13
  s.authors = ["id774"]
13
- s.date = "2013-12-17"
14
+ s.date = "2014-01-24"
14
15
  s.description = "Ruby General Automation Framework"
15
16
  s.email = "idnanashi@gmail.com"
16
17
  s.executables = ["automatic"]
@@ -41,6 +42,7 @@ Gem::Specification.new do |s|
41
42
  "lib/automatic/opml.rb",
42
43
  "lib/automatic/pipeline.rb",
43
44
  "lib/automatic/recipe.rb",
45
+ "lib/automatic/version.rb",
44
46
  "plugins/custom_feed/svn_log.rb",
45
47
  "plugins/filter/absolute_uri.rb",
46
48
  "plugins/filter/accept.rb",
@@ -158,73 +160,75 @@ Gem::Specification.new do |s|
158
160
  ]
159
161
  s.homepage = "http://github.com/automaticruby/automaticruby"
160
162
  s.licenses = ["GPL"]
161
- s.require_paths = ["lib"]
162
- s.rubygems_version = "2.1.11"
163
+ s.rubygems_version = "2.2.0"
163
164
  s.summary = "Automatic Ruby"
164
165
 
165
166
  if s.respond_to? :specification_version then
166
167
  s.specification_version = 4
167
168
 
168
169
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
169
- s.add_runtime_dependency(%q<json>, [">= 0"])
170
- s.add_runtime_dependency(%q<sqlite3>, [">= 0"])
171
- s.add_runtime_dependency(%q<activesupport>, ["~> 4.0.0"])
172
- s.add_runtime_dependency(%q<activerecord>, ["~> 4.0.0"])
173
- s.add_runtime_dependency(%q<hashie>, [">= 0"])
174
- s.add_runtime_dependency(%q<gcalapi>, [">= 0"])
175
- s.add_runtime_dependency(%q<xml-simple>, [">= 0"])
176
- s.add_runtime_dependency(%q<feedbag>, [">= 0"])
177
- s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
178
- s.add_runtime_dependency(%q<sanitize>, [">= 0"])
170
+ s.add_runtime_dependency(%q<json>, ["~> 1.8.1"])
171
+ s.add_runtime_dependency(%q<sqlite3>, ["~> 1.3.8"])
172
+ s.add_runtime_dependency(%q<activesupport>, ["~> 4.0.2"])
173
+ s.add_runtime_dependency(%q<activerecord>, ["~> 4.0.2"])
174
+ s.add_runtime_dependency(%q<hashie>, ["~> 2.0.5"])
175
+ s.add_runtime_dependency(%q<gcalapi>, ["~> 0.1.2"])
176
+ s.add_runtime_dependency(%q<xml-simple>, ["~> 1.1.3"])
177
+ s.add_runtime_dependency(%q<feedbag>, ["~> 0.9.2"])
178
+ s.add_runtime_dependency(%q<nokogiri>, ["~> 1.6.1"])
179
+ s.add_runtime_dependency(%q<sanitize>, ["~> 2.1.0"])
180
+ s.add_runtime_dependency(%q<faraday>, ["~> 0.8.9"])
179
181
  s.add_runtime_dependency(%q<twitter>, ["~> 4.8.1"])
180
- s.add_runtime_dependency(%q<weather_hacker>, [">= 0"])
181
- s.add_runtime_dependency(%q<pocket-ruby>, [">= 0"])
182
- s.add_runtime_dependency(%q<hipchat>, [">= 0"])
183
- s.add_runtime_dependency(%q<fluent-logger>, [">= 0"])
184
- s.add_runtime_dependency(%q<dalli>, [">= 0"])
182
+ s.add_runtime_dependency(%q<pocket-ruby>, ["~> 0.0.4"])
183
+ s.add_runtime_dependency(%q<weather_hacker>, ["~> 0.1.7"])
184
+ s.add_runtime_dependency(%q<hipchat>, ["~> 1.0.1"])
185
+ s.add_runtime_dependency(%q<fluent-logger>, ["~> 0.4.7"])
186
+ s.add_runtime_dependency(%q<dalli>, ["~> 2.7.0"])
185
187
  s.add_development_dependency(%q<cucumber>, [">= 0"])
186
188
  s.add_development_dependency(%q<bundler>, [">= 0"])
187
189
  s.add_development_dependency(%q<builder>, [">= 0"])
188
190
  s.add_development_dependency(%q<jeweler>, [">= 0"])
189
191
  else
190
- s.add_dependency(%q<json>, [">= 0"])
191
- s.add_dependency(%q<sqlite3>, [">= 0"])
192
- s.add_dependency(%q<activesupport>, ["~> 4.0.0"])
193
- s.add_dependency(%q<activerecord>, ["~> 4.0.0"])
194
- s.add_dependency(%q<hashie>, [">= 0"])
195
- s.add_dependency(%q<gcalapi>, [">= 0"])
196
- s.add_dependency(%q<xml-simple>, [">= 0"])
197
- s.add_dependency(%q<feedbag>, [">= 0"])
198
- s.add_dependency(%q<nokogiri>, [">= 0"])
199
- s.add_dependency(%q<sanitize>, [">= 0"])
192
+ s.add_dependency(%q<json>, ["~> 1.8.1"])
193
+ s.add_dependency(%q<sqlite3>, ["~> 1.3.8"])
194
+ s.add_dependency(%q<activesupport>, ["~> 4.0.2"])
195
+ s.add_dependency(%q<activerecord>, ["~> 4.0.2"])
196
+ s.add_dependency(%q<hashie>, ["~> 2.0.5"])
197
+ s.add_dependency(%q<gcalapi>, ["~> 0.1.2"])
198
+ s.add_dependency(%q<xml-simple>, ["~> 1.1.3"])
199
+ s.add_dependency(%q<feedbag>, ["~> 0.9.2"])
200
+ s.add_dependency(%q<nokogiri>, ["~> 1.6.1"])
201
+ s.add_dependency(%q<sanitize>, ["~> 2.1.0"])
202
+ s.add_dependency(%q<faraday>, ["~> 0.8.9"])
200
203
  s.add_dependency(%q<twitter>, ["~> 4.8.1"])
201
- s.add_dependency(%q<weather_hacker>, [">= 0"])
202
- s.add_dependency(%q<pocket-ruby>, [">= 0"])
203
- s.add_dependency(%q<hipchat>, [">= 0"])
204
- s.add_dependency(%q<fluent-logger>, [">= 0"])
205
- s.add_dependency(%q<dalli>, [">= 0"])
204
+ s.add_dependency(%q<pocket-ruby>, ["~> 0.0.4"])
205
+ s.add_dependency(%q<weather_hacker>, ["~> 0.1.7"])
206
+ s.add_dependency(%q<hipchat>, ["~> 1.0.1"])
207
+ s.add_dependency(%q<fluent-logger>, ["~> 0.4.7"])
208
+ s.add_dependency(%q<dalli>, ["~> 2.7.0"])
206
209
  s.add_dependency(%q<cucumber>, [">= 0"])
207
210
  s.add_dependency(%q<bundler>, [">= 0"])
208
211
  s.add_dependency(%q<builder>, [">= 0"])
209
212
  s.add_dependency(%q<jeweler>, [">= 0"])
210
213
  end
211
214
  else
212
- s.add_dependency(%q<json>, [">= 0"])
213
- s.add_dependency(%q<sqlite3>, [">= 0"])
214
- s.add_dependency(%q<activesupport>, ["~> 4.0.0"])
215
- s.add_dependency(%q<activerecord>, ["~> 4.0.0"])
216
- s.add_dependency(%q<hashie>, [">= 0"])
217
- s.add_dependency(%q<gcalapi>, [">= 0"])
218
- s.add_dependency(%q<xml-simple>, [">= 0"])
219
- s.add_dependency(%q<feedbag>, [">= 0"])
220
- s.add_dependency(%q<nokogiri>, [">= 0"])
221
- s.add_dependency(%q<sanitize>, [">= 0"])
215
+ s.add_dependency(%q<json>, ["~> 1.8.1"])
216
+ s.add_dependency(%q<sqlite3>, ["~> 1.3.8"])
217
+ s.add_dependency(%q<activesupport>, ["~> 4.0.2"])
218
+ s.add_dependency(%q<activerecord>, ["~> 4.0.2"])
219
+ s.add_dependency(%q<hashie>, ["~> 2.0.5"])
220
+ s.add_dependency(%q<gcalapi>, ["~> 0.1.2"])
221
+ s.add_dependency(%q<xml-simple>, ["~> 1.1.3"])
222
+ s.add_dependency(%q<feedbag>, ["~> 0.9.2"])
223
+ s.add_dependency(%q<nokogiri>, ["~> 1.6.1"])
224
+ s.add_dependency(%q<sanitize>, ["~> 2.1.0"])
225
+ s.add_dependency(%q<faraday>, ["~> 0.8.9"])
222
226
  s.add_dependency(%q<twitter>, ["~> 4.8.1"])
223
- s.add_dependency(%q<weather_hacker>, [">= 0"])
224
- s.add_dependency(%q<pocket-ruby>, [">= 0"])
225
- s.add_dependency(%q<hipchat>, [">= 0"])
226
- s.add_dependency(%q<fluent-logger>, [">= 0"])
227
- s.add_dependency(%q<dalli>, [">= 0"])
227
+ s.add_dependency(%q<pocket-ruby>, ["~> 0.0.4"])
228
+ s.add_dependency(%q<weather_hacker>, ["~> 0.1.7"])
229
+ s.add_dependency(%q<hipchat>, ["~> 1.0.1"])
230
+ s.add_dependency(%q<fluent-logger>, ["~> 0.4.7"])
231
+ s.add_dependency(%q<dalli>, ["~> 2.7.0"])
228
232
  s.add_dependency(%q<cucumber>, [">= 0"])
229
233
  s.add_dependency(%q<bundler>, [">= 0"])
230
234
  s.add_dependency(%q<builder>, [">= 0"])
data/doc/ChangeLog CHANGED
@@ -1,3 +1,10 @@
1
+ === 14.1.0 / 2014-01-24
2
+
3
+ * Fix dependency conflict.
4
+
5
+ * Refactoring error retry handling.
6
+
7
+
1
8
  === 13.12.0 / 2013-12-17
2
9
 
3
10
  * Fix twitter gem version.
@@ -0,0 +1,3 @@
1
+ module Automatic
2
+ VERSION = "14.1.0"
3
+ end
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:: Dec 17, 2013
6
- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
5
+ # Updated:: Jan 24, 2014
6
+ # Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  module Automatic
@@ -12,8 +12,8 @@ module Automatic
12
12
  require 'automatic/pipeline'
13
13
  require 'automatic/log'
14
14
  require 'automatic/feed_parser'
15
+ require 'automatic/version'
15
16
 
16
- VERSION = "13.12.0"
17
17
  USER_DIR = "/.automatic"
18
18
 
19
19
  class << self
@@ -75,7 +75,7 @@ module Automatic::Plugin
75
75
  feeds.items.each {|feed|
76
76
  Automatic::Log.puts("info", %Q(Ikachan: [#{feed.link}] sending with params #{ikachan.params.to_s}...))
77
77
  ikachan.post(feed.link, feed.title)
78
- sleep @config['interval'].to_i unless @config['interval'].nil?
78
+ sleep ||= @config['interval'].to_i
79
79
  }
80
80
  end
81
81
  }
@@ -1,9 +1,9 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Name:: Automatic::Plugin::Publish::Eject
3
3
  # Author:: soramugi <http://soramugi.net>
4
- # Created:: Jun 9, 2013
5
- # Updated:: Jun 9, 2013
6
- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
4
+ # Created:: Jun 9, 2013
5
+ # Updated:: Jan 15, 2014
6
+ # Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  module Automatic::Plugin
@@ -23,7 +23,7 @@ module Automatic::Plugin
23
23
  Automatic::Log.puts('info', "Eject: #{feed.link}")
24
24
 
25
25
  interval = @config['interval'].to_i unless @config['interval'].nil? unless @config.nil?
26
- sleep 3 if interval.nil?
26
+ sleep ||= @config['interval'].to_i
27
27
  end
28
28
  }
29
29
  end
@@ -2,8 +2,8 @@
2
2
  # Name:: Automatic::Plugin::Publish::Googlecalendar
3
3
  # Author:: 774 <http://id774.net>
4
4
  # Created:: Feb 24, 2012
5
- # Updated:: Jan 8, 2013
6
- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
5
+ # Updated:: Jan 15, 2014
6
+ # Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  module Automatic::Plugin
@@ -74,7 +74,7 @@ module Automatic::Plugin
74
74
  unless feeds.nil?
75
75
  feeds.items.each {|feed|
76
76
  @gc.add('今日 ' + feed.title)
77
- sleep @config['interval'].to_i unless @config['interval'].nil?
77
+ sleep ||= @config['interval'].to_i
78
78
  }
79
79
  end
80
80
  }
@@ -2,8 +2,8 @@
2
2
  # Name:: Automatic::Plugin::Publish::HatenaBookmark
3
3
  # Author:: 774 <http://id774.net>
4
4
  # Created:: Feb 22, 2012
5
- # Updated:: Mar 7, 2013
6
- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
5
+ # Updated:: Jan 15, 2014
6
+ # Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  module Automatic::Plugin
@@ -89,7 +89,7 @@ module Automatic::Plugin
89
89
  unless feeds.nil?
90
90
  feeds.items.each {|feed|
91
91
  hb.post(rewrite(feed.link), nil)
92
- sleep @config['interval'].to_i unless @config['interval'].nil?
92
+ sleep ||= @config['interval'].to_i
93
93
  }
94
94
  end
95
95
  }
@@ -1,9 +1,9 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Name:: Automatic::Plugin::Publish::Hipchat
3
3
  # Author:: Kohei Hasegawa <http://github.com/banyan>
4
- # Created:: Jun 6, 2013
5
- # Updated:: Jun 6, 2013
6
- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
4
+ # Created:: Jun 6, 2013
5
+ # Updated:: Jan 15, 2014
6
+ # Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  module Automatic::Plugin
@@ -26,16 +26,17 @@ module Automatic::Plugin
26
26
  unless feeds.nil?
27
27
  feeds.items.each {|feed|
28
28
  retries = 0
29
+ retry_max = @config['retry'].to_i || 0
29
30
  begin
30
31
  @client.send(@config['username'], feed.description, @options)
31
32
  Automatic::Log.puts("info", "post: #{feed.description.gsub(/[\r\n]/,'')[0..50]}...") rescue nil
32
33
  rescue => e
33
34
  retries += 1
34
35
  Automatic::Log.puts("error", "ErrorCount: #{retries}, #{e.message}")
35
- sleep @config['interval'].to_i unless @config['interval'].nil?
36
- retry if retries <= @config['retry'].to_i unless @config['retry'].nil?
36
+ sleep ||= @config['interval'].to_i
37
+ retry if retries <= retry_max
37
38
  end
38
- sleep @config['interval'].to_i unless @config['interval'].nil?
39
+ sleep ||= @config['interval'].to_i
39
40
  }
40
41
  end
41
42
  }
@@ -3,8 +3,8 @@
3
3
  # Author:: soramugi <http://soramugi.net>
4
4
  # 774 <http://id774.net>
5
5
  # Created:: Feb 9, 2013
6
- # Updated:: Mar 23, 2013
7
- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
6
+ # Updated:: Jan 15, 2014
7
+ # Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
8
8
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
9
9
 
10
10
  module Automatic::Plugin
@@ -69,15 +69,16 @@ module Automatic::Plugin
69
69
  feeds.items.each {|feed|
70
70
  Automatic::Log.puts("info", "add: #{feed.link}")
71
71
  retries = 0
72
+ retry_max = @config['retry'].to_i || 0
72
73
  begin
73
74
  instapaper.add(feed.link, feed.title, feed.description)
74
75
  rescue
75
76
  retries += 1
76
77
  Automatic::Log.puts("error", "ErrorCount: #{retries}, Fault in publish to instapaper.")
77
- sleep @config['interval'].to_i unless @config['interval'].nil?
78
- retry if retries <= @config['retry'].to_i unless @config['retry'].nil?
78
+ sleep ||= @config['interval'].to_i
79
+ retry if retries <= retry_max
79
80
  end
80
- sleep @config['interval'].to_i unless @config['interval'].nil?
81
+ sleep ||= @config['interval'].to_i
81
82
  }
82
83
  end
83
84
  }
@@ -2,8 +2,8 @@
2
2
  # Name:: Automatic::Plugin::Publish::Pocket
3
3
  # Author:: soramugi <http://soramugi.net>
4
4
  # Created:: May 15, 2013
5
- # Updated:: May 15, 2013
6
- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
5
+ # Updated:: Jan 15, 2014
6
+ # Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  module Automatic::Plugin
@@ -25,16 +25,17 @@ module Automatic::Plugin
25
25
  unless feeds.nil?
26
26
  feeds.items.each {|feed|
27
27
  retries = 0
28
+ retry_max = @config['retry'].to_i || 0
28
29
  begin
29
30
  @client.add(:url => feed.link)
30
31
  Automatic::Log.puts("info", "add: #{feed.link}")
31
32
  rescue
32
33
  retries += 1
33
34
  Automatic::Log.puts("error", "ErrorCount: #{retries}, Fault in publish to pocket.")
34
- sleep @config['interval'].to_i unless @config['interval'].nil?
35
- retry if retries <= @config['retry'].to_i unless @config['retry'].nil?
35
+ sleep ||= @config['interval'].to_i
36
+ retry if retries <= retry_max
36
37
  end
37
- sleep @config['interval'].to_i unless @config['interval'].nil?
38
+ sleep ||= @config['interval'].to_i
38
39
  }
39
40
  end
40
41
  }
@@ -36,6 +36,7 @@ module Automatic::Plugin
36
36
  feeds.items.each {|feed|
37
37
  Automatic::Log.puts("info", "tweet: #{feed.link}")
38
38
  retries = 0
39
+ retry_max = @config['retry'].to_i || 0
39
40
  begin
40
41
  tweet = @tweet_tmp.gsub(/\{(.+?)\}/) do |text|
41
42
  feed.__send__($1)
@@ -44,10 +45,10 @@ module Automatic::Plugin
44
45
  rescue
45
46
  retries += 1
46
47
  Automatic::Log.puts("error", "ErrorCount: #{retries}, Fault in publish to twitter.")
47
- sleep @config['interval'].to_i unless @config['interval'].nil?
48
- retry if retries <= @config['retry'].to_i unless @config['retry'].nil?
48
+ sleep ||= @config['interval'].to_i
49
+ retry if retries <= retry_max
49
50
  end
50
- sleep @config['interval'].to_i unless @config['interval'].nil?
51
+ sleep ||= @config['interval'].to_i
51
52
  }
52
53
  end
53
54
  }
@@ -3,8 +3,8 @@
3
3
  # Name:: Automatic::Plugin::Store::TargetLink
4
4
  # Author:: 774 <http://id774.net>
5
5
  # Created:: Feb 28, 2012
6
- # Updated:: Feb 9, 2013
7
- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
6
+ # Updated:: Jan 15, 2014
7
+ # Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
8
8
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
9
9
 
10
10
  require 'open-uri'
@@ -25,14 +25,15 @@ module Automatic::Plugin
25
25
  Automatic::Log.puts("info", "Downloading: #{feed.link}")
26
26
  FileUtils.mkdir_p(@config['path']) unless FileTest.exist?(@config['path'])
27
27
  retries = 0
28
+ retry_max = @config['retry'].to_i || 0
28
29
  begin
29
30
  retries += 1
30
31
  wget(feed.link)
31
- sleep @config['interval'].to_i unless @config['interval'].nil?
32
+ sleep ||= @config['interval'].to_i
32
33
  rescue
33
34
  Automatic::Log.puts("error", "ErrorCount: #{retries}, Fault during file download.")
34
- sleep @config['interval'].to_i unless @config['interval'].nil?
35
- retry if retries <= @config['retry'].to_i unless @config['retry'].nil?
35
+ sleep ||= @config['interval'].to_i
36
+ retry if retries <= retry_max
36
37
  end
37
38
  end
38
39
  }
@@ -2,8 +2,8 @@
2
2
  # Name:: Automatic::Plugin::Subscription::ChanToru
3
3
  # Author:: soramugi <http://soramugi.net>
4
4
  # Created:: Jun 28, 2013
5
- # Updated:: Jun 28, 2013
6
- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
5
+ # Updated:: Jan 15, 2014
6
+ # Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  require File.expand_path(File.dirname(__FILE__) + '/g_guide')
@@ -22,6 +22,7 @@ module Automatic::Plugin
22
22
 
23
23
  def run
24
24
  retries = 0
25
+ retry_max = @config['retry'].to_i || 0
25
26
  begin
26
27
  pipeline = g_guide_pipeline
27
28
  pipeline.each {|feeds|
@@ -33,8 +34,8 @@ module Automatic::Plugin
33
34
  rescue
34
35
  retries += 1
35
36
  Automatic::Log.puts("error", "ErrorCount: #{retries}, Fault in parsing: #{retries}")
36
- sleep @config['interval'].to_i unless @config['interval'].nil?
37
- retry if retries <= @config['retry'].to_i unless @config['retry'].nil?
37
+ sleep ||= @config['interval'].to_i
38
+ retry if retries <= retry_max
38
39
  end
39
40
 
40
41
  @pipeline
@@ -2,8 +2,8 @@
2
2
  # Name:: Automatic::Plugin::SubscriptionFeed
3
3
  # Author:: 774 <http://id774.net>
4
4
  # Created:: Feb 22, 2012
5
- # Updated:: Feb 8, 2013
6
- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
5
+ # Updated:: Jan 15, 2014
6
+ # Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  module Automatic::Plugin
@@ -16,14 +16,15 @@ module Automatic::Plugin
16
16
  def run
17
17
  @config['feeds'].each {|feed|
18
18
  retries = 0
19
+ retry_max = @config['retry'].to_i || 0
19
20
  begin
20
21
  rss = Automatic::FeedParser.get(feed)
21
22
  @pipeline << rss
22
23
  rescue
23
24
  retries += 1
24
25
  Automatic::Log.puts("error", "ErrorCount: #{retries}, Fault in parsing: #{feed}")
25
- sleep @config['interval'].to_i unless @config['interval'].nil?
26
- retry if retries <= @config['retry'].to_i unless @config['retry'].nil?
26
+ sleep ||= @config['interval'].to_i
27
+ retry if retries <= retry_max
27
28
  end
28
29
  }
29
30
  @pipeline
@@ -2,8 +2,8 @@
2
2
  # Name:: Automatic::Plugin::Subscription::GGuide
3
3
  # Author:: soramugi <http://soramugi.net>
4
4
  # Created:: Jun 28, 2013
5
- # Updated:: Jun 28, 2013
6
- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
5
+ # Updated:: Jan 15, 2014
6
+ # Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  module Automatic::Plugin
@@ -22,6 +22,7 @@ module Automatic::Plugin
22
22
 
23
23
  def run
24
24
  retries = 0
25
+ retry_max = @config['retry'].to_i || 0
25
26
  begin
26
27
  @keywords.each {|keyword|
27
28
  @pipeline << Automatic::FeedParser.get(feed_url keyword)
@@ -29,8 +30,8 @@ module Automatic::Plugin
29
30
  rescue
30
31
  retries += 1
31
32
  Automatic::Log.puts("error", "ErrorCount: #{retries}, Fault in parsing: #{retries}")
32
- sleep @config['interval'].to_i unless @config['interval'].nil?
33
- retry if retries <= @config['retry'].to_i unless @config['retry'].nil?
33
+ sleep ||= @config['interval'].to_i
34
+ retry if retries <= retry_max
34
35
  end
35
36
  @pipeline
36
37
  end
@@ -2,8 +2,8 @@
2
2
  # Name:: Automatic::Plugin::Subscription::Link
3
3
  # Author:: 774 <http://id774.net>
4
4
  # Created:: Sep 18, 2012
5
- # Updated:: Apr 5, 2013
6
- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
5
+ # Updated:: Jan 15, 2014
6
+ # Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
7
7
  # License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8
8
 
9
9
  module Automatic::Plugin
@@ -20,13 +20,14 @@ module Automatic::Plugin
20
20
  @return_feeds = []
21
21
  @config['urls'].each {|url|
22
22
  retries = 0
23
+ retry_max = @config['retry'].to_i || 0
23
24
  begin
24
25
  create_rss(URI.encode(url))
25
26
  rescue
26
27
  retries += 1
27
28
  Automatic::Log.puts("error", "ErrorCount: #{retries}, Fault in parsing: #{url}")
28
- sleep @config['interval'].to_i unless @config['interval'].nil?
29
- retry if retries <= @config['retry'].to_i unless @config['retry'].nil?
29
+ sleep ||= @config['interval'].to_i
30
+ retry if retries <= retry_max
30
31
  end
31
32
  }
32
33
  @return_feeds
@@ -38,7 +39,7 @@ module Automatic::Plugin
38
39
  html = open(url).read
39
40
  unless html.nil?
40
41
  rss = Automatic::FeedParser.parse(html)
41
- sleep @config['interval'].to_i unless @config['interval'].nil?
42
+ sleep ||= @config['interval'].to_i
42
43
  @return_feeds << rss
43
44
  end
44
45
  end