percentage 2.2.0 → 2.3.0

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: 017b498f1847df3570b1176c1047a0a3ab2fa394c24befbd2abdc8f4cb7e5f5e
4
- data.tar.gz: cee72ecd3ab177c51d7784b2d596b2ec1abc4eafefaf1569a9adf32d09785bac
3
+ metadata.gz: d3962a510e791ec11f17b93dc34bb162d7af6129a5f4cd8a37bada8eb9abab85
4
+ data.tar.gz: 7fe5102660e503e2908a2fa67907c8678d947cf64b33dee12c186f0f33d60628
5
5
  SHA512:
6
- metadata.gz: 12621156aca237f0d6dc30d341103e4cd61caf9b2282e26aa9069651e4f6d40c71dc5be575b5a62a060bb896fb81f990f53e59c5290bb9425d124fdb583f57b6
7
- data.tar.gz: a6cc6d0c86841a1c2fc203e5a6fd66849e0dbb9484368457d54edf4e012b1dececf26f66a1846394f016c6222cb1d510b88f4cf2536966c00b90f58335eecddc
6
+ metadata.gz: a171aa1ac38e246bd24ea9fde11f5c4f5a8fec689b1942b19a7625ffd4b9fa2abf0280cf908a42c66cf7b404ecb6c0275f09b9478d5f82c0cce54e9669d3a4d8
7
+ data.tar.gz: 8c669769c44e568ef1356d939dfda3b7f59137255fbcd8e9221a55a0b9181393bb99204769ea17e771ee07849753b04c94e29e0618d7976f406a93fdc278568c
data/CHANGES.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 2.3.0
2
+
3
+ * **Required ruby version is now 2.5.0**
4
+
5
+ * Added Percentage#nonzero?
6
+
7
+ * Added Percentage#inspect
8
+
1
9
  # 2.2.0
2
10
 
3
11
  * Added Rational#to_percentage
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2024 TIMCRAFT
1
+ Copyright (c) 2012-2025 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
@@ -41,6 +41,11 @@ class Percentage
41
41
  @value.zero?
42
42
  end
43
43
 
44
+ def nonzero?
45
+ return if @value.zero?
46
+ self
47
+ end
48
+
44
49
  def <=>(object)
45
50
  if self.class === object
46
51
  fractional_value <=> object.fractional_value
@@ -115,6 +120,10 @@ class Percentage
115
120
  @value.negative?
116
121
  end
117
122
 
123
+ def inspect
124
+ "<Percentage: value=#{value.inspect}>"
125
+ end
126
+
118
127
  protected
119
128
 
120
129
  def fractional_value
data/percentage.gemspec CHANGED
@@ -1,15 +1,15 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'percentage'
3
- s.version = '2.2.0'
3
+ s.version = '2.3.0'
4
4
  s.license = 'LGPL-3.0'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ['Tim Craft']
7
- s.email = ['mail@timcraft.com']
7
+ s.email = ['email@timcraft.com']
8
8
  s.homepage = 'https://github.com/readysteady/percentage'
9
9
  s.description = 'Ruby gem for working with percentages'
10
10
  s.summary = 'See description'
11
11
  s.files = Dir.glob('lib/**/*.rb') + %w[CHANGES.md LICENSE.txt README.md percentage.gemspec]
12
- s.required_ruby_version = '>= 1.9.3'
12
+ s.required_ruby_version = '>= 2.5.0'
13
13
  s.require_path = 'lib'
14
14
  s.metadata = {
15
15
  'homepage' => 'https://github.com/readysteady/percentage',
@@ -17,5 +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
+ s.add_dependency 'bigdecimal', '~> 3'
21
21
  end
metadata CHANGED
@@ -1,32 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percentage
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Craft
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-10-22 00:00:00.000000000 Z
10
+ date: 2025-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bigdecimal
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - ">="
16
+ - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '0'
18
+ version: '3'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
- - - ">="
23
+ - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: '0'
25
+ version: '3'
27
26
  description: Ruby gem for working with percentages
28
27
  email:
29
- - mail@timcraft.com
28
+ - email@timcraft.com
30
29
  executables: []
31
30
  extensions: []
32
31
  extra_rdoc_files: []
@@ -45,7 +44,6 @@ metadata:
45
44
  source_code_uri: https://github.com/readysteady/percentage
46
45
  bug_tracker_uri: https://github.com/readysteady/percentage/issues
47
46
  changelog_uri: https://github.com/readysteady/percentage/blob/main/CHANGES.md
48
- post_install_message:
49
47
  rdoc_options: []
50
48
  require_paths:
51
49
  - lib
@@ -53,15 +51,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
53
51
  requirements:
54
52
  - - ">="
55
53
  - !ruby/object:Gem::Version
56
- version: 1.9.3
54
+ version: 2.5.0
57
55
  required_rubygems_version: !ruby/object:Gem::Requirement
58
56
  requirements:
59
57
  - - ">="
60
58
  - !ruby/object:Gem::Version
61
59
  version: '0'
62
60
  requirements: []
63
- rubygems_version: 3.5.11
64
- signing_key:
61
+ rubygems_version: 3.6.2
65
62
  specification_version: 4
66
63
  summary: See description
67
64
  test_files: []