Skip to content
This repository was archived by the owner on Sep 28, 2021. It is now read-only.
This repository was archived by the owner on Sep 28, 2021. It is now read-only.

Ruby floor method does not accept arguments in Ruby versions lower than 2.4 #1

@dsolsona

Description

@dsolsona

Hi,

Testing the nomad client in Ruby 2.1 (fails also in 2.2. and 2.3) I got the following error

irb(main):002:0> Nomad::Client.new(:address => "http://nomad.service.consul:4646").job.read("my-job")
ArgumentError: wrong number of arguments (1 for 0)
	from /opt/ruby2.1/lib/ruby/gems/2.1.0/gems/nomad-0.1.0/lib/nomad/duration.rb:174:in `floor'
	from /opt/ruby2.1/lib/ruby/gems/2.1.0/gems/nomad-0.1.0/lib/nomad/duration.rb:174:in `block in to_s'
	from /opt/ruby2.1/lib/ruby/gems/2.1.0/gems/nomad-0.1.0/lib/nomad/duration.rb:173:in `each'
	from /opt/ruby2.1/lib/ruby/gems/2.1.0/gems/nomad-0.1.0/lib/nomad/duration.rb:173:in `to_s'
	from /opt/ruby2.1/lib/ruby/gems/2.1.0/gems/nomad-0.1.0/lib/nomad/duration.rb:187:in `inspect'
	from /opt/ruby2.1/bin/irb:11:in `<main>'

It is failing because it is calling floor(0) which doesn't work in any ruby version lower than 2.4.

Does this gem only work in ruby 2.4? Any plans to at least support 2.3?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions