Permalink
Browse files

cleaning

  • Loading branch information...
1 parent 52dbf8e commit d05e153ee6a01ae7cea736d48ce784edc301c04c @akwiatkowski committed Feb 20, 2012
Showing with 3 additions and 95 deletions.
  1. +2 −3 .rvmrc
  2. +1 −19 Rakefile
  3. +0 −30 lib/monetico/loan.rb
  4. +0 −29 spec/loan_spec.rb
  5. +0 −14 spec/money_round_spec.rb
View
5 .rvmrc
@@ -1,4 +1,3 @@
-#rvm_gemset_create_on_use_flag=1
-#rvm gemset use monetico
-
+rvm_gemset_create_on_use_flag=1
+rvm gemset use monetico
rvm use 1.9.3@monetico --create
View
20 Rakefile
@@ -1,7 +1,7 @@
# encoding: utf-8
#!/usr/bin/env rake
-#require "bundler/gem_tasks"
+require "bundler/gem_tasks"
require 'rubygems'
require 'bundler'
@@ -14,24 +14,6 @@ rescue Bundler::BundlerError => e
end
require 'rake'
-#require 'jeweler'
-#Jeweler::Tasks.new do |gem|
-# # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
-# gem.name = "gem name"
-# gem.homepage = "http://github.com/zaiste/monetico"
-# gem.license = "licence"
-# gem.summary = %Q{summary}
-# gem.description = %Q{desc}
-# gem.email = "..."
-# gem.authors = ["..."]
-# # dependencies defined in Gemfile
-#
-# gem.files = FileList[
-# "[A-Z]*", "{bin,generators,lib,test}/**/*"
-# ]
-#end
-#Jeweler::RubygemsDotOrgTasks.new
-
require 'rspec/core'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
View
30 lib/monetico/loan.rb
@@ -210,36 +210,6 @@ def round_paybacks(res)
return res
end
- # temporary
-
- #def capital_real
- # r(@amount / @no_installments)
- #end
-
- #def total_interests_real_float
- # if const?
- # par = (1 + @interest_rate) ** @no_installments
- # payback_amount = @amount * @interest_rate * par / (par - 1)
- # res = payback_amount * @no_installments - @amount
- # else
- # res = 0.5.big * @interest_rate * @no_installments * (@amount + capital_real)
- # end
- # res
- #end
-
- #def total_interests_real
- # r(total_interests_float)
- #end
-
- #def interests_real(idx)
- # if const?
- # res = interests_for_period(idx)
- # else
- # res = (@amount - (idx - 1) * capital_real) * @interest_rate
- # end
- # r(res)
- #end
-
end
end
View
29 spec/loan_spec.rb
@@ -102,34 +102,5 @@
end
- #it "should calculate loan" do
- # amount = 1000.0
- # interest_rate = 0.2
- # number_of_installments = 3
- # #cadence = :weekly
- # cadence = :monthly
- # kind = :const
- # #kind = :desc
- #
- # loan_calc = Monetico::Loan.new(amount, interest_rate, number_of_installments, cadence, kind)
- # puts loan_calc.to_yaml
- #
- # loan_calc.payback(1..number_of_installments).each do |l|
- # #puts lo_nu.inspect
- # puts l[:amount].to_f
- # puts l[:interests].to_f
- # puts l[:capital].to_f
- # puts l[:balance].to_f
- # puts "*"
- # #payback_items.create(
- # # number: lo_nu[:no],
- # # pay_day: created_at + lo_nu[:no].send(period),
- # # interests: lo_nu[:interests],
- # # capital: lo_nu[:capital],
- # # balance: lo_nu[:balance]
- # #)
- # end
- #end
-
end
View
14 spec/money_round_spec.rb
@@ -20,20 +20,6 @@
end
it "should round simple loan results" do
- #344.50566129375136
- #16.666666666666668
- #327.8389946270847
- #689.0113225874981
- #*
- #344.50566129375136
- #11.20268342288194
- #333.3029778708694
- #344.5056612937467
- #*
- #344.50566129375136
- #5.647633791700789
- #338.85802750205056
-
ma = Monetico::MoneyArray.new
# also testes using floats
ma << BigDecimal.new("327.8389946270847")

0 comments on commit d05e153

Please sign in to comment.