ruby-units 4.0.2 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 515d78b788c31cefd79643b9a145f4cecf0448ac9e0df785453a2b19d31268d5
4
- data.tar.gz: b10b08bf4d1d23d94603a9e0c5ca0d6c4962587225f9b04b6f74bac5ae521816
3
+ metadata.gz: 2371b3ae13f46ce73b204bbbc66d9bdcd91e10a1acc890e7ef532c774a530d64
4
+ data.tar.gz: 16ebec59108aa9e7ac93cbb09c7610744c2f8aa39263a2069aba3999f4414e12
5
5
  SHA512:
6
- metadata.gz: 86df302207791952b19f06923111cb9305cf0e3cfeffab1869db061748925aa164b0f5d0eec453b546869b4895c0e1b41f38e2bfc4cb5f0b16986fdd41d5d576
7
- data.tar.gz: 5f5c690e1dbb1f222fa95f8e0050cac04d1431dfb2ee0517921c819961ec3c3b1f57b3ab97807d3ccf04f00e13f8aac91577d21aedfba2b8c2d98b0703449782
6
+ metadata.gz: 0fdfb41ee29400a9686c8555b41d2439b6e77b0f727a1a845e456e9625e91d86ded9c8bf55a745ebedb3eb1533f427f05e3b21625918b8a5c9bd8070ac837dd4
7
+ data.tar.gz: 616b0c7479d9e07d1fedb70539b13e4ff108157ef891f2bcf2de2dedfae02d04964c7876aec69eba51bf881e8295c2e5d30ffc425e9ce79b32a6ba84be8f268f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-units (4.0.2)
4
+ ruby-units (4.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1640,8 +1640,11 @@ module RubyUnits
1640
1640
  return self
1641
1641
  end
1642
1642
 
1643
- while unit_string.gsub!(/(<#{self.class.unit_regex})><(#{self.class.unit_regex}>)/, '\1*\2')
1644
- # collapse <x><y><z> into <x*y*z>...
1643
+ while unit_string.gsub!(/<(#{self.class.prefix_regex})><(#{self.class.unit_regex})>/, '<\1\2>')
1644
+ # replace <prefix><unit> with <prefixunit>
1645
+ end
1646
+ while unit_string.gsub!(/<#{self.class.unit_match_regex}><#{self.class.unit_match_regex}>/, '<\1\2>*<\3\4>')
1647
+ # collapse <prefixunit><prefixunit> into <prefixunit>*<prefixunit>...
1645
1648
  end
1646
1649
  # ... and then strip the remaining brackets for x*y*z
1647
1650
  unit_string.gsub!(/[<>]/, '')
@@ -27,7 +27,8 @@ end
27
27
 
28
28
  RubyUnits::Unit.define('naut-mile') do |naut|
29
29
  naut.definition = RubyUnits::Unit.new('1852 m')
30
- naut.aliases = %w[nmi M NM]
30
+ naut.aliases = %w[nmi NM]
31
+ # Don't use the 'M' abbreviation here since it conflicts with 'Molar'
31
32
  end
32
33
 
33
34
  # on land
@@ -71,7 +72,9 @@ end
71
72
 
72
73
  RubyUnits::Unit.define('pica') do |pica|
73
74
  pica.definition = RubyUnits::Unit.new('1/72 ft')
74
- pica.aliases = %w[P pica picas]
75
+ pica.aliases = %w[pica picas]
76
+ # Don't use 'P' as an abbreviation since it conflicts with 'Poise'
77
+ # Don't use 'pc' as an abbreviation since it conflicts with 'parsec'
75
78
  end
76
79
 
77
80
  RubyUnits::Unit.define('point') do |point|
@@ -1,5 +1,5 @@
1
1
  module RubyUnits
2
2
  class Unit < Numeric
3
- VERSION = '4.0.2'.freeze
3
+ VERSION = '4.0.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-units
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.2
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Olbrich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-06 00:00:00.000000000 Z
11
+ date: 2024-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake