exonio 0.5.4 → 0.6.1
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/.github/dependabot.yml +18 -0
- data/.github/workflows/gem-push.yml +26 -0
- data/.github/workflows/tests.yml +30 -0
- data/.gitignore +2 -1
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +16 -16
- data/README.md +11 -1
- data/lib/exonio/financial.rb +17 -0
- data/lib/exonio/version.rb +1 -1
- metadata +6 -6
- data/.travis.yml +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4c634f17bc1a7424b3be9e782fb72a8e226c4dd09a7b37d0dc71f026c2909b71
|
|
4
|
+
data.tar.gz: aa306d1c5dd6de8e32c06916057986291e551779293ceeed832100eacddf7c5b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33ae1525fa62badfdc56d8203f4eab2d762f5284e4b4996b25b8a447c16f70c8beae9946137a03104e8c68c4c0c7131a70fc673fb26328faf9b74e2a42cc8035
|
|
7
|
+
data.tar.gz: e6b5907b0f28a7d235d462bbe3861398669d7339e0d77d0b3700cd906628a9d53660c51d5341915206bd6a32bc7dbbeec656e2ddfe4eb78d977914f3e8191496
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
|
|
3
|
+
updates:
|
|
4
|
+
- open-pull-requests-limit: 10
|
|
5
|
+
package-ecosystem: "bundler"
|
|
6
|
+
directory: "/"
|
|
7
|
+
schedule:
|
|
8
|
+
interval: "monthly"
|
|
9
|
+
reviewers:
|
|
10
|
+
- "noverde/developers"
|
|
11
|
+
|
|
12
|
+
- open-pull-requests-limit: 10
|
|
13
|
+
package-ecosystem: "github-actions"
|
|
14
|
+
directory: "/"
|
|
15
|
+
schedule:
|
|
16
|
+
interval: "monthly"
|
|
17
|
+
reviewers:
|
|
18
|
+
- "noverde/developers"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: RubyGem
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- v*
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v3
|
|
14
|
+
|
|
15
|
+
- name: Set up Ruby
|
|
16
|
+
uses: ruby/setup-ruby@v1
|
|
17
|
+
with:
|
|
18
|
+
ruby-version: "3.1"
|
|
19
|
+
|
|
20
|
+
- name: Install dependencies
|
|
21
|
+
run: bundle install
|
|
22
|
+
|
|
23
|
+
- name: Publish to RubyGems
|
|
24
|
+
uses: noverde/github-actions/push-rubygems@main
|
|
25
|
+
with:
|
|
26
|
+
rubygems_api_key: ${{ secrets.RUBYGEMS_TOKEN }}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
strategy:
|
|
11
|
+
matrix:
|
|
12
|
+
os: [ubuntu-latest, macos-latest]
|
|
13
|
+
ruby: ["2.3.1", "2.7", "3.0", "3.1"]
|
|
14
|
+
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v3
|
|
19
|
+
|
|
20
|
+
- name: Set up Ruby
|
|
21
|
+
uses: ruby/setup-ruby@v1
|
|
22
|
+
with:
|
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
|
24
|
+
bundler-cache: true
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: bundle install
|
|
28
|
+
|
|
29
|
+
- name: Run tests
|
|
30
|
+
run: bundle exec rake spec
|
data/.gitignore
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
*.gem
|
|
2
2
|
*.rbc
|
|
3
|
+
bin/
|
|
3
4
|
/.config
|
|
4
5
|
/coverage/
|
|
5
6
|
/InstalledFiles
|
|
@@ -29,8 +30,8 @@ build/
|
|
|
29
30
|
# for a library or gem, you might want to ignore these files since the code is
|
|
30
31
|
# intended to run in multiple environments; otherwise, check them in:
|
|
31
32
|
# Gemfile.lock
|
|
32
|
-
# .ruby-version
|
|
33
33
|
# .ruby-gemset
|
|
34
|
+
.ruby-version
|
|
34
35
|
|
|
35
36
|
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
|
36
37
|
.rvmrc
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
exonio (0.
|
|
4
|
+
exonio (0.6.1)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
9
|
byebug (8.2.5)
|
|
10
|
-
coderay (1.1.
|
|
11
|
-
diff-lcs (1.
|
|
10
|
+
coderay (1.1.3)
|
|
11
|
+
diff-lcs (1.5.0)
|
|
12
12
|
method_source (1.0.0)
|
|
13
|
-
pry (0.
|
|
13
|
+
pry (0.14.1)
|
|
14
14
|
coderay (~> 1.1)
|
|
15
15
|
method_source (~> 1.0)
|
|
16
16
|
pry-byebug (3.3.0)
|
|
17
17
|
byebug (~> 8.0)
|
|
18
18
|
pry (~> 0.10)
|
|
19
|
-
rake (13.0.
|
|
20
|
-
rspec (3.
|
|
21
|
-
rspec-core (~> 3.
|
|
22
|
-
rspec-expectations (~> 3.
|
|
23
|
-
rspec-mocks (~> 3.
|
|
24
|
-
rspec-core (3.
|
|
25
|
-
rspec-support (~> 3.
|
|
26
|
-
rspec-expectations (3.
|
|
19
|
+
rake (13.0.6)
|
|
20
|
+
rspec (3.11.0)
|
|
21
|
+
rspec-core (~> 3.11.0)
|
|
22
|
+
rspec-expectations (~> 3.11.0)
|
|
23
|
+
rspec-mocks (~> 3.11.0)
|
|
24
|
+
rspec-core (3.11.0)
|
|
25
|
+
rspec-support (~> 3.11.0)
|
|
26
|
+
rspec-expectations (3.11.0)
|
|
27
27
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
28
|
-
rspec-support (~> 3.
|
|
29
|
-
rspec-mocks (3.
|
|
28
|
+
rspec-support (~> 3.11.0)
|
|
29
|
+
rspec-mocks (3.11.1)
|
|
30
30
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
31
|
-
rspec-support (~> 3.
|
|
32
|
-
rspec-support (3.
|
|
31
|
+
rspec-support (~> 3.11.0)
|
|
32
|
+
rspec-support (3.11.0)
|
|
33
33
|
|
|
34
34
|
PLATFORMS
|
|
35
35
|
ruby
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@ This gem brings some useful Excel formulas to Ruby. For now, it just has
|
|
|
4
4
|
financial formulas, but could have more (like statistical formulas) in the future.
|
|
5
5
|
|
|
6
6
|
[](https://badge.fury.io/rb/exonio)
|
|
7
|
-
[](https://github.com/noverde/exonio/actions)
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -32,6 +32,16 @@ To use Exonio you just have to call the method you like to use. Example:
|
|
|
32
32
|
|
|
33
33
|
## Available Formulas
|
|
34
34
|
|
|
35
|
+
### EFFECT
|
|
36
|
+
|
|
37
|
+
The Excel EFFECT function returns the effective annual interest rate, given a nominal interest rate and the number of compounding periods per year.
|
|
38
|
+
Effective annual interest rate is the interest rate actually earned due to compounding.
|
|
39
|
+
More about this function [EFFECT](https://exceljet.net/excel-functions/excel-effect-function)
|
|
40
|
+
|
|
41
|
+
```ruby
|
|
42
|
+
Exonio.effect(0.05, 10 * 12) # ==> 0.05126014873337037
|
|
43
|
+
```
|
|
44
|
+
|
|
35
45
|
### FV
|
|
36
46
|
|
|
37
47
|
What is the future value after 10 years of saving $100 now, with
|
data/lib/exonio/financial.rb
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
module Exonio
|
|
2
2
|
module Financial
|
|
3
|
+
# Calculates the effective annual interest rate, given a nominal interest rate and the number of
|
|
4
|
+
# compounding periods. Nominal interest rate is the stated rate on the financial product.
|
|
5
|
+
# Effective annual interest rate is the interest rate actually earned due to compounding.
|
|
6
|
+
# constant-amount periodic payments and a constant interest rate.
|
|
7
|
+
#
|
|
8
|
+
# @param rate [Float] The nominal interest rate as decimal (not per cent) per period
|
|
9
|
+
# @param nper [Integer] The number of compounding periods
|
|
10
|
+
#
|
|
11
|
+
# @return [Float]
|
|
12
|
+
#
|
|
13
|
+
# @example
|
|
14
|
+
# Exonio.effect(0.05, 12 * 10) # ==> 0.05126014873337037
|
|
15
|
+
#
|
|
16
|
+
def effect(rate, nper)
|
|
17
|
+
(1 + rate / nper) ** nper - 1
|
|
18
|
+
end
|
|
19
|
+
|
|
3
20
|
# Calculates the future value of an annuity investment based on
|
|
4
21
|
# constant-amount periodic payments and a constant interest rate.
|
|
5
22
|
#
|
data/lib/exonio/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: exonio
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rafael Izidoro
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-08-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -74,17 +74,17 @@ executables: []
|
|
|
74
74
|
extensions: []
|
|
75
75
|
extra_rdoc_files: []
|
|
76
76
|
files:
|
|
77
|
+
- ".github/dependabot.yml"
|
|
78
|
+
- ".github/workflows/gem-push.yml"
|
|
79
|
+
- ".github/workflows/tests.yml"
|
|
77
80
|
- ".gitignore"
|
|
78
81
|
- ".rspec"
|
|
79
|
-
- ".travis.yml"
|
|
80
82
|
- CHANGELOG.md
|
|
81
83
|
- Gemfile
|
|
82
84
|
- Gemfile.lock
|
|
83
85
|
- LICENSE.md
|
|
84
86
|
- README.md
|
|
85
87
|
- Rakefile
|
|
86
|
-
- bin/console
|
|
87
|
-
- bin/setup
|
|
88
88
|
- exonio.gemspec
|
|
89
89
|
- lib/exonio.rb
|
|
90
90
|
- lib/exonio/financial.rb
|
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: '0'
|
|
111
111
|
requirements: []
|
|
112
|
-
rubygems_version: 3.
|
|
112
|
+
rubygems_version: 3.3.7
|
|
113
113
|
signing_key:
|
|
114
114
|
specification_version: 4
|
|
115
115
|
summary: Excel usefull formulas written in Ruby
|
data/.travis.yml
DELETED
data/bin/console
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
require "bundler/setup"
|
|
4
|
-
require "exonio"
|
|
5
|
-
|
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
-
|
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
-
# require "pry"
|
|
11
|
-
# Pry.start
|
|
12
|
-
|
|
13
|
-
require "irb"
|
|
14
|
-
IRB.start
|