simple-ynab 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/simple-ynab +17 -18
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 792eef199b1e07d837499d49a0adfb3b420206c6
4
- data.tar.gz: 8a175ff0cd6b7b00374a040a22f893d9d40b52ef
3
+ metadata.gz: cabb1f913594c58030b31312b99eb10570e34f87
4
+ data.tar.gz: c0b4faa6bbe84ec3245700e6b21ec272d5ae4da6
5
5
  SHA512:
6
- metadata.gz: 13d4bfec638964c7ff3c219138452cc2ce6008fc7c76251a3089b7119b703aee9cc8a05641916138a49b3ba2942862299c28d57286dbde081f0f316fa46241e0
7
- data.tar.gz: 39c1eca1f427a7b527d8de7f6397f09078defbc413d45b9c7b3b801e1a02632632cd679ea43d4e4863427ce426d876e8355d418abf31692750467efc2ebd3c6f
6
+ metadata.gz: 52f14adca756b11609d1d9f3b0d15e1be576a9b2450d76f5a47e1eaa11035c3d93e0c6f50eed606074a5003a54111434c71ab8d2b7669afcb2c4144cd4b36953
7
+ data.tar.gz: 8a85367f92eb859bbd2184bf08a63de2f8574d23b6e3e35d7f1743ce140cf38b41975c971636d5de9fc1be014d1430d865bbbb3a021c02ebc108ae0b6b628b73
data/bin/simple-ynab CHANGED
@@ -9,14 +9,13 @@ require 'Date'
9
9
  opts = Slop.parse(:banner => 'simple-ynab', :help => true ) do
10
10
  on 'd', 'days=', 'Strips all rows before x days ago, e.g -d 30 ', :argument => true
11
11
  on 'y', 'ynab_date', 'Converts date to MM/DD/YYYY. SEE README.md FOR WARNINGS!!!', :argument => false
12
- on 'p', 'pending', 'Include pending transactions', :argument => false
13
12
  on 'v', 'verbose', 'Print debug information', :argument => false
14
13
  on 'x', 'very_verbose', 'Prints an uncomfortable amount of debugging information to terminal, does not replace -v', :argument => false
15
14
  end
16
15
 
17
16
  # Which column headers in the Simple CSV match up with the columns headers needed by YNAB
18
- simple_keywords = ["Date", "Description", "Category", "Memo", "Amount"]
19
- ynab_keywords = ["Date", "Payee", "Category", "Memo", "Amount"]
17
+ simple_keywords = ["when_received", "raw_description", "merchant_description", "amount"]
18
+ ynab_keywords = ["Date", "Payee", "Memo", "Amount"]
20
19
 
21
20
  ##### Get the csv file from args
22
21
  ARGV.each do |argument|
@@ -42,25 +41,25 @@ simple_headers = simple_keywords.map{ |column| simplecsv[0].index(column)}
42
41
  if opts.verbose? then puts "Simple_headers indexes are #{simple_headers}".blue end
43
42
 
44
43
 
45
- # Create a new array that omits the CSV rows when the value in the 'Pending' column = true
46
- if opts.verbose? then puts "Removing pending transactions".magenta end
47
- if opts.pending? then puts "User chose to include pending transactions".blue end
48
- no_pending_array = Array.new()
49
- pending = simplecsv[0].find_index('Pending') # Column number that contains 'Pending'
50
- simplecsv.each do |row|
51
- # If -p (Pending) option is not provided, Only push rows with 'false' in the pending column.
52
- # Make sure header (row 0) gets included too.
53
- if opts.pending? or row[pending].to_s.casecmp('false') == 0 or row[pending].to_s.casecmp('Pending') == 0
54
- no_pending_array.push(row)
55
- else
56
- if opts.verbose? then puts "Removing pending transaction #{row}".yellow end
57
- end
58
- end
44
+ # # Create a new array that omits the CSV rows when the value in the 'Pending' column = true
45
+ # if opts.verbose? then puts "Removing pending transactions".magenta end
46
+ # if opts.pending? then puts "User chose to include pending transactions".blue end
47
+ # no_pending_array = Array.new()
48
+ # pending = simplecsv[0].find_index('Pending') # Column number that contains 'Pending'
49
+ # simplecsv.each do |row|
50
+ # # If -p (Pending) option is not provided, Only push rows with 'false' in the pending column.
51
+ # # Make sure header (row 0) gets included too.
52
+ # if opts.pending? or row[pending].to_s.casecmp('false') == 0 or row[pending].to_s.casecmp('Pending') == 0
53
+ # no_pending_array.push(row)
54
+ # else
55
+ # if opts.verbose? then puts "Removing pending transaction #{row}".yellow end
56
+ # end
57
+ # end
59
58
 
60
59
 
61
60
  # Create a new array that only includes the YNAB columns
62
61
  ynab_array = Array.new()
63
- no_pending_array.each do |row| #Itterate over every row in new 'pending free' array
62
+ simplecsv.each do |row| #Itterate over every row in new 'pending free' array
64
63
  newrow = Array.new() #Create a temporary array
65
64
  simple_headers.each do | desired_index | #Itterate over each of the columsn we want e.g. [0, 7, 9, 16, 3]
66
65
  newrow.push(row[desired_index]) #Add the new value to the temporary array
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-ynab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Spencer Owen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-04 00:00:00.000000000 Z
11
+ date: 2016-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  version: '0'
67
67
  requirements: []
68
68
  rubyforge_project:
69
- rubygems_version: 2.4.5
69
+ rubygems_version: 2.4.6
70
70
  signing_key:
71
71
  specification_version: 4
72
72
  summary: Converts csv from simple format to ynab format