Sha256: 1625b7eec160f8a95595f466736e20a9b952eeaf83677399291b3dcd746d78a2

Contents?: true

Size: 1.1 KB

Versions: 7

Compression:

Stored size: 1.1 KB

Contents

require 'rake'

module Rake
  module Funnel
    module Integration
      module TeamCity
        class ProgressReport < Rake::Funnel::Integration::ProgressReport
          include Rake::Funnel::Integration

          def initialize # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity
            super do
              task_starting do |task, _args|
                next unless TeamCity.running?

                unless TeamCity.rake_runner?
                  ServiceMessages.block_opened(name: task.name)
                end
              end

              task_finished do |task, _args, error|
                next unless TeamCity.running?

                if error.respond_to?(:inner_exception)
                  error = error.inner_exception
                end

                ServiceMessages.build_problem(description: error.message[0..4000 - 1]) if error

                next if Rake::Funnel::Integration::TeamCity.rake_runner?

                ServiceMessages.block_closed(name: task.name)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rake-funnel-0.21.2 lib/rake/funnel/integration/teamcity/progress_report.rb
rake-funnel-0.21.1 lib/rake/funnel/integration/teamcity/progress_report.rb
rake-funnel-0.21.0 lib/rake/funnel/integration/teamcity/progress_report.rb
rake-funnel-0.20.2 lib/rake/funnel/integration/teamcity/progress_report.rb
rake-funnel-0.20.1 lib/rake/funnel/integration/teamcity/progress_report.rb
rake-funnel-0.20.0 lib/rake/funnel/integration/teamcity/progress_report.rb
rake-funnel-0.19.0 lib/rake/funnel/integration/teamcity/progress_report.rb