File tree Expand file tree Collapse file tree 6 files changed +25
-25
lines changed
Expand file tree Collapse file tree 6 files changed +25
-25
lines changed Original file line number Diff line number Diff line change @@ -409,17 +409,17 @@ StoreFullText
409409 db: DB_NAME
410410
411411
412- StoreTargetLink
413- ---------------
412+ StoreFile
413+ ---------
414414[Path]
415- /plugins/store/target_link .rb
415+ /plugins/store/file .rb
416416
417417[Abstract]
418- Store target locally .
418+ Store target to local file system .
419419 This emulate "Right click to save".
420420
421421[Syntax]
422- - Module: StoreTargetLink
422+ - Module: StoreFile
423423 config:
424424 path: SAVE_TO_PATH
425425 retry: RETRY_COUNT
Original file line number Diff line number Diff line change @@ -412,16 +412,16 @@ StoreFullText
412412 db: SQLite3 DB 名
413413
414414
415- StoreTargetLink
416- ---------------
415+ StoreFile
416+ ---------
417417[パス]
418- /plugins/store/target_link .rb
418+ /plugins/store/file .rb
419419
420420[概要]
421- リンク先のコンテンツをローカルに保存する
421+ リンク先のコンテンツをローカルファイルシステムに保存する
422422
423423[レシピ記法]
424- - module: StoreTargetLink
424+ - module: StoreFile
425425 config:
426426 path: 保存先のフォルダ
427427 retry: エラー時のリトライ回数 (回数, 省略時 0)
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ plugins:
112112
113113 - module: FilterTumblrResize
114114
115- - module: StoreTargetLink
115+ - module: StoreFile
116116 config:
117117 path: /Users/yourname/Desktop/
118118 interval: 1
@@ -121,7 +121,7 @@ In the case of sample this recipe.
1211211. Subscribe to RSS feeds of Tumblr by SubScriptionFeed.
1221222. Save permalink to database by StorePermalink.
1231233. Specify the URL of the image by FilterImage and FilterTumblrResize.
124- 4. Downloading image file of Tumblr by StoreTargetLink .
124+ 4. Downloading image file of Tumblr by StoreFile .
125125
126126
127127Showing another example as follows.
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ plugins:
117117
118118 - module: FilterTumblrResize
119119
120- - module: StoreTargetLink
120+ - module: StoreFile
121121 config:
122122 path: /Users/yourname/Desktop/
123123 interval: 1
@@ -126,7 +126,7 @@ plugins:
1261261. Subscription Feed で Tumblr のフィードを購読し
1271272. StorePermalink でパーマリンクをデータベースに保存し
1281283 FilterImage と FilterTumblrResize で画像の URL を指定して
129- 4. StoreTargetLink で Tumblr の画像をダウンロードする
129+ 4. StoreFile で Tumblr の画像をダウンロードする
130130という一連の処理をプラグインの組み合わせで実現している。
131131
132132
Original file line number Diff line number Diff line change 11#!/usr/bin/env ruby
22# -*- coding: utf-8 -*-
3- # Name:: Automatic::Plugin::Store::TargetLink
3+ # Name:: Automatic::Plugin::Store::File
44# Author:: 774 <http://id774.net>
55# Created:: Feb 28, 2012
6- # Updated:: Jan 15 , 2014
6+ # Updated:: Feb 21 , 2014
77# Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
88# License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
99
1010require 'open-uri'
1111
1212module Automatic ::Plugin
13- class StoreTargetLink
13+ class StoreFile
1414
1515 def initialize ( config , pipeline = [ ] )
1616 @config = config
Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
2- # Name:: Automatic::Plugin::CustomFeed::SVNFLog
2+ # Name:: Automatic::Plugin::Store::File
33# Author:: kzgs
44# 774 <http://id774.net>
55# Created:: Mar 4, 2012
6- # Updated:: May 1, 2013
7- # Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
6+ # Updated:: Feb 21, 2014
7+ # Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
88# License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
99
1010require File . expand_path ( File . dirname ( __FILE__ ) + '../../../spec_helper' )
1111
12- require 'store/target_link '
12+ require 'store/file '
1313require 'tmpdir'
1414require 'pathname'
1515
16- describe Automatic ::Plugin ::StoreTargetLink do
16+ describe Automatic ::Plugin ::StoreFile do
1717 it "should store the target link" do
1818 Dir . mktmpdir do |dir |
19- instance = Automatic ::Plugin ::StoreTargetLink . new (
19+ instance = Automatic ::Plugin ::StoreFile . new (
2020 { "path" => dir } ,
2121 AutomaticSpec . generate_pipeline {
2222 feed { item "http://id774.net/test/store/rss" }
2929
3030 it "should error during file download" do
3131 Dir . mktmpdir do |dir |
32- instance = Automatic ::Plugin ::StoreTargetLink . new (
32+ instance = Automatic ::Plugin ::StoreFile . new (
3333 { "path" => dir } ,
3434 AutomaticSpec . generate_pipeline {
3535 feed { item "aaa" }
4141
4242 it "should error and retry during file download" do
4343 Dir . mktmpdir do |dir |
44- instance = Automatic ::Plugin ::StoreTargetLink . new (
44+ instance = Automatic ::Plugin ::StoreFile . new (
4545 {
4646 "path" => dir ,
4747 'retry' => 1 ,
You can’t perform that action at this time.
0 commit comments