Skip to content

Commit

Permalink
Merge pull request #55 from shivam091/5.6.0
Browse files Browse the repository at this point in the history
5.6.0
  • Loading branch information
shivam091 authored Oct 29, 2023
2 parents 8b0a756 + 424c795 commit 528ee7a
Show file tree
Hide file tree
Showing 8 changed files with 3,326 additions and 34 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## [5.6.0](https://github.com/shivam091/unit_measurements/compare/v5.5.0...v5.6.0) - 2023-10-31

### What's new

- Added new units `ftm³`, `pk`, `gt`, `bsh`, `min`, `bkt`, `hhd`, `fls`, `dspn`, `fldr`, `bdft`, `ac⋅ft`, `ac⋅in` in volume.
- Added new units `oz/ft³`, `oz/in³`, `oz/gal`, `lb/ft³`, `lb/in³`, `lb/gal`, `slug/ft³`, `slug/in³` in density.

----------

## [5.5.0](https://github.com/shivam091/unit_measurements/compare/v5.4.1...v5.5.0) - 2023-10-29

### What's new
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
unit_measurements (5.5.0)
unit_measurements (5.6.0)
activesupport (~> 7.0)

GEM
Expand Down
17 changes: 15 additions & 2 deletions lib/unit_measurements/unit_groups/density.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,23 @@

system :metric do
unit "g/m³", aliases: ["g/m^3", "g·m⁻³", "gram per cubic meter", "grams per cubic meter", "gramme per cubic metre", "grammes per cubic metre"]
unit "kg/m³", value: "1000 g/m³", aliases: ["kg/m^3", "kg·m⁻³", "kilogram per cubic meter", "kilograms per cubic meter", "kilogramme per cubic metre", "kilogrammes per cubic metre"]

unit "g/l", value: "1 kg/m³", aliases: ["g·l⁻¹", "gram per liter", "grams per liter", "gramme per litre", "grammes per litre"]
unit "g/ml", value: "1000 g/l", aliases: ["g·ml⁻¹", "gram per milliliter", "grams per milliliter", "gramme per millilitre", "grammes per millilitre"]

unit "kg/l", value: "1e+6 g/m³", aliases: ["kg·l⁻¹", "kilogram per liter", "kilograms per liter", "kilogramme per litre", "kilogrammes per litre"]
unit "kg/m³", value: "1000 g/m³", aliases: ["kg/m^3", "kg·m⁻³", "kilogram per cubic meter", "kilograms per cubic meter", "kilogramme per cubic metre", "kilogrammes per cubic metre"]
end

system :imperial do
unit "oz/ft³", value: "1.001153961 kg/m³", aliases: ["oz/ft^3", "oz·ft⁻³", "ounce per cubic foot", "ounces per cubic foot"]
unit "oz/in³", value: "1.729994044e+3 kg/m³", aliases: ["oz/in^3", "oz·in⁻³", "ounce per cubic inch", "ounces per cubic inch"]
unit "oz/gal", value: "6.236023291 kg/m³", aliases: ["oz·gal⁻¹", "ounce per gallon", "ounces per gallon"]

unit "lb/ft³", value: "16.01846337 kg/m³", aliases: ["lb/ft^3", "lb·ft⁻³", "pound per cubic foot", "pounds per cubic foot"]
unit "lb/in³", value: "2.767990471e+4 kg/m³", aliases: ["lb/in^3", "lb·in⁻³", "pound per cubic inch", "pounds per cubic inch"]
unit "lb/gal", value: "99.77637266 kg/m³", aliases: ["lb·gal⁻¹", "pound per gallon", "pounds per gallon"]

unit "slug/ft³", value: "515.3788184 kg/m³", aliases: ["slug/ft^3", "slug·ft⁻³", "slug per cubic foot", "slugs per cubic foot"]
unit "slug/in³", value: "890574.582782 kg/m³", aliases: ["slug/in^3", "slug·in⁻³", "slug per cubic inch", "slugs per cubic inch"]
end
end
21 changes: 21 additions & 0 deletions lib/unit_measurements/unit_groups/volume.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
si_unit "l", aliases: ["liter", "litre", "liters", "litres"]

unit "m³", value: "1000 l", aliases: ["m^3", "cu m", "cubic meter", "cubic meters", "cubic metre", "cubic metres"]

unit "mm³", value: "1e-9 m³", aliases: ["mm^3", "cu mm", "cubic millimeter", "cubic millimeters", "cubic millimetre", "cubic millimetres"]
unit "cm³", value: "1e-6 m³", aliases: ["cm^3", "cu cm", "cubic centimeter", "cubic centimeters", "cubic centimetre", "cubic centimetres"]
unit "dm³", value: "1 l", aliases: ["dm^3", "cu dm", "cubic decimeter", "cubic decimeters", "cubic decimetre", "cubic decimetres"]
Expand All @@ -20,15 +21,35 @@
unit "ft³", value: "1728 in³", aliases: ["ft^3", "cu ft", "cubic foot", "cubic feet"]
unit "yd³", value: "27 ft³", aliases: ["yd^3", "cu yd", "cubic yard", "cubic yards"]
unit "mi³", value: "5451776000 yd³", aliases: ["mi^3", "cu mi", "cubic mile", "cubic miles"]
unit "ftm³", value: "216 ft³", aliases: ["ftm^3", "cu ftm", "cubic fathom", "cubic fathoms"]

unit "c", value: "284.130625e-6 m³", aliases: ["cup", "cups"]

unit "qt", value: "0.0011365225 m³", aliases: ["quart", "quarts"]
unit "pk", value: "2 gal", aliases: ["peck", "pecks"]
unit "gi", value: "1/2 c", aliases: ["gill", "gills"]
unit "pt", value: "1/8 gal", aliases: ["pint", "pints"]
unit "gt", value: "1/288 floz", aliases: ["gtt", "drop", "drops"]

unit "gal", value: "4.54609 dm³", aliases: ["gallon", "gallons"]
unit "bsh", value: "8 gal", aliases: ["bu", "bushel", "bushels"]
unit "min", value: "1/480 floz", aliases: ["minim", "minims"]
unit "bbl", value: "36 gal", aliases: ["barrel", "barrels"]
unit "tsp", value: "1/24 gi", aliases: ["teaspoon", "teaspoons"]
unit "bkt", value: "4 gal", aliases: ["bucket", "buckets"]
unit "hhd", value: "2 bbl", aliases: ["hogshead", "hogsheads"]
unit "fls", value: "1/24 floz", aliases: ["fluid scruple", "fluid scruples"]

unit "dspn", value: "10 ml", aliases: ["dsp", "dessertspoon", "dessertspoons"]
unit "tbsp", value: "3 tsp", aliases: ["tbs", "tablespoon", "tablespoons"]
unit "floz", value: "1/160 gal", aliases: ["fluid ounce", "fluid ounces"]
unit "fldr", value: "1/8 floz", aliases: ["fluid drachm", "fluid drachms"]
end

system :us_customary do
unit "bdft", value: "144 in³", aliases: ["bf", "fbm", "board-foot", "board-feet"]

unit "ac⋅ft", value: "43560 ft³", aliases: ["acre-foot", "acre-feet"]
unit "ac⋅in", value: "6272640 in³", aliases: ["acre-inch", "acre-inches"]
end
end
2 changes: 1 addition & 1 deletion lib/unit_measurements/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

module UnitMeasurements
# Current stable version.
VERSION = "5.5.0"
VERSION = "5.6.0"
end
Loading

0 comments on commit 528ee7a

Please sign in to comment.