0.0
No commit activity in last 3 years
No release in over 3 years
Go's time.Duration parsing/serialization for Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.0
~> 5.0
~> 10.0
 Project Readme

GoDuration for Ruby

Gem Version Build Status

Installation

Add this line to your application's Gemfile:

gem 'go_duration'

And then execute:

$ bundle

Or install it yourself as:

$ gem install go_duration

Usage

Parsing

require 'go_duration'

GoDuration.parse("2m30s") # => 150

Generating

require 'go_duration'

GoDuration.generate(150) # => "2m30s"

require 'go_duration/core_ext'

150.to_go_duration # => "2m30"

require 'active_support/core_ext'

(2.hours + 45.minutes).to_go_duration # => "2h45m"