ledger-rest 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/ledger-rest.org CHANGED
@@ -9,6 +9,9 @@
9
9
  CLOSED: [2012-11-24 Sat 01:26]
10
10
  - State "DONE" from "TODO" [2012-11-24 Sat 01:26]
11
11
  ** NEXT implement ledger append
12
+ ** NEXT add error handling for execution of ledger commands
13
+ ** NEXT do not add null-fields to register export
14
+ e.g. `code` or `effective_date`
12
15
  ** TODO implement transactions GET method
13
16
  Get all transactions.
14
17
  ** TODO implement transactions POST method
@@ -13,11 +13,4 @@ class Hash
13
13
  end
14
14
  self
15
15
  end
16
-
17
- def inject acc, &block
18
- self.each_pair do |key, val|
19
- acc = block.call acc, key, val
20
- end
21
- acc
22
- end
23
16
  end
@@ -15,15 +15,16 @@ module LedgerRest
15
15
  end
16
16
 
17
17
  # Execute ledger command with given parameters
18
- def exec(cmd, params = {})
18
+ def exec(cmd, options = {})
19
19
  Git.invoke :before_read
20
20
 
21
- params = {
21
+ options = {
22
22
  '-f' => @file
23
- }.merge(params)
23
+ }.merge(options)
24
24
 
25
- params = params.inject '' do |acc, key, val|
26
- acc << " #{key} #{Escape.shell_single_word(val)}"
25
+ params = ""
26
+ options.each do |key, val|
27
+ params << " #{key} #{Escape.shell_single_word(val)}"
27
28
  end
28
29
 
29
30
  command = "#{bin} #{params} #{cmd}"
@@ -1,3 +1,3 @@
1
1
  module LedgerRest
2
- VERSION = "2.0.2"
2
+ VERSION = "2.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ledger-rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -187,7 +187,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
187
187
  version: '0'
188
188
  segments:
189
189
  - 0
190
- hash: -3352241011932591077
190
+ hash: -3952331821210503451
191
191
  required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  none: false
193
193
  requirements:
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  version: '0'
197
197
  segments:
198
198
  - 0
199
- hash: -3352241011932591077
199
+ hash: -3952331821210503451
200
200
  requirements: []
201
201
  rubyforge_project:
202
202
  rubygems_version: 1.8.24