ldgr 0.1.5 → 0.1.6
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/README.md +5 -2
- data/lib/ldgr/parser.rb +5 -3
- data/lib/ldgr/version.rb +1 -1
- 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: 28d904e9b9e8cb5832fad842b351741e6d38771b
|
4
|
+
data.tar.gz: 040151e2ca4142af1549f83b59f44e27adfd3aaf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 856d4e4cad9b6f3ca8606fb87d5616b4fbf6fcbd1081413153427f4c6de934e6f062bc7309cc3c6390d6e4050aff24a809c7f865033e4620a5ebe66fc839ace1
|
7
|
+
data.tar.gz: 96c1afabba60d90737cc83f922c4f7f6535f044ec254a1496fb604d20630b3f4fdc479b34c16151dab78fb5c3afaa7c53dd906a9b6f2fb0304d384e728d48c9c
|
data/README.md
CHANGED
@@ -40,16 +40,18 @@ Type `ldgr -h` at the command-line to see available commands and options.
|
|
40
40
|
The CLI defaults the currency to **$**. You can set this yourself by adding a single currency character to `~/.config/ledger/default_currency`.
|
41
41
|
|
42
42
|
## CLI
|
43
|
-
```
|
43
|
+
```
|
44
44
|
ldgr add --payee Brandon \
|
45
45
|
--amount 1000 \
|
46
46
|
--account Something \
|
47
47
|
--equity Cash \
|
48
48
|
--date 2017-02-01 \
|
49
49
|
--effective 2017-02-03 \
|
50
|
-
--cleared
|
50
|
+
--cleared \
|
51
|
+
--currency ¥
|
51
52
|
ldgr clear
|
52
53
|
ldgr sort
|
54
|
+
ldgr tag
|
53
55
|
```
|
54
56
|
|
55
57
|
## Library
|
@@ -63,6 +65,7 @@ transaction = Ldgr::Transaction.new do |t|
|
|
63
65
|
t.date = Date.today + 1
|
64
66
|
t.effective = Date.today + 10
|
65
67
|
t.cleared = true
|
68
|
+
t.currency = '¥'
|
66
69
|
end
|
67
70
|
~~~
|
68
71
|
|
data/lib/ldgr/parser.rb
CHANGED
@@ -11,11 +11,12 @@ module Ldgr
|
|
11
11
|
class Parser
|
12
12
|
FILEBASE = Dir.home + '/.config/ledger/'
|
13
13
|
FILE = FILEBASE + 'transactions.dat'
|
14
|
-
VERSION = Ldgr::VERSION
|
14
|
+
VERSION = Ldgr::VERSION
|
15
15
|
PROGRAM_NAME = 'ldgr'
|
16
16
|
MATCH = /(?=(\n\d\d\d\d-\d\d-\d\d)(=\d\d\d\d-\d\d-\d\d)*)|\z/
|
17
17
|
OTHER_MATCH = /(?=(\d\d\d\d-\d\d-\d\d)(=\d\d\d\d-\d\d-\d\d)*)/
|
18
18
|
DEFAULT_CURRENCY = Pathname(FILEBASE + '/default_currency').exist? ? Pathname(FILEBASE + '/default_currency').read.chomp : '$'
|
19
|
+
COMMANDS = %w(add sort tag clear open)
|
19
20
|
|
20
21
|
def self.parse
|
21
22
|
cli = OptionParser.new do |o|
|
@@ -35,9 +36,9 @@ module Ldgr
|
|
35
36
|
end
|
36
37
|
|
37
38
|
config = {}
|
38
|
-
command = String(cli.parse(ARGV, into: config)[0])
|
39
|
+
command = String(cli.parse(ARGV, into: config)[0])
|
39
40
|
|
40
|
-
send(command, config) if
|
41
|
+
send(command, config) if COMMANDS.include? command
|
41
42
|
end
|
42
43
|
|
43
44
|
def self.add(config)
|
@@ -137,6 +138,7 @@ module Ldgr
|
|
137
138
|
|
138
139
|
def self.setup
|
139
140
|
unless config_exist?
|
141
|
+
FileUtils.mkdir_p(FILEBASE)
|
140
142
|
%w(transactions.dat accounts.dat budgets.dat aliases.dat commodities.dat setup.dat ledger.dat).each do |file|
|
141
143
|
FileUtils.touch("#{FILEBASE}#{file}")
|
142
144
|
end
|
data/lib/ldgr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ldgr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Pittman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: highline
|