MtTool
A Ruby gem for generating VIPER architecture modules for iOS projects. Supports both Swift and Objective-C.
Features
- Generate complete VIPER module structure
- Support for both Swift and Objective-C
- Customizable templates
- Command-line interface
- Detailed logging for debugging
Installation
Add this line to your application's Gemfile:
gem 'mt_tool'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install mt_tool
Usage
Generating a VIPER Module
# Generate a VIPER module
mt_tool vmod -n ModuleName -a "Author Name" -p ./path/to/module
# Example
mt_tool vmod -n HomeScreen -a "Tom Liu" -p ./Modules
Command Options
-
-n, --name
: Module name (required) -
-a, --author
: Author name (required) -
-p, --path
: Target path for generation (required)
Generated Structure
ModuleName/
├── ModuleNameEntity.swift
├── ModuleNameInteractor.swift
├── ModuleNamePresenter.swift
├── ModuleNameRouter.swift
└── ModuleNameViewController.swift
Development
After checking out the repo, run bundle install
to install dependencies.
To run the test suite:
bundle exec rake test
To install this gem onto your local machine:
bundle exec rake install
Contributing
- Fork it
- Create your feature branch (
git checkout -b feature/my-new-feature
) - Add tests for your changes
- Make your changes
- Run the tests (
bundle exec rake test
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin feature/my-new-feature
) - Create new Pull Request
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the MtTool project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.