Sha256: ea48b2e007b55e2119f42af6afb44a5e2291dda5d7b827522689debf8ec8ea53

Contents?: true

Size: 726 Bytes

Versions: 43

Compression:

Stored size: 726 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.select{ |f| f.basename.to_s.match(pattern) }.first
        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

43 entries across 43 versions & 1 rubygems

Version Path
renalware-core-2.0.55 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.54 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.53 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.52 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.51 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.50 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.48 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.47 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.46 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.45 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.44 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.43 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.42 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.41 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.40 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.39 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.38 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.37 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.36 app/models/concerns/renalware/feeds/job.rb
renalware-core-2.0.35 app/models/concerns/renalware/feeds/job.rb