Specifying which files to encode and which to copy

Top  Previous  Next

We have added an option into the command line encoder to specify which files should be encoded in Ruby mode (-f). You may specify what files will be encoded specifying  their filenames, filemasks or filelist. All other files which have been added for processing or found by expanding filemasks will be copied to the output directory "as-is" without encoding.  If you don't specify the -f option then all specified files will be encoded by default.

 

Example 1:

>rubyencoder -r -f "*.rb" -o "output_dir" "*"

 

All (with recursion) *.rb files from the current directory will be encoded and copied to output_dir. All other files from the current directory will be copied to output_dir as-is (unencoded).

 

 

You may specify multiple filenames or filemasks adding more than one -f option:

 

Example 2:

>rubyencoder -r -f "*.rb" -f "includes/*.inc" -f @myrubyfiles -o "output_dir" "*"

 

If you don't specify the output directory but use -f option then only files specified with -f option will be encoded. All other files will remain unchanged.

 

 

You may also use the -c (--copy) filter option in additon to -f (--file) and -x (--exclude). The -c (--copy) option may be used to specify what files will be copied as-is without encoding to the target folder. This option makes sense only if you specify the target folder with -o (--output) option. If -c is used without -o, then it works as -x and skips the specified files. The option may take * and ? wildcards or a @filelist.

 

E.g. you may encode *.rb files but keep *.erb or config.rb unencoded and copy the latter ones as-is:

 

>rubyencoder -o /path/to/target -r -f "*.rb" -c "*.erb" -c "config.rb" /path/to/source

 

Do not forget to quote file masks in the command line on Unix or Mac