Name
falsework–A primitive scaffold generator for writing CLI programs.
Synopsis
falsework [] command ...
Description
The falsework utility ships with 2 templates: ruby-cli and c-glib.
Initially the template spec was designed only for Ruby projects but later (from version 1.3.0) hard-coded Ruby staff was removed which added more flexibility.
The generated project is not dependent on falsework. The utility can also add skeletons for tests end executables after the project generation.
Ruby Template
… is default. It 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,testtargets; -
easy to use configuration 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.
Version & name of your project can be located at generated myproject/lib/myproject/meta.rb file.
Options
The commands:
- list
-
Do nothing except listing all available templates. You can add your own templates in
~/.falsework/templatesdirectory. - listdirs
-
Do nothing except listing all available templates directories. You can add another directory by modifying
tdiroption in the config file. (tdiris an array). - 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 doc in
docsub-directory. - doc NAME
-
Add a new doc file in
docsub-directory. - test NAME
-
Add a new test in
testsub-directory. - upgrade
-
‘Inject’ or upgrade some vital files from the template into the project. Currently only ‘ruby-cli’ template supports this.
The options are as follows:
- -t
-
A template name.
- -b
-
A batch mode. (No questions asked.)
- –no-git
-
Don’t create a Git repository. Don’t use this for ‘ruby-cli’ template.
- –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-dirsis ignored. - -V
-
Show falsework version and exit.
- -v
-
Be more verbose. You can supply it several times, viz.
-vvdumps even more debug info.
Examples
Create a new project:
% falsework -v new
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.)
Create a project from another template:
% falsework -t c-glib -v new foo-
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 sub-directory 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.