deb 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MzE4ZTExMmIzYWVkZDMwNjM2MWUxZTQ5ZDBiOGFlMGQ1NTZiYTBlNQ==
5
+ data.tar.gz: !binary |-
6
+ MTU1YmUwYThjNjkzMmMxZWU3NTMyYmY3ZjU1M2I4NjQxM2ZjNzIzMA==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NTc1NzA2MzlkMDM0ZjY2ZTUxZDVhMDYxNzNhZGEwOWRiNmYyNzQ1ODk0MDZh
10
+ OTcxNTQ0N2FiODgwZTVjZDZiZjI2OTE4OWYwOGU3OWM1MmViY2NiNWIzMDJj
11
+ NDJhYWZlMmQ3M2JhMmE5MjA1NjA3YTYyZDI2NjRkNjEzZWYxOWQ=
12
+ data.tar.gz: !binary |-
13
+ MzYxYzg5ZTEwZGZmM2NiNDAzMTIzMGQwMGViMTQ5ZTFlYjgwZGU5ZDU5NTAz
14
+ ZDdkMDJhMmYyMDA5OWQ4OGIwNTY2M2Y4ZWU1ZmEzYTQ1M2FlY2FiZWJmOTgy
15
+ MDg4ZGY3NjAzM2Y0NTE0MTcwMzhiYTJiNWM1ZGQzZWJiYzU5MDc=
data/Rakefile CHANGED
@@ -12,6 +12,8 @@ rescue LoadError
12
12
  RDoc::Task = Rake::RDocTask
13
13
  end
14
14
 
15
+ require 'rspec/core/rake_task'
16
+
15
17
  RDoc::Task.new(:rdoc) do |rdoc|
16
18
  rdoc.rdoc_dir = 'rdoc'
17
19
  rdoc.title = 'Deb'
@@ -23,7 +25,9 @@ end
23
25
  APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
24
26
  load 'rails/tasks/engine.rake'
25
27
 
28
+ RSpec::Core::RakeTask.new('spec')
26
29
 
30
+ task :default => :spec
27
31
 
28
32
  Bundler::GemHelper.install_tasks
29
33
 
@@ -18,9 +18,21 @@ module Deb
18
18
  Docile.dsl_eval(Deb::Builder.new, &block).build
19
19
  end
20
20
 
21
+ def rollback!
22
+ tran = self
23
+ self.class.start! do
24
+ tran.debit_items.each { |di| credit(di.account, di.amount) }
25
+ tran.credit_items.each { |ci| debit(ci.account, ci.amount) }
26
+ reference(tran)
27
+ description("Rollback of #{tran.description}")
28
+ end
29
+ end
30
+
21
31
  def self.start!(&block)
22
32
  transaction do
23
- start(&block).save!
33
+ start(&block).tap do |t|
34
+ t.save!
35
+ end
24
36
  end
25
37
  end
26
38
 
data/lib/deb/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Deb
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
5
- prerelease:
4
+ version: 0.0.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - Boris Nadion
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-07-23 00:00:00.000000000 Z
11
+ date: 2013-11-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: docile
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: sqlite3
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rspec
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rspec-rails
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ~>
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ~>
92
81
  - !ruby/object:Gem::Version
@@ -94,7 +83,6 @@ dependencies:
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rspec-rails
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
87
  - - ~>
100
88
  - !ruby/object:Gem::Version
@@ -102,7 +90,6 @@ dependencies:
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
94
  - - ~>
108
95
  - !ruby/object:Gem::Version
@@ -130,32 +117,25 @@ files:
130
117
  homepage: https://github.com/astrails/deb
131
118
  licenses:
132
119
  - MIT
120
+ metadata: {}
133
121
  post_install_message:
134
122
  rdoc_options: []
135
123
  require_paths:
136
124
  - lib
137
125
  required_ruby_version: !ruby/object:Gem::Requirement
138
- none: false
139
126
  requirements:
140
127
  - - ! '>='
141
128
  - !ruby/object:Gem::Version
142
129
  version: '0'
143
- segments:
144
- - 0
145
- hash: -3315931154693391300
146
130
  required_rubygems_version: !ruby/object:Gem::Requirement
147
- none: false
148
131
  requirements:
149
132
  - - ! '>='
150
133
  - !ruby/object:Gem::Version
151
134
  version: '0'
152
- segments:
153
- - 0
154
- hash: -3315931154693391300
155
135
  requirements: []
156
136
  rubyforge_project:
157
- rubygems_version: 1.8.25
137
+ rubygems_version: 2.1.11
158
138
  signing_key:
159
- specification_version: 3
139
+ specification_version: 4
160
140
  summary: Double Entry Bookkeeping for Rails
161
141
  test_files: []