RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

left_pad

Ruby implementation famous npm’s left-pad is finally here - https://github.com/atipugin/left_pad

Comments

Haha, and the one-liner..

class String;alias :leftpad :rjust end

Yeah, but the goal was to pass original test cases ;)

Can I get this as a gem?

Never mind, gem is already there, time to add it to Gemfile

Adding it too, I hope it doesn’t get yanked.

Thx, for porting this marvellous js library to ruby.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in