gruner / smurftp

A small program for uploading recently modified project files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Smurftp

Smurftp is a command-line utility written in Ruby that searches a specified directory and creates a queue of recently modified files for quickly uploading to a remote server over FTP.

It was written for making web site edits where you might have a small group of files in multiple subdirectories that you want uploaded without having to manually go directory by directory.

Install

$ gem sources -a http://gems.github.com
$ sudo gem install divineflame-smurftp

Usage

Start Smurftp with this command:

$ smurftp <directory or configuration file>

Configuration

Smurftp requires a configuration file in YAML format that defines your FTP server and login information, as well as a local directory ('document_root').

When starting Smurftp, if you specify a directory, it looks for a 'smurftp_config.yaml' file in that directory. If the file is not found you'll be given the option for this file to be generated for you.

Alternatively, if you specify an existing configuration file (it doesn't require the 'smurftp_config.yaml' name) Smurftp will start by loading this file. Because the 'document_root' setting is defined in the configuration file, you can store the configuration file separately from your project files if you choose.

It's also possible to define multiple servers, sites, and login credentials in the same configuration file.

File List

Smurftp will search the defined 'document_root' directory and list all files in all sub directories, ordered by modification date with newest files first. It skips any files defined in the configuration's 'exclusions' list.

Sample Output

[1] foo.php
[2] images/bar.jpg
[3] includes/header.php
[4] images/logo.png
[5] yada.php
====================
smurftp>

At the smurftp> prompt enter the number identifier of the files you want uploaded. You can also enter a list or range of files.

Example Commands

'1' uploads file [1]
'1-5' uploads files [1-5]
'1,2,4' uploads [1], [2], and [4]
'1-5,^4' uploads files [1-3], and [5], skipping file [4]
'1-5,!4' same as above
'all' uploads all listed files

To quit type quit or exit at the prompt. e or q will also quit.

TODO

  • support relative paths for :document_root
  • add optional sftp
  • automatically refresh file list

About

A small program for uploading recently modified project files

License:MIT License


Languages

Language:Ruby 100.0%