175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
|
# File 'lib/aspen/cli/commands/build_steps.rb', line 175
def call(main_aspen_file, options)
super
puts "----> Compiling main Aspen file (#{main_aspen_file.path})"
unless manifest["output"]
puts " Defaulting to Cypher output. To customize, set up a manifest.yml."
end
outputs = manifest["output"] ? Array(manifest["output"]) : ["Cypher"]
outputs.each do |format|
adapter = Aspen::Adapters::Registry.get(format.downcase.to_sym)
out_path = main_aspen_file.path.gsub(/\.aspen$/, '') + adapter.ext
File.open(out_path, 'w') do |file|
file << Aspen.compile_text(
File.read(main_aspen_file),
adapter: adapter.id,
batch: options[:batch]
)
end
puts "----> Compiled main #{adapter.name} file"
end
end
|