-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathRakefile
33 lines (28 loc) · 1.1 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require "bundler/gem_tasks"
require "ruby_danfe"
desc "Open an irb session preloaded ruby_danfe classes"
task :console do
sh "irb -rubygems -I lib -r ruby_danfe.rb"
end
namespace :spec do
namespace :fixtures do
desc "Recreate all pdfs fixtures. Use this task always that output pdf format is changed."
task :recreate_pdfs do
Dir["spec/fixtures/nfe*.xml"].each do |f|
puts "Recreating #{f}.fixture.pdf"
RubyDanfe.generate("#{f}.fixture.pdf", "#{f}")
end
puts "Recreating spec/fixtures/4_decimals_nfe_simples_nacional.xml.fixture.pdf"
RubyDanfe.options = {"quantity_decimals" => 4}
RubyDanfe.generate("spec/fixtures/4_decimals_nfe_simples_nacional.xml.fixture.pdf", "spec/fixtures/4_decimals_nfe_simples_nacional.xml")
Dir["spec/fixtures/cte*.xml"].each do |f|
puts "Recreating #{f}.fixture.pdf"
RubyDanfe.generate("#{f}.fixture.pdf", "#{f}", :dacte)
end
Dir["spec/fixtures/nfse*.xml"].each do |f|
puts "Recreating #{f}.fixture.pdf"
RubyDanfe.generate("#{f}.fixture.pdf", "#{f}", :danfse)
end
end
end
end