Sha256: 864cdf5b07831257a2ef8a61a995d6fb8aaff2105e7907f97cbba5c90f6b672e

Contents?: true

Size: 1.39 KB

Versions: 9

Compression:

Stored size: 1.39 KB

Contents

require 'fedux_org/stdlib/logging/logger'

begin
  require 'command_exec'
rescue LoadError => e
  $stderr.puts "You need to install the following gems to make it work: \"command_exec\"."
  exit 1
end

module FeduxOrg
  module Stdlib
    module Project
      module Generators

        class Taskjuggler
          def generate_report( directory, plan_file )
            FeduxOrg::Stdlib::Project.logger.debug "Start generating report."

            begin
              command = CommandExec::Command.new(:tj3 , 
                                                :parameter          => "-o #{directory} #{plan_file}",
                                                :error_detection_on => [:return_code],
                                                :error_indicators   => {
                                                  :allowed_return_code => [0],
                                                },
                                                :on_error_do => :raise_error,
                                                )
              command.run
            rescue CommandExec::Exceptions::CommandExecutionFailed
             FeduxOrg::Stdlib::Project.logger.fatal "Failed to generate report:\n\n#{ command.result.stderr.join( "\n" ) }"
             exit 1
            end

            FeduxOrg::Stdlib::Project.logger.info "Generating report succeeded."
          end
        end

      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fedux_org-stdlib-0.3.2 lib/fedux_org/stdlib/project/generators/taskjuggler.rb
fedux_org-stdlib-0.3.0 lib/fedux_org/stdlib/project/generators/taskjuggler.rb
fedux_org-stdlib-0.2.1 lib/fedux_org/stdlib/project/generators/taskjuggler.rb
fedux_org-stdlib-0.1.3 lib/fedux_org/stdlib/project/generators/taskjuggler.rb
fedux_org-stdlib-0.1.2 lib/fedux_org/stdlib/project/generators/taskjuggler.rb
fedux_org-stdlib-0.1.1 lib/fedux_org/stdlib/project/generators/taskjuggler.rb
fedux_org-stdlib-0.1.0 lib/fedux_org/stdlib/project/generators/taskjuggler.rb
fedux_org-stdlib-0.0.39 lib/fedux_org/stdlib/project/generators/taskjuggler.rb
fedux_org-stdlib-0.0.38 lib/fedux_org/stdlib/project/generators/taskjuggler.rb