Sha256: aeab71c99c9ba9977e2506998ddac2ded97cdba3eecd1223804f045249c9d51a

Contents?: true

Size: 720 Bytes

Versions: 19

Compression:

Stored size: 720 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/feeds"

module Renalware
  module Feeds
    module Job
      extend ActiveSupport::Concern

      def formatted_exception(error)
        [
          "#{error.backtrace.first}: #{error.message} (#{error.class})",
          error.backtrace.drop(1).map{ |s| "\t#{s}" }
        ].join("\n")
      end

      def log(msg)
        Rails.logger.info(msg)
      end

      def find_file_in(files, pattern)
        file = files.detect{ |f| f.basename.to_s.match(pattern) }
        if file.nil?
          msg = "Zip file does not contain a file with name matching #{pattern}!"
          log(msg)
          fail(msg)
        end
        file
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
renalware-core-2.0.77 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.76 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.75 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.74 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.73 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.72 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.71 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.70 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.69 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.68 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.67 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.64 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.63 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.62 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.61 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.60 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.58 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.57 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.56 app/models/concerns/renalware/feeds/job.rb