forked from zdavatz/ydim
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added pdfinvoice. Made unittests pass under Ruby 2.3.0
- Loading branch information
Showing
21 changed files
with
86 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
coverage | ||
pkg | ||
.bundle | ||
.ruby-version | ||
Gemfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ before_install: | |
script: bundle exec test/suite.rb | ||
|
||
rvm: | ||
- 1.9.3 | ||
- 2.1 | ||
- 2.2 | ||
- 2.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env ruby | ||
# Config -- pdfinvoice -- 28.07.2005 -- hwyss@ywesee.com | ||
|
||
require 'rclconf' | ||
|
||
module PdfInvoice | ||
def PdfInvoice.config(argv=[]) | ||
default_dir = File.join(ENV['HOME'].to_s, '.pdfinvoice') | ||
default_config_files = [ | ||
File.join(default_dir, 'config.yml'), | ||
'/etc/pdfinvoice/config.yml', | ||
] | ||
defaults = { | ||
'colors' => { | ||
'items' => [0xFA, 0xFA, 0xFA], | ||
'total' => [0xF0, 0xF0, 0xF0], | ||
}, | ||
'config' => default_config_files, | ||
'creditor_address' => '', | ||
'creditor_email' => '', | ||
'creditor_bank' => '', | ||
'due_days' => '', | ||
'font' => 'Helvetica', | ||
'font_b' => 'Helvetica-Bold', | ||
'formats' => { | ||
'currency' => "%1.2f", | ||
'total' => "%1.2f", | ||
'date' => "%d.%m.%Y", | ||
'invoice_number' => "<b>#%06i</b>", | ||
'quantity' => '%1.1f', | ||
}, | ||
'logo_path' => nil, | ||
'logo_link' => nil, | ||
'tax' => 0, | ||
'texts' => { | ||
'date' => 'Date', | ||
'description' => 'Description', | ||
'unit' => 'Unit', | ||
'quantity' => 'Quantity', | ||
'price' => 'Price', | ||
'item_total' => 'Item Total', | ||
'subtotal' => 'Subtotal', | ||
'tax' => 'Tax', | ||
'thanks' => nil, | ||
'total' => 'Total', | ||
}, | ||
'text_options' => {:spacing => 1.25}, | ||
} | ||
config = RCLConf::RCLConf.new(ARGV, defaults) | ||
config.load(config.config) | ||
config | ||
end | ||
end |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
#!/usr/bin/env ruby | ||
# TestSuite -- ydim -- 27.01.2005 -- hwyss@ywesee.com | ||
require 'simplecov' | ||
|
||
$: << File.dirname(File.expand_path(__FILE__)) | ||
SimpleCov.start | ||
|
||
Dir.foreach(File.dirname(__FILE__)) { |file| | ||
Dir.foreach(File.dirname(__FILE__)) do |file| | ||
if /^test_.*\.rb$/o.match(file) | ||
require file | ||
require file | ||
end | ||
} | ||
end |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters