ascii_invoicer 2.5.15 → 2.5.17
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 +4 -4
- data/bin/ascii +22 -20
- data/lib/ascii_invoicer.rb +7 -7
- data/lib/ascii_invoicer/InvoiceProject.rb +13 -2
- data/lib/ascii_invoicer/ascii_logger.rb +1 -0
- data/lib/ascii_invoicer/filters.rb +2 -0
- data/lib/ascii_invoicer/generators.rb +2 -0
- data/lib/ascii_invoicer/hash_transformer.rb +1 -0
- data/lib/ascii_invoicer/mixins.rb +2 -0
- data/lib/ascii_invoicer/projectFileReader.rb +3 -1
- data/lib/ascii_invoicer/rfc5322_regex.rb +1 -0
- data/lib/ascii_invoicer/settings_manager.rb +1 -0
- data/lib/ascii_invoicer/texwriter.rb +11 -3
- data/lib/ascii_invoicer/tweaks.rb +2 -0
- data/lib/ascii_invoicer/version.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb682f58e7ae42b47e5d84e88de21f953df524ec
|
4
|
+
data.tar.gz: d6240cbc5f434f6ab8efef3ee8915cf63a5aefa0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d173a22fa136e4d20de1921c993a8ff7d33a4abb56978d8ed23fd3571ef0f9976adc458ecf87a52ca1b4afc4c6225098b1ba294295ce2c12e78683441247c249
|
7
|
+
data.tar.gz: 47796e28941946ab71ddeb4244a59632f43f4f6537670fa3859e331bd1483cf730677f1fe2ec27dc4a519099bd488cfb3bdc5ecc0d9345bc066bf44ee6ee6330
|
data/bin/ascii
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# warn_indent: true
|
3
|
+
# frozen_string_literal: true
|
2
4
|
|
3
5
|
require 'pp'
|
4
6
|
require 'csv'
|
@@ -187,30 +189,30 @@ class Commander < Thor
|
|
187
189
|
projects = open_projects names, options
|
188
190
|
paths= projects.map{ |project| project.path }
|
189
191
|
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
192
|
+
if options[:archive]
|
193
|
+
map = $PLUMBER.map_project_files_archive(options[:archive])
|
194
|
+
else
|
195
|
+
map = $PLUMBER.map_project_files_working()
|
196
|
+
end
|
197
|
+
map.each{|k,v|
|
198
|
+
names.each{|name|
|
199
|
+
if k.downcase.include? name.downcase
|
200
|
+
paths += [v]
|
201
|
+
end
|
202
|
+
}
|
200
203
|
}
|
201
|
-
|
202
|
-
paths.uniq!
|
204
|
+
paths.uniq!
|
203
205
|
|
204
|
-
|
205
|
-
|
206
|
-
|
206
|
+
#pp paths
|
207
|
+
$logger.info "opening #{paths}", :stdo
|
208
|
+
end
|
207
209
|
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
210
|
+
if paths.size > 0
|
211
|
+
edit_files paths, options[:editor]
|
212
|
+
else
|
213
|
+
puts "nothing found (#{names})"
|
214
|
+
end
|
212
215
|
end
|
213
|
-
end
|
214
216
|
|
215
217
|
|
216
218
|
desc "open NAMES", "Open created documents"
|
data/lib/ascii_invoicer.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require "ascii_invoicer/version"
|
2
|
-
require "ascii_invoicer/settings_manager"
|
3
|
-
require "ascii_invoicer/InvoiceProject"
|
4
|
-
require "ascii_invoicer/hash_transformer"
|
5
|
-
require "ascii_invoicer/tweaks"
|
6
|
-
require "ascii_invoicer/mixins"
|
7
|
-
require "ascii_invoicer/ascii_logger"
|
1
|
+
require "./lib/ascii_invoicer/version"
|
2
|
+
require "./lib/ascii_invoicer/settings_manager"
|
3
|
+
require "./lib/ascii_invoicer/InvoiceProject"
|
4
|
+
require "./lib/ascii_invoicer/hash_transformer"
|
5
|
+
require "./lib/ascii_invoicer/tweaks"
|
6
|
+
require "./lib/ascii_invoicer/mixins"
|
7
|
+
require "./lib/ascii_invoicer/ascii_logger"
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# warn_indent: true
|
1
2
|
require 'yaml'
|
2
3
|
require 'csv'
|
3
4
|
require 'date'
|
@@ -115,7 +116,13 @@ class InvoiceProject < LuigiProject
|
|
115
116
|
end
|
116
117
|
|
117
118
|
#load format and transform or not
|
118
|
-
@data[:format] =
|
119
|
+
@data[:format] = if @raw_data['format']
|
120
|
+
@raw_data['format']
|
121
|
+
elsif @raw_data['meta']['format']
|
122
|
+
@raw_data['meta']['format']
|
123
|
+
else
|
124
|
+
"1.0.0"
|
125
|
+
end
|
119
126
|
if @data[:format] < "2.4.0"
|
120
127
|
begin
|
121
128
|
@raw_data = import_100 @raw_data
|
@@ -199,7 +206,11 @@ class InvoiceProject < LuigiProject
|
|
199
206
|
new_hash.set_path("event/dates/0/time/begin", new_hash.get_path("time")) if date[1].nil?
|
200
207
|
new_hash.set_path("event/dates/0/time/end", new_hash.get_path("time_end")) if date[1].nil?
|
201
208
|
|
202
|
-
|
209
|
+
pp new_hash
|
210
|
+
manager_lines = new_hash['manager'].lines.to_a()
|
211
|
+
if manager_lines.length > 1
|
212
|
+
new_hash['manager'] = new_hash['manager'].lines[1]
|
213
|
+
end
|
203
214
|
|
204
215
|
if new_hash.get_path("client/fullname").words.class == Array
|
205
216
|
new_hash.set_path("client/title", new_hash.get_path("client/fullname").lines.to_a[0].strip)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# warn_indent: true
|
2
|
+
# frozen_string_literal: true
|
1
3
|
require 'paint'
|
2
4
|
|
3
5
|
require File.join __dir__, 'tweaks.rb'
|
@@ -87,13 +89,13 @@ module ProjectFileReader
|
|
87
89
|
@logger.info Paint[path, :yellow] if @settings.DEBUG
|
88
90
|
return parser.call(value)
|
89
91
|
end
|
90
|
-
end
|
91
92
|
rescue => error
|
92
93
|
fail_at path
|
93
94
|
puts Array.new($@).keep_if{|line| line.include? "filter_"}.map {|line| Paint[line, :red, :bold]}
|
94
95
|
puts Array.new($@).keep_if{|line| line.include? "generate_"}.map {|line| Paint[line, :blue, :bold]}
|
95
96
|
puts Paint[" #{error} (#{@project_path})", :yellow]
|
96
97
|
end
|
98
|
+
end
|
97
99
|
|
98
100
|
def fail_at(*criteria)
|
99
101
|
@data[:valid] = false
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# warn_indent: true
|
1
2
|
require 'logger'
|
2
3
|
|
3
4
|
module TexWriter
|
@@ -93,11 +94,18 @@ module TexWriter
|
|
93
94
|
templates[File.basename(file.split(?.)[0]).to_sym] = file
|
94
95
|
}
|
95
96
|
path = templates[type]
|
96
|
-
|
97
|
-
|
98
|
-
|
97
|
+
|
98
|
+
if path.nil?
|
99
|
+
@logger.error "No template found!\n Check #{$PLUMBER.dirs[:templates]} !"
|
100
|
+
return false
|
101
|
+
|
102
|
+
elsif not File.exists?(path)
|
99
103
|
@logger.error "Template (#{path}) File not found!"
|
100
104
|
return false
|
105
|
+
|
106
|
+
else
|
107
|
+
return File.open(path).read
|
108
|
+
|
101
109
|
end
|
102
110
|
end
|
103
111
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ascii_invoicer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hendrik Sollich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|