subledger 0.7.10 → 0.7.11
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 +5 -13
- data/lib/subledger.rb +3 -3
- data/lib/subledger/actor.rb +0 -4
- data/lib/subledger/domain/journal_entry.rb +18 -4
- data/lib/subledger/exception_handler.rb +1 -1
- data/lib/subledger/version.rb +1 -1
- data/spec/spec_helper.rb +7 -0
- data/subledger.gemspec +1 -10
- metadata +31 -20
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
YjBmY2ZlMTQyZDNkYjY2MzdkMjY5OTIzYjQ1ZTA0YzBmYzM3N2ZmYg==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2a30fb8fa06400f51754376baaf877caa6cee8f1
|
4
|
+
data.tar.gz: d723fe6629d90babe54baeecfc16d891eb7cf69e
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
MDI0MDllZTE5NDM5NTkwNzU2ZWUwZmQ3ZWU3NWI1MGJkZTc1MDk3NTRlNDhj
|
11
|
-
NGVjYzljZDZiZjc0NDY2YjZhZGQyYjQyODM2OTAwNmNiZGRhYmI=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZmMxOWVjOGRhNTQ4MjBjMGM4NDI0MzIzN2IxYWYzODYxM2M0NGFkM2YxZDZl
|
14
|
-
NTllNGZmYTgzNzM4MDU5YTllNDVmNGI5OTk3YTcwMmYwYzQyYjlhMTIxZTJi
|
15
|
-
ZjU3ODVlNTQ4ZmUxYWU3MDgxYWIyNDczODhhNDNlOThhMWM0Mzc=
|
6
|
+
metadata.gz: 9c126f199597ed7f424260333911ee1cb7ed8e63117f9aa8ce9dbdb03ba868979d29cacd31dfea17a50370747e5d5aec404d8c071828539986ad61d5d052448e
|
7
|
+
data.tar.gz: b6a56e4ac224851d9105cd6bfa9a3cb4fd2ae0910f09c63cfc2f03e36ce6a51441ed7612cb1fd15e6176b7e0e5f43eccf841eeb2928d3a5d61777cb8a7e4bedc
|
data/lib/subledger.rb
CHANGED
@@ -99,19 +99,19 @@ module Subledger
|
|
99
99
|
|
100
100
|
case STORE
|
101
101
|
when :memory
|
102
|
-
SLOW_POST_DELAY = ::ENV['SUBLEDGER_SLOW_POST_DELAY'] ||
|
102
|
+
SLOW_POST_DELAY = ::ENV['SUBLEDGER_SLOW_POST_DELAY'] || 1
|
103
103
|
PROGRESS_INITIAL = ::ENV['SUBLEDGER_PROGRESS_INITIAL'] || 0.075
|
104
104
|
PROGRESS_RETRY = ::ENV['SUBLEDGER_PROGRESS_RETRY'] || 0.05
|
105
105
|
PROGRESS_FAIL = ::ENV['SUBLEDGER_PROGRESS_FAIL'] || 4
|
106
106
|
BALANCE_SETTLE_DELAY = ::ENV['SUBLEDGER_BALANCE_SETTLE_DELAY'] || 0
|
107
107
|
when :api
|
108
|
-
SLOW_POST_DELAY = ::ENV['SUBLEDGER_SLOW_POST_DELAY'] ||
|
108
|
+
SLOW_POST_DELAY = ::ENV['SUBLEDGER_SLOW_POST_DELAY'] || 1
|
109
109
|
PROGRESS_INITIAL = ::ENV['SUBLEDGER_PROGRESS_INITIAL'] || 0.075
|
110
110
|
PROGRESS_RETRY = ::ENV['SUBLEDGER_PROGRESS_RETRY'] || 0.05
|
111
111
|
PROGRESS_FAIL = ::ENV['SUBLEDGER_PROGRESS_FAIL'] || 4
|
112
112
|
BALANCE_SETTLE_DELAY = ::ENV['SUBLEDGER_BALANCE_SETTLE_DELAY'] || 0
|
113
113
|
when :aws
|
114
|
-
SLOW_POST_DELAY = ::ENV['SUBLEDGER_SLOW_POST_DELAY'] ||
|
114
|
+
SLOW_POST_DELAY = ::ENV['SUBLEDGER_SLOW_POST_DELAY'] || 15
|
115
115
|
PROGRESS_INITIAL = ::ENV['SUBLEDGER_PROGRESS_INITIAL'] || 1.5
|
116
116
|
PROGRESS_RETRY = ::ENV['SUBLEDGER_PROGRESS_RETRY'] || 0.5
|
117
117
|
PROGRESS_FAIL = ::ENV['SUBLEDGER_PROGRESS_FAIL'] || 20
|
data/lib/subledger/actor.rb
CHANGED
@@ -99,6 +99,8 @@ module Subledger
|
|
99
99
|
active_lines << line
|
100
100
|
end
|
101
101
|
|
102
|
+
active_journal_entry.send :set_active_lines, active_lines
|
103
|
+
|
102
104
|
store.create_and_post(
|
103
105
|
:active_journal_entry => active_journal_entry,
|
104
106
|
:active_lines => active_lines,
|
@@ -128,6 +130,8 @@ module Subledger
|
|
128
130
|
end
|
129
131
|
|
130
132
|
def lines args={ }, &block
|
133
|
+
return @active_lines if @active_lines
|
134
|
+
|
131
135
|
args.merge! :action => args[:action] || :starting,
|
132
136
|
:state => args[:state] || line_state,
|
133
137
|
:order => args[:order] || '0',
|
@@ -137,10 +141,16 @@ module Subledger
|
|
137
141
|
end
|
138
142
|
|
139
143
|
def balance
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
+
if @active_lines
|
145
|
+
active_lines_balance = client.balance
|
146
|
+
@active_lines.each { |line| active_lines_balance += line }
|
147
|
+
active_lines_balance
|
148
|
+
else
|
149
|
+
store.journal_entry_balance :store => store,
|
150
|
+
:client => client,
|
151
|
+
:journal_entry => self,
|
152
|
+
:state => line_state
|
153
|
+
end
|
144
154
|
end
|
145
155
|
|
146
156
|
def balanced?
|
@@ -235,6 +245,10 @@ module Subledger
|
|
235
245
|
|
236
246
|
private
|
237
247
|
|
248
|
+
def set_active_lines active_lines
|
249
|
+
@active_lines = active_lines
|
250
|
+
end
|
251
|
+
|
238
252
|
def set_reason reason
|
239
253
|
@reason = reason
|
240
254
|
end
|
data/lib/subledger/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -7,6 +7,11 @@ require 'pp'
|
|
7
7
|
require 'rubygems'
|
8
8
|
|
9
9
|
require 'subledger'
|
10
|
+
|
11
|
+
require 'celluloid/autostart'
|
12
|
+
|
13
|
+
Celluloid.logger = Subledger::LOG
|
14
|
+
|
10
15
|
require 'subledger/server'
|
11
16
|
|
12
17
|
require 'minitest/autorun'
|
@@ -74,4 +79,6 @@ module Kernel
|
|
74
79
|
end
|
75
80
|
end
|
76
81
|
|
82
|
+
Celluloid.logger = Subledger::LOG
|
83
|
+
|
77
84
|
Minitest.autorun
|
data/subledger.gemspec
CHANGED
@@ -19,16 +19,6 @@ Gem::Specification.new do |gem|
|
|
19
19
|
'Rakefile',
|
20
20
|
'README.md' ]
|
21
21
|
|
22
|
-
gem.post_install_message = <<-'EOF'
|
23
|
-
As of subledger-0.7.8 the subledger gem is now publicly available.
|
24
|
-
|
25
|
-
If you have a source line in your Gemfile it can, and *should* be removed.
|
26
|
-
|
27
|
-
source ’https://boocx:i9JHYGcWC9zjtw06@gems.boocx.com’
|
28
|
-
|
29
|
-
Thanks, and let us know if we can help in any way!
|
30
|
-
EOF
|
31
|
-
|
32
22
|
gem.bindir = 'bin'
|
33
23
|
gem.executables = 'subledger'
|
34
24
|
|
@@ -59,4 +49,5 @@ Gem::Specification.new do |gem|
|
|
59
49
|
gem.add_runtime_dependency 'multi_json', '~> 1.10'
|
60
50
|
gem.add_runtime_dependency 'grape-entity', '~> 0.4'
|
61
51
|
gem.add_runtime_dependency 'bcrypt', '~> 3.1'
|
52
|
+
gem.add_runtime_dependency 'valid_email', '~> 0.0'
|
62
53
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: subledger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Loren Hale
|
@@ -9,78 +9,92 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-04-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - ~>
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '4.1'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - ~>
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '4.1'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: faraday_middleware
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - ~>
|
32
|
+
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0.9'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - ~>
|
39
|
+
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0.9'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: multi_json
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- - ~>
|
46
|
+
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '1.10'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- - ~>
|
53
|
+
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '1.10'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: grape-entity
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - ~>
|
60
|
+
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0.4'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - ~>
|
67
|
+
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0.4'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: bcrypt
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - ~>
|
74
|
+
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '3.1'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - ~>
|
81
|
+
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '3.1'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: valid_email
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - "~>"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0.0'
|
91
|
+
type: :runtime
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0.0'
|
84
98
|
description: Subledger client gem
|
85
99
|
email: admin@subledger.com
|
86
100
|
executables:
|
@@ -88,7 +102,7 @@ executables:
|
|
88
102
|
extensions: []
|
89
103
|
extra_rdoc_files: []
|
90
104
|
files:
|
91
|
-
- .gitignore
|
105
|
+
- ".gitignore"
|
92
106
|
- LICENSE.txt
|
93
107
|
- README.md
|
94
108
|
- Rakefile
|
@@ -176,26 +190,23 @@ homepage: http://subledger.com
|
|
176
190
|
licenses:
|
177
191
|
- BSD 3-Clause
|
178
192
|
metadata: {}
|
179
|
-
post_install_message:
|
180
|
-
available.\n\n If you have a source line in your Gemfile it can, and *should*
|
181
|
-
be removed.\n\n source ’https://boocx:i9JHYGcWC9zjtw06@gems.boocx.com’\n\n
|
182
|
-
\ Thanks, and let us know if we can help in any way!\n"
|
193
|
+
post_install_message:
|
183
194
|
rdoc_options: []
|
184
195
|
require_paths:
|
185
196
|
- lib
|
186
197
|
required_ruby_version: !ruby/object:Gem::Requirement
|
187
198
|
requirements:
|
188
|
-
- -
|
199
|
+
- - ">="
|
189
200
|
- !ruby/object:Gem::Version
|
190
201
|
version: '0'
|
191
202
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
192
203
|
requirements:
|
193
|
-
- -
|
204
|
+
- - ">="
|
194
205
|
- !ruby/object:Gem::Version
|
195
206
|
version: '0'
|
196
207
|
requirements: []
|
197
208
|
rubyforge_project:
|
198
|
-
rubygems_version: 2.4.
|
209
|
+
rubygems_version: 2.4.5
|
199
210
|
signing_key:
|
200
211
|
specification_version: 4
|
201
212
|
summary: Ruby client gem for accessing the Subledger API
|