Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converge closer to master #2

Open
wants to merge 185 commits into
base: master
Choose a base branch
from
Open

Conversation

stwr667
Copy link

@stwr667 stwr667 commented Nov 30, 2020

We currently have quite a diverged fork of ruby-units for Agworld purposes. Originally this was done in 2012 because of a number of issues with ruby-units. Most of these issues have now been resolved in the gem, so we should be almost clear to return to their master.
The one main unsupported feature that works on our old fork, but not the latest version of ruby units is the per N idiom that we use regularly. E.g. Unit.new(2, "kg/100kg"). We use this for activity inputs that have rates per weight/volume of tank mix.

If we can get this working and pulled into the main gem, we should be able to remove our fork. Here's the linked PR for the potential fixes (currently incomplete) - olbrich#210

If we bring it into Agworld, we'll also need to replace all Unit() and "".u references with Unit.new() and/or "".to_unit.

Technical Approach: Note that this branch is simply a --hard reset to ruby-units master, with minor fixes on top.

See more development notes below.

Issues that were a problem that no longer are:

Issues that were a problem that may still be:

  • NONE

Issues that were a problem that definitely still are:

Minor changes need to be made:

  • olbrich@3238534 (probably no impact - doesn't look like we check the message)
    -> Our Fork: "Incompatible Units (#{self.units} !~ #{target.units})"
    -> Gem: "Incompatible Units ('#{self}' not compatible with '#{other}')"
  • All Unit() and "".u references need replacing with Unit.new() and/or "".to_unit.

Things that may not (still) work without modifications:
In app/lib/ruby_units.rb:

  • def convert_to

Other Notes:

agraves and others added 30 commits May 17, 2013 15:07
Remove non-existent RakeFile from gemspec
Support passing Time objects to Time.at
…er kinds of units, but also changes the unit as well
provide method to get the best prefix
Without this, #best_prefix will raise FloatDomainError while trying to
call #floor on '-Infinity' if the scalar is 0.
Return base unit from #best_prefix if scalar is 0.
olbrich and others added 30 commits December 7, 2017 09:24
* update supported rubygems to include 2.5.0, 2.4.3, 2.3.6, 2.2.9 and jruby 9.1.15.0
* Drop build support for ruby 2.2
When adding or subtracting two unitless numbers, the result used to be 
converted to the same units as the receiver.  This didn't work if the 
receiver was unitless.  The fix changes the way we do the conversion in 
a way that is not subject to this problem.
replaces jeweler with bundler for building / pushing gems
Add license scan report and status
Update rubocop requirement from ~> 0.63.0 to ~> 0.77.0

Co-authored-by: null <27856297+dependabot-preview[bot]@users.noreply.github.com>
E.g. "2 kg/100kg" or "4 l/1000l".
It's similar to a percentage, but can be for any scalar number, and is
often the terminology used in industry, rather than percentages.
E.g. in Agriculture - adding 4 liters of Roundup per 100 liters of tank mixture.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.