finance_math 1.0.5 → 1.0.6
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 +5 -5
- data/.circleci/config.yml +61 -0
- data/.gitlab-ci.yml +15 -0
- data/.tool-versions +1 -0
- data/README.md +10 -11
- data/finance_math.gemspec +2 -2
- data/lib/version.rb +1 -1
- metadata +14 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 96f21dff1ebfa8772bbe2a251e2c24d55c6430ec8e9fc39ca6175aced2aa0e8e
|
4
|
+
data.tar.gz: 5e45af7a4f350de830406dd7caa762c5590cbf7e2f4d70e859a810926acd5429
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 305a7493c91b7a463d8d6543e4607f14dd403082fc044418f5ceac7b25ef9b911f643ac345e734f7b5ce58461ae6a46c5662209d62ba9a6052c1e48f0bfa3db4
|
7
|
+
data.tar.gz: 1e3fbdba12205a00495cdc030c8907afbdc57092b1b0be2b6c5ebbe5cead0091c3b93f16e01fa65ded5e6a7c21930e463d660fe2dc931971115c13f47f5ce4ec
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# Ruby CircleCI 2.0 configuration file
|
2
|
+
#
|
3
|
+
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
+
#
|
5
|
+
version: 2
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
docker:
|
9
|
+
# specify the version you desire here
|
10
|
+
- image: circleci/ruby:2.4.1-node-browsers
|
11
|
+
|
12
|
+
# Specify service dependencies here if necessary
|
13
|
+
# CircleCI maintains a library of pre-built images
|
14
|
+
# documented at https://circleci.com/docs/2.0/circleci-images/
|
15
|
+
# - image: circleci/postgres:9.4
|
16
|
+
|
17
|
+
working_directory: ~/repo
|
18
|
+
|
19
|
+
steps:
|
20
|
+
- checkout
|
21
|
+
|
22
|
+
# Download and cache dependencies
|
23
|
+
- restore_cache:
|
24
|
+
keys:
|
25
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
26
|
+
# fallback to using the latest cache if no exact match is found
|
27
|
+
- v1-dependencies-
|
28
|
+
|
29
|
+
- run:
|
30
|
+
name: install dependencies
|
31
|
+
command: |
|
32
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
33
|
+
|
34
|
+
- save_cache:
|
35
|
+
paths:
|
36
|
+
- ./vendor/bundle
|
37
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
38
|
+
|
39
|
+
# Database setup
|
40
|
+
- run: bundle exec rake db:create
|
41
|
+
- run: bundle exec rake db:schema:load
|
42
|
+
|
43
|
+
# run tests!
|
44
|
+
- run:
|
45
|
+
name: run tests
|
46
|
+
command: |
|
47
|
+
mkdir /tmp/test-results
|
48
|
+
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
49
|
+
|
50
|
+
bundle exec rspec --format progress \
|
51
|
+
--format RspecJunitFormatter \
|
52
|
+
--out /tmp/test-results/rspec.xml \
|
53
|
+
--format progress \
|
54
|
+
$TEST_FILES
|
55
|
+
|
56
|
+
# collect reports
|
57
|
+
- store_test_results:
|
58
|
+
path: /tmp/test-results
|
59
|
+
- store_artifacts:
|
60
|
+
path: /tmp/test-results
|
61
|
+
destination: test-results
|
data/.gitlab-ci.yml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
before_script:
|
2
|
+
- apt-get update -qq && apt-get install -y -qq sqlite3 libsqlite3-dev nodejs
|
3
|
+
- ruby -v
|
4
|
+
- which ruby
|
5
|
+
- gem install bundler --no-ri --no-rdoc
|
6
|
+
- bundle install --jobs $(nproc) "${FLAGS[@]}"
|
7
|
+
|
8
|
+
rspec:
|
9
|
+
script:
|
10
|
+
- bundle exec rspec
|
11
|
+
|
12
|
+
rubocop:
|
13
|
+
script:
|
14
|
+
- bundle exec rubocop
|
15
|
+
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 3.3.0
|
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
[](http://badge.fury.io/rb/finance_math)
|
2
|
-
[](https://semaphoreapp.com/kolosek/finance_math)
|
3
2
|
[](https://codeclimate.com/github/kolosek/finance_math)
|
4
3
|
|
5
4
|
|
@@ -30,7 +29,7 @@ Defaults are structure_fee = 5, currency protection = 3, so please update if you
|
|
30
29
|
|
31
30
|
```ruby
|
32
31
|
|
33
|
-
Loan.new(nominal_rate: 10.5, duration: 12, amount: 15000)
|
32
|
+
FinanceMath::Loan.new(nominal_rate: 10.5, duration: 12, amount: 15000)
|
34
33
|
```
|
35
34
|
|
36
35
|
## Advanced Usage
|
@@ -41,36 +40,36 @@ Defaults are structure_fee = 5, currency protection = 3, so please update if you
|
|
41
40
|
|
42
41
|
```ruby
|
43
42
|
|
44
|
-
Loan.new(nominal_rate: 10.5, duration: 12, amount: 15000, structure_fee: 5.1, currency_protection: 2.75, fee: 25)
|
43
|
+
FinanceMath::Loan.new(nominal_rate: 10.5, duration: 12, amount: 15000, structure_fee: 5.1, currency_protection: 2.75, fee: 25)
|
45
44
|
```
|
46
45
|
|
47
46
|
## Functions
|
48
47
|
|
49
48
|
This is the list of available functions.
|
50
49
|
|
51
|
-
### Loan.pmt
|
50
|
+
### FinanceMath::Loan.pmt
|
52
51
|
|
53
52
|
Calculates the periodic payment for an annuity investment based on constant-amount periodic payments and a constant interest rate.
|
54
53
|
|
55
54
|
```ruby
|
56
55
|
|
57
|
-
loan = Loan.new(nominal_rate: 10, duration: 12, amount: 1000)
|
56
|
+
loan = FinanceMath::Loan.new(nominal_rate: 10, duration: 12, amount: 1000)
|
58
57
|
loan.pmt
|
59
58
|
# 87.9158872300099
|
60
59
|
|
61
60
|
```
|
62
61
|
|
63
|
-
### Loan.apr
|
62
|
+
### FinanceMath::Loan.apr
|
64
63
|
|
65
64
|
Calculates the Annual Percentage Rate.
|
66
65
|
|
67
66
|
```ruby
|
68
67
|
|
69
|
-
loan = Loan.new(nominal_rate: 13, duration: 12, amount: 10000)
|
68
|
+
loan = FinanceMath::Loan.new(nominal_rate: 13, duration: 12, amount: 10000)
|
70
69
|
loan.apr
|
71
70
|
#29.179538647635006
|
72
71
|
|
73
|
-
loan = Loan.new(nominal_rate: 15, duration: 36, amount: 10000, structure_fee: 5, currency_protection: 3, fee: 10)
|
72
|
+
loan = FinanceMath::Loan.new(nominal_rate: 15, duration: 36, amount: 10000, structure_fee: 5, currency_protection: 3, fee: 10)
|
74
73
|
loan.apr
|
75
74
|
#23.964418264624054
|
76
75
|
|
@@ -90,7 +89,7 @@ Please cover with tests your pull requests
|
|
90
89
|
|
91
90
|
## Ruby versions
|
92
91
|
|
93
|
-
Currently supported
|
92
|
+
Currently supported version of 2.x and 3.x
|
94
93
|
|
95
94
|
## Credits
|
96
95
|
|
@@ -99,9 +98,9 @@ Finance Math is maintained and sponsored by
|
|
99
98
|
|
100
99
|

|
101
100
|
|
102
|
-
Initially developed by
|
101
|
+
Initially developed by Nesha Zoric
|
103
102
|
|
104
|
-
###Follow up @
|
103
|
+
###Follow up @kolosek
|
105
104
|
|
106
105
|
|
107
106
|
## License
|
data/finance_math.gemspec
CHANGED
@@ -19,6 +19,6 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.6"
|
22
|
-
spec.add_development_dependency "rake"
|
23
|
-
spec.add_development_dependency 'rspec'
|
22
|
+
spec.add_development_dependency "rake", "~> 2.0"
|
23
|
+
spec.add_development_dependency 'rspec', "~> 2.0"
|
24
24
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: finance_math
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nesha Zoric
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,30 +28,30 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '2.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
40
|
+
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
47
|
+
version: '2.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
54
|
+
version: '2.0'
|
55
55
|
description: 'Implementation of Loan/Mortgage functions in Ruby language. APR function
|
56
56
|
and PMT function. In calculations it includes implementation of bank fee, marketplace
|
57
57
|
fee, fees for each payment to provide the most precise calculation at very high
|
@@ -62,7 +62,10 @@ executables: []
|
|
62
62
|
extensions: []
|
63
63
|
extra_rdoc_files: []
|
64
64
|
files:
|
65
|
+
- ".circleci/config.yml"
|
65
66
|
- ".gitignore"
|
67
|
+
- ".gitlab-ci.yml"
|
68
|
+
- ".tool-versions"
|
66
69
|
- Gemfile
|
67
70
|
- LICENSE.txt
|
68
71
|
- README.md
|
@@ -92,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
95
|
- !ruby/object:Gem::Version
|
93
96
|
version: '0'
|
94
97
|
requirements: []
|
95
|
-
|
96
|
-
rubygems_version: 2.6.11
|
98
|
+
rubygems_version: 3.5.3
|
97
99
|
signing_key:
|
98
100
|
specification_version: 4
|
99
101
|
summary: Most accurate APR and PMT caluclator for Ruby.
|