A simple gem created to explain the process of creating a basic ruby gem
|
3 years ago | |
---|---|---|
lib | 3 years ago | |
.gitignore | 3 years ago | |
README.md | 3 years ago | |
tilde_array_shuffler.gemspec | 3 years ago |
A simple gem created to demonstrate the process of creating a ruby gem.
This is a simple gem that lets you shuffle an array with a ~
Once you have created the gemspec file with all the required and relevant information, you can build the gem with the following command
$ gem build tilde_array_shuffler.gemspec
Successfully built RubyGem
Name: tilde_array_shuffler
Version: 0.0.1
File: tilde_array_shuffler-0.0.1.gem
Once built, you can install the gem locally
$ gem install tilde_array_shuffler
Successfully installed tilde_array_shuffler-0.0.1
1 gem installed
To install with bundler, add this to the Gemfile
gem 'tilde_array_shuffler', git: 'https://git.victorcode.com/gaurav/tilde_array_shuffler'
Then run bundle install
> require 'tilde_array_shuffler'
> ~[1,2,3]
[2,1,3]