percentage 2.0.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d73c317eceabcfd5b4b4f385f7def4664d5e7d827e925d101a306ba404170b69
4
- data.tar.gz: 3f225768beb51e4d8a743f2550be17119773ef392550369c2756d603bf448d68
3
+ metadata.gz: da6d1c6c5ff20dee1500808d27aa029754cf4ac8771a9750363de4c701c37a15
4
+ data.tar.gz: f5021e0a31e03ccdf52108e7ba5e0c743567afbf0ff4716449e60c76d788a0b2
5
5
  SHA512:
6
- metadata.gz: 50b8c3ca5f618908e1ea75c2bb5076bf87a27d902781f96267f76954b9ec4481965a3dddc1a2f259b677a151bcf6bd39f48093e42307430335eb459b7270d3e7
7
- data.tar.gz: 16e31215f053b38882f6b96e49e8b5c13a106342d7fefc0f4a5a2e87e8ce60aae95f64d5d65b279c3ec2e04e86b6230ca136904140b93c3321079903732b02ac
6
+ metadata.gz: 97fc4161adefd0e64646970976af477a71830534c399a5d9a7d89022a61ba065a57b9698af64cfdc8413aeb6c68cf860aa2d79931811dcf830b21f23b3888e0d
7
+ data.tar.gz: a526ad11816cb946dacf2ee16973485e236d2e826d5811113ada545b3a8b73db81607f26cbdd629474dc637525cd35901a71c383c2e62ba0956fefb070bece48
data/CHANGES.md CHANGED
@@ -1,3 +1,15 @@
1
+ # 2.1.1
2
+
3
+ * Added bigdecimal gem dependency (thanks @orien)
4
+
5
+ # 2.1.0
6
+
7
+ * Added Percentage#-@
8
+
9
+ * Added Percentage#positive?
10
+
11
+ * Added Percentage#negative?
12
+
1
13
  # 2.0.0
2
14
 
3
15
  * Added Percentage#to_d
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2022 TIMCRAFT
1
+ Copyright (c) 2012-2024 TIMCRAFT
2
2
 
3
3
  This is an Open Source project licensed under the terms of the LGPLv3 license.
4
4
  Please see <http://www.gnu.org/licenses/lgpl-3.0.html> for license text.
data/lib/percentage.rb CHANGED
@@ -103,6 +103,18 @@ class Percentage
103
103
  self.class.new(@value * n)
104
104
  end
105
105
 
106
+ def -@
107
+ self.class.new(-@value)
108
+ end
109
+
110
+ def positive?
111
+ @value.positive?
112
+ end
113
+
114
+ def negative?
115
+ @value.negative?
116
+ end
117
+
106
118
  protected
107
119
 
108
120
  def fractional_value
data/percentage.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'percentage'
3
- s.version = '2.0.0'
3
+ s.version = '2.1.1'
4
4
  s.license = 'LGPL-3.0'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ['Tim Craft']
@@ -17,4 +17,5 @@ Gem::Specification.new do |s|
17
17
  'bug_tracker_uri' => 'https://github.com/readysteady/percentage/issues',
18
18
  'changelog_uri' => 'https://github.com/readysteady/percentage/blob/main/CHANGES.md'
19
19
  }
20
+ s.add_runtime_dependency 'bigdecimal'
20
21
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percentage
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Craft
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-07 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2024-03-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bigdecimal
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: Ruby gem for working with percentages
14
28
  email:
15
29
  - mail@timcraft.com
@@ -46,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
60
  - !ruby/object:Gem::Version
47
61
  version: '0'
48
62
  requirements: []
49
- rubygems_version: 3.3.3
63
+ rubygems_version: 3.5.3
50
64
  signing_key:
51
65
  specification_version: 4
52
66
  summary: See description