Add basic invoices setup
This commit is contained in:
1 parent
4a7b752ace
commit
9b0351576a
7 files changed
+131
-2
No files matched your search
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
# give a replacement version of a file replacing found UUIDs,
|
||||
# preserving multiple instances that might indicate relations
|
||||
|
||||
require 'active_support/all'
|
||||
require 'pry'
|
||||
|
||||
file_path = $ARGV.first
|
||||
|
||||
abort 'Specify the file to replace' unless file_path.present?
|
||||
|
||||
matcher = /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/
|
||||
content = File.read(file_path)
|
||||
|
||||
puts '==== Old content ===='
|
||||
puts content
|
||||
puts "--------------------------\n\n"
|
||||
uuids = content.scan(matcher).uniq
|
||||
uuids.each do |uuid|
|
||||
content.gsub! uuid, SecureRandom.uuid
|
||||
end
|
||||
puts '==== New content ===='
|
||||
puts content
|
||||
Reference in new issue
Block a user