Module: CSVPlusPlus
- Defined in:
- lib/csv_plus_plus.rb,
lib/csv_plus_plus/cli.rb,
lib/csv_plus_plus/row.rb,
lib/csv_plus_plus/cell.rb,
lib/csv_plus_plus/color.rb,
lib/csv_plus_plus/error.rb,
lib/csv_plus_plus/graph.rb,
lib/csv_plus_plus/lexer.rb,
lib/csv_plus_plus/scope.rb,
lib/csv_plus_plus/expand.rb,
lib/csv_plus_plus/writer.rb,
lib/csv_plus_plus/options.rb,
lib/csv_plus_plus/runtime.rb,
lib/csv_plus_plus/version.rb,
lib/csv_plus_plus/cli_flag.rb,
lib/csv_plus_plus/compiler.rb,
lib/csv_plus_plus/entities.rb,
lib/csv_plus_plus/modifier.rb,
lib/csv_plus_plus/template.rb,
lib/csv_plus_plus/references.rb,
lib/csv_plus_plus/writer/csv.rb,
lib/csv_plus_plus/error/error.rb,
lib/csv_plus_plus/lexer/lexer.rb,
lib/csv_plus_plus/writer/excel.rb,
lib/csv_plus_plus/entities/date.rb,
lib/csv_plus_plus/google_options.rb,
lib/csv_plus_plus/data_validation.rb,
lib/csv_plus_plus/entities/entity.rb,
lib/csv_plus_plus/entities/number.rb,
lib/csv_plus_plus/entities/string.rb,
lib/csv_plus_plus/lexer/tokenizer.rb,
lib/csv_plus_plus/entities/boolean.rb,
lib/csv_plus_plus/entities/builtins.rb,
lib/csv_plus_plus/entities/function.rb,
lib/csv_plus_plus/entities/variable.rb,
lib/csv_plus_plus/google_api_client.rb,
lib/csv_plus_plus/error/syntax_error.rb,
lib/csv_plus_plus/error/writer_error.rb,
lib/csv_plus_plus/validated_modifier.rb,
lib/csv_plus_plus/writer/base_writer.rb,
lib/csv_plus_plus/parser/modifier.tab.rb,
lib/csv_plus_plus/benchmarked_compiler.rb,
lib/csv_plus_plus/entities/ast_builder.rb,
lib/csv_plus_plus/writer/google_sheets.rb,
lib/csv_plus_plus/writer/open_document.rb,
lib/csv_plus_plus/can_define_references.rb,
lib/csv_plus_plus/parser/cell_value.tab.rb,
lib/csv_plus_plus/writer/rubyxl_builder.rb,
lib/csv_plus_plus/can_resolve_references.rb,
lib/csv_plus_plus/entities/function_call.rb,
lib/csv_plus_plus/entities/runtime_value.rb,
lib/csv_plus_plus/writer/rubyxl_modifier.rb,
lib/csv_plus_plus/entities/cell_reference.rb,
lib/csv_plus_plus/parser/code_section.tab.rb,
lib/csv_plus_plus/writer/file_backer_upper.rb,
lib/csv_plus_plus/error/formula_syntax_error.rb,
lib/csv_plus_plus/error/modifier_syntax_error.rb,
lib/csv_plus_plus/writer/google_sheet_builder.rb,
lib/csv_plus_plus/writer/google_sheet_modifier.rb,
lib/csv_plus_plus/error/modifier_validation_error.rb,
lib/csv_plus_plus/modifier/conditional_formatting.rb
Overview
A programming language for writing rich CSV files
Defined Under Namespace
Modules: BenchmarkedCompiler, CanDefineReferences, CanResolveReferences, Entities, Error, GoogleApiClient, Graph, Lexer, Modifier, Parser, Writer Classes: CLI, Cell, CliFlag, Color, Compiler, DataValidation, Expand, GoogleOptions, Options, References, Row, Runtime, Scope, Template, ValidatedModifier
Constant Summary collapse
- VERSION =
'0.1.2'
Class Method Summary collapse
-
.apply_template_to_sheet!(input, filename, options) ⇒ Object
Parse the input into a
Templateand write it to the desired format. -
.write_template(template, compiler, options) ⇒ Object
Write the results (and possibly make a backup) of a compiled
template.
Class Method Details
.apply_template_to_sheet!(input, filename, options) ⇒ Object
Parse the input into a Template and write it to the desired format
42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/csv_plus_plus.rb', line 42 def self.apply_template_to_sheet!(input, filename, ) warn(.verbose_summary) if .verbose runtime = ::CSVPlusPlus::Runtime.new(input:, filename:) ::CSVPlusPlus::Compiler.with_compiler(options:, runtime:) do |compiler| template = compiler.compile_template warn(template.verbose_summary) if .verbose write_template(template, compiler, ) end end |
.write_template(template, compiler, options) ⇒ Object
Write the results (and possibly make a backup) of a compiled template
61 62 63 64 65 66 67 |
# File 'lib/csv_plus_plus.rb', line 61 def self.write_template(template, compiler, ) compiler.outputting! do output = ::CSVPlusPlus::Writer.writer() output.write_backup if .backup output.write(template) end end |