Add the following code to your project's shard.yml under:
dependencies
to use in production
- OR -
development_dependencies
to use in development
A straightforward port of Ruby's Abbrev to Crystal.
Add this to your application's shard.yml
:
dependencies:
abbrev:
github: woodruffw/abbrev.cr
Usage is nearly identical to Ruby's Abbrev.abbrev
and Array#abbrev
, except that the (optional)
pattern
parameter has to be a regular expression:
require "abbrev"
Abbrev.abbrev(%w{crystal})
# => {"crystal" => "crystal", "crysta" => "crystal", "cryst" => "crystal", "crys" => "crystal", "cry" => "crystal", "cr" => "crystal", "c" => "crystal"}
Abbrev.abbrev(%w{crystal ruby}, /^r/)
# => {"ruby" => "ruby", "rub" => "ruby", "ru" => "ruby", "r" => "ruby"}
%w{crystal is fun}.abbrev
# => {"crystal" => "crystal", "crysta" => "crystal", "cryst" => "crystal", "crys" => "crystal", "cry" => "crystal", "cr" => "crystal", "c" => "crystal", "is" => "is", "i" => "is", "fun" => "fun", "fu" => "fun", "f" => "fun"}
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)