Usage |
Top Previous Next |
Run the rubyencoder executable without parameters to get a list of all available options.
You may run the RubyEncoder 3 encoder to encode either one or multiple files. You may enumerate all files you want to encode or use a file mask or file list to specify multiple files. A file list is a text file with either full or relative file paths of all the files to encode, separated by a new line. You should use an @ sign before the filelist name in the command line. A file list passed to the RubyEncoder encoder for batch processing from the command line may contain file masks. Standard ? and * symbols are available.
The encoded file will replace the original file. The original file will be backed up with a .bak extension by default (until you turn off the backup facility with a -b- option).
If -o option is used to specify output directory the original file will not be backed up. Instead of it, the original file will be copied to the output directory and encoded there. We recommend that you always encode to the output folder specified with -o.
--ruby <version x.y>
RubyEncoder CLI encoder encodes scripts for Ruby 1.9.x and 2.x by default. Use --ruby option to specify versions of Ruby you need to encode scripts for. Available values for --ruby option are 1.8, 1.9 (encoding for 1.9.0/1.9.1), 1.9.2 (encoding for 1.9.2/1.9.3), 2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.4.0, 2.5.0 etc.To encode a script to run under Ruby 1.8.x, 1.9.x and/or 2.x use the --ruby option mutliple times and specify all versions of Ruby you need to run protected files under.
Your code must be compatible with ALL specified versions of Ruby. Otherwise you will get an error message when encoding incompatible files and such files will remain unencoded.
Example: > rubyencoder file1.rb > rubyencoder --ruby 2.4.0 --ruby 2.5.0 file2.rb file3.rb file4.rb
Optionally your may use "+" and "-" suffix for the --ruby option. "+" means to encode for the specified version of Ruby and for all the newer versions which are supported by the current version of RubyEncoder. "-" means to encode for all the supported versions of Ruby except the specified one and all the lower versions, which is useful if you always need to encode by default for new versions but do not need support for old versions starting from some one. E.g.
You may enumerate all the files you want to encode in a file list. A file list is a text file with either full or relative file paths of all the files to encode, separated by a new line (masks are supported, use '*' and '?' for it). You should use an @ sign before the file list name in the command line. Usage: >rubyencoder @filelist When specifying a relative path don't start it with ../ or ./ directory specifiers.
It's possible to use shorter syntax for directory encoding. All specified directories will be recognized and the "*" file mask will be added: >rubyencoder -r source_dir
which will work as if a file mask was specified: >rubyencoder -r "source_dir/*"
A log will be printed to the terminal during the encoding process. A status message will be displayed for each encoded file. You may get one of the following status messages:
|