Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from okkez/add-plain-text-formatter
Add plain text formatter
- Loading branch information
Showing
3 changed files
with
39 additions
and
1 deletion.
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
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,22 @@ | ||
| module ChupaText | ||
| module Formatters | ||
| class Text | ||
| def initialize(output) | ||
| @output = output | ||
| @texts = [] | ||
| end | ||
|
|
||
| def format_start(data) | ||
| end | ||
|
|
||
| def format_extracted(data) | ||
| @texts << data.body | ||
| end | ||
|
|
||
| def format_finish(data) | ||
| @output << @texts.join("\n\x0c\n") | ||
| @output << "\n" | ||
| end | ||
| end | ||
| end | ||
| end |