Gemplate is a Ruby gem generator that creates new gems with established best practices, testing setup, and CI configuration. Install it once and generate as many gems as you need!
Install from GitHub Packages:
# Configure GitHub Packages as a gem source (one-time setup)
bundle config set --global https://rubygems.pkg.github.com/twilightcoders <your_github_token>
# Install the gem
gem install gemplate --source https://rubygems.pkg.github.com/twilightcoders
Or add to your Gemfile:
source "https://rubygems.pkg.github.com/twilightcoders" do
gem "gemplate"
end
Create a new gem:
gemplate new my_awesome_gem
cd my_awesome_gem
bundle install
rake spec
Each generated gem includes:
- Modern Ruby gem structure following current conventions
- RSpec testing framework with sample tests
- Rake tasks for common development operations
- Bundler integration for dependency management
- CI/CD ready with placeholder badge configuration
- Git repository with sensible .gitignore
- MIT License template
- Development dependencies pre-configured
gemplate new GEM_NAME # Create a new gem
gemplate version # Show version
gemplate help # Show help
my_awesome_gem/
├── lib/
│ ├── my_awesome_gem.rb # Main gem file
│ └── my_awesome_gem/
│ └── version.rb # Version specification
├── spec/
│ ├── spec_helper.rb # RSpec configuration
│ └── my_awesome_gem/
│ └── my_awesome_gem_spec.rb # Sample tests
├── my_awesome_gem.gemspec # Gem specification
├── Gemfile # Dependencies
├── Rakefile # Rake tasks
├── README.md # Documentation
├── LICENSE.txt # MIT License
└── .gitignore # Git ignore rules
After generating a gem, customize it:
- Update the gemspec with your details, description, and dependencies
- Implement your functionality in the main lib file
- Write tests using the included RSpec setup
- Update README with usage instructions
- Release when ready using
rake release
Bug reports and pull requests are welcome on GitHub at https://github.com/TwilightCoders/gemplate.
The gem is available as open source under the terms of the MIT License.