CLAISS is a Ruby-based CLI application and toolbox designed to manage CLAISS Refactored applications and deployments. Please note that some features may have limited compatibility depending on the environment. Use with caution!
Install the CLAISS gem by running the following command in your terminal:
$ gem install claiss
The refactor
command allows you to rename and replace text terms within files and filenames in a specified directory. This command will refactor all exact occurrences of specified terms, including filenames. For example, "Abc" is treated differently from "AbC", "ABc", or "abc".
Note: The refactor
command ignores the .git/
and node_modules/
directories to avoid modifying critical or third-party files.
Basic usage:
$ claiss refactor ./project/ ./my_changes.json
You can create a JSON file that specifies the terms you want to refactor. This JSON file should be structured as a simple key-value pair object, where each key is the term to be replaced and the value is the replacement term. The terms are processed in the order they appear in the file.
Example my_changes.json
:
{
"system pro": "system b2b",
"System Pro": "System B2b",
"System": "Laiss",
"system": "laiss",
"2010 Moevo Silver": "2023 Júlio Papel",
"Jared Moevo": "Júlio Papel",
"[email protected]": "[email protected]",
"https://somelivesite.com": "https://api.mynewsite.pt",
"This is your Rails project.": "Multi Layered Software Services.",
"This is your Rails project for your business.": "A Multi Layered Software Services ready to be deployed for any business.",
"MIT-LICENSE": "LICENSE",
"https://somesite.com": "https://api.mynewsite.pt"
}
To apply the changes using the dictionary file:
$ claiss refactor ./project/ ./my_changes.json
Important: After refactoring, any empty directories left behind will be automatically removed to keep your project structure clean.
The fix_ruby_permissions
command adjusts file permissions for a Ruby or Rails project. It ensures that directories have the correct execute permissions and that files retain their appropriate read/write/execute permissions.
$ claiss fix_ruby_permissions ./project/
Note: This command uses chmod
and may encounter issues on systems that do not distinguish between uppercase and lowercase filenames or support spaces in filenames (e.g., certain end-user operating systems). If you encounter errors, particularly with filenames like MyImage copy.svg
, manually fix those file permissions and re-run the command.
We are continuously working to improve CLAISS and add new functionalities. Stay tuned for updates!
Bug reports and pull requests are welcome on GitHub at https://github.com/JulioPapel/claiss.
This gem is available as open source under the terms of the MIT License.
Júlio Papel