This repository has been archived by the owner on Sep 30, 2021. It is now read-only.
forked from lmp/croovy_finance
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename from Croovy::Finance to CroovyFinance
The former was clashing with our Croovy app's namespace.
- Loading branch information
Eric Wollesen
committed
Aug 12, 2013
1 parent
a25de9d
commit 0fcd668
Showing
18 changed files
with
73 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# coding: utf-8 | ||
lib = File.expand_path('../lib', __FILE__) | ||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | ||
require 'croovy/finance/version' | ||
require 'croovy_finance/version' | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "croovy_finance" | ||
spec.version = Croovy::Finance::VERSION | ||
spec.version = CroovyFinance::VERSION | ||
spec.authors = ["Eric Wollesen"] | ||
spec.email = ["[email protected]"] | ||
spec.description = %q{Financial calculations used by Croovy} | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module CroovyFinance | ||
require_relative "croovy_finance/version" | ||
require_relative "croovy_finance/npv" | ||
require_relative "croovy_finance/secant" | ||
require_relative "croovy_finance/irr" | ||
require_relative "croovy_finance/apr" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class Croovy::Finance::Secant | ||
class CroovyFinance::Secant | ||
|
||
# Calculate the root of a function | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module CroovyFinance | ||
VERSION = "0.0.1" | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require "minitest/autorun" | ||
require_relative "../../lib/croovy_finance" | ||
|
||
|
||
class TestIrr < Minitest::Unit::TestCase | ||
|
||
def test_irr | ||
irr = CroovyFinance::Irr.new([-4_000, | ||
1200, | ||
1410, | ||
1875, | ||
1050,]) | ||
result = irr.calc(0.25, 0.2) | ||
|
||
assert_in_delta 0.142, result, 0.001 | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
require "minitest/autorun" | ||
require_relative "../../lib/croovy_finance" | ||
|
||
|
||
class TestNpv < Minitest::Unit::TestCase | ||
|
||
def test_npv | ||
npv = CroovyFinance::Npv.new([-100_000, | ||
-54_672, | ||
-39_161, | ||
3_054, | ||
7_128, | ||
25_927, | ||
28_838, | ||
46_088, | ||
77_076, | ||
46_726, | ||
76_852, | ||
132_332, | ||
166_047]) | ||
|
||
assert_in_delta 59_832.766488911, npv.call(0.1), 0.0000000001 | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters