ruby-units 4.0.2 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ruby_units/unit.rb +5 -2
- data/lib/ruby_units/unit_definitions/standard.rb +5 -2
- data/lib/ruby_units/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2371b3ae13f46ce73b204bbbc66d9bdcd91e10a1acc890e7ef532c774a530d64
|
4
|
+
data.tar.gz: 16ebec59108aa9e7ac93cbb09c7610744c2f8aa39263a2069aba3999f4414e12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fdfb41ee29400a9686c8555b41d2439b6e77b0f727a1a845e456e9625e91d86ded9c8bf55a745ebedb3eb1533f427f05e3b21625918b8a5c9bd8070ac837dd4
|
7
|
+
data.tar.gz: 616b0c7479d9e07d1fedb70539b13e4ff108157ef891f2bcf2de2dedfae02d04964c7876aec69eba51bf881e8295c2e5d30ffc425e9ce79b32a6ba84be8f268f
|
data/Gemfile.lock
CHANGED
data/lib/ruby_units/unit.rb
CHANGED
@@ -1640,8 +1640,11 @@ module RubyUnits
|
|
1640
1640
|
return self
|
1641
1641
|
end
|
1642
1642
|
|
1643
|
-
while unit_string.gsub!(
|
1644
|
-
#
|
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
|
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[
|
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|
|
data/lib/ruby_units/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2024-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|