Class: RosettAi::Thor::Tasks::Compile

Inherits:
Thor
  • Object
show all
Defined in:
lib/rosett_ai/thor/tasks/compile.rb

Overview

Thor task for compiling YAML configuration into markdown rule files

Instance Method Summary collapse

Instance Method Details

#generatevoid

This method returns an undefined value.

Generate the compiled output.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/rosett_ai/thor/tasks/compile.rb', line 91

def generate
  if options[:locales]
    compile_locales
    return
  end

  check_xdg_migration
  compiler = build_compiler
  categories = compiler.discover_categories

  if categories.empty?
    puts Rainbow(t('compile.no_categories')).yellow
    return
  end

  log_categories(categories, compiler) if options[:verbose]

  compiled = compiler.compile
  check_conflict_warnings(compiler)
  check_capabilities(resolve_engine_option)
  results = process_compiled(compiler, compiled)
  remove_orphans(compiler, compiled)
  write_lockfile(compiler, compiled) if options[:vendor] && !options[:simulate]
  print_summary(results)
end