forked from olbrich/ruby-units
-
Notifications
You must be signed in to change notification settings - Fork 3
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
stwr667
wants to merge
185
commits into
master
Choose a base branch
from
converge_closer_to_master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fix YAML test failure
Remove non-existent RakeFile from gemspec
Support passing Time objects to Time.at
…s config for 2.0.0
Namespace support, closes olbrich#60
…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.
* update supported rubygems to include 2.5.0, 2.4.3, 2.3.6, 2.2.9 and jruby 9.1.15.0
Signed-off-by: fossabot <[email protected]>
* 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
Updates the requirements on [rubocop](https://github.com/rubocop-hq/rubocop) to permit the latest version. - [Release notes](https://github.com/rubocop-hq/rubocop/releases) - [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md) - [Commits](rubocop/rubocop@v0.63.0...v0.77.0) Signed-off-by: dependabot-preview[bot] <[email protected]>
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 withUnit.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:
Issues that were a problem that definitely still are:
Unit.new("1", "kg^2/100l")
) ✅Minor changes need to be made:
-> Our Fork:
"Incompatible Units (#{self.units} !~ #{target.units})"
-> Gem:
"Incompatible Units ('#{self}' not compatible with '#{other}')"
Unit()
and"".u
references need replacing withUnit.new()
and/or"".to_unit
.Things that may not (still) work without modifications:
In app/lib/ruby_units.rb:
Other Notes: