diff --git a/exe/quby-compile b/exe/quby-compile index acadf2e2fffbe1b8cbbbb9577e36c32dfc155097..2bb438fd2045d1a20d6201db7ea51e7eba127609 100755 --- a/exe/quby-compile +++ b/exe/quby-compile @@ -21,7 +21,7 @@ OptionParser.new do |opts| end opts.on("--seeds=INPUT") do |value| - seeds_path = value + puts '--seeds is a deprecated option, questionnaire definitions should use seed_patches to conserve seed tweaks' end end.parse! @@ -38,7 +38,7 @@ lookup_tables = Quby::Compiler::Entities::LookupTables.new(lookup_tables_path) paths.each do |path| puts "Compiling #{path}" - key = File.basename(path, File.extname(path)) + key = File.basename(File.dirname(path)) sourcecode = File.read(path) last_update = File.mtime(path) seed_path = File.join(seeds_path, "#{key}.yml") @@ -46,7 +46,6 @@ paths.each do |path| compiled = Quby::Compiler.compile(key, sourcecode, path: path, seeds: seeds, lookup_tables: lookup_tables, last_update: last_update) FileUtils.mkdir_p(File.join(output_path, key)) - compiled[:outputs].each do |type, output| next unless output File.open(File.join(output_path, key, output.filename), 'w') do |file| diff --git a/lib/quby/compiler/instance.rb b/lib/quby/compiler/instance.rb index 5f724c9e06ecdba69a7c5627c72bbd5ff7ee2953..7bad7164944c2f2904c01094d2efc961481cd29d 100644 --- a/lib/quby/compiler/instance.rb +++ b/lib/quby/compiler/instance.rb @@ -11,7 +11,7 @@ module Quby if block # defined in block for tests questionnaire = DSL.build(key, path: path, &block) else # sourcecode given as string - tempfile = Tempfile.new(key) + tempfile = Tempfile.new([key, '.rb']) questionnaire = Entities::Questionnaire.new(key, last_update: last_update) Thread.current["quby-questionnaire-loading"] = Quby::Compiler::DSL::QuestionnaireBuilder.new(questionnaire, lookup_tables: lookup_tables)