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 +4 -4
- data/Gemfile +23 -22
- data/README.md +1 -1
- data/VERSION +1 -1
- data/automatic.gemspec +54 -50
- data/doc/ChangeLog +7 -0
- data/lib/automatic/version.rb +3 -0
- data/lib/automatic.rb +3 -3
- data/plugins/notify/ikachan.rb +1 -1
- data/plugins/publish/eject.rb +4 -4
- data/plugins/publish/google_calendar.rb +3 -3
- data/plugins/publish/hatena_bookmark.rb +3 -3
- data/plugins/publish/hipchat.rb +7 -6
- data/plugins/publish/instapaper.rb +6 -5
- data/plugins/publish/pocket.rb +6 -5
- data/plugins/publish/twitter.rb +4 -3
- data/plugins/store/target_link.rb +6 -5
- data/plugins/subscription/chan_toru.rb +5 -4
- data/plugins/subscription/feed.rb +5 -4
- data/plugins/subscription/g_guide.rb +5 -4
- data/plugins/subscription/link.rb +6 -5
- data/plugins/subscription/pocket.rb +5 -4
- data/plugins/subscription/tumblr.rb +6 -5
- data/plugins/subscription/twitter.rb +7 -5
- data/plugins/subscription/twitter_search.rb +5 -4
- data/plugins/subscription/xml.rb +6 -5
- data/spec/lib/automatic/recipe_spec.rb +12 -7
- data/spec/lib/automatic_spec.rb +2 -2
- data/test/integration/test_add_pocket.yml +2 -0
- data/test/integration/test_chan_toru.yml +4 -2
- data/test/integration/test_image2local.yml +1 -1
- data/test/integration/test_instapaper.yml +2 -1
- data/test/integration/test_link2local.yml +2 -2
- data/test/integration/test_pocket.yml +1 -2
- data/test/integration/test_sort.yml +2 -2
- data/test/integration/test_tumblr2local.yml +2 -2
- metadata +92 -77
@@ -2,8 +2,8 @@
|
|
2
2
|
# Name:: Automatic::Plugin::Subscription::Pocket
|
3
3
|
# Author:: soramugi <http://soramugi.net>
|
4
4
|
# Created:: May 21, 2013
|
5
|
-
# Updated::
|
6
|
-
# Copyright:: Copyright (c) 2012-
|
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,14 +22,15 @@ 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
|
dummyfeeds = cleate_dummy_feed(@client.retrieve(@config['optional']))
|
27
28
|
@pipeline << Automatic::FeedParser.create(dummyfeeds)
|
28
29
|
rescue
|
29
30
|
retries += 1
|
30
31
|
Automatic::Log.puts("error", "ErrorCount: #{retries}, Fault in parsing: #{retries}")
|
31
|
-
sleep @config['interval'].to_i
|
32
|
-
retry if retries <=
|
32
|
+
sleep ||= @config['interval'].to_i
|
33
|
+
retry if retries <= retry_max
|
33
34
|
end
|
34
35
|
@pipeline
|
35
36
|
end
|
@@ -2,8 +2,8 @@
|
|
2
2
|
# Name:: Automatic::Plugin::Subscription::Tumblr
|
3
3
|
# Author:: 774 <http://id774.net>
|
4
4
|
# Created:: Oct 16, 2012
|
5
|
-
# Updated::
|
6
|
-
# Copyright:: Copyright (c) 2012-
|
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
|
@@ -19,6 +19,7 @@ module Automatic::Plugin
|
|
19
19
|
@return_feeds = []
|
20
20
|
@config['urls'].each {|url|
|
21
21
|
retries = 0
|
22
|
+
retry_max = @config['retry'].to_i || 0
|
22
23
|
begin
|
23
24
|
create_rss(url)
|
24
25
|
unless @config['pages'].nil?
|
@@ -32,8 +33,8 @@ module Automatic::Plugin
|
|
32
33
|
rescue
|
33
34
|
retries += 1
|
34
35
|
Automatic::Log.puts("error", "ErrorCount: #{retries}, Fault in parsing: #{url}")
|
35
|
-
sleep @config['interval'].to_i
|
36
|
-
retry if retries <=
|
36
|
+
sleep ||= @config['interval'].to_i
|
37
|
+
retry if retries <= retry_max
|
37
38
|
end
|
38
39
|
}
|
39
40
|
@return_feeds
|
@@ -51,7 +52,7 @@ module Automatic::Plugin
|
|
51
52
|
item.link = nil
|
52
53
|
end
|
53
54
|
}
|
54
|
-
sleep @config['interval'].to_i
|
55
|
+
sleep ||= @config['interval'].to_i
|
55
56
|
@return_feeds << rss
|
56
57
|
end
|
57
58
|
end
|
@@ -2,8 +2,8 @@
|
|
2
2
|
# Name:: Automatic::Plugin::Subscription::Twitter
|
3
3
|
# Author:: 774 <http://id774.net>
|
4
4
|
# Created:: Sep 9, 2012
|
5
|
-
# Updated::
|
6
|
-
# Copyright:: Copyright (c) 2012-
|
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
|
@@ -21,19 +21,21 @@ module Automatic::Plugin
|
|
21
21
|
@return_feeds = []
|
22
22
|
@config['urls'].each {|url|
|
23
23
|
retries = 0
|
24
|
+
retry_max = @config['retry'].to_i || 0
|
24
25
|
begin
|
25
26
|
create_rss(url)
|
26
27
|
rescue
|
27
28
|
retries += 1
|
28
29
|
Automatic::Log.puts("error", "ErrorCount: #{retries}, Fault in parsing: #{url}")
|
29
|
-
sleep @config['interval'].to_i
|
30
|
-
retry if retries <=
|
30
|
+
sleep ||= @config['interval'].to_i
|
31
|
+
retry if retries <= retry_max
|
31
32
|
end
|
32
33
|
}
|
33
34
|
@return_feeds
|
34
35
|
end
|
35
36
|
|
36
37
|
private
|
38
|
+
|
37
39
|
def create_rss(url)
|
38
40
|
Automatic::Log.puts("info", "Parsing: #{url}")
|
39
41
|
html = open(url).read
|
@@ -59,7 +61,7 @@ module Automatic::Plugin
|
|
59
61
|
item.description = content.search('[@class="js-tweet-text"]').text.to_s
|
60
62
|
}
|
61
63
|
}
|
62
|
-
sleep @config['interval'].to_i
|
64
|
+
sleep ||= @config['interval'].to_i
|
63
65
|
@return_feeds << rss
|
64
66
|
end
|
65
67
|
end
|
@@ -2,8 +2,8 @@
|
|
2
2
|
# Name:: Automatic::Plugin::Subscription::TwitterSearch
|
3
3
|
# Author:: soramugi <http://soramugi.net>
|
4
4
|
# Created:: May 30, 2013
|
5
|
-
# Updated::
|
6
|
-
# Copyright:: Copyright (c) 2012-
|
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
|
@@ -24,6 +24,7 @@ module Automatic::Plugin
|
|
24
24
|
def run
|
25
25
|
@pipeline = []
|
26
26
|
retries = 0
|
27
|
+
retry_max = @config['retry'].to_i || 0
|
27
28
|
begin
|
28
29
|
feeds = []
|
29
30
|
@client.search(@config['search'],@config['opt']).results.each do |status|
|
@@ -41,8 +42,8 @@ module Automatic::Plugin
|
|
41
42
|
rescue
|
42
43
|
retries += 1
|
43
44
|
Automatic::Log.puts("error", "ErrorCount: #{retries}")
|
44
|
-
sleep @config['interval'].to_i
|
45
|
-
retry if retries <=
|
45
|
+
sleep ||= @config['interval'].to_i
|
46
|
+
retry if retries <= retry_max
|
46
47
|
end
|
47
48
|
@pipeline
|
48
49
|
end
|
data/plugins/subscription/xml.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# Name:: Automatic::Plugin::Subscription::Xml
|
3
3
|
# Author:: 774 <http://id774.net>
|
4
4
|
# Created:: Jul 12, 2013
|
5
|
-
# Updated::
|
6
|
-
# Copyright:: Copyright (c) 2012-
|
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,13 +22,14 @@ module Automatic::Plugin
|
|
22
22
|
@return_feeds = []
|
23
23
|
@config['urls'].each {|url|
|
24
24
|
retries = 0
|
25
|
+
retry_max = @config['retry'].to_i || 0
|
25
26
|
begin
|
26
27
|
create_rss(URI.encode(url))
|
27
28
|
rescue
|
28
29
|
retries += 1
|
29
30
|
Automatic::Log.puts("error", "ErrorCount: #{retries}, Fault in parsing: #{url}")
|
30
|
-
sleep @config['interval'].to_i
|
31
|
-
retry if retries <=
|
31
|
+
sleep ||= @config['interval'].to_i
|
32
|
+
retry if retries <= retry_max
|
32
33
|
end
|
33
34
|
}
|
34
35
|
@return_feeds
|
@@ -42,7 +43,7 @@ module Automatic::Plugin
|
|
42
43
|
data = ActiveSupport::JSON.decode(json)
|
43
44
|
unless data.nil?
|
44
45
|
rss = Automatic::FeedParser.content_provide(url, data)
|
45
|
-
sleep @config['interval'].to_i
|
46
|
+
sleep ||= @config['interval'].to_i
|
46
47
|
@return_feeds << rss
|
47
48
|
end
|
48
49
|
end
|
@@ -20,14 +20,19 @@ describe Automatic::Recipe do
|
|
20
20
|
Automatic.user_dir = nil
|
21
21
|
end
|
22
22
|
|
23
|
-
|
24
|
-
|
23
|
+
context "with a normal recipe" do
|
24
|
+
subject {
|
25
25
|
recipe = Automatic::Recipe.new(TEST_RECIPE)
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
recipe.each_plugin{recipe}
|
27
|
+
}
|
28
|
+
let(:expected) { [{"module"=>"SubscriptionFeed",
|
29
|
+
"config"=>{"feeds"=>["http://blog.id774.net/post/feed/"]}},
|
30
|
+
{"module"=>"FilterIgnore", "config"=>{"link"=>["hoge"]}},
|
31
|
+
{"module"=>"StorePermalink", "config"=>{"db"=>"test_permalink.db"}}]
|
32
|
+
}
|
33
|
+
|
34
|
+
it "correctly load recipe" do
|
35
|
+
expect(subject).to eq expected
|
31
36
|
end
|
32
37
|
end
|
33
38
|
|
data/spec/lib/automatic_spec.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# Author:: kzgs
|
4
4
|
# 774 <http://id774.net>
|
5
5
|
# Created:: Mar 9, 2012
|
6
|
-
# Updated::
|
6
|
+
# Updated:: Jan 24, 2014
|
7
7
|
# Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
|
8
8
|
# License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
|
9
9
|
|
@@ -27,7 +27,7 @@ describe Automatic do
|
|
27
27
|
describe "#version" do
|
28
28
|
subject { Automatic.const_get(:VERSION) }
|
29
29
|
|
30
|
-
it { expect(subject).to eq "
|
30
|
+
it { expect(subject).to eq "14.1.0" }
|
31
31
|
end
|
32
32
|
|
33
33
|
describe "#(root)_dir" do
|