module Thor::Actions
def directory(source, *args, &block)
directory "doc", "docs", :recursive => false
directory "doc"
==== Examples
If :exclude_pattern => /regexp/, prevents copying files that match that regexp.
If :mode => :preserve, preserve the file mode from the source.
If :recursive => false, does not look for paths recursively.
config
destination
source
==== Parameters
#directory. If a method is private, Thor stack raises PrivateMethodEncodedError.
expand %something%, this `something` should be a public method in the class calling
Encoded path note: Since Thor internals use Object#respond_to? to check if it can
blog.rb
rdoc.rb
README
components/
doc/
files (assuming that the `app_name` method returns the value "blog"):
It will create a doc directory in the destination with the following
directory "doc"
When invoked as:
%app_name%.rb
rdoc.rb.tt
README
components/.empty_directory
doc/
value. Let's suppose a doc directory with the following files:
the % signs will be executed as a method and replaced with the returned
ignored. If any file name is wrapped within % signs, the text within
empty directory is found, it's copied and all .empty_directory files are
and is placed in the destination without the extension .tt. If any
If any of the files finishes with .tt, it's considered to be a template
Copies recursively the files from source directory to root directory.
def directory(source, *args, &block) config = args.last.is_a?(Hash) ? args.pop : {} destination = args.first || source action Directory.new(self, source, destination || source, config, &block) end