• Stars
    star
    24
  • Rank 986,245 (Top 20 %)
  • Language
    Ruby
  • License
    Do What The F*ck ...
  • Created over 8 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ruby implementation of famous npm package

left_pad

Gem Version Code Climate Build Status

Ruby implementation of famous npm package.

Installation

Add following line to your Gemfile:

gem 'left_pad'

And then execute:

$ bundle

Or install it system-wide:

$ gem install left_pad

Usage

Simple as that:

require 'left_pad'

'foo'.leftpad(5)
# => "  foo"

'foobar'.leftpad(6)
# => "foobar"

String(1).leftpad(2, 0)
# => "01"

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

P.S.

Don't take it seriously. It's just a joke ;)