treasurer 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b5eb9890a54a614720f287ec3cd65d77478b8225
4
- data.tar.gz: 7341d4cb3c37507bdacf15b7d49b53d83de79749
3
+ metadata.gz: 92a0a6c8e0a23eecc1d69c1dd14ff399b8b227c4
4
+ data.tar.gz: 66e9cab23527f7dd3f843e2601a8d2904dbe6301
5
5
  SHA512:
6
- metadata.gz: 3e86953149b37629f61297e90beeb3ebc7e41b70816f38c45f332a3f333fd40b5bd3b40a696c69b6dc33d2a103e590653ac13e9926280c5a95e3bdc6d9d0b252
7
- data.tar.gz: c58e49206abb4f80e48a98af57659374aa14d38841c110ac1bc73bb1b6825b2961e82f978addf28273683e43310e4756e65c451d88d0554442f2784d8d47fa65
6
+ metadata.gz: 9bc7d55859630ea044d03356f113a20edc1a33dbe357d06b3055c7c922b285944b13acce16f7e4c2a825b10baf83f9eeff182f69863387009fc730e223088973
7
+ data.tar.gz: 8c5e101af682d340a99b283f0801ed7afd776e4df1185fa90e3921f4003877c489116b450e3fd951d48c5f27b3a6c7eef99981aa2ea302dff47065a8b11ff5b9
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.6.0
@@ -24,7 +24,7 @@ class << self
24
24
  end
25
25
  def fetch_reporter(copts = {})
26
26
  load_treasurer_folder(copts)
27
- reporter = Reporter.new(CodeRunner.fetch_runner(h: :component, A: true), days_before: copts[:b]||360, days_ahead: copts[:a]||180, today: copts[:t], report_currency: copts[:r])
27
+ Reporter.new(CodeRunner.fetch_runner(h: :component, A: true), days_before: copts[:b]||360, days_ahead: copts[:a]||180, today: copts[:t], report_currency: copts[:r])
28
28
  end
29
29
  def status(copts={})
30
30
  load_treasurer_folder(copts)
@@ -48,6 +48,16 @@ class << self
48
48
  CodeRunner::Budget.send(:include, Treasurer::LocalCustomisations)
49
49
  _runner = CodeRunner.fetch_runner(eval(copts[:C]||"{}"))
50
50
  end
51
+ def list_last_updated(copts={})
52
+ reporter = fetch_reporter(copts)
53
+ reporter.generate_accounts
54
+ accts = reporter.accounts.find_all{|ac| not ac.external and not ac.type==:Equity}
55
+ puts "Account | Date "
56
+ accts.each do |ac|
57
+ #puts ac.name
58
+ puts "#{ac.name} | #{ac.runs.sort_by{|r| r.date}[-1].date.to_s}"
59
+ end
60
+ end
51
61
 
52
62
  def method_missing(meth, *args)
53
63
  CodeRunner.send(meth, *args)
data/lib/treasurer.rb CHANGED
@@ -4,11 +4,11 @@
4
4
  require 'getoptlong'
5
5
 
6
6
  module CommandLineFlunky
7
-
8
- STARTUP_MESSAGE = "\n------Treasurer Financial Utility (c) Edmund Highcock------"
9
7
 
10
- MANUAL_HEADER = <<EOF
11
-
8
+ STARTUP_MESSAGE = "\n------Treasurer Financial Utility (c) Edmund Highcock------"
9
+
10
+ MANUAL_HEADER = <<EOF
11
+
12
12
  -------------Treasurer Financial Utility Manual---------------
13
13
 
14
14
  Written by Edmund Highcock (2014)
@@ -19,7 +19,7 @@ NAME
19
19
 
20
20
 
21
21
  SYNOPSIS
22
-
22
+
23
23
  treasurer <command> [arguments] [options]
24
24
 
25
25
 
@@ -28,7 +28,7 @@ DESCRIPTION
28
28
  Generate a financial report from one or more bank accounts, credit cards
29
29
  etc by analysing internet banking sheets. Simple local files can be used to
30
30
  customise the reports by adding budgets and categories
31
-
31
+
32
32
  EXAMPLES
33
33
 
34
34
  treasurer init my_accounts_folder
@@ -38,72 +38,73 @@ EXAMPLES
38
38
  treasurer report
39
39
 
40
40
  treasurer add_folder folder_of_bank_statements
41
-
42
-
41
+
42
+
43
43
  EOF
44
-
45
- COMMANDS_WITH_HELP = [
46
- ['add_file', 'add', 2, 'Import a new internet banking spreadsheet for the given account.', ['csv spreadsheet filename', 'account name'], []],
47
- ['add_folder_of_files', 'addf', 1, 'Import all internet banking spreadsheets within the given folder .', ['folder'], []],
48
- ['init_root_folder', 'init', 1, 'Create a new folder and initialise it for storing treasurer data.', ['folder'], []],
49
- ['create_report', 'report', 0, 'Generate a detailed report (typeset using latex) showing account activity, spending by category, and projections.', [], [:a, :b, :t]],
44
+
45
+ COMMANDS_WITH_HELP = [
46
+ ['add_file', 'add', 2, 'Import a new internet banking spreadsheet for the given account.', ['csv spreadsheet filename', 'account name'], []],
47
+ ['add_folder_of_files', 'addf', 1, 'Import all internet banking spreadsheets within the given folder .', ['folder'], []],
48
+ ['init_root_folder', 'init', 1, 'Create a new folder and initialise it for storing treasurer data.', ['folder'], []],
49
+ ['list_last_updated', 'last', 1, 'For each account, prints the date of the latest entry.', ['folder'], []],
50
+ ['create_report', 'report', 0, 'Generate a detailed report (typeset using latex) showing account activity, spending by category, and projections.', [], [:a, :b, :t]],
50
51
  ['status', 'st', 0, 'Print the transactions to screen..', [], [:C]],
51
52
 
52
- ]
53
-
53
+ ]
54
54
 
55
55
 
56
- COMMAND_LINE_FLAGS_WITH_HELP = [
57
- ['--after', '-a', GetoptLong::REQUIRED_ARGUMENT, 'Calculate projections up till given number of days after today'],
58
- ['--before', '-b', GetoptLong::REQUIRED_ARGUMENT, 'Start budget from given number of days before today'],
59
- ['--today', '-t', GetoptLong::REQUIRED_ARGUMENT, "Specify today's date, i.e. change the date on which the report is generated."],
60
- ['--coderunner', '-C', GetoptLong::REQUIRED_ARGUMENT, "Options to pass to CodeRunner, the engine which manages the transaction data."],
61
- ['--month', '-m', GetoptLong::REQUIRED_ARGUMENT, "Overrides -a, -b and -t and produces a report for a given month"],
56
+
57
+ COMMAND_LINE_FLAGS_WITH_HELP = [
58
+ ['--after', '-a', GetoptLong::REQUIRED_ARGUMENT, 'Calculate projections up till given number of days after today'],
59
+ ['--before', '-b', GetoptLong::REQUIRED_ARGUMENT, 'Start budget from given number of days before today'],
60
+ ['--today', '-t', GetoptLong::REQUIRED_ARGUMENT, "Specify today's date, i.e. change the date on which the report is generated."],
61
+ ['--coderunner', '-C', GetoptLong::REQUIRED_ARGUMENT, "Options to pass to CodeRunner, the engine which manages the transaction data."],
62
+ ['--month', '-m', GetoptLong::REQUIRED_ARGUMENT, "Overrides -a, -b and -t and produces a report for a given month"],
62
63
  ['--report-currency', '-r', GetoptLong::REQUIRED_ARGUMENT, "Convert all amounts to the given currency (e.g. GBP) and amalgamate different currency data to form a unified overview."],
63
- #['--formats', '-f', GetoptLong::REQUIRED_ARGUMENT, "A list of formats pertaining to the various input and output files (in the order which they appear), separated by commas. If they are all the same, only one value may be given. If a value is left empty (i.e. there are two commas in a row) then the previous value will be used. Currently supported formats are #{SUPPORTED_FORMATS.inspect}. "],
64
-
65
- ]
66
-
67
- LONG_COMMAND_LINE_OPTIONS = [
68
- #["--no-short-form", "", GetoptLong::NO_ARGUMENT, %[This boolean option has no short form]],
69
- ]
70
-
71
- # specifying flag sets a bool to be true
72
-
73
- CLF_BOOLS = []
74
-
75
- CLF_INVERSE_BOOLS = [] # specifying flag sets a bool to be false
76
-
77
- PROJECT_NAME = 'treasurer'
78
-
79
- def self.method_missing(method, *args)
80
- # p method, args
81
- Treasurer.send(method, *args)
82
- end
83
-
84
- #def self.setup(copts)
85
- #CommandLineFlunkyTestUtility.setup(copts)
86
- #end
87
-
88
- SCRIPT_FILE = __FILE__
64
+ #['--formats', '-f', GetoptLong::REQUIRED_ARGUMENT, "A list of formats pertaining to the various input and output files (in the order which they appear), separated by commas. If they are all the same, only one value may be given. If a value is left empty (i.e. there are two commas in a row) then the previous value will be used. Currently supported formats are #{SUPPORTED_FORMATS.inspect}. "],
65
+
66
+ ]
67
+
68
+ LONG_COMMAND_LINE_OPTIONS = [
69
+ #["--no-short-form", "", GetoptLong::NO_ARGUMENT, %[This boolean option has no short form]],
70
+ ]
71
+
72
+ # specifying flag sets a bool to be true
73
+
74
+ CLF_BOOLS = []
75
+
76
+ CLF_INVERSE_BOOLS = [] # specifying flag sets a bool to be false
77
+
78
+ PROJECT_NAME = 'treasurer'
79
+
80
+ def self.method_missing(method, *args)
81
+ # p method, args
82
+ Treasurer.send(method, *args)
83
+ end
84
+
85
+ #def self.setup(copts)
86
+ #CommandLineFlunkyTestUtility.setup(copts)
87
+ #end
88
+
89
+ SCRIPT_FILE = __FILE__
89
90
  end
90
91
 
91
92
  class Treasurer
92
- class << self
93
- # This function gets called before every command
94
- # and allows arbitrary manipulation of the command
95
- # options (copts) hash
96
- def setup(copts)
97
- # None neededed
98
- copts[:b] = copts[:b].to_i if copts[:b]
99
- copts[:a] = copts[:a].to_i if copts[:a]
100
- copts[:t] = Date.parse(copts[:t]) if copts[:t]
101
- end
102
- def verbosity
103
- 2
104
- end
105
- end
106
- SCRIPT_FOLDER = folder = File.dirname(File.expand_path(__FILE__))
93
+ class << self
94
+ # This function gets called before every command
95
+ # and allows arbitrary manipulation of the command
96
+ # options (copts) hash
97
+ def setup(copts)
98
+ # None neededed
99
+ copts[:b] = copts[:b].to_i if copts[:b]
100
+ copts[:a] = copts[:a].to_i if copts[:a]
101
+ copts[:t] = Date.parse(copts[:t]) if copts[:t]
102
+ end
103
+ def verbosity
104
+ 2
105
+ end
106
+ end
107
+ SCRIPT_FOLDER = File.dirname(File.expand_path(__FILE__))
107
108
  end
108
109
 
109
110
  $has_put_startup_message_for_code_runner = true
data/treasurer.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: treasurer 0.5.1 ruby lib
5
+ # stub: treasurer 0.6.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "treasurer".freeze
9
- s.version = "0.5.1"
9
+ s.version = "0.6.0"
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-07"
14
+ s.date = "2018-04-05"
15
15
  s.description = "A simple command line tool for managing accounts and finances. Easily import internet banking spreadsheets and generate sophisticated reports and projections.".freeze
16
16
  s.email = "edmundhighcock@users.sourceforge.net".freeze
17
17
  s.executables = ["treasurer".freeze]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: treasurer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
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-07 00:00:00.000000000 Z
11
+ date: 2018-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport