ynab_convert 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/Gemfile.lock +1 -1
- data/bin/ynab_convert +0 -1
- data/lib/ynab_convert/processor/base.rb +6 -5
- data/lib/ynab_convert/processor/n26.rb +0 -15
- data/lib/ynab_convert/version.rb +1 -1
- data/lib/ynab_convert.rb +0 -1
- data/ynab_convert.gemspec +10 -0
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ad8f2a7b8c6b00d895032525413d35d4879da80be21e0b9fc852e1d413dbaa0
|
4
|
+
data.tar.gz: 99b9168cb23390fe15deec8f0c9c3c27cda183f95867b2849d79fa4e4a704c4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 630775dd15ab4f65a32c6dbe9617bea36c0721ff9d5cca49ee986f4e04831fa9335b41b996b2b3f69bbce630e452ae9045d3d98ec9b3d6862c84f6fb0077a1a6
|
7
|
+
data.tar.gz: 3bdf9b06d5327815fc31b8b3b9a9f6fb52e606ae6dc900501ff8fdf0671c110effe02dd5ca625fed0c3bbeb884b9572ff18ce7b9e46b8c21dd61d0a4b685956c
|
data/.travis.yml
CHANGED
@@ -3,12 +3,12 @@ language: ruby
|
|
3
3
|
cache: bundler
|
4
4
|
rvm:
|
5
5
|
- 2.6
|
6
|
+
- 2.7
|
6
7
|
before_install: gem install bundler
|
7
8
|
|
8
9
|
jobs:
|
9
10
|
include:
|
10
11
|
- stage: test
|
11
|
-
rvm: 2.6
|
12
12
|
script: echo "Running tests for $(ruby -v)..." && bundle exec rake ci
|
13
13
|
- stage: gem release
|
14
14
|
rvm: 2.6
|
data/Gemfile.lock
CHANGED
data/bin/ynab_convert
CHANGED
@@ -5,7 +5,8 @@ require 'csv'
|
|
5
5
|
require 'ynab_convert/logger'
|
6
6
|
|
7
7
|
module Processor
|
8
|
-
# Base class for a Processor, all processors must inherit from it
|
8
|
+
# Base class for a Processor, all processors must inherit from it.
|
9
|
+
|
9
10
|
# rubocop:disable Metrics/ClassLength
|
10
11
|
class Base
|
11
12
|
include YnabLogger
|
@@ -13,8 +14,8 @@ module Processor
|
|
13
14
|
|
14
15
|
attr_reader :loader_options
|
15
16
|
|
16
|
-
# @option
|
17
|
-
# @option
|
17
|
+
# @option options [String] :file Path to the CSV file to process
|
18
|
+
# @option options [Symbol] :format YNAB4 format to use, one of :flows or
|
18
19
|
# :amounts. :flows is useful for CSVs with separate debit and credit
|
19
20
|
# columns, :amounts is for CSVs with only one amount columns and +/-
|
20
21
|
# numbers. See
|
@@ -140,8 +141,8 @@ module Processor
|
|
140
141
|
logger.debug "Will write to `#{temp_filename}'"
|
141
142
|
|
142
143
|
logger.debug(loader_options)
|
143
|
-
CSV.open(temp_filename, 'wb', output_options) do |converted|
|
144
|
-
CSV.foreach(@file, 'rb', loader_options) do |row|
|
144
|
+
CSV.open(temp_filename, 'wb', **output_options) do |converted|
|
145
|
+
CSV.foreach(@file, 'rb', **loader_options) do |row|
|
145
146
|
logger.debug "Parsing row: `#{row.to_h}'"
|
146
147
|
# Some rows don't contain valid or useful data
|
147
148
|
catch :skip_row do
|
@@ -2,21 +2,6 @@
|
|
2
2
|
|
3
3
|
module Processor
|
4
4
|
# Processes CSV files from N26
|
5
|
-
#
|
6
|
-
# An example of how to implement a custom processor
|
7
|
-
# Processes CSV files with this format:
|
8
|
-
# <<~ROWS
|
9
|
-
# "Date","Payee","Memo","Outflow","Inflow"
|
10
|
-
# "23/12/2019","coaxial","","1000000.00",""
|
11
|
-
# "30/12/2019","Santa","","50000.00",""
|
12
|
-
# "02/02/2020","Someone Else","","45.00",""
|
13
|
-
# ROWS
|
14
|
-
# The file name for the processor should be the institution name in
|
15
|
-
# camel case. It's ok to skip "Bank" or "Credit Union" when naming the file
|
16
|
-
# if it's redundant. For instance, this parser is for "Example Bank" but it's
|
17
|
-
# named "example.rb", its corresponding spec is
|
18
|
-
# "spec/example_processor_spec.rb" and its fixture would be
|
19
|
-
# "spec/fixtures/example.csv"
|
20
5
|
class N26 < Processor::Base
|
21
6
|
# @option options [String] :file Path to the CSV file to process
|
22
7
|
def initialize(options)
|
data/lib/ynab_convert/version.rb
CHANGED
data/lib/ynab_convert.rb
CHANGED
data/ynab_convert.gemspec
CHANGED
@@ -14,6 +14,16 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = 'https://github.com/coaxial/ynab_convert'
|
15
15
|
spec.license = 'MIT'
|
16
16
|
|
17
|
+
spec.required_ruby_version = '~> 2.6'
|
18
|
+
|
19
|
+
spec.metadata = {
|
20
|
+
'bug_tracker_uri' => 'https://github.com/coaxial/ynab_convert/issues',
|
21
|
+
'documentation_uri' => 'https://rubydoc.info/github/coaxial/ynab_convert/master',
|
22
|
+
'homepage_uri' => 'https://github.com/coaxial/ynab_convert',
|
23
|
+
'source_code_uri' => 'https://github.com/coaxial/ynab_convert'
|
24
|
+
}
|
25
|
+
spec.post_install_message = 'Happy budgetting!'
|
26
|
+
|
17
27
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
28
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
29
|
if spec.respond_to?(:metadata)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ynab_convert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- coaxial
|
@@ -236,18 +236,20 @@ homepage: https://github.com/coaxial/ynab_convert
|
|
236
236
|
licenses:
|
237
237
|
- MIT
|
238
238
|
metadata:
|
239
|
-
|
239
|
+
bug_tracker_uri: https://github.com/coaxial/ynab_convert/issues
|
240
|
+
documentation_uri: https://rubydoc.info/github/coaxial/ynab_convert/master
|
240
241
|
homepage_uri: https://github.com/coaxial/ynab_convert
|
241
242
|
source_code_uri: https://github.com/coaxial/ynab_convert
|
242
|
-
|
243
|
+
allowed_push_host: https://rubygems.org
|
244
|
+
post_install_message: Happy budgetting!
|
243
245
|
rdoc_options: []
|
244
246
|
require_paths:
|
245
247
|
- lib
|
246
248
|
required_ruby_version: !ruby/object:Gem::Requirement
|
247
249
|
requirements:
|
248
|
-
- - "
|
250
|
+
- - "~>"
|
249
251
|
- !ruby/object:Gem::Version
|
250
|
-
version: '
|
252
|
+
version: '2.6'
|
251
253
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
252
254
|
requirements:
|
253
255
|
- - ">="
|