gnucash-invoice 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NTM0ZmFmZmJhNzA5ZDU5OTk3YmViZTBmY2I4ZDQ5MWQ0OTlmYjZkZg==
5
+ data.tar.gz: !binary |-
6
+ MjkxM2RmZThlM2YyZDYxMDZlNWU3MmViMTZhY2RjODk2NjcxNDNlNw==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ ZDk1MzI3OWI2MTU1N2U4YWIzNDBhNmM0MDk2YjA4OTAzMDUxNGE5Njg3Mjlj
10
+ NzVjYjgxYjI1ODg4Nzc0NDEwYTE0MTQ4ZTliMzhhOTQzZGFjMjUxZTVjYzcx
11
+ NjAxNjhmMmVlNTc4ODE5ODQ5OWUwNDQ3YWJhODY3MzE1MWEzMmI=
12
+ data.tar.gz: !binary |-
13
+ NGRkOGY0Mzc3MWQwZTRiMTdmYTM0MzUyYjJmMjViMTZiOWM2MjBlOTE3NjA2
14
+ MTJhZjQwZmZiZDc2NjdkYjg4NmE0NjhjMmQxYTgyNmZlOWQwZmEwY2RkYTdi
15
+ ZWYwNzY3MmU2NzkxMzA1ODM2MWNjZWU1N2ZlOTA4ODRmZTBhNDk=
data/.gitignore CHANGED
@@ -3,6 +3,8 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
+ .rvmrc
7
+ .ruby-version
6
8
  Gemfile.lock
7
9
  InstalledFiles
8
10
  _yardoc
@@ -6,8 +6,9 @@ require 'sprockets'
6
6
  module GnuCash
7
7
  class Invoice
8
8
  class Printer
9
- def initialize invoice_id
10
- @invoice = Invoice.find(invoice_id)
9
+ def initialize invoice_id, templates = "templates"
10
+ @invoice = Invoice.find(invoice_id)
11
+ @templates = GnuCash.root.join(templates)
11
12
  end
12
13
 
13
14
 
@@ -17,7 +18,7 @@ module GnuCash
17
18
 
18
19
 
19
20
  def environment
20
- @environment ||= Sprockets::Environment.new(template_dir).tap do |env|
21
+ @environment ||= Sprockets::Environment.new(@templates).tap do |env|
21
22
  env.append_path 'assets/stylesheets'
22
23
  env.css_compressor = :sass
23
24
  end
@@ -25,7 +26,7 @@ module GnuCash
25
26
 
26
27
 
27
28
  def render
28
- template = Slim::Template.new template_dir('invoice.slim').to_s
29
+ template = Slim::Template.new @templates.join('invoice.slim').to_s
29
30
  template.render(self, {
30
31
  :invoice => @invoice,
31
32
  :entries => @invoice.entries,
@@ -33,15 +34,6 @@ module GnuCash
33
34
  :options => Options
34
35
  })
35
36
  end
36
-
37
-
38
- protected
39
-
40
-
41
- def template_dir *args
42
- args.unshift 'templates'
43
- GnuCash.root.join(*args)
44
- end
45
37
  end
46
38
  end
47
39
  end
@@ -17,7 +17,7 @@ module GnuCash
17
17
 
18
18
  # Print out invoice
19
19
  unless argv.empty?
20
- puts Printer.new(options.invoice_id).render
20
+ puts Printer.new(options.invoice_id, options.template_path).render
21
21
  exit
22
22
  end
23
23
 
@@ -38,6 +38,9 @@ module GnuCash
38
38
  opts.on('-d', '--dbpath [DATABASE]', 'SQLite database path') do |path|
39
39
  options.dbpath = Pathname.new path
40
40
  end
41
+ opts.on('-t', '--template [TEMPLATE]', 'Template directory path') do |path|
42
+ options.template_path = Pathname.new path
43
+ end
41
44
  end.parse! argv
42
45
 
43
46
  raise InvalidArguments, "No database selected" unless options.dbpath
@@ -1,5 +1,5 @@
1
1
  module GnuCash
2
2
  class Invoice
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gnucash-invoice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
5
- prerelease:
4
+ version: 0.1.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Aleksey
@@ -11,12 +10,11 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2013-07-26 00:00:00.000000000 Z
13
+ date: 2013-11-11 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: sequel
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
19
  - - ~>
22
20
  - !ruby/object:Gem::Version
@@ -24,7 +22,6 @@ dependencies:
24
22
  type: :runtime
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
26
  - - ~>
30
27
  - !ruby/object:Gem::Version
@@ -32,7 +29,6 @@ dependencies:
32
29
  - !ruby/object:Gem::Dependency
33
30
  name: slim
34
31
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
32
  requirements:
37
33
  - - ~>
38
34
  - !ruby/object:Gem::Version
@@ -40,7 +36,6 @@ dependencies:
40
36
  type: :runtime
41
37
  prerelease: false
42
38
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
39
  requirements:
45
40
  - - ~>
46
41
  - !ruby/object:Gem::Version
@@ -48,7 +43,6 @@ dependencies:
48
43
  - !ruby/object:Gem::Dependency
49
44
  name: sass
50
45
  requirement: !ruby/object:Gem::Requirement
51
- none: false
52
46
  requirements:
53
47
  - - ~>
54
48
  - !ruby/object:Gem::Version
@@ -56,7 +50,6 @@ dependencies:
56
50
  type: :runtime
57
51
  prerelease: false
58
52
  version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
53
  requirements:
61
54
  - - ~>
62
55
  - !ruby/object:Gem::Version
@@ -64,7 +57,6 @@ dependencies:
64
57
  - !ruby/object:Gem::Dependency
65
58
  name: sprockets
66
59
  requirement: !ruby/object:Gem::Requirement
67
- none: false
68
60
  requirements:
69
61
  - - ~>
70
62
  - !ruby/object:Gem::Version
@@ -72,7 +64,6 @@ dependencies:
72
64
  type: :runtime
73
65
  prerelease: false
74
66
  version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
67
  requirements:
77
68
  - - ~>
78
69
  - !ruby/object:Gem::Version
@@ -80,7 +71,6 @@ dependencies:
80
71
  - !ruby/object:Gem::Dependency
81
72
  name: sqlite3
82
73
  requirement: !ruby/object:Gem::Requirement
83
- none: false
84
74
  requirements:
85
75
  - - ! '>='
86
76
  - !ruby/object:Gem::Version
@@ -88,7 +78,6 @@ dependencies:
88
78
  type: :development
89
79
  prerelease: false
90
80
  version_requirements: !ruby/object:Gem::Requirement
91
- none: false
92
81
  requirements:
93
82
  - - ! '>='
94
83
  - !ruby/object:Gem::Version
@@ -96,7 +85,6 @@ dependencies:
96
85
  - !ruby/object:Gem::Dependency
97
86
  name: rake
98
87
  requirement: !ruby/object:Gem::Requirement
99
- none: false
100
88
  requirements:
101
89
  - - ! '>='
102
90
  - !ruby/object:Gem::Version
@@ -104,7 +92,6 @@ dependencies:
104
92
  type: :development
105
93
  prerelease: false
106
94
  version_requirements: !ruby/object:Gem::Requirement
107
- none: false
108
95
  requirements:
109
96
  - - ! '>='
110
97
  - !ruby/object:Gem::Version
@@ -142,27 +129,26 @@ files:
142
129
  - templates/invoice.slim
143
130
  homepage: http://ixti.github.com/gnucash-invoice
144
131
  licenses: []
132
+ metadata: {}
145
133
  post_install_message:
146
134
  rdoc_options: []
147
135
  require_paths:
148
136
  - lib
149
137
  required_ruby_version: !ruby/object:Gem::Requirement
150
- none: false
151
138
  requirements:
152
139
  - - ! '>='
153
140
  - !ruby/object:Gem::Version
154
141
  version: '0'
155
142
  required_rubygems_version: !ruby/object:Gem::Requirement
156
- none: false
157
143
  requirements:
158
144
  - - ! '>='
159
145
  - !ruby/object:Gem::Version
160
146
  version: '0'
161
147
  requirements: []
162
148
  rubyforge_project:
163
- rubygems_version: 1.8.23
149
+ rubygems_version: 2.1.8
164
150
  signing_key:
165
- specification_version: 3
166
- summary: gnucash-invoice-0.1.2
151
+ specification_version: 4
152
+ summary: gnucash-invoice-0.1.3
167
153
  test_files: []
168
154
  has_rdoc: