rock_books 0.7.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{manual.md → MANUAL.md} +26 -26
- data/README.md +20 -12
- data/RELEASE_NOTES.md +55 -10
- data/REPORTS.md +81 -0
- data/assets/doc-images/sample-index-html.png +0 -0
- data/lib/rock_books/cmd_line/command_line_interface.rb +12 -21
- data/lib/rock_books/documents/book_set.rb +4 -1
- data/lib/rock_books/documents/journal.rb +2 -3
- data/lib/rock_books/reports/balance_sheet.rb +2 -2
- data/lib/rock_books/reports/book_set_reporter.rb +69 -55
- data/lib/rock_books/reports/data/bs_is_section_data.rb +3 -1
- data/lib/rock_books/reports/data/journal_data.rb +1 -0
- data/lib/rock_books/reports/data/multidoc_txn_by_account_data.rb +1 -1
- data/lib/rock_books/reports/data/tx_one_account_data.rb +1 -1
- data/lib/rock_books/reports/helpers/erb_helper.rb +1 -6
- data/lib/rock_books/reports/helpers/receipts_hyperlink_converter.rb +59 -0
- data/lib/rock_books/reports/helpers/{reporter.rb → text_report_helper.rb} +11 -1
- data/lib/rock_books/reports/income_statement.rb +2 -2
- data/lib/rock_books/reports/index_html_page.rb +27 -0
- data/lib/rock_books/reports/journal_report.rb +18 -8
- data/lib/rock_books/reports/multidoc_txn_by_account_report.rb +2 -2
- data/lib/rock_books/reports/multidoc_txn_report.rb +2 -2
- data/lib/rock_books/reports/receipts_report.rb +1 -1
- data/lib/rock_books/reports/templates/html/index.html.erb +45 -6
- data/lib/rock_books/reports/templates/html/report_page.html.erb +14 -1
- data/lib/rock_books/reports/templates/text/balance_sheet.txt.erb +2 -0
- data/lib/rock_books/reports/templates/text/income_statement.txt.erb +3 -1
- data/lib/rock_books/reports/templates/text/journal.txt.erb +5 -2
- data/lib/rock_books/reports/templates/text/multidoc_txn_by_account_report.txt.erb +3 -0
- data/lib/rock_books/reports/templates/text/multidoc_txn_report.txt.erb +3 -0
- data/lib/rock_books/reports/templates/text/receipts_report.txt.erb +3 -0
- data/lib/rock_books/reports/templates/text/tx_one_account.txt.erb +3 -0
- data/lib/rock_books/reports/tx_one_account.rb +2 -2
- data/lib/rock_books/version.rb +2 -1
- data/rock_books.gemspec +1 -0
- metadata +22 -5
- data/lib/rock_books/helpers/html_helper.rb +0 -35
@@ -1,35 +0,0 @@
|
|
1
|
-
module RockBooks
|
2
|
-
module HtmlHelper
|
3
|
-
|
4
|
-
def self.convert_receipts_to_hyperlinks(original_html_string, html_filespec)
|
5
|
-
html_lines = original_html_string.split("\n")
|
6
|
-
content_changed = false
|
7
|
-
|
8
|
-
# If the HTML file being created is in DATA_DIR/rockbooks-reports/html/single-account, then
|
9
|
-
# the processed link should be '../../../receipts/[receipt_filespec]'
|
10
|
-
# else it's in DATA_DIR/rockbooks-reports/html, and
|
11
|
-
# the processed link should be '../../receipts/[receipt_filespec]'
|
12
|
-
processed_receipt_filespec = ->(listed_receipt_filespec) do
|
13
|
-
num_dirs_up = html_filespec.include?('/single-account/') ? 3 : 2
|
14
|
-
File.join(('../' * num_dirs_up), 'receipts', listed_receipt_filespec)
|
15
|
-
end
|
16
|
-
|
17
|
-
receipt_anchor_line = ->(line, listed_receipt_filespec) do
|
18
|
-
line.gsub( \
|
19
|
-
/Receipt:\s*#{listed_receipt_filespec}/, \
|
20
|
-
%Q{Receipt: <a href="#{processed_receipt_filespec.(listed_receipt_filespec)}">#{listed_receipt_filespec}</a>})
|
21
|
-
end
|
22
|
-
|
23
|
-
html_lines.each_with_index do |line, index|
|
24
|
-
matches = /Receipt:\s*(\S*)/.match(line)
|
25
|
-
if matches
|
26
|
-
listed_receipt_filespec = matches[1]
|
27
|
-
html_lines[index] = receipt_anchor_line.(line, listed_receipt_filespec)
|
28
|
-
content_changed = true
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
content_changed ? html_lines.join("\n") : original_html_string
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|