sk_calc 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +1 -4
- data/.travis.yml +4 -0
- data/Gemfile +0 -2
- data/README.rdoc +5 -7
- data/Rakefile +1 -11
- data/lib/sk_calc/helper.rb +3 -4
- data/lib/sk_calc/item.rb +23 -44
- data/lib/sk_calc/items.rb +30 -21
- data/lib/sk_calc/version.rb +1 -1
- data/lib/sk_calc.rb +1 -1
- data/sk_calc.gemspec +1 -1
- data/spec/spec_helper.rb +10 -2
- metadata +86 -111
- data/Gemfile.lock +0 -36
- data/VERSION +0 -1
- data/ci/Gemfile +0 -8
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MWE1ZTA5MmYzYjE5MjM4NmRmNjA1ZTk1YWJjMTkxN2QzYTI0YmExYQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MjEzY2E4NTgwNjhmNmNkNTI1M2FmYzU2NjEyZDhkNmUxY2IwYjBmYw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NjIzZmU0YTk5YmRlNTJhMTUzYTFmZmY4ODdkNTllN2ZkYzE4YTI2NDdmOGE1
|
10
|
+
MDNlNjkxZTdiNzhiMTU0YzQzYzliOTU2ODRmN2EzN2Y4MDU0NzQ5YTUyNzFm
|
11
|
+
YTZmYjUyMzc2NjliYjNkYThhNGMwYTk5YTk5MjgyNzNmZWE4OTc=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NTA5MzdhMDM3ZjY2YmQyNGJhYjY3OTg0MDc5NjUxYmMyMTc0MGQ4MjM5MmU2
|
14
|
+
N2U5NTRjNGM3ZTQ4Y2Y3MmU4ZTQ4MjM1MjI5MWE4ZmQwN2U5YzMzYWUwM2Ey
|
15
|
+
MjUyN2QzYjk3YmZmZmMwMWQyMDZiYzczYjRiZWUyNTIwMzgxOGQ=
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
= SalesKing Calculation
|
2
|
+
{<img src="https://secure.travis-ci.org/salesking/sk_calc.png?branch=master" alt="Build Status" />}[http://travis-ci.org/salesking/sk_calc]
|
2
3
|
|
3
4
|
Why?
|
4
5
|
|
@@ -6,10 +7,10 @@ Why?
|
|
6
7
|
2. Ever stumbled upon rounding problems, when calculating totals?
|
7
8
|
3. Wouldn't it be nice to change a calculation strategy?
|
8
9
|
|
9
|
-
We decided to open-source this part, so everybody can transparently see
|
10
|
-
how we calculate item and document totals.
|
10
|
+
We decided to open-source this part, so everybody can transparently see
|
11
|
+
how we calculate item and document totals.
|
11
12
|
|
12
|
-
You can take advantage of this lib for example when using our API and
|
13
|
+
You can take advantage of this lib for example when using our API and
|
13
14
|
mixing it into your local classes.
|
14
15
|
|
15
16
|
|
@@ -18,12 +19,9 @@ mixing it into your local classes.
|
|
18
19
|
gem install sk_calc
|
19
20
|
|
20
21
|
|
21
|
-
== Classes
|
22
|
-
|
23
|
-
|
24
22
|
== Usage
|
25
23
|
|
26
|
-
|
24
|
+
read spec/sk_calc/*.rb to see examples
|
27
25
|
|
28
26
|
require 'sk_calc'
|
29
27
|
|
data/Rakefile
CHANGED
@@ -3,6 +3,7 @@ require 'rake'
|
|
3
3
|
require 'rdoc/task'
|
4
4
|
require 'rspec'
|
5
5
|
require 'rspec/core/rake_task'
|
6
|
+
require 'bundler/gem_tasks'
|
6
7
|
|
7
8
|
desc 'Default: run specs.'
|
8
9
|
task :default => :spec
|
@@ -13,13 +14,6 @@ RSpec::Core::RakeTask.new do |t|
|
|
13
14
|
# Put spec opts in a file named .rspec in root
|
14
15
|
end
|
15
16
|
|
16
|
-
desc "Generate code coverage"
|
17
|
-
RSpec::Core::RakeTask.new(:coverage) do |t|
|
18
|
-
t.pattern = "./spec/**/*_spec.rb" # don't need this, it's default.
|
19
|
-
t.rcov = true
|
20
|
-
t.rcov_opts = ['--exclude', 'spec']
|
21
|
-
end
|
22
|
-
|
23
17
|
desc 'Generate documentation.'
|
24
18
|
Rake::RDocTask.new(:rdoc) do |rdoc|
|
25
19
|
rdoc.rdoc_dir = 'rdoc'
|
@@ -29,7 +23,3 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
|
|
29
23
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
30
24
|
end
|
31
25
|
|
32
|
-
#require "bundler/gem_tasks"
|
33
|
-
########### to be dropped when we go public
|
34
|
-
require "bundler/gem_helper"
|
35
|
-
Bundler::GemHelper.install_tasks
|
data/lib/sk_calc/helper.rb
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
# - convert empty or integer values into BigDecimals
|
3
3
|
module SK::Calc::Helper
|
4
4
|
|
5
|
-
|
6
5
|
private
|
7
6
|
|
8
7
|
# Init price single with 0 if nil and cast to BigDecimal
|
@@ -18,12 +17,12 @@ module SK::Calc::Helper
|
|
18
17
|
def conv_tax
|
19
18
|
to_bd(tax || 0)
|
20
19
|
end
|
21
|
-
|
20
|
+
|
22
21
|
# Cast a val to BigDecimal
|
23
22
|
# == Return
|
24
23
|
# <BigDecimal>
|
25
|
-
def to_bd(val)
|
26
|
-
val.is_a?(BigDecimal) ? val : BigDecimal.new("#{val}")
|
24
|
+
def to_bd(val)
|
25
|
+
val.is_a?(BigDecimal) ? val : BigDecimal.new("#{val}")
|
27
26
|
end
|
28
27
|
|
29
28
|
end
|
data/lib/sk_calc/item.rb
CHANGED
@@ -49,14 +49,12 @@ module SK::Calc::Item
|
|
49
49
|
# Total unrounded net basis incl discount
|
50
50
|
# Use this internally to do calculations! Differs from net_total_base which is
|
51
51
|
# used to output the rounded & formatted values
|
52
|
-
#
|
53
|
-
# <BigDecimal>::
|
52
|
+
# @return [BigDecimal]
|
54
53
|
def net_total_base
|
55
|
-
(100 - discount) * total / 100
|
54
|
+
(100 - (discount||0)) * total / 100
|
56
55
|
end
|
57
56
|
|
58
|
-
#
|
59
|
-
# <BigDecimal>:: total amount of tax
|
57
|
+
# @return [BigDecimal] total amount of tax
|
60
58
|
def tax_total_base
|
61
59
|
(net_total_base * conv_tax) / 100
|
62
60
|
end
|
@@ -64,10 +62,9 @@ module SK::Calc::Item
|
|
64
62
|
# Single net price with discount applied
|
65
63
|
# DO NOT use this method to calculate(eg. totals for a document) use net_total
|
66
64
|
# or gross_total instead
|
67
|
-
#
|
68
|
-
# <BigDecimal>:: rounded 2 decimals
|
65
|
+
# @return [BigDecimal] rounded 2 decimals
|
69
66
|
def net_single_base
|
70
|
-
conv_price_single * ( 1 - (discount / 100 ) )
|
67
|
+
conv_price_single * ( 1 - ((discount||0) / 100 ) )
|
71
68
|
end
|
72
69
|
|
73
70
|
def gross_single_base
|
@@ -75,23 +72,20 @@ module SK::Calc::Item
|
|
75
72
|
end
|
76
73
|
|
77
74
|
# Total gross price incl. discount
|
78
|
-
#
|
79
|
-
# <BigDecimal>:: total gross base
|
75
|
+
# @return [BigDecimal] total gross base
|
80
76
|
def gross_total_base
|
81
77
|
net_total_base + tax_total_base
|
82
78
|
end
|
83
79
|
|
84
80
|
# The discount amount unrounded
|
85
|
-
#
|
86
|
-
# <BigDecimal>:: rounded
|
81
|
+
# @return [BigDecimal] rounded
|
87
82
|
def discount_total_base
|
88
|
-
total * (discount / 100)
|
83
|
+
total * ((discount||0) / 100)
|
89
84
|
end
|
90
85
|
|
91
86
|
# Unrounded item total price * quantity, excl discount
|
92
87
|
# Use it to do calculations!
|
93
|
-
#
|
94
|
-
# <BigDecimal>::
|
88
|
+
# @return [BigDecimal]
|
95
89
|
def total
|
96
90
|
conv_price_single * ( quantity || 0)
|
97
91
|
end
|
@@ -104,39 +98,32 @@ module SK::Calc::Item
|
|
104
98
|
### for calculations!
|
105
99
|
|
106
100
|
# Total gross price incl. discount
|
107
|
-
#
|
108
|
-
# <BigDecimal>:: rounded 2 decimals
|
101
|
+
# @return [BigDecimal] rounded 2 decimals
|
109
102
|
def gross_total
|
110
103
|
gross_total_base.round(2)
|
111
104
|
end
|
112
105
|
|
113
106
|
# Total net price(2 decimals) incl. discount
|
114
|
-
#
|
115
|
-
# <BigDecimal>:: rounded 2 decimals
|
107
|
+
# @return [BigDecimal] rounded 2 decimals
|
116
108
|
def net_total
|
117
109
|
net_total_base.round(2)
|
118
110
|
end
|
119
111
|
|
120
|
-
|
121
|
-
# ==== Returns
|
122
|
-
# <BigDecimal>:: rounded 2 decimals
|
112
|
+
# @return [BigDecimal] rounded 2 decimals
|
123
113
|
def tax_total
|
124
114
|
tax_total_base.round(2)
|
125
115
|
end
|
126
116
|
|
127
117
|
# The discount amount
|
128
|
-
#
|
129
|
-
# <BigDecimal>:: rounded 2 decimals
|
118
|
+
# @return [BigDecimal] rounded 2 decimals
|
130
119
|
def discount_total
|
131
120
|
discount_total_base.round(2)
|
132
121
|
end
|
133
122
|
|
134
|
-
|
135
123
|
# Single net price with discount applied rounded 2.
|
136
124
|
# DO NOT use this method to calculate(eg. totals for a document) use net_total
|
137
125
|
# or gross_total instead
|
138
|
-
#
|
139
|
-
# <BigDecimal>:: rounded 2 decimals
|
126
|
+
# @return [BigDecimal] rounded 2 decimals
|
140
127
|
def net_single
|
141
128
|
net_single_base.round(2)
|
142
129
|
end
|
@@ -144,8 +131,7 @@ module SK::Calc::Item
|
|
144
131
|
# Single gross price rounded 2.
|
145
132
|
# DONT use this method to calculate(eg. totals for a document) use net_total
|
146
133
|
# or gross_total instead
|
147
|
-
#
|
148
|
-
# <BigDecimal>:: rounded 2 decimals
|
134
|
+
# @return [BigDecimal] rounded 2 decimals
|
149
135
|
def gross_single
|
150
136
|
gross_single_base.round(2)
|
151
137
|
end
|
@@ -158,29 +144,25 @@ module SK::Calc::Item
|
|
158
144
|
### for calculations!
|
159
145
|
|
160
146
|
# Total gross price incl. discount
|
161
|
-
#
|
162
|
-
# <BigDecimal>:: rounded 2 decimals
|
147
|
+
# @return [BigDecimal] rounded 2 decimals
|
163
148
|
def gross_total_4
|
164
149
|
gross_total_base.round(4)
|
165
150
|
end
|
166
151
|
|
167
|
-
# Total net price
|
168
|
-
#
|
169
|
-
# <BigDecimal>:: rounded 2 decimals
|
152
|
+
# Total net price
|
153
|
+
# @return [BigDecimal] rounded 4 decimals
|
170
154
|
def net_total_4
|
171
155
|
net_total_base.round(4)
|
172
156
|
end
|
173
157
|
|
174
158
|
|
175
|
-
#
|
176
|
-
# <BigDecimal>:: rounded 2 decimals
|
159
|
+
# @return [BigDecimal] rounded 4 decimals
|
177
160
|
def tax_total_4
|
178
161
|
tax_total_base.round(4)
|
179
162
|
end
|
180
163
|
|
181
164
|
# The discount amount
|
182
|
-
#
|
183
|
-
# <BigDecimal>:: rounded 2 decimals
|
165
|
+
# @return [BigDecimal] rounded 4 decimals
|
184
166
|
def discount_total_4
|
185
167
|
discount_total_base.round(4)
|
186
168
|
end
|
@@ -189,8 +171,7 @@ module SK::Calc::Item
|
|
189
171
|
# Single net price with discount applied rounded 2.
|
190
172
|
# DO NOT use this method to calculate(eg. totals for a document) use net_total
|
191
173
|
# or gross_total instead
|
192
|
-
#
|
193
|
-
# <BigDecimal>:: rounded 2 decimals
|
174
|
+
# @return [BigDecimal] rounded 4 decimals
|
194
175
|
def net_single_4
|
195
176
|
net_single_base.round(4)
|
196
177
|
end
|
@@ -198,8 +179,7 @@ module SK::Calc::Item
|
|
198
179
|
# Single gross price rounded 2.
|
199
180
|
# DONT use this method to calculate(eg. totals for a document) use net_total
|
200
181
|
# or gross_total instead
|
201
|
-
#
|
202
|
-
# <BigDecimal>:: rounded 2 decimals
|
182
|
+
# @return [BigDecimal] rounded 4 decimals
|
203
183
|
def gross_single_4
|
204
184
|
gross_single_base.round(4)
|
205
185
|
end
|
@@ -207,8 +187,7 @@ module SK::Calc::Item
|
|
207
187
|
private
|
208
188
|
|
209
189
|
# Init price single with 0 if nil and cast to BigDecimal
|
210
|
-
#
|
211
|
-
# <BigDecimal>
|
190
|
+
# @return [BigDecimal]
|
212
191
|
def conv_price_single
|
213
192
|
to_bd(price_single || 0)
|
214
193
|
end
|
data/lib/sk_calc/items.rb
CHANGED
@@ -1,44 +1,54 @@
|
|
1
1
|
# Calculate totals for a multiple items eg in an invoice
|
2
2
|
# Including class MUST respond to:
|
3
3
|
# - price_total
|
4
|
-
# - precision
|
5
4
|
# - price_tax
|
6
5
|
# - line_items
|
7
6
|
module SK::Calc::Items
|
8
7
|
include SK::Calc::Helper
|
9
8
|
|
10
|
-
# Unrounded net total
|
11
|
-
#
|
9
|
+
# Unrounded net total the taxation base
|
10
|
+
# @return [BigDecimal]
|
12
11
|
def net_total_base
|
13
12
|
conv_price_total
|
14
13
|
end
|
15
14
|
|
16
|
-
# Gross total
|
15
|
+
# Gross total unrounded
|
16
|
+
# @return [BigDecimal]
|
17
17
|
def gross_total_base
|
18
|
-
(net_total_base || 0) +
|
18
|
+
(net_total_base || 0) + tax_total_base
|
19
19
|
end
|
20
20
|
|
21
|
-
# Net total rounded to 2 decimals
|
21
|
+
# Net total rounded to 2 decimals
|
22
22
|
def net_total
|
23
23
|
net_total_base.round(2)
|
24
24
|
end
|
25
25
|
|
26
26
|
# Gross total rounded to 2 decimals
|
27
|
+
# @return [BigDecimal]
|
27
28
|
def gross_total
|
28
29
|
gross_total_base.round(2)
|
29
30
|
end
|
30
31
|
|
31
|
-
#
|
32
|
+
# Tax total rounded price_tax to 2 decimals
|
33
|
+
# @return [BigDecimal]
|
34
|
+
def tax_total_base
|
35
|
+
conv_tax
|
36
|
+
end
|
37
|
+
|
38
|
+
# Tax total rounded price_tax to 2 decimals
|
39
|
+
# @return [BigDecimal]
|
32
40
|
def tax_total
|
33
41
|
conv_tax.round(2)
|
34
42
|
end
|
35
43
|
|
36
|
-
# Net total rounded to
|
44
|
+
# Net total rounded to 4 decimals
|
45
|
+
# @return [BigDecimal]
|
37
46
|
def net_total_4
|
38
47
|
net_total_base.round(4)
|
39
48
|
end
|
40
49
|
|
41
|
-
# Rounded price_tax to
|
50
|
+
# Rounded price_tax to 4 decimals
|
51
|
+
# @return [BigDecimal]
|
42
52
|
def tax_total_4
|
43
53
|
conv_tax.round(4)
|
44
54
|
end
|
@@ -55,22 +65,23 @@ module SK::Calc::Items
|
|
55
65
|
end
|
56
66
|
|
57
67
|
# Sums up the tax price of the line items, grouped by tax
|
58
|
-
#
|
59
|
-
|
60
|
-
#
|
68
|
+
#
|
69
|
+
# @example
|
70
|
+
# Sums up the price_total and calculate the tax -does not sum price_tax
|
71
|
+
# because of rounding errors!
|
72
|
+
# Returns a sorted sorted hash
|
73
|
+
# { [ 7, 3.50 ], [ 19, 47.50 ] } for each price/tax combination
|
61
74
|
# So if you are using two kinds of tax (7%/19%) in an document:
|
62
75
|
#
|
63
76
|
# [0] =>
|
64
77
|
# [0] => 7 # the tax percentage
|
65
78
|
# [1] => 14.00 # tax sum of all line item with this tax (items summ is 200.00)
|
66
79
|
# [1] =>
|
67
|
-
# [0] => 19
|
68
|
-
# [1] => 57 #
|
69
|
-
#
|
80
|
+
# [0] => 19
|
81
|
+
# [1] => 57 #(items sum = 300)
|
70
82
|
#
|
71
|
-
# Sum up the price_total and calculate the tax -
|
72
|
-
# don't sum price_tax because of rounding errors!
|
73
83
|
#
|
84
|
+
# @return [Hash]
|
74
85
|
def tax_grouped(items=nil)
|
75
86
|
items ||= line_items
|
76
87
|
result = {}
|
@@ -84,15 +95,13 @@ module SK::Calc::Items
|
|
84
95
|
private
|
85
96
|
|
86
97
|
# Init price single with 0 if nil and cast to BigDecimal
|
87
|
-
#
|
88
|
-
# <BigDecimal>
|
98
|
+
# @return [BigDecimal]
|
89
99
|
def conv_price_total
|
90
100
|
to_bd(price_total || 0)
|
91
101
|
end
|
92
102
|
|
93
103
|
# Init tax with 0 if nil and cast to BigDecimal .. same in helper
|
94
|
-
#
|
95
|
-
# <BigDecimal>
|
104
|
+
# @return [BigDecimal]
|
96
105
|
def conv_tax
|
97
106
|
to_bd(price_tax || 0)
|
98
107
|
end
|
data/lib/sk_calc/version.rb
CHANGED
data/lib/sk_calc.rb
CHANGED
data/sk_calc.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.summary = %q{SalesKing Calculation Module}
|
25
25
|
|
26
26
|
s.add_development_dependency 'rspec'
|
27
|
-
s.add_development_dependency '
|
27
|
+
s.add_development_dependency 'simplecov'
|
28
28
|
s.add_development_dependency 'rdoc'
|
29
29
|
s.add_development_dependency 'activesupport'
|
30
30
|
s.add_development_dependency 'rake', '>= 0.9.2'
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,13 @@
|
|
1
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'simplecov'
|
2
3
|
require 'yaml'
|
3
4
|
require 'rspec'
|
4
|
-
require
|
5
|
+
require 'active_support'
|
6
|
+
|
7
|
+
SimpleCov.start do
|
8
|
+
root File.join(File.dirname(__FILE__), '..')
|
9
|
+
add_filter "/bin/"
|
10
|
+
add_filter "/spec/"
|
11
|
+
end
|
12
|
+
|
5
13
|
require "#{File.dirname(__FILE__)}/../lib/sk_calc"
|
metadata
CHANGED
@@ -1,112 +1,100 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: sk_calc
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 3
|
10
|
-
version: 0.0.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Georg Leciejewski
|
14
|
-
-
|
8
|
+
- Mike Połtyn
|
15
9
|
autorequire:
|
16
10
|
bindir: bin
|
17
11
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-02-15 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: rspec
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
version: "0"
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ! '>='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
33
21
|
type: :development
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: rcov
|
37
22
|
prerelease: false
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ! '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: simplecov
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ! '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
47
35
|
type: :development
|
48
|
-
version_requirements: *id002
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: rdoc
|
51
36
|
prerelease: false
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rdoc
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
61
49
|
type: :development
|
62
|
-
version_requirements: *id003
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
|
-
name: activesupport
|
65
50
|
prerelease: false
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: activesupport
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
75
63
|
type: :development
|
76
|
-
version_requirements: *id004
|
77
|
-
- !ruby/object:Gem::Dependency
|
78
|
-
name: rake
|
79
64
|
prerelease: false
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rake
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
90
76
|
version: 0.9.2
|
91
77
|
type: :development
|
92
|
-
|
93
|
-
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ! '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: 0.9.2
|
84
|
+
description: Calculate document and line item totals. This moule is used inside SalesKIng
|
85
|
+
and outsourced for transparency and reusability.
|
94
86
|
email: gl@salesking.eu
|
95
87
|
executables: []
|
96
|
-
|
97
88
|
extensions: []
|
98
|
-
|
99
|
-
extra_rdoc_files:
|
89
|
+
extra_rdoc_files:
|
100
90
|
- README.rdoc
|
101
|
-
files:
|
91
|
+
files:
|
102
92
|
- .gitignore
|
93
|
+
- .travis.yml
|
103
94
|
- Gemfile
|
104
|
-
- Gemfile.lock
|
105
95
|
- LICENSE
|
106
96
|
- README.rdoc
|
107
97
|
- Rakefile
|
108
|
-
- VERSION
|
109
|
-
- ci/Gemfile
|
110
98
|
- lib/sk_calc.rb
|
111
99
|
- lib/sk_calc/helper.rb
|
112
100
|
- lib/sk_calc/item.rb
|
@@ -118,38 +106,25 @@ files:
|
|
118
106
|
- spec/spec_helper.rb
|
119
107
|
homepage: http://github.com/salesking/sk_calc
|
120
108
|
licenses: []
|
121
|
-
|
109
|
+
metadata: {}
|
122
110
|
post_install_message:
|
123
111
|
rdoc_options: []
|
124
|
-
|
125
|
-
require_paths:
|
112
|
+
require_paths:
|
126
113
|
- lib
|
127
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
none: false
|
138
|
-
requirements:
|
139
|
-
- - ">="
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
hash: 3
|
142
|
-
segments:
|
143
|
-
- 0
|
144
|
-
version: "0"
|
114
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ! '>='
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: '0'
|
145
124
|
requirements: []
|
146
|
-
|
147
125
|
rubyforge_project:
|
148
|
-
rubygems_version: 1.
|
126
|
+
rubygems_version: 2.1.11
|
149
127
|
signing_key:
|
150
|
-
specification_version:
|
128
|
+
specification_version: 4
|
151
129
|
summary: SalesKing Calculation Module
|
152
|
-
test_files:
|
153
|
-
- spec/sk_calc/item_spec.rb
|
154
|
-
- spec/sk_calc/items_spec.rb
|
155
|
-
- spec/spec_helper.rb
|
130
|
+
test_files: []
|
data/Gemfile.lock
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
sk_calc (0.0.1)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
activesupport (3.1.3)
|
10
|
-
multi_json (~> 1.0)
|
11
|
-
diff-lcs (1.1.3)
|
12
|
-
json (1.6.4)
|
13
|
-
multi_json (1.0.4)
|
14
|
-
rake (0.9.2.2)
|
15
|
-
rcov (0.9.11)
|
16
|
-
rdoc (3.12)
|
17
|
-
json (~> 1.4)
|
18
|
-
rspec (2.7.0)
|
19
|
-
rspec-core (~> 2.7.0)
|
20
|
-
rspec-expectations (~> 2.7.0)
|
21
|
-
rspec-mocks (~> 2.7.0)
|
22
|
-
rspec-core (2.7.1)
|
23
|
-
rspec-expectations (2.7.0)
|
24
|
-
diff-lcs (~> 1.1.2)
|
25
|
-
rspec-mocks (2.7.0)
|
26
|
-
|
27
|
-
PLATFORMS
|
28
|
-
ruby
|
29
|
-
|
30
|
-
DEPENDENCIES
|
31
|
-
activesupport
|
32
|
-
rake (>= 0.9.2)
|
33
|
-
rcov
|
34
|
-
rdoc
|
35
|
-
rspec
|
36
|
-
sk_calc!
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.0.3
|