exe/formatafacil in formatafacil-0.2.3 vs exe/formatafacil in formatafacil-0.2.4
- old
+ new
@@ -31,11 +31,11 @@
c.desc 'Linealiza o pdf otimizando-o para web'
c.switch [:w, 'otimiza-para-web'], :default_value => false
c.desc 'Diretório para execução'
- c.flag [:dir]
+ c.flag [:d, :dir]
c.action do |global,options,args|
if (global['logfile'])
logger = Logger.new('formatafacil.log')
@@ -47,10 +47,13 @@
begin
compilador = nil
if (options['pdf'])
compilador = Formatafacil::Compila.new()
+ if (options['otimiza-para-web']) then
+ compilador.otimizador = Formatafacil::OtimizadorParaWeb.new('artigo.pdf')
+ end
end
tarefa = Formatafacil::ArtigoTarefa.new(:compilador => compilador)
tarefa.logger = logger
@@ -97,38 +100,10 @@
rescue Exception => e
logger.error {e.message}
end
end
-
end
-
-desc 'Auto detecta o comando com base no arquivo de configuração'
-command :auto do |c|
-
-
- c.action do |global,options,args|
-
- if (global['logfile'])
- logger = Logger.new('formatafacil.log')
- else
- logger = Logger.new(STDERR)
- end
- logger.level = Logger::WARN
-
- begin
- tarefa = Formatafacil::TarefaChooser.new().escolhe_tarefa
- tarefa.logger = logger
- tarefa.executa
- rescue Exception => e
- logger.error {e.message}
- end
-
- end
-
-end
-
-
desc 'Lista modelos disponíveis'
command :modelos do |c|
c.action do |global,options,args|