budgetcrmod 0.2.1 → 0.2.2
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/VERSION +1 -1
- data/budgetcrmod.gemspec +3 -3
- data/lib/budgetcrmod/budget.rb +9 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5eb9c1cfe45e04c7b0b7b3900a5f306b3af5821b
|
4
|
+
data.tar.gz: f860ba5fd4e5b1bd729d3b25be7a1c8eed176098
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19bea47404cf1e2bd70ca3b65a9aa0bcce84bf83660dde3f89a8b731457536ce4588b70791fb0b0f2b015a293358c759e5dcfb71c97dfdb1a9a60f2753e7f84e
|
7
|
+
data.tar.gz: dfaaccb2045895cd5f4e35f74fbd12da3544c11af9d79eb5ff314797b7214105a5a1b1d596dc8bb5d791ee19f4041a5b7316e3c3723a2e1961fc552cea439bb3
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/budgetcrmod.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: budgetcrmod 0.2.
|
5
|
+
# stub: budgetcrmod 0.2.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "budgetcrmod".freeze
|
9
|
-
s.version = "0.2.
|
9
|
+
s.version = "0.2.2"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Edmund Highcock".freeze]
|
14
|
-
s.date = "2018-03-
|
14
|
+
s.date = "2018-03-07"
|
15
15
|
s.description = "A CodeRunner module to help you do your budget".freeze
|
16
16
|
s.email = "edmundhighcock@users.sourceforge.net".freeze
|
17
17
|
s.extra_rdoc_files = [
|
data/lib/budgetcrmod/budget.rb
CHANGED
@@ -9,7 +9,7 @@ end
|
|
9
9
|
require 'date'
|
10
10
|
class String
|
11
11
|
def latex_escape
|
12
|
-
self.gsub(/(?<!\\)([
|
12
|
+
self.gsub(/(?<!\\)([$%_&^])/, '\\\\\1')
|
13
13
|
end
|
14
14
|
#alias :old_to_f :to_f
|
15
15
|
#def to_f
|
@@ -105,6 +105,7 @@ class CodeRunner
|
|
105
105
|
@first_line_string = data[0].dup
|
106
106
|
data = data.map do |line|
|
107
107
|
matches = line.scan(Regexp.new("((?:#{DOUBLE_STRING}|[^,])*)(?:,|$)"))
|
108
|
+
pp matches
|
108
109
|
matches.flatten
|
109
110
|
end
|
110
111
|
#pp data
|
@@ -175,6 +176,10 @@ class CodeRunner
|
|
175
176
|
[:date,:description,:dummy,:deposit,:balance]
|
176
177
|
when /Bokföringsdatum,Transaktionsreferens,Mottagare,Belopp,Valuta/ # Forex.se privat, Belopp is positive when the asset increases
|
177
178
|
[:date,:description,:dummy,:deposit,:dummy]
|
179
|
+
when /Datum,Text,Belopp/ #Ecster Credit Card
|
180
|
+
[:date,:description,:withdrawal]
|
181
|
+
when /Effective Date,Entered Date,Transaction Description,Amount/ #QudosBank, the first field is blank
|
182
|
+
[:dummy,:date,:description,:deposit]
|
178
183
|
end
|
179
184
|
end
|
180
185
|
|
@@ -205,7 +210,7 @@ class CodeRunner
|
|
205
210
|
#end
|
206
211
|
@data.each do |dataset|
|
207
212
|
#next if @runner.cache[:data].include? dataset and Date.parse(dataset[0]) > Date.parse("1/1/2013")
|
208
|
-
next if @runner.component_run_list.map{|k,v| v.instance_variable_get(:@dataset)}.include? dataset and Date.parse(dataset[0]) > Date.parse("1/1/2013")
|
213
|
+
next if @runner.component_run_list.map{|k,v| v.instance_variable_get(:@dataset)}.include? dataset # and Date.parse(dataset[0]) > Date.parse("1/1/2013")
|
209
214
|
next if @first_line_string =~ /^Datum/ and dataset[1] =~ /Reservation/
|
210
215
|
component = create_component
|
211
216
|
ep 'Generating Component', @component_runs.size
|
@@ -217,7 +222,7 @@ class CodeRunner
|
|
217
222
|
if [:deposit, :withdrawal, :balance].include? res
|
218
223
|
case @first_line_string
|
219
224
|
when /^Datum/i # we are dealing with European numbers
|
220
|
-
value = value.gsub(/[."]/, '')
|
225
|
+
value = value.gsub(/[." ]/, '')
|
221
226
|
value = value.sub(/[,]/, '.')
|
222
227
|
else
|
223
228
|
value = value.gsub(/[",]/, '')
|
@@ -229,8 +234,8 @@ class CodeRunner
|
|
229
234
|
component.set(res, value)
|
230
235
|
component.set_zeroes
|
231
236
|
component.set(:data_line, reslts.map{|r| component.send(r).to_s}.join(','))
|
232
|
-
component.date_i = component.date.to_datetime.to_time.to_i
|
233
237
|
end
|
238
|
+
component.date_i = component.date.to_datetime.to_time.to_i
|
234
239
|
if component.deposit < 0.0 and component.withdrawal == 0.0
|
235
240
|
component.withdrawal = -component.deposit
|
236
241
|
component.deposit = 0.0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: budgetcrmod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edmund Highcock
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coderunner
|