finrb 0.1.10 → 0.1.11
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/CHANGELOG.md +6 -1
- data/lib/finrb/cashflows.rb +1 -6
- data/lib/finrb/config.rb +7 -4
- data/lib/finrb/rates.rb +1 -0
- data/lib/finrb/utils.rb +1 -0
- data/lib/finrb.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 70ffddb4fc39b755fea5fc6999eb3b25d9da39f1384f84d21d2a1dd34d2e89b3
|
|
4
|
+
data.tar.gz: a34054fe375454259ccee5f5ac7cf46f12d67705301c0eba88b44c649bbf8046
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a7695ba1956716fd1e592ccbb01f4b0b45fba4ea7d4b3369d6fc8598070ccf3efeab66207ba1368d881453e21d3cdc6a2f9627bcc410d7345041c042b4cb3b1e
|
|
7
|
+
data.tar.gz: 664c65612915fd5319e844097ad328b95b7605204140f90eb5eb8773123602ff0fee536a87650d20d6fabc8dd57b02f549fabbb8bcc9fc2511d12a3726270da2
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# finrb changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.11
|
|
4
|
+
|
|
5
|
+
- fix activesupport configurable deprecation (thanks to @schinery)
|
|
6
|
+
- bump gem versions
|
|
7
|
+
|
|
3
8
|
## 0.1.10
|
|
4
9
|
|
|
5
10
|
- bump gem versions
|
|
@@ -26,7 +31,7 @@
|
|
|
26
31
|
|
|
27
32
|
## 0.1.4
|
|
28
33
|
|
|
29
|
-
- transactions rails fix
|
|
34
|
+
- transactions rails fix (thanks to @MattHall)
|
|
30
35
|
- rm ruby 3.0 support
|
|
31
36
|
|
|
32
37
|
## 0.1.2
|
data/lib/finrb/cashflows.rb
CHANGED
|
@@ -100,12 +100,7 @@ module Finrb
|
|
|
100
100
|
def xirr(guess = nil)
|
|
101
101
|
# Make sure we have a valid sequence of cash flows.
|
|
102
102
|
positives, negatives = partition { |t| t.amount >= 0 }
|
|
103
|
-
if positives.empty? || negatives.empty?
|
|
104
|
-
raise(
|
|
105
|
-
ArgumentError,
|
|
106
|
-
'Calculation does not converge. Cashflow needs to have a least one positive and one negative value.'
|
|
107
|
-
)
|
|
108
|
-
end
|
|
103
|
+
raise(ArgumentError, 'Calculation does not converge. Cashflow needs to have a least one positive and one negative value.') if positives.empty? || negatives.empty?
|
|
109
104
|
|
|
110
105
|
func = Function.new(self, :xnpv)
|
|
111
106
|
rate = [valid(guess)]
|
data/lib/finrb/config.rb
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Finrb
|
|
4
|
-
|
|
4
|
+
Config = Struct.new(:eps, :guess, :business_days, :periodic_compound)
|
|
5
|
+
private_constant :Config
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
def self.config
|
|
8
|
+
@config ||= Config.new(eps: '1.0e-16', guess: 1.0, business_days: false, periodic_compound: false)
|
|
9
|
+
end
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
config
|
|
11
|
+
def self.configure
|
|
12
|
+
yield(config)
|
|
10
13
|
end
|
|
11
14
|
end
|
data/lib/finrb/rates.rb
CHANGED
data/lib/finrb/utils.rb
CHANGED
data/lib/finrb.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: finrb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nadir Cohen
|
|
@@ -79,6 +79,20 @@ dependencies:
|
|
|
79
79
|
- - ">="
|
|
80
80
|
- !ruby/object:Gem::Version
|
|
81
81
|
version: '0'
|
|
82
|
+
- !ruby/object:Gem::Dependency
|
|
83
|
+
name: ostruct
|
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
|
85
|
+
requirements:
|
|
86
|
+
- - ">="
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: '0'
|
|
89
|
+
type: :development
|
|
90
|
+
prerelease: false
|
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - ">="
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: '0'
|
|
82
96
|
- !ruby/object:Gem::Dependency
|
|
83
97
|
name: pry
|
|
84
98
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -249,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
249
263
|
- !ruby/object:Gem::Version
|
|
250
264
|
version: '0'
|
|
251
265
|
requirements: []
|
|
252
|
-
rubygems_version:
|
|
266
|
+
rubygems_version: 4.0.8
|
|
253
267
|
specification_version: 4
|
|
254
268
|
summary: Ruby gem for financial calculations/modeling
|
|
255
269
|
test_files: []
|