Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
akwiatkowski committed Feb 20, 2012
1 parent 52dbf8e commit d05e153
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 95 deletions.
5 changes: 2 additions & 3 deletions .rvmrc
@@ -1,4 +1,3 @@
#rvm_gemset_create_on_use_flag=1 rvm_gemset_create_on_use_flag=1
#rvm gemset use monetico rvm gemset use monetico

rvm use 1.9.3@monetico --create rvm use 1.9.3@monetico --create
20 changes: 1 addition & 19 deletions Rakefile
@@ -1,7 +1,7 @@
# encoding: utf-8 # encoding: utf-8


#!/usr/bin/env rake #!/usr/bin/env rake
#require "bundler/gem_tasks" require "bundler/gem_tasks"


require 'rubygems' require 'rubygems'
require 'bundler' require 'bundler'
Expand All @@ -14,24 +14,6 @@ rescue Bundler::BundlerError => e
end end
require 'rake' 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'
require 'rspec/core/rake_task' require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec| RSpec::Core::RakeTask.new(:spec) do |spec|
Expand Down
30 changes: 0 additions & 30 deletions lib/monetico/loan.rb
Expand Up @@ -210,36 +210,6 @@ def round_paybacks(res)
return res return res
end 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
end end
29 changes: 0 additions & 29 deletions spec/loan_spec.rb
Expand Up @@ -102,34 +102,5 @@


end 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 end


14 changes: 0 additions & 14 deletions spec/money_round_spec.rb
Expand Up @@ -20,20 +20,6 @@
end end


it "should round simple loan results" do 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 ma = Monetico::MoneyArray.new
# also testes using floats # also testes using floats
ma << BigDecimal.new("327.8389946270847") ma << BigDecimal.new("327.8389946270847")
Expand Down

0 comments on commit d05e153

Please sign in to comment.