ledger_gen 0.1.0 → 0.1.1

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: 966d3554a058f768f3c3f7e90262b60469c79916
4
- data.tar.gz: 0802b4c89af101b6220cb9f9386f38778a368565
3
+ metadata.gz: 763557d263c2408975476acebad9452549128599
4
+ data.tar.gz: ee0173259c05d1279fdb7f5a5b0d8948edf86c00
5
5
  SHA512:
6
- metadata.gz: 61b172629664fd9f7ff3961798222b591a236e22eb58f9d3c60961796fa17f99bfd5617bb7e63609e25a4445b7a509c204412df78440b1e694f2054f6989b33d
7
- data.tar.gz: 4c660113dfeac9c79e080c8bbce7380f1fc97609689d8a1b9d368e35a89a263293bc13e3571b7338017c6b965961e5e346c4855f7a6c6baab1b3e290d08886e1
6
+ metadata.gz: ac34d6c6d52fc2dc733e85e05d94f826e838207de0e50ece8472a4042de6fe368a820d5eb702e00c7f5281e757286dce1338b5f9453d43f6cc83be88c2ab841f
7
+ data.tar.gz: 8f975d087063dae424941d8ea23d162267ec3815533cec603a1d4fcc3df32883c6edb1bafb82c438d5b4035fd353a96e49e480979a978f7907fd86f7162ab71e
data/README.md CHANGED
@@ -39,6 +39,16 @@ puts j.pretty_print # ledger binary required
39
39
  puts j.to_s # not pretty, but it works without the binary
40
40
  ```
41
41
 
42
+ ## Limitations
43
+
44
+ LedgerGen currently supports a very limited subset of Ledger. In particular, that means:
45
+
46
+ * Only supports dollars as commodity
47
+ * Does not insert thousands separator
48
+ * Can't insert journal-level comments
49
+ * No support for building things like periodic entries or automated transactions
50
+ * No support for virtual transactions
51
+
42
52
  ## Development
43
53
 
44
54
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,5 +1,7 @@
1
1
  module LedgerGen
2
2
  class Journal
3
+ attr_accessor :date_format
4
+
3
5
  def self.build
4
6
  journal = new
5
7
 
@@ -10,10 +12,11 @@ module LedgerGen
10
12
 
11
13
  def initialize
12
14
  @transactions = []
15
+ @date_format = '%Y/%m/%d'
13
16
  end
14
17
 
15
18
  def transaction
16
- txn = Transaction.new
19
+ txn = Transaction.new(date_format)
17
20
  @transactions << txn
18
21
 
19
22
  yield txn
@@ -1,6 +1,7 @@
1
1
  module LedgerGen
2
2
  class Transaction
3
- def initialize
3
+ def initialize(date_format=nil)
4
+ @date_format = date_format || '%Y/%m/%d'
4
5
  @postings = []
5
6
  @comments = []
6
7
  end
@@ -52,7 +53,7 @@ module LedgerGen
52
53
  private
53
54
 
54
55
  def date_string
55
- @date.strftime("%Y/%m/%d")
56
+ @date.strftime(date_format)
56
57
  end
57
58
 
58
59
  def cleared_string
@@ -1,3 +1,3 @@
1
1
  module LedgerGen
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ledger_gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Keen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-30 00:00:00.000000000 Z
11
+ date: 2017-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler