automatic 12.6.0 → 12.9.1
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.
- data/VERSION +1 -1
- data/automatic.gemspec +10 -22
- data/bin/automatic-config +4 -4
- data/doc/ChangeLog +30 -1
- data/doc/PLUGINS +46 -178
- data/doc/PLUGINS.ja +46 -177
- data/doc/README +2 -10
- data/doc/README.ja +2 -9
- data/lib/automatic.rb +2 -3
- data/plugins/custom_feed/svn_log.rb +0 -1
- data/plugins/filter/absolute_uri.rb +39 -0
- data/plugins/filter/image.rb +46 -0
- data/plugins/filter/reverse.rb +0 -1
- data/plugins/store/database.rb +8 -23
- data/plugins/store/full_text.rb +4 -4
- data/plugins/store/permalink.rb +12 -9
- data/plugins/store/target_link.rb +3 -2
- data/plugins/subscription/link.rb +55 -0
- data/plugins/subscription/twitter.rb +57 -0
- data/script/build +1 -1
- data/spec/lib/automatic_spec.rb +3 -2
- data/spec/plugins/custom_feed/svn_log_spec.rb +1 -1
- data/spec/plugins/filter/absolute_uri_spec.rb +61 -0
- data/spec/plugins/filter/image_source_spec.rb +1 -1
- data/spec/plugins/filter/image_spec.rb +65 -0
- data/spec/plugins/publish/google_calendar_spec.rb +1 -1
- data/spec/plugins/store/full_text_spec.rb +0 -1
- data/spec/plugins/store/permalink_spec.rb +52 -3
- data/spec/plugins/store/target_link_spec.rb +1 -2
- data/spec/plugins/subscription/feed_spec.rb +0 -1
- data/spec/plugins/subscription/{uri_spec.rb → link_spec.rb} +9 -10
- data/spec/plugins/subscription/twitter_spec.rb +42 -0
- data/spec/spec_helper.rb +12 -26
- data/spec/user_dir/plugins/store/mock.rb +1 -1
- data/test/integration/test_get_image.yml +4 -6
- data/test/integration/test_image2local.yml +1 -1
- metadata +10 -22
- data/config/html2console.yml +0 -16
- data/plugins/extract/link.rb +0 -32
- data/plugins/filter/image_link.rb +0 -37
- data/plugins/publish/dump.rb +0 -24
- data/plugins/store/link.rb +0 -47
- data/plugins/store/target.rb +0 -41
- data/plugins/subscription/uri.rb +0 -31
- data/spec/fixtures/extractLink.html +0 -14
- data/spec/fixtures/filterImageLink.html +0 -34
- data/spec/fixtures/publishDump.html +0 -14
- data/spec/fixtures/storeLink.html +0 -34
- data/spec/fixtures/storeLink2.html +0 -36
- data/spec/fixtures/storeTarget.html +0 -11
- data/spec/fixtures/storeTarget2.html +0 -11
- data/spec/plugins/extract/link_spec.rb +0 -38
- data/spec/plugins/filter/image_link_spec.rb +0 -51
- data/spec/plugins/publish/dump_spec.rb +0 -32
- data/spec/plugins/store/link_spec.rb +0 -47
- data/spec/plugins/store/target_spec.rb +0 -41
@@ -1,51 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
# Name:: Automatic::Plugin::Filter::ImageLink
|
3
|
-
# Author:: 774 <http://id774.net>
|
4
|
-
# Created:: Jun 13, 2012
|
5
|
-
# Updated:: Jun 13, 2012
|
6
|
-
# Copyright:: 774 Copyright (c) 2012
|
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 'filter/image_link'
|
12
|
-
|
13
|
-
describe Automatic::Plugin::FilterImageLink do
|
14
|
-
context "with html contain link tag" do
|
15
|
-
subject {
|
16
|
-
Automatic::Plugin::FilterImageLink.new({},
|
17
|
-
AutomaticSpec.generate_pipeline {
|
18
|
-
link "filterImageLink.html"
|
19
|
-
}
|
20
|
-
)
|
21
|
-
}
|
22
|
-
|
23
|
-
describe "#run" do
|
24
|
-
its(:run) { should have(10).items }
|
25
|
-
specify {
|
26
|
-
subject.run
|
27
|
-
expect = "http://link_1.jpg"
|
28
|
-
subject.instance_variable_get(:@return_html)[0].should == expect
|
29
|
-
expect = "http://link_2.jpg"
|
30
|
-
subject.instance_variable_get(:@return_html)[1].should == expect
|
31
|
-
expect = "http://link_3.JPG"
|
32
|
-
subject.instance_variable_get(:@return_html)[2].should == expect
|
33
|
-
expect = "http://link_4.png"
|
34
|
-
subject.instance_variable_get(:@return_html)[3].should == expect
|
35
|
-
expect = "http://link_5.jpeg"
|
36
|
-
subject.instance_variable_get(:@return_html)[4].should == expect
|
37
|
-
expect = "http://link_6.PNG"
|
38
|
-
subject.instance_variable_get(:@return_html)[5].should == expect
|
39
|
-
expect = "http://link_8.gif"
|
40
|
-
subject.instance_variable_get(:@return_html)[6].should == expect
|
41
|
-
expect = "http://link_9.GIF"
|
42
|
-
subject.instance_variable_get(:@return_html)[7].should == expect
|
43
|
-
expect = "http://link_10.tiff"
|
44
|
-
subject.instance_variable_get(:@return_html)[8].should == expect
|
45
|
-
expect = "http://link_11.TIFF"
|
46
|
-
subject.instance_variable_get(:@return_html)[9].should == expect
|
47
|
-
}
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
# Name:: Automatic::Plugin::Publish::Dump
|
3
|
-
# Author:: 774 <http://id774.net>
|
4
|
-
# Created:: Jun 13, 2012
|
5
|
-
# Updated:: Jun 13, 2012
|
6
|
-
# Copyright:: 774 Copyright (c) 2012
|
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 'publish/dump'
|
12
|
-
|
13
|
-
describe Automatic::Plugin::PublishDump do
|
14
|
-
|
15
|
-
context "with contain normal HTML" do
|
16
|
-
subject {
|
17
|
-
Automatic::Plugin::PublishDump.new({},
|
18
|
-
AutomaticSpec.generate_pipeline {
|
19
|
-
html "publishDump.html"
|
20
|
-
}
|
21
|
-
)}
|
22
|
-
|
23
|
-
describe "#run" do
|
24
|
-
its(:run) { should have(1).items }
|
25
|
-
specify {
|
26
|
-
subject.run
|
27
|
-
expect = "<!DOCTYPE html>\n<html lang=\"ja\">\n <head>\n <title>Sample</title>\n </head>\n <body>\n <p>A simple <b>test</b> string.</p>\n <a href=\"http://id774.net\">id774.net</a>\n <a href=\"http://reblog.id774.net\">reblog.id774.net</a>\n <a href=\"http://oh-news.net/live/wp-content/uploads/2011/04/Eila_omote.jpg\">\n <img src=\"http://24.media.tumblr.com/tumblr_m5gneyJmsH1qza5ppo1_500.jpg\" alt=\"\" /></a>\n <a href=\"http://blog.id774.net/post/\">blog.id774.net</a>\n </body>\n</html>\n"
|
28
|
-
subject.instance_variable_get(:@pipeline)[0].should == expect
|
29
|
-
}
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
# Name:: Automatic::Plugin::Store::Link
|
3
|
-
# Author:: 774 <http://id774.net>
|
4
|
-
# Created:: Jun 13, 2012
|
5
|
-
# Updated:: Jun 13, 2012
|
6
|
-
# Copyright:: 774 Copyright (c) 2012
|
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 'store/link'
|
12
|
-
|
13
|
-
require 'pathname'
|
14
|
-
|
15
|
-
describe Automatic::Plugin::StoreLink do
|
16
|
-
before do
|
17
|
-
@db_filename = "test_link.db"
|
18
|
-
db_path = Pathname(AutomaticSpec.db_dir).cleanpath+"#{@db_filename}"
|
19
|
-
db_path.delete if db_path.exist?
|
20
|
-
Automatic::Plugin::StoreLink.new({"db" => @db_filename}).run
|
21
|
-
end
|
22
|
-
|
23
|
-
it "should store 14 record for the new link" do
|
24
|
-
instance = Automatic::Plugin::StoreLink.new({"db" => @db_filename},
|
25
|
-
AutomaticSpec.generate_pipeline {
|
26
|
-
link "storeLink.html"
|
27
|
-
}
|
28
|
-
)
|
29
|
-
|
30
|
-
lambda {
|
31
|
-
instance.run.should have(14).items
|
32
|
-
}.should change(Automatic::Plugin::Link, :count).by(14)
|
33
|
-
end
|
34
|
-
|
35
|
-
it "should not store record for the existent link" do
|
36
|
-
instance = Automatic::Plugin::StoreLink.new({"db" => @db_filename},
|
37
|
-
AutomaticSpec.generate_pipeline {
|
38
|
-
link "storeLink2.html"
|
39
|
-
}
|
40
|
-
)
|
41
|
-
|
42
|
-
instance.run.should have(15).items
|
43
|
-
lambda {
|
44
|
-
instance.run.should have(0).items
|
45
|
-
}.should change(Automatic::Plugin::Link, :count).by(0)
|
46
|
-
end
|
47
|
-
end
|
@@ -1,41 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
# Name:: Automatic::Plugin::Store::Target
|
3
|
-
# Author:: 774 <http://id774.net>
|
4
|
-
# Created:: Jun 13, 2012
|
5
|
-
# Updated:: Jun 14, 2012
|
6
|
-
# Copyright:: 774 Copyright (c) 2012
|
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 'store/target'
|
12
|
-
|
13
|
-
require 'tmpdir'
|
14
|
-
require 'pathname'
|
15
|
-
|
16
|
-
describe Automatic::Plugin::StoreTarget do
|
17
|
-
it "should store the target link" do
|
18
|
-
Dir.mktmpdir do |dir|
|
19
|
-
instance = Automatic::Plugin::StoreTarget.new(
|
20
|
-
{ "path" => dir },
|
21
|
-
AutomaticSpec.generate_pipeline {
|
22
|
-
link "storeTarget.html"
|
23
|
-
}
|
24
|
-
)
|
25
|
-
instance.run.should have(1).item
|
26
|
-
(Pathname(dir)+"Eila_omote.jpg").should be_exist
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should error during file download" do
|
31
|
-
Dir.mktmpdir do |dir|
|
32
|
-
instance = Automatic::Plugin::StoreTarget.new(
|
33
|
-
{ "path" => dir },
|
34
|
-
AutomaticSpec.generate_pipeline {
|
35
|
-
link "storeTarget2.html"
|
36
|
-
}
|
37
|
-
)
|
38
|
-
instance.run.should have(1).items
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|