clinvoice 1.1.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/clinvoice.rb +0 -9
- data/lib/clinvoice/data.rb +3 -1
- data/lib/clinvoice/version.rb +1 -1
- metadata +6 -8
- data/lib/clinvoice/generate_next_template.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f14251c2e76af986045d3ca172d0863711562b01b212691be36c2d61021b7ea
|
4
|
+
data.tar.gz: 3347c2a65da53a16050980236dc84a68483b689c02dda0cae527895134e766ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d7ff3cd3eac02ed2ab4c3bfdf770b15d8fcb0ff935a222c306f37133311ae34cb4e2a574de54e118a24a8907e479d6edd233ca2113e8f3db5a021c913264670
|
7
|
+
data.tar.gz: 74db98d5b3b4b5f275b9c29f768c2d2d93e974d0d8df26f46ca7429850dbd8b4488eed6cba0cd62664561271418aee546f9c130692969dcf186ff1bd15fd0e67
|
data/lib/clinvoice.rb
CHANGED
@@ -17,8 +17,6 @@ module Clinvoice
|
|
17
17
|
Clinvoice::InitializeTemplate.call(file)
|
18
18
|
when 'new'
|
19
19
|
Clinvoice::GeneratePDF.call(file)
|
20
|
-
when 'next'
|
21
|
-
Clinvoice::GenerateNextTemplate.call(file)
|
22
20
|
else
|
23
21
|
show_usage_and_exit!
|
24
22
|
end
|
@@ -30,7 +28,6 @@ module Clinvoice
|
|
30
28
|
|
31
29
|
clinvoice init <datafile> # starts a new template with id 1 and empty entries.
|
32
30
|
clinvoice new <filename> # generates a pdf invoice based on a data file `yml`.
|
33
|
-
clinvoice next <datafile> # generates the next data file `yml`.
|
34
31
|
|
35
32
|
Args:
|
36
33
|
|
@@ -55,12 +52,6 @@ module Clinvoice
|
|
55
52
|
|
56
53
|
This will create a `doge-client-1.pdf` file based on the data file `doge-client-1.yml`.
|
57
54
|
|
58
|
-
4 - Generate a next datafile
|
59
|
-
|
60
|
-
`$ clinvoice next doge-client`
|
61
|
-
|
62
|
-
This will create a `doge-client-2.yml` data file, based on the last data file id + 1.
|
63
|
-
|
64
55
|
USAGE
|
65
56
|
|
66
57
|
exit
|
data/lib/clinvoice/data.rb
CHANGED
data/lib/clinvoice/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clinvoice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew S Aguiar
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -89,7 +89,6 @@ files:
|
|
89
89
|
- clinvoice.gemspec
|
90
90
|
- lib/clinvoice.rb
|
91
91
|
- lib/clinvoice/data.rb
|
92
|
-
- lib/clinvoice/generate_next_template.rb
|
93
92
|
- lib/clinvoice/generate_pdf.rb
|
94
93
|
- lib/clinvoice/helper.rb
|
95
94
|
- lib/clinvoice/initialize_template.rb
|
@@ -104,7 +103,7 @@ homepage: https://github.com/andrewaguiar/clinvoice
|
|
104
103
|
licenses:
|
105
104
|
- MIT
|
106
105
|
metadata: {}
|
107
|
-
post_install_message:
|
106
|
+
post_install_message:
|
108
107
|
rdoc_options: []
|
109
108
|
require_paths:
|
110
109
|
- lib
|
@@ -119,9 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
118
|
- !ruby/object:Gem::Version
|
120
119
|
version: '0'
|
121
120
|
requirements: []
|
122
|
-
|
123
|
-
|
124
|
-
signing_key:
|
121
|
+
rubygems_version: 3.1.4
|
122
|
+
signing_key:
|
125
123
|
specification_version: 4
|
126
124
|
summary: Generates invoices using command line
|
127
125
|
test_files: []
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Clinvoice
|
4
|
-
module GenerateNextTemplate
|
5
|
-
def self.call(file)
|
6
|
-
last_data_file = Dir["#{file}-*.yml"].max
|
7
|
-
template_content = File.read(last_data_file)
|
8
|
-
|
9
|
-
next_id = template_content.scan(/id: (\d*)/).first.first.to_i + 1
|
10
|
-
|
11
|
-
next_template_content = template_content.sub(/id: (\d*)/, "id: #{next_id}")
|
12
|
-
|
13
|
-
File.write("#{file}-#{next_id}.yml", next_template_content)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|