automatic 14.12.2 → 26.08
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +635 -83
- data/VERSION +1 -1
- data/automatic.gemspec +109 -248
- data/bin/automatic +20 -139
- data/config/feed2console.yml +10 -4
- data/config/feed2markdown.yml +41 -0
- data/doc/AI_TUTORIAL.md +518 -0
- data/doc/BASIC_DESIGN.md +516 -0
- data/doc/COPYING.LESSER +165 -0
- data/doc/DEPLOYMENT.md +824 -0
- data/doc/LICENSE.md +14 -0
- data/doc/PLUGINS.md +1875 -0
- data/doc/PLUGIN_DEVELOPMENT.md +86 -0
- data/doc/POLICY.md +857 -0
- data/doc/QUICKSTART.md +256 -0
- data/doc/RELEASING.md +381 -0
- data/doc/REQUIREMENTS.md +526 -0
- data/doc/VERSIONS +208 -0
- data/lib/automatic/cli.rb +248 -0
- data/lib/automatic/environment.rb +31 -5
- data/lib/automatic/feed_maker.rb +10 -9
- data/lib/automatic/feed_parser.rb +51 -35
- data/lib/automatic/http.rb +107 -0
- data/lib/automatic/log.rb +49 -18
- data/lib/automatic/opml.rb +3 -1
- data/lib/automatic/pipeline.rb +63 -32
- data/lib/automatic/recipe.rb +56 -17
- data/lib/automatic/version.rb +14 -1
- data/lib/automatic.rb +78 -20
- data/plugins/custom_feed/svn_log.rb +73 -32
- data/plugins/custom_feed/web.rb +348 -0
- data/plugins/filter/absolute_uri.rb +43 -27
- data/plugins/filter/accept.rb +38 -45
- data/plugins/filter/claude.rb +217 -0
- data/plugins/filter/clear.rb +12 -8
- data/plugins/filter/description_link.rb +49 -51
- data/plugins/filter/full_feed.rb +158 -52
- data/plugins/filter/gemini.rb +216 -0
- data/plugins/filter/github_feed.rb +38 -26
- data/plugins/filter/ignore.rb +33 -44
- data/plugins/filter/image.rb +36 -25
- data/plugins/filter/image_source.rb +58 -52
- data/plugins/filter/join.rb +107 -0
- data/plugins/filter/one.rb +19 -26
- data/plugins/filter/open_ai.rb +198 -0
- data/plugins/filter/rand.rb +16 -17
- data/plugins/filter/sakura_ai.rb +205 -0
- data/plugins/filter/sanitize.rb +29 -34
- data/plugins/filter/sort.rb +20 -27
- data/plugins/filter/tumblr_resize.rb +31 -23
- data/plugins/notify/ikachan.rb +86 -48
- data/plugins/provide/fluentd.rb +43 -24
- data/plugins/publish/amazon_s3.rb +73 -40
- data/plugins/publish/console.rb +19 -16
- data/plugins/publish/console_link.rb +20 -17
- data/plugins/publish/eject.rb +48 -26
- data/plugins/publish/fluentd.rb +50 -30
- data/plugins/publish/hatena_bookmark.rb +88 -71
- data/plugins/publish/instapaper.rb +69 -59
- data/plugins/publish/markdown.rb +278 -0
- data/plugins/publish/memcached.rb +35 -29
- data/plugins/store/database.rb +50 -48
- data/plugins/store/digest.rb +212 -0
- data/plugins/store/file.rb +99 -68
- data/plugins/store/full_text.rb +32 -25
- data/plugins/store/permalink.rb +18 -22
- data/plugins/subscription/feed.rb +34 -21
- data/plugins/subscription/link.rb +31 -32
- data/plugins/subscription/text.rb +32 -46
- data/plugins/subscription/tumblr.rb +55 -44
- data/plugins/subscription/xml.rb +40 -36
- metadata +108 -321
- data/Gemfile +0 -38
- data/Rakefile +0 -59
- data/doc/ChangeLog +0 -303
- data/doc/PLUGINS +0 -750
- data/doc/PLUGINS.ja +0 -753
- data/doc/README +0 -511
- data/doc/README.ja +0 -519
- data/plugins/filter/google_news.rb +0 -50
- data/plugins/publish/google_calendar.rb +0 -84
- data/plugins/publish/hipchat.rb +0 -46
- data/plugins/publish/pocket.rb +0 -45
- data/plugins/publish/twitter.rb +0 -58
- data/plugins/subscription/chan_toru.rb +0 -57
- data/plugins/subscription/g_guide.rb +0 -57
- data/plugins/subscription/pocket.rb +0 -51
- data/plugins/subscription/twitter.rb +0 -69
- data/plugins/subscription/twitter_search.rb +0 -50
- data/plugins/subscription/weather.rb +0 -33
- data/script/build +0 -84
- data/spec/fixtures/sampleFeeds.tsv +0 -1
- data/spec/fixtures/sampleFeeds2.tsv +0 -2
- data/spec/fixtures/sampleRecipe.yml +0 -24
- data/spec/lib/automatic/log_spec.rb +0 -32
- data/spec/lib/automatic/pipeline_spec.rb +0 -68
- data/spec/lib/automatic/recipe_spec.rb +0 -40
- data/spec/lib/automatic_spec.rb +0 -99
- data/spec/plugins/custom_feed/svn_log_spec.rb +0 -31
- data/spec/plugins/filter/absolute_uri_spec.rb +0 -61
- data/spec/plugins/filter/accept_spec.rb +0 -331
- data/spec/plugins/filter/clear_spec.rb +0 -49
- data/spec/plugins/filter/description_link_spec.rb +0 -138
- data/spec/plugins/filter/full_feed_spec.rb +0 -129
- data/spec/plugins/filter/github_feed_spec.rb +0 -55
- data/spec/plugins/filter/google_news_spec.rb +0 -69
- data/spec/plugins/filter/ignore_spec.rb +0 -328
- data/spec/plugins/filter/image_source_spec.rb +0 -89
- data/spec/plugins/filter/image_spec.rb +0 -65
- data/spec/plugins/filter/one_spec.rb +0 -71
- data/spec/plugins/filter/rand_spec.rb +0 -52
- data/spec/plugins/filter/sanitize_spec.rb +0 -153
- data/spec/plugins/filter/sort_spec.rb +0 -189
- data/spec/plugins/filter/tumblr_resize_spec.rb +0 -109
- data/spec/plugins/notify/ikachan_spec.rb +0 -58
- data/spec/plugins/provide/fluentd_spec.rb +0 -49
- data/spec/plugins/publish/amazon_s3_spec.rb +0 -40
- data/spec/plugins/publish/console_spec.rb +0 -30
- data/spec/plugins/publish/eject_spec.rb +0 -40
- data/spec/plugins/publish/fluentd_spec.rb +0 -40
- data/spec/plugins/publish/google_calendar_spec.rb +0 -83
- data/spec/plugins/publish/hatena_bookmark_spec.rb +0 -134
- data/spec/plugins/publish/hipchat_spec.rb +0 -69
- data/spec/plugins/publish/instapaper_spec.rb +0 -82
- data/spec/plugins/publish/memcached_spec.rb +0 -63
- data/spec/plugins/publish/pocket_spec.rb +0 -51
- data/spec/plugins/publish/twitter_spec.rb +0 -73
- data/spec/plugins/store/file_spec.rb +0 -58
- data/spec/plugins/store/full_text_spec.rb +0 -152
- data/spec/plugins/store/permalink_spec.rb +0 -206
- data/spec/plugins/subscription/chan_toru_spec.rb +0 -56
- data/spec/plugins/subscription/feed_spec.rb +0 -71
- data/spec/plugins/subscription/g_guide_spec.rb +0 -82
- data/spec/plugins/subscription/link_spec.rb +0 -72
- data/spec/plugins/subscription/pocket_spec.rb +0 -57
- data/spec/plugins/subscription/text_spec.rb +0 -84
- data/spec/plugins/subscription/tumblr_spec.rb +0 -74
- data/spec/plugins/subscription/twitter_search_spec.rb +0 -57
- data/spec/plugins/subscription/twitter_spec.rb +0 -73
- data/spec/plugins/subscription/weather_spec.rb +0 -44
- data/spec/plugins/subscription/xml_spec.rb +0 -84
- data/spec/spec_helper.rb +0 -106
- data/spec/user_dir/plugins/store/mock.rb +0 -16
- data/test/fixtures/sampleOPML.xml +0 -11
- data/test/integration/test_absoluteurl.yml +0 -25
- data/test/integration/test_activerecord.yml +0 -24
- data/test/integration/test_add_pocket.yml +0 -26
- data/test/integration/test_chan_toru.yml +0 -21
- data/test/integration/test_descriptionlink.yml +0 -21
- data/test/integration/test_fluentd.yml +0 -22
- data/test/integration/test_fulltext.yml +0 -30
- data/test/integration/test_google_news.yml +0 -21
- data/test/integration/test_googlealert.yml +0 -21
- data/test/integration/test_hatenabookmark.yml +0 -30
- data/test/integration/test_ignore.yml +0 -25
- data/test/integration/test_ignore2.yml +0 -22
- data/test/integration/test_image2local.yml +0 -33
- data/test/integration/test_instapaper.yml +0 -26
- data/test/integration/test_link2local.yml +0 -34
- data/test/integration/test_one.yml +0 -23
- data/test/integration/test_pocket.yml +0 -22
- data/test/integration/test_rand.yml +0 -21
- data/test/integration/test_sanitize.yml +0 -23
- data/test/integration/test_sort.yml +0 -36
- data/test/integration/test_svnlog.yml +0 -15
- data/test/integration/test_text2feed.yml +0 -36
- data/test/integration/test_tumblr2local.yml +0 -43
- data/test/integration/test_twitter_search.yml +0 -22
- data/test/integration/test_weather.yml +0 -19
- data/test/integration/test_xml2fluentd.yml +0 -21
- data/vendor/.gitkeep +0 -0
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Name:: Automatic::Plugin::Subscription::Feed
|
|
3
|
-
# Author:: 774 <http://id774.net>
|
|
4
|
-
# Updated:: Feb 8, 2013
|
|
5
|
-
# Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
|
|
6
|
-
# License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
|
|
7
|
-
|
|
8
|
-
require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
|
|
9
|
-
|
|
10
|
-
require 'subscription/feed'
|
|
11
|
-
|
|
12
|
-
describe Automatic::Plugin::SubscriptionFeed do
|
|
13
|
-
context "with empty feeds" do
|
|
14
|
-
subject {
|
|
15
|
-
Automatic::Plugin::SubscriptionFeed.new(
|
|
16
|
-
{ 'feeds' => [] }
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
its(:run) { should be_empty }
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
context "with feeds whose invalid URL" do
|
|
24
|
-
subject {
|
|
25
|
-
Automatic::Plugin::SubscriptionFeed.new(
|
|
26
|
-
{ 'feeds' => ["invalid_url"] }
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
its(:run) { should be_empty }
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
context "with feeds whose valid URL" do
|
|
34
|
-
subject {
|
|
35
|
-
Automatic::Plugin::SubscriptionFeed.new(
|
|
36
|
-
{ 'feeds' => [
|
|
37
|
-
"https://github.com/automaticruby/automaticruby/commits/master.atom"]
|
|
38
|
-
}
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
its(:run) { should have(1).feed }
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
context "with retry to feeds whose valid URL" do
|
|
46
|
-
subject {
|
|
47
|
-
Automatic::Plugin::SubscriptionFeed.new(
|
|
48
|
-
{ 'feeds' => [
|
|
49
|
-
"https://github.com/automaticruby/automaticruby/commits/master.atom"],
|
|
50
|
-
'retry' => 3,
|
|
51
|
-
'interval' => 5
|
|
52
|
-
}
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
its(:run) { should have(1).feed }
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
context "with retry to feeds whose invalid URL" do
|
|
60
|
-
subject {
|
|
61
|
-
Automatic::Plugin::SubscriptionFeed.new(
|
|
62
|
-
{ 'feeds' => ["invalid_url"],
|
|
63
|
-
'retry' => 1,
|
|
64
|
-
'interval' => 1
|
|
65
|
-
}
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
its(:run) { should be_empty }
|
|
70
|
-
end
|
|
71
|
-
end
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Name:: Automatic::Plugin::Subscription::GGuide
|
|
3
|
-
# Author:: soramugi <http://soramugi.net>
|
|
4
|
-
# Created:: Jun 28, 2013
|
|
5
|
-
# Updated:: Jun 28, 2013
|
|
6
|
-
# Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
|
|
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/g_guide'
|
|
12
|
-
|
|
13
|
-
def g_guide(config = {}, pipeline = [])
|
|
14
|
-
Automatic::Plugin::SubscriptionGGuide.new(config,pipeline)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
describe 'Automatic::Plugin::SubscriptionGGuide' do
|
|
18
|
-
context 'when config' do
|
|
19
|
-
describe 'is empty' do
|
|
20
|
-
subject { g_guide }
|
|
21
|
-
|
|
22
|
-
its(:feed_url) {
|
|
23
|
-
should == Automatic::Plugin::SubscriptionGGuide::G_GUIDE_RSS +
|
|
24
|
-
'stationPlatformId=0&'
|
|
25
|
-
}
|
|
26
|
-
end
|
|
27
|
-
describe 'keyword is anime' do
|
|
28
|
-
config = { 'keyword' => 'anime' }
|
|
29
|
-
subject { g_guide(config) }
|
|
30
|
-
|
|
31
|
-
it 'feed_url' do
|
|
32
|
-
subject.feed_url(config['keyword']).should == URI::Parser.new.escape(
|
|
33
|
-
Automatic::Plugin::SubscriptionGGuide::G_GUIDE_RSS +
|
|
34
|
-
"condition.keyword=#{config['keyword']}&" +
|
|
35
|
-
'stationPlatformId=0&')
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
describe 'station is 地上波' do
|
|
39
|
-
config = { 'station' => '地上波' }
|
|
40
|
-
subject { g_guide(config) }
|
|
41
|
-
|
|
42
|
-
its(:feed_url) {
|
|
43
|
-
should == URI::Parser.new.escape(
|
|
44
|
-
Automatic::Plugin::SubscriptionGGuide::G_GUIDE_RSS +
|
|
45
|
-
'stationPlatformId=1&')
|
|
46
|
-
}
|
|
47
|
-
end
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
context 'when feed is empty' do
|
|
51
|
-
describe 'attestation error' do
|
|
52
|
-
subject { g_guide }
|
|
53
|
-
before do
|
|
54
|
-
subject.should_receive(:feed_url).and_return('')
|
|
55
|
-
end
|
|
56
|
-
its(:run) { should be_empty }
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
describe 'interval & retry was used error' do
|
|
60
|
-
config = {'interval' => 1, 'retry' => 1}
|
|
61
|
-
subject { g_guide(config) }
|
|
62
|
-
before do
|
|
63
|
-
subject.should_receive(:feed_url).exactly(2).times.and_return('')
|
|
64
|
-
end
|
|
65
|
-
its(:run) { should be_empty }
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
context 'when feed' do
|
|
70
|
-
describe 'config keyword' do
|
|
71
|
-
config = { 'keyword' => 'アニメ', 'station' => '地上波' }
|
|
72
|
-
subject { g_guide(config) }
|
|
73
|
-
its(:run) { should have(1).feed }
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
describe 'config keyword ","' do
|
|
77
|
-
config = { 'keyword' => 'おじゃる丸,忍たま', 'station' => '地上波' }
|
|
78
|
-
subject { g_guide(config) }
|
|
79
|
-
its(:run) { should have(2).feed }
|
|
80
|
-
end
|
|
81
|
-
end
|
|
82
|
-
end
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Name:: Automatic::Plugin::Subscription::Link
|
|
3
|
-
# Author:: 774 <http://id774.net>
|
|
4
|
-
# Created:: Sep 18, 2012
|
|
5
|
-
# Updated:: Feb 8, 2013
|
|
6
|
-
# Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
|
|
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/link'
|
|
12
|
-
|
|
13
|
-
describe Automatic::Plugin::SubscriptionLink do
|
|
14
|
-
context "with empty URLs" do
|
|
15
|
-
subject {
|
|
16
|
-
Automatic::Plugin::SubscriptionLink.new(
|
|
17
|
-
{ 'urls' => [] })
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
its(:run) { should be_empty }
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
context "with URLs whose invalid URL" do
|
|
24
|
-
subject {
|
|
25
|
-
Automatic::Plugin::SubscriptionLink.new(
|
|
26
|
-
{ 'urls' => ["invalid_url"] }
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
its(:run) { should be_empty }
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
context "with URLs whose valid URL" do
|
|
34
|
-
subject {
|
|
35
|
-
Automatic::Plugin::SubscriptionLink.new(
|
|
36
|
-
{ 'urls' => [
|
|
37
|
-
"http://id774.net"],
|
|
38
|
-
'interval' => 1
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
its(:run) { should have(1).item }
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
context "with retry to URLs whose valid URL" do
|
|
47
|
-
subject {
|
|
48
|
-
Automatic::Plugin::SubscriptionLink.new(
|
|
49
|
-
{ 'urls' => [
|
|
50
|
-
"http://id774.net"],
|
|
51
|
-
'interval' => 2,
|
|
52
|
-
'retry' => 3
|
|
53
|
-
}
|
|
54
|
-
)
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
its(:run) { should have(1).item }
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
context "with retry to URLs whose invalid URL" do
|
|
61
|
-
subject {
|
|
62
|
-
Automatic::Plugin::SubscriptionLink.new(
|
|
63
|
-
{ 'urls' => ["invalid_url"],
|
|
64
|
-
'interval' => 1,
|
|
65
|
-
'retry' => 1
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
its(:run) { should be_empty }
|
|
71
|
-
end
|
|
72
|
-
end
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Name:: Automatic::Plugin::Subscription::Pocket
|
|
3
|
-
# Author:: soramugi <http://soramugi.net>
|
|
4
|
-
# Created:: May 21, 2013
|
|
5
|
-
# Updated:: Feb 25, 2014
|
|
6
|
-
# Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
|
|
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/pocket'
|
|
12
|
-
|
|
13
|
-
def pocket(config = {}, pipeline = [])
|
|
14
|
-
Automatic::Plugin::SubscriptionPocket.new(config,pipeline)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
describe 'Automatic::Plugin::SubscriptionPocket' do
|
|
18
|
-
context 'when feed is empty' do
|
|
19
|
-
describe 'attestation error' do
|
|
20
|
-
subject { pocket }
|
|
21
|
-
|
|
22
|
-
its(:run) { should be_empty }
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
describe 'interval & retry was used error' do
|
|
26
|
-
config = {'interval' => 1, 'retry' => 1}
|
|
27
|
-
subject { pocket(config) }
|
|
28
|
-
|
|
29
|
-
its(:run) { should be_empty }
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
context 'when feed' do
|
|
34
|
-
describe 'config optional' do
|
|
35
|
-
config = { 'optional' => {
|
|
36
|
-
'count' => 1,
|
|
37
|
-
'favorite' => 1
|
|
38
|
-
}}
|
|
39
|
-
subject { pocket(config) }
|
|
40
|
-
before do
|
|
41
|
-
retrieve = {'list' => {
|
|
42
|
-
'id' => {
|
|
43
|
-
'given_url' => 'http://github.com',
|
|
44
|
-
'given_title' => 'GitHub',
|
|
45
|
-
'excerpt' => 'github'
|
|
46
|
-
}}}
|
|
47
|
-
client = double("client")
|
|
48
|
-
client.should_receive(:retrieve).
|
|
49
|
-
with(config['optional']).
|
|
50
|
-
and_return(retrieve)
|
|
51
|
-
subject.instance_variable_set(:@client, client)
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
its(:run) { should have(1).item }
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Name:: Automatic::Plugin::Subscription::Text
|
|
3
|
-
# Author:: soramugi <http://soramugi.net>
|
|
4
|
-
# 774 <http://id774.net>
|
|
5
|
-
# Created:: May 6, 2013
|
|
6
|
-
# Updated:: Feb 19, 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 File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
|
|
11
|
-
|
|
12
|
-
require 'subscription/text'
|
|
13
|
-
|
|
14
|
-
describe Automatic::Plugin::SubscriptionText do
|
|
15
|
-
context "with empty titles" do
|
|
16
|
-
subject {
|
|
17
|
-
Automatic::Plugin::SubscriptionText.new(
|
|
18
|
-
{ 'titles' => [] }
|
|
19
|
-
)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
its(:run) { should be_empty }
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
context "with titles whose return feed" do
|
|
26
|
-
subject {
|
|
27
|
-
Automatic::Plugin::SubscriptionText.new(
|
|
28
|
-
{ 'titles' => ["hugehuge"] }
|
|
29
|
-
)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
its(:run) { should have(1).feed }
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
context "with urls whose return feed" do
|
|
36
|
-
subject {
|
|
37
|
-
Automatic::Plugin::SubscriptionText.new(
|
|
38
|
-
{ 'urls' => ["http://hugehuge"] }
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
its(:run) { should have(1).feed }
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
context "with feeds whose return feed" do
|
|
46
|
-
subject {
|
|
47
|
-
Automatic::Plugin::SubscriptionText.new(
|
|
48
|
-
{ 'feeds' => [ {'title' => 'huge', 'url' => "http://hugehuge"} ] }
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
its(:run) { should have(1).feed }
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
context "with feeds including full fields whose return feed" do
|
|
56
|
-
subject {
|
|
57
|
-
Automatic::Plugin::SubscriptionText.new(
|
|
58
|
-
{ 'feeds' => [ {'title' => 'huge', 'url' => "http://hugehuge", 'description' => "aaa", 'comments' => "bbb", 'author' => "ccc" } ] }
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
its(:run) { should have(1).feed }
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
context "with file whose return feed" do
|
|
66
|
-
subject {
|
|
67
|
-
Automatic::Plugin::SubscriptionText.new(
|
|
68
|
-
{ 'files' => ["spec/fixtures/sampleFeeds.tsv"] }
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
its(:run) { should have(1).feed }
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
context "with files whose return feed" do
|
|
76
|
-
subject {
|
|
77
|
-
Automatic::Plugin::SubscriptionText.new(
|
|
78
|
-
{ 'files' => ["spec/fixtures/sampleFeeds.tsv", "spec/fixtures/sampleFeeds2.tsv"] }
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
its(:run) { should have(1).feed }
|
|
83
|
-
end
|
|
84
|
-
end
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Name:: Automatic::Plugin::Subscription::Tumblr
|
|
3
|
-
# Author:: 774 <http://id774.net>
|
|
4
|
-
# Created:: Oct 16, 2012
|
|
5
|
-
# Updated:: Feb 8, 2013
|
|
6
|
-
# Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
|
|
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/tumblr'
|
|
12
|
-
|
|
13
|
-
describe Automatic::Plugin::SubscriptionTumblr do
|
|
14
|
-
context "with empty URLs" do
|
|
15
|
-
subject {
|
|
16
|
-
Automatic::Plugin::SubscriptionTumblr.new(
|
|
17
|
-
{ 'urls' => [] }
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
its(:run) { should be_empty }
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
context "with URLs whose invalid URL" do
|
|
25
|
-
subject {
|
|
26
|
-
Automatic::Plugin::SubscriptionTumblr.new(
|
|
27
|
-
{ 'urls' => ["invalid_url"] }
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
its(:run) { should be_empty }
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
context "with URLs whose valid URL" do
|
|
35
|
-
subject {
|
|
36
|
-
Automatic::Plugin::SubscriptionTumblr.new(
|
|
37
|
-
{ 'urls' => [
|
|
38
|
-
"http://reblog.id774.net"]
|
|
39
|
-
}
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
its(:run) { should have(1).item }
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
context "with URLs and Pages" do
|
|
47
|
-
subject {
|
|
48
|
-
Automatic::Plugin::SubscriptionTumblr.new(
|
|
49
|
-
{ 'urls' => [
|
|
50
|
-
"http://reblog.id774.net"],
|
|
51
|
-
'pages' => 3,
|
|
52
|
-
'interval' => 5,
|
|
53
|
-
'retry' => 5
|
|
54
|
-
}
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
its(:run) { should have(3).item }
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
context "with retry to URLs whose invalid URL" do
|
|
62
|
-
subject {
|
|
63
|
-
Automatic::Plugin::SubscriptionTumblr.new(
|
|
64
|
-
{ 'urls' => ["invalid_url"],
|
|
65
|
-
'pages' => 3,
|
|
66
|
-
'interval' => 1,
|
|
67
|
-
'retry' => 2
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
its(:run) { should be_empty }
|
|
73
|
-
end
|
|
74
|
-
end
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Name:: Automatic::Plugin::Subscription::TwitterSearch
|
|
3
|
-
# Author:: soramugi <http://soramugi.net>
|
|
4
|
-
# Created:: May 30, 2013
|
|
5
|
-
# Updated:: Feb 25, 2014
|
|
6
|
-
# Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
|
|
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/twitter_search'
|
|
12
|
-
|
|
13
|
-
def twitter_search(config = {}, pipeline = [])
|
|
14
|
-
Automatic::Plugin::SubscriptionTwitterSearch.new(config,pipeline)
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
describe 'Automatic::Plugin::SubscriptionTwitterSearch' do
|
|
18
|
-
context 'when feed is empty' do
|
|
19
|
-
|
|
20
|
-
describe 'attestation error' do
|
|
21
|
-
subject { twitter_search }
|
|
22
|
-
|
|
23
|
-
its(:run) { should be_empty }
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
describe 'interval & retry was used error' do
|
|
27
|
-
config = {'interval' => 1, 'retry' => 1}
|
|
28
|
-
subject { twitter_search(config) }
|
|
29
|
-
|
|
30
|
-
its(:run) { should be_empty }
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
context 'when feed' do
|
|
36
|
-
describe 'config optional' do
|
|
37
|
-
config = { 'search' => 'ruby', 'opt' => { 'lang' => 'ja', 'count' => 1 }}
|
|
38
|
-
subject { twitter_search(config) }
|
|
39
|
-
before do
|
|
40
|
-
status = Hashie::Mash.new
|
|
41
|
-
status.user = {'screen_name' => 'soramugi'}
|
|
42
|
-
status.id = 12345
|
|
43
|
-
status.text = 'twitter_search rspec'
|
|
44
|
-
status.created_at = Time.now
|
|
45
|
-
search = Hashie::Mash.new
|
|
46
|
-
search.results = [status]
|
|
47
|
-
client = double("client")
|
|
48
|
-
client.should_receive(:search)
|
|
49
|
-
.with(config['search'],config['opt'])
|
|
50
|
-
.and_return(search)
|
|
51
|
-
subject.instance_variable_set(:@client, client)
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
its(:run) { should have(1).item }
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Name:: Automatic::Plugin::Subscription::Twitter
|
|
3
|
-
# Author:: 774 <http://id774.net>
|
|
4
|
-
# Created:: Sep 10, 2012
|
|
5
|
-
# Updated:: Feb 8, 2013
|
|
6
|
-
# Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
|
|
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/twitter'
|
|
12
|
-
|
|
13
|
-
describe Automatic::Plugin::SubscriptionTwitter do
|
|
14
|
-
context "with empty URLs" do
|
|
15
|
-
subject {
|
|
16
|
-
Automatic::Plugin::SubscriptionTwitter.new(
|
|
17
|
-
{ 'urls' => [] }
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
its(:run) { should be_empty }
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
context "with URLs whose invalid URL" do
|
|
25
|
-
subject {
|
|
26
|
-
Automatic::Plugin::SubscriptionTwitter.new(
|
|
27
|
-
{ 'urls' => ["invalid_url"] }
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
its(:run) { should be_empty }
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
context "with URLs whose valid URL" do
|
|
35
|
-
subject {
|
|
36
|
-
Automatic::Plugin::SubscriptionTwitter.new(
|
|
37
|
-
{ 'urls' => [
|
|
38
|
-
"http://id774.net/test/twitter/favorites.html"],
|
|
39
|
-
'interval' => 1
|
|
40
|
-
}
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
its(:run) { should have(1).item }
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
context "with retry to URLs whose valid URL" do
|
|
48
|
-
subject {
|
|
49
|
-
Automatic::Plugin::SubscriptionTwitter.new(
|
|
50
|
-
{ 'urls' => [
|
|
51
|
-
"http://id774.net/test/twitter/favorites.html"],
|
|
52
|
-
'interval' => 2,
|
|
53
|
-
'retry' => 1
|
|
54
|
-
}
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
its(:run) { should have(1).item }
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
context "with retry to URLs whose invalid URL" do
|
|
62
|
-
subject {
|
|
63
|
-
Automatic::Plugin::SubscriptionTwitter.new(
|
|
64
|
-
{ 'urls' => ["invalid_url"],
|
|
65
|
-
'interval' => 1,
|
|
66
|
-
'retry' => 2
|
|
67
|
-
}
|
|
68
|
-
)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
its(:run) { should be_empty }
|
|
72
|
-
end
|
|
73
|
-
end
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Name:: Automatic::Plugin::Subscription::Weather
|
|
3
|
-
# Author:: soramugi <http://soramugi.net>
|
|
4
|
-
# Created:: May 12, 2013
|
|
5
|
-
# Updated:: May 12, 2013
|
|
6
|
-
# Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
|
|
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/weather'
|
|
12
|
-
|
|
13
|
-
describe Automatic::Plugin::SubscriptionWeather do
|
|
14
|
-
context "with empty zipcode" do
|
|
15
|
-
subject {
|
|
16
|
-
Automatic::Plugin::SubscriptionWeather.new(
|
|
17
|
-
{}
|
|
18
|
-
)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
its(:run) { should be_empty }
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
context "with zipcode whose return feed" do
|
|
25
|
-
subject {
|
|
26
|
-
Automatic::Plugin::SubscriptionWeather.new(
|
|
27
|
-
{ 'zipcode' => '166-0003' }
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
its(:run) { should have(1).feed }
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
context "with zipcode and day whose return feed" do
|
|
35
|
-
subject {
|
|
36
|
-
Automatic::Plugin::SubscriptionWeather.new(
|
|
37
|
-
{ 'zipcode' => '166-0003', 'day' => 'tomorrow' }
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
its(:run) { should have(1).feed }
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
end
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Name:: Automatic::Plugin::Subscription::Xml
|
|
3
|
-
# Author:: 774 <http://id774.net>
|
|
4
|
-
# Created:: Jul 12, 2013
|
|
5
|
-
# Updated:: Jul 12, 2013
|
|
6
|
-
# Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
|
|
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/xml'
|
|
12
|
-
|
|
13
|
-
describe Automatic::Plugin::SubscriptionXml do
|
|
14
|
-
context "with empty URLs" do
|
|
15
|
-
subject {
|
|
16
|
-
Automatic::Plugin::SubscriptionXml.new(
|
|
17
|
-
{ 'urls' => [] })
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
its(:run) { should be_empty }
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
context "with URLs whose invalid URL" do
|
|
24
|
-
subject {
|
|
25
|
-
Automatic::Plugin::SubscriptionXml.new(
|
|
26
|
-
{ 'urls' => ["invalid_url"] }
|
|
27
|
-
)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
its(:run) { should be_empty }
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
context "with URLs whose invalid Xml" do
|
|
34
|
-
subject {
|
|
35
|
-
Automatic::Plugin::SubscriptionXml.new(
|
|
36
|
-
{ 'urls' => [
|
|
37
|
-
"http://id774.net"]
|
|
38
|
-
}
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
its(:run) { should be_empty }
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
context "with URLs whose valid XML" do
|
|
46
|
-
subject {
|
|
47
|
-
Automatic::Plugin::SubscriptionXml.new(
|
|
48
|
-
{ 'urls' => [
|
|
49
|
-
"http://id774.net/test/xml/data"],
|
|
50
|
-
'interval' => 1
|
|
51
|
-
}
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
its(:run) { should have(1).item }
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
context "with retry to URLs whose valid XML" do
|
|
59
|
-
subject {
|
|
60
|
-
Automatic::Plugin::SubscriptionXml.new(
|
|
61
|
-
{ 'urls' => [
|
|
62
|
-
"http://id774.net/test/xml/data"],
|
|
63
|
-
'interval' => 2,
|
|
64
|
-
'retry' => 3
|
|
65
|
-
}
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
its(:run) { should have(1).item }
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
context "with retry to URLs whose invalid XML" do
|
|
73
|
-
subject {
|
|
74
|
-
Automatic::Plugin::SubscriptionXml.new(
|
|
75
|
-
{ 'urls' => ["invalid_url"],
|
|
76
|
-
'interval' => 1,
|
|
77
|
-
'retry' => 1
|
|
78
|
-
}
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
its(:run) { should be_empty }
|
|
83
|
-
end
|
|
84
|
-
end
|