Name
falsework–A primitive scaffold generator for writing CLI programs in Ruby.
Synopsis
falsework [options] command ...
Description
The falsework utility generates a scaffold which have:
-
auto-created git (but not github) project;
-
gem
(a file list is pulled from the git repository, no more missing files in gems!),doc
,test
targers; -
easy to use configuraton parser/loader. This includes scanning for:
-
env variable(s);
-
the flat YAML configuration file;
-
the command line.
-
-
an ability to pick up a user name & an email for a github project.
The generated project is not dependent on falsework.
The utility can also add skeletons for tests end executables after the project generation.
The commands:
- list
-
Do nothing except listing all available templates. You can add your own templates in
~/.falsework/templates
directory. - new NAME
-
Create a new project. It creates a directory NAME and populates it with files.
The following commands works only from the root project directory:
- exe NAME
-
Add a new executable to an existing project and a corresponding
.rdoc
file indoc
subdirectory. - test NAME
-
Add a new minitest.
- upgrade
-
‘Inject’ or upgrade some vital files from the default ‘naive’ template into the project. (Warning: this works only from version 0.2.2 and (hopefully) above.)
The options are as follows:
- -t
-
A template name.
- -b
-
A batch mode. (No questions asked.)
- –config-dirs
-
List all possible locations for the configuration file. The first found wins.
- –config NAME
-
The name of the configuration file. If it contains
/
in it, the list from--config-dirs
is ignored. - -V
-
Show falsework version and exit.
- -v
-
Be more verbose. You can supply it several times, viz.
-vv
dumps even more debug info.
Meta
Version & name of your project can be located at generated myproject/lib/myproject/meta.rb
file.
Examples
Create a new project:
% falsework -v new foobar
Add another CL util to the existing project:
% pwd
.../foobar
% falsework exe foo
(It will appear in bin/
sub-directory.)
Add another test file:
% falsework test foo
(It will appear in test/
sub-directory.)
Bugs
While falsework supports symlinks in templates, rubygems replaces symlinks with its corresponding source files. That is why you’ll get 2 README.rdoc
files in generated project when it was intended to have 1 in doc
subdirectory and the symlink to it in the root project directory.
If you think that this is pathetic, then just grab the source of falsework, place its directory somewhere, create a symlink to /where/is/your/clone/falsework/bin/falsework
file in one of your PATH directories and forget about the gem and this bug.