pdground 0.1.2 → 0.1.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 +4 -4
- data/.rubocop.yml +10 -1
- data/README.md +1 -0
- data/lib/pdground/extension.rb +11 -0
- data/lib/pdground/version.rb +1 -1
- data/pdground.gemspec +6 -4
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf18f37df086e1af11178ee44765815faf2e3918ccf61dfceca9c782541351eb
|
4
|
+
data.tar.gz: 20d3d5df1007722dfa7f546f190e9381c6b9b3c6c6dbc880e2c0a4bf2cfba636
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3092e462e7af2b3f69e3071bce8206e04b6265bc424992b844ac422e1e4cef6c07af9bb0fe21a57fa538777c851c7ad9c76a08eded2eec7d4a62d37c40ef8cb8
|
7
|
+
data.tar.gz: a092face125761256d2afb30c5219d272d4763bc356e69b2b057f82b208fddfb1df377f097747098d4d9a95afff68d5904ebcbbea95c1e2b0af40306313b18b9
|
data/.rubocop.yml
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
Metrics/AbcSize:
|
2
2
|
Max: 20
|
3
3
|
AllCops:
|
4
|
-
TargetRubyVersion: 2.4
|
4
|
+
TargetRubyVersion: 2.4
|
5
|
+
Style/BlockLength:
|
6
|
+
Exclude:
|
7
|
+
- 'Rakefile'
|
8
|
+
- '**/*.rake'
|
9
|
+
- 'spec/**/*_spec.rb'
|
10
|
+
Style/NumericLiterals:
|
11
|
+
Enabled: false
|
12
|
+
Metrics/LineLength:
|
13
|
+
Max: 100
|
data/README.md
CHANGED
@@ -43,6 +43,7 @@ puts "Rounded error: #{result[1]}"
|
|
43
43
|
|
44
44
|
## Contributing
|
45
45
|
|
46
|
+
Contributions to this project are only accepted in its [GitLab repo](https://gitlab.com/jparaque/pdground)
|
46
47
|
If you want to contribute to improve this gem with any bug fix or new feature:
|
47
48
|
* First open an issue to discuss the bug or feature
|
48
49
|
* Place a merge request referring to the issue once agreed to include it
|
data/lib/pdground/extension.rb
CHANGED
@@ -13,3 +13,14 @@ class Float
|
|
13
13
|
format("%.#{digits - 1}e", self).split('e')[0].delete('.')
|
14
14
|
end
|
15
15
|
end
|
16
|
+
|
17
|
+
# Redefine Integer class to include the same methods as Float
|
18
|
+
class Integer
|
19
|
+
def sigfig(digits)
|
20
|
+
to_f.sigfig(digits)
|
21
|
+
end
|
22
|
+
|
23
|
+
def hisigfig(digits)
|
24
|
+
to_f.hisigfig(digits)
|
25
|
+
end
|
26
|
+
end
|
data/lib/pdground/version.rb
CHANGED
data/pdground.gemspec
CHANGED
@@ -11,9 +11,11 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.authors = ['J.P. Araque']
|
12
12
|
spec.email = ['erjuanpea@gmail.com']
|
13
13
|
|
14
|
-
spec.summary = 'Round numbers using the
|
15
|
-
spec.description = 'Provides an easy
|
16
|
-
with a given uncertainty following PDG rounding rules
|
14
|
+
spec.summary = 'Round numbers using the PDG rounding rules'
|
15
|
+
spec.description = 'Provides an easy way to round any value
|
16
|
+
with a given uncertainty following PDG rounding rules. Mainly consists of a
|
17
|
+
Pdground module witha round method which will round the central value and
|
18
|
+
uncertainty.'
|
17
19
|
spec.homepage = 'https://gitlab.com/jparaque/pdground'
|
18
20
|
spec.license = 'MIT'
|
19
21
|
|
@@ -27,7 +29,7 @@ with a given uncertainty following PDG rounding rules'
|
|
27
29
|
spec.add_development_dependency 'bundler', '~> 1.16'
|
28
30
|
spec.add_development_dependency 'rake', '~> 10.0'
|
29
31
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
30
|
-
spec.add_development_dependency 'rubocop', '~> 0'
|
32
|
+
spec.add_development_dependency 'rubocop', '~> 0.50'
|
31
33
|
spec.add_development_dependency 'simplecov', '~> 0'
|
32
34
|
|
33
35
|
spec.required_ruby_version = '~> 2.4'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdground
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- J.P. Araque
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '0.50'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '0.50'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: simplecov
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,8 +81,10 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
description: |-
|
84
|
-
Provides an easy
|
85
|
-
|
84
|
+
Provides an easy way to round any value
|
85
|
+
with a given uncertainty following PDG rounding rules. Mainly consists of a
|
86
|
+
Pdground module witha round method which will round the central value and
|
87
|
+
uncertainty.
|
86
88
|
email:
|
87
89
|
- erjuanpea@gmail.com
|
88
90
|
executables:
|
@@ -129,5 +131,5 @@ rubyforge_project:
|
|
129
131
|
rubygems_version: 2.7.4
|
130
132
|
signing_key:
|
131
133
|
specification_version: 4
|
132
|
-
summary: Round numbers using the
|
134
|
+
summary: Round numbers using the PDG rounding rules
|
133
135
|
test_files: []
|