https://github.com/rubyworks/ratch
Ruby Batch Scripts
https://github.com/rubyworks/ratch
Last synced: 4 months ago
JSON representation
Ruby Batch Scripts
- Host: GitHub
- URL: https://github.com/rubyworks/ratch
- Owner: rubyworks
- License: other
- Created: 2009-08-17T18:59:58.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2012-06-19T04:14:18.000Z (over 13 years ago)
- Last Synced: 2024-12-07T22:09:26.493Z (about 1 year ago)
- Language: Ruby
- Homepage: http://rubyworks.github.com/ratch
- Size: 801 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- Changelog: HISTORY.rdoc
- License: LICENSE.txt
Awesome Lists containing this project
README
= Ratch
Ruby-based Batch Scripts
== Introduction
Ratch is Ruby-based DSL for building batch scripts. It's intent
is to ease the burden of batch script writers by supplementing
the standard ruby environment to be more conducive to the needs
of batch scripting.
In addition to using Ratch to write stand-alone batch scripts,
it makes a very powerful library for other applications that
require batch-like functionality. In general any program that
access the file system extensively could benefit from it's use.
== Resources
* home: http://rubyworks.github.com/ratch
* code: http://github.com/rubyworks/ratch
* talk: http://googlegroups.com/
== Usage
=== Batch Scripting
To use for your own scripts, simply add a bang line.
#!/usr/bin/env ratch
On Windows, of course, you will want to associate the .ratch extension
name to the ratch executable instead.
=== As a Library
To use Ratch as a library, require 'ratch' and create an instance of
Ratch::Shell.
If you wish to extend Ratch::Shell for your application, it is recommend
that you either subclass Ratch::Shell, e.g.
require 'ratch'
class MyClass < Ratch::Shell
end
Or delegate to a Ratch::Shell instance, e.g.
require 'ratch'
class MyClass
def initialize(path)
@shell = Ratch::Shell.new(path)
end
end
For details on all the functionality Ratch provides, please refer to
the API documentation.
== Bonus Feature
Ratch also includes the `ludo` command, which stands for "lookup and do".
It will ascend up the directory tree searching for a matching executable
script. If it finds one it will execute the script relative the currently
ascended directory.
== Installation
Standard installation procedure apply.
$ gem install ratch
or manually using Setup.rb
$ tar -xzf ratch-1.0.0.tgz
$ cd ratch-1.0.0
$ setup.rb
== Development
Ratch is hosted on GitHub.
To pull the 'ratch' repository anonymously, use:
git clone git://github.com/rubyworks/ratch.git
== Copying
Copyright (c) 2008 Thomas Sawyer
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this program except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.