generalis 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/main.yml +68 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.rubocop.yml +46 -0
- data/.ruby-version +1 -0
- data/.vscode/settings.json +5 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +134 -0
- data/README.md +622 -0
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/rspec +29 -0
- data/bin/rubocop +29 -0
- data/bin/setup +8 -0
- data/generalis.gemspec +34 -0
- data/lib/generalis/account.rb +98 -0
- data/lib/generalis/accountable.rb +43 -0
- data/lib/generalis/asset.rb +7 -0
- data/lib/generalis/config.rb +15 -0
- data/lib/generalis/credit.rb +7 -0
- data/lib/generalis/debit.rb +7 -0
- data/lib/generalis/entry.rb +66 -0
- data/lib/generalis/expense.rb +7 -0
- data/lib/generalis/liability.rb +7 -0
- data/lib/generalis/link.rb +10 -0
- data/lib/generalis/linkable.rb +15 -0
- data/lib/generalis/revenue.rb +7 -0
- data/lib/generalis/rspec.rb +6 -0
- data/lib/generalis/transaction/double_entry.rb +37 -0
- data/lib/generalis/transaction/dsl.rb +70 -0
- data/lib/generalis/transaction/links.rb +29 -0
- data/lib/generalis/transaction/preparation.rb +45 -0
- data/lib/generalis/transaction.rb +109 -0
- data/lib/generalis/version.rb +5 -0
- data/lib/generalis.rb +55 -0
- data/lib/generators/factory_bot/templates/transactions.rb.erb +7 -0
- data/lib/generators/factory_bot/transaction_generator.rb +39 -0
- data/lib/generators/generalis/install_generator.rb +19 -0
- data/lib/generators/generalis/migrations_generator.rb +45 -0
- data/lib/generators/generalis/templates/base_transaction.rb +12 -0
- data/lib/generators/generalis/templates/create_ledger_accounts.rb.erb +18 -0
- data/lib/generators/generalis/templates/create_ledger_entries.rb.erb +25 -0
- data/lib/generators/generalis/templates/create_ledger_links.rb.erb +14 -0
- data/lib/generators/generalis/templates/create_ledger_transactions.rb.erb +14 -0
- data/lib/generators/generalis/templates/generalis.rb +6 -0
- data/lib/generators/generalis/templates/transaction.rb.erb +26 -0
- data/lib/generators/generalis/transaction_generator.rb +33 -0
- data/lib/generators/rspec/templates/transaction_spec.rb.erb +11 -0
- data/lib/generators/rspec/transaction_generator.rb +41 -0
- data/lib/rspec/change_balance_of_matcher.rb +32 -0
- data/lib/rspec/credit_account_matcher.rb +45 -0
- data/lib/rspec/debit_account_matcher.rb +45 -0
- data/lib/rspec/have_balance_matcher.rb +27 -0
- data/lib/rspec/helpers/format_helper.rb +28 -0
- data/lib/rspec/helpers/resolve_account_helper.rb +21 -0
- data/lib/rspec/helpers/resolve_amount_helper.rb +21 -0
- metadata +136 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9d36cc1151a3ac8d413e10c1a1840cd85f0dbba976ef8170d531a812a8d1563d
|
4
|
+
data.tar.gz: 325b040fc4f2d607ff8be30363e8ce8d052ff7829c260b126c7760238830fe2b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 34e43cd739dbd5e70765b5ab0dbd28c04daab24485fa76b84ce9a735c469de3119d98c7ad62d6e2ee8ccb15293f9ce9754931ec1eab489c708de22b1eb32be82
|
7
|
+
data.tar.gz: 04c03f87e8a5f5d4d0cee02e68d45993a2cc11ec2eddd2b8ae5f12751f7285bca6650f847227618d8d776756bfcbcf36ff9a939643dc92bcf0b0bce01e8fe1e3
|
@@ -0,0 +1,68 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [push,pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
rubocop:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- uses: actions/checkout@v2
|
10
|
+
- name: Set up Ruby
|
11
|
+
uses: ruby/setup-ruby@v1
|
12
|
+
with:
|
13
|
+
ruby-version: 3.0.2
|
14
|
+
bundler-cache: true
|
15
|
+
- name: Rubocop
|
16
|
+
run: bin/rubocop
|
17
|
+
|
18
|
+
rspec:
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v2
|
22
|
+
- name: Set up Ruby
|
23
|
+
uses: ruby/setup-ruby@v1
|
24
|
+
with:
|
25
|
+
ruby-version: 3.0.2
|
26
|
+
bundler-cache: true
|
27
|
+
- name: RSpec
|
28
|
+
run: bin/rspec
|
29
|
+
|
30
|
+
integration:
|
31
|
+
runs-on: ubuntu-latest
|
32
|
+
services:
|
33
|
+
postgres:
|
34
|
+
image: postgres:13
|
35
|
+
ports:
|
36
|
+
- 5432:5432
|
37
|
+
env:
|
38
|
+
POSTGRES_USER: postgres
|
39
|
+
POSTGRES_PASSWORD: postgres
|
40
|
+
POSTGRES_DB: generalis_integration_test
|
41
|
+
options: --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 10
|
42
|
+
steps:
|
43
|
+
- uses: actions/checkout@v2
|
44
|
+
- name: Install Native Dependencies
|
45
|
+
run: sudo apt-get install libpq-dev
|
46
|
+
- name: Set up Ruby (Integration)
|
47
|
+
uses: ruby/setup-ruby@v1
|
48
|
+
with:
|
49
|
+
ruby-version: 3.0.2
|
50
|
+
bundler-cache: true
|
51
|
+
working-directory: integration
|
52
|
+
- name: Setup Test Database
|
53
|
+
working-directory: integration
|
54
|
+
run: |
|
55
|
+
bin/rails db:create db:schema:load
|
56
|
+
env:
|
57
|
+
RAILS_ENV: test
|
58
|
+
PGHOST: localhost
|
59
|
+
PGUSER: postgres
|
60
|
+
PGPASSWORD: postgres
|
61
|
+
- name: RSpec (Integration)
|
62
|
+
working-directory: integration
|
63
|
+
run: bin/rspec
|
64
|
+
env:
|
65
|
+
RAILS_ENV: test
|
66
|
+
PGHOST: localhost
|
67
|
+
PGUSER: postgres
|
68
|
+
PGPASSWORD: postgres
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
- rubocop-rails
|
4
|
+
- rubocop-rspec
|
5
|
+
|
6
|
+
AllCops:
|
7
|
+
NewCops: enable
|
8
|
+
SuggestExtensions: false
|
9
|
+
TargetRubyVersion: 3.0
|
10
|
+
Exclude:
|
11
|
+
- bin/*
|
12
|
+
- integration/bin/*
|
13
|
+
- integration/db/schema.rb
|
14
|
+
- vendor/**/*
|
15
|
+
|
16
|
+
Layout/AccessModifierIndentation:
|
17
|
+
EnforcedStyle: outdent
|
18
|
+
|
19
|
+
Layout/LineLength:
|
20
|
+
Max: 120
|
21
|
+
|
22
|
+
Layout/MultilineMethodCallIndentation:
|
23
|
+
EnforcedStyle: indented
|
24
|
+
|
25
|
+
Layout/SpaceInLambdaLiteral:
|
26
|
+
EnforcedStyle: require_space
|
27
|
+
|
28
|
+
Metrics/BlockLength:
|
29
|
+
Exclude:
|
30
|
+
- '**/*_spec.rb'
|
31
|
+
- 'lib/rspec/*_matcher.rb'
|
32
|
+
|
33
|
+
Naming/RescuedExceptionsVariableName:
|
34
|
+
PreferredName: error
|
35
|
+
|
36
|
+
Rails/ApplicationRecord:
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
RSpec/ExpectChange:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
Style/Documentation:
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
Style/ParallelAssignment:
|
46
|
+
Enabled: false
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.0.2
|
data/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in generalis.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
gem 'rake', '~> 13.0'
|
9
|
+
gem 'rspec', '~> 3.0'
|
10
|
+
gem 'rubocop', '~> 1.7'
|
11
|
+
gem 'rubocop-performance'
|
12
|
+
gem 'rubocop-rails'
|
13
|
+
gem 'rubocop-rspec'
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,134 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
generalis (0.1.0)
|
5
|
+
activerecord (>= 5, < 7)
|
6
|
+
money-rails (~> 1.15)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionpack (6.1.4.1)
|
12
|
+
actionview (= 6.1.4.1)
|
13
|
+
activesupport (= 6.1.4.1)
|
14
|
+
rack (~> 2.0, >= 2.0.9)
|
15
|
+
rack-test (>= 0.6.3)
|
16
|
+
rails-dom-testing (~> 2.0)
|
17
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
18
|
+
actionview (6.1.4.1)
|
19
|
+
activesupport (= 6.1.4.1)
|
20
|
+
builder (~> 3.1)
|
21
|
+
erubi (~> 1.4)
|
22
|
+
rails-dom-testing (~> 2.0)
|
23
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
24
|
+
activemodel (6.1.4.1)
|
25
|
+
activesupport (= 6.1.4.1)
|
26
|
+
activerecord (6.1.4.1)
|
27
|
+
activemodel (= 6.1.4.1)
|
28
|
+
activesupport (= 6.1.4.1)
|
29
|
+
activesupport (6.1.4.1)
|
30
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
31
|
+
i18n (>= 1.6, < 2)
|
32
|
+
minitest (>= 5.1)
|
33
|
+
tzinfo (~> 2.0)
|
34
|
+
zeitwerk (~> 2.3)
|
35
|
+
ast (2.4.2)
|
36
|
+
builder (3.2.4)
|
37
|
+
concurrent-ruby (1.1.9)
|
38
|
+
crass (1.0.6)
|
39
|
+
diff-lcs (1.4.4)
|
40
|
+
erubi (1.10.0)
|
41
|
+
i18n (1.8.11)
|
42
|
+
concurrent-ruby (~> 1.0)
|
43
|
+
loofah (2.12.0)
|
44
|
+
crass (~> 1.0.2)
|
45
|
+
nokogiri (>= 1.5.9)
|
46
|
+
method_source (1.0.0)
|
47
|
+
minitest (5.14.4)
|
48
|
+
monetize (1.11.0)
|
49
|
+
money (~> 6.12)
|
50
|
+
money (6.16.0)
|
51
|
+
i18n (>= 0.6.4, <= 2)
|
52
|
+
money-rails (1.15.0)
|
53
|
+
activesupport (>= 3.0)
|
54
|
+
monetize (~> 1.9)
|
55
|
+
money (~> 6.13)
|
56
|
+
railties (>= 3.0)
|
57
|
+
nokogiri (1.12.5-x86_64-linux)
|
58
|
+
racc (~> 1.4)
|
59
|
+
parallel (1.21.0)
|
60
|
+
parser (3.0.2.0)
|
61
|
+
ast (~> 2.4.1)
|
62
|
+
racc (1.6.0)
|
63
|
+
rack (2.2.3)
|
64
|
+
rack-test (1.1.0)
|
65
|
+
rack (>= 1.0, < 3)
|
66
|
+
rails-dom-testing (2.0.3)
|
67
|
+
activesupport (>= 4.2.0)
|
68
|
+
nokogiri (>= 1.6)
|
69
|
+
rails-html-sanitizer (1.4.2)
|
70
|
+
loofah (~> 2.3)
|
71
|
+
railties (6.1.4.1)
|
72
|
+
actionpack (= 6.1.4.1)
|
73
|
+
activesupport (= 6.1.4.1)
|
74
|
+
method_source
|
75
|
+
rake (>= 0.13)
|
76
|
+
thor (~> 1.0)
|
77
|
+
rainbow (3.0.0)
|
78
|
+
rake (13.0.6)
|
79
|
+
regexp_parser (2.1.1)
|
80
|
+
rexml (3.2.5)
|
81
|
+
rspec (3.10.0)
|
82
|
+
rspec-core (~> 3.10.0)
|
83
|
+
rspec-expectations (~> 3.10.0)
|
84
|
+
rspec-mocks (~> 3.10.0)
|
85
|
+
rspec-core (3.10.1)
|
86
|
+
rspec-support (~> 3.10.0)
|
87
|
+
rspec-expectations (3.10.1)
|
88
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
89
|
+
rspec-support (~> 3.10.0)
|
90
|
+
rspec-mocks (3.10.2)
|
91
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
92
|
+
rspec-support (~> 3.10.0)
|
93
|
+
rspec-support (3.10.3)
|
94
|
+
rubocop (1.23.0)
|
95
|
+
parallel (~> 1.10)
|
96
|
+
parser (>= 3.0.0.0)
|
97
|
+
rainbow (>= 2.2.2, < 4.0)
|
98
|
+
regexp_parser (>= 1.8, < 3.0)
|
99
|
+
rexml
|
100
|
+
rubocop-ast (>= 1.12.0, < 2.0)
|
101
|
+
ruby-progressbar (~> 1.7)
|
102
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
103
|
+
rubocop-ast (1.13.0)
|
104
|
+
parser (>= 3.0.1.1)
|
105
|
+
rubocop-performance (1.12.0)
|
106
|
+
rubocop (>= 1.7.0, < 2.0)
|
107
|
+
rubocop-ast (>= 0.4.0)
|
108
|
+
rubocop-rails (2.12.4)
|
109
|
+
activesupport (>= 4.2.0)
|
110
|
+
rack (>= 1.1)
|
111
|
+
rubocop (>= 1.7.0, < 2.0)
|
112
|
+
rubocop-rspec (2.6.0)
|
113
|
+
rubocop (~> 1.19)
|
114
|
+
ruby-progressbar (1.11.0)
|
115
|
+
thor (1.1.0)
|
116
|
+
tzinfo (2.0.4)
|
117
|
+
concurrent-ruby (~> 1.0)
|
118
|
+
unicode-display_width (2.1.0)
|
119
|
+
zeitwerk (2.5.1)
|
120
|
+
|
121
|
+
PLATFORMS
|
122
|
+
x86_64-linux
|
123
|
+
|
124
|
+
DEPENDENCIES
|
125
|
+
generalis!
|
126
|
+
rake (~> 13.0)
|
127
|
+
rspec (~> 3.0)
|
128
|
+
rubocop (~> 1.7)
|
129
|
+
rubocop-performance
|
130
|
+
rubocop-rails
|
131
|
+
rubocop-rspec
|
132
|
+
|
133
|
+
BUNDLED WITH
|
134
|
+
2.2.22
|