percentage 1.1.0 → 1.2.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: 3c32ff68bc5ee26ca6f82898ffb94d6aba49153d8187999d1206c2920a6d132b
4
- data.tar.gz: 6c46179997da767a0cce9dba903d9b33b4ca5a00a7fe62e7ae8c2a5131c409bb
3
+ metadata.gz: d7dde72257c6d27abdfca2ca058a7048287cbdbcd1421b70e2e517144242e639
4
+ data.tar.gz: '0619980650ea0118d1127e3aee909076a8edba57e94cf3a9d686f4d358f00976'
5
5
  SHA512:
6
- metadata.gz: 77c8e9753c605d8ff006d7c50db1fd78478eef8983a1020951fb8c46ec752438933f30829baee3d0d303877b8533b1be8c376001fc98a0ca6cce6826fb08d072
7
- data.tar.gz: 51a800e6f7ebd074925b7cc91dc603fb1c064f5965026276645c0781ec92b95388cd5ba5708caa7dce3fc063a9b9802c8ad077d220502f869801a02a229551ca
6
+ metadata.gz: 69b9ab800bc4898f765dd2e5667ae35b74ae02a59276fe5d85680267a5eaf0ae3cda8fe4188d18dcf0a530c46a19e2a2d5c5691dadf9bfc0851592951911361e
7
+ data.tar.gz: 333b4e6f9d8867aebf17ecdceab9d36997b026d2bdc1efd09612dfb92797d68dbf6d5eab3f40a1921b0406ae981ef1589eeb7efd06db242abcfc1330cddc9cdd
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2018 TIMCRAFT
1
+ Copyright (c) 2012-2019 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.
@@ -86,7 +86,7 @@ class Percentage
86
86
  protected
87
87
 
88
88
  def fractional_value
89
- @fractional_value ||= @value.integer? ? Rational(@value, 100) : @value
89
+ @value.integer? ? Rational(@value, 100) : @value
90
90
  end
91
91
 
92
92
  private
@@ -1,11 +1,11 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'percentage'
3
- s.version = '1.1.0'
3
+ s.version = '1.2.0'
4
4
  s.license = 'LGPL-3.0'
5
5
  s.platform = Gem::Platform::RUBY
6
6
  s.authors = ['Tim Craft']
7
7
  s.email = ['mail@timcraft.com']
8
- s.homepage = 'http://github.com/timcraft/percentage'
8
+ s.homepage = 'https://github.com/timcraft/percentage'
9
9
  s.description = 'A little library for working with percentages'
10
10
  s.summary = 'See description'
11
11
  s.files = Dir.glob('{lib,spec}/**/*') + %w(LICENSE.txt README.md Rakefile.rb percentage.gemspec)
@@ -24,6 +24,12 @@ describe 'Percentage object' do
24
24
 
25
25
  hash[Percentage.new(Rational(1, 10))].must_equal(3)
26
26
  end
27
+
28
+ it 'can be frozen' do
29
+ percentage = Percentage.new(10).freeze
30
+ percentage.frozen?.must_equal(true)
31
+ percentage.to_i.must_equal(10)
32
+ end
27
33
  end
28
34
 
29
35
  describe 'Percentage object initialized with an integer value' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percentage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Craft
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-24 00:00:00.000000000 Z
11
+ date: 2019-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -51,7 +51,7 @@ files:
51
51
  - lib/percentage.rb
52
52
  - percentage.gemspec
53
53
  - spec/percentage_spec.rb
54
- homepage: http://github.com/timcraft/percentage
54
+ homepage: https://github.com/timcraft/percentage
55
55
  licenses:
56
56
  - LGPL-3.0
57
57
  metadata: {}
@@ -70,8 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  requirements: []
73
- rubyforge_project:
74
- rubygems_version: 2.7.6
73
+ rubygems_version: 3.0.3
75
74
  signing_key:
76
75
  specification_version: 4
77
76
  summary: See description