Sha256: 444bd5ddfbe5b44f4a0db26e83da71bca160e2e8ea393abddae2e0a78b73797f

Contents?: true

Size: 1.04 KB

Versions: 58

Compression:

Stored size: 1.04 KB

Contents

require 'active_support/concern'

module NdrDevSupport
  module RakeCI
    module CommitCop
      # Deputisable cop concern
      module Deputisable
        extend ActiveSupport::Concern

        private

        def migration_file?
          proc do |file|
            if file.is_a?(Array)
              file.any?(&migration_file?)
            else
              file.start_with?(*NdrDevSupport::RakeCI::CommitCop.migration_paths) &&
                file =~ /\d{14}_.*\.rb\z/
            end
          end
        end

        def unscoped_migration_file?
          proc do |file|
            file.start_with?(*NdrDevSupport::RakeCI::CommitCop.migration_paths) &&
              file =~ /\d{14}_[^\.]*\.rb\z/
          end
        end

        def structure_dump_file?
          proc { |file| file =~ NdrDevSupport::RakeCI::CommitCop.structure_dump_pattern }
        end

        def attachment(severity, title, text)
          {
            color: severity.to_s, title: title, text: text, mrkdwn_in: ['text']
          }
        end
      end
    end
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
ndr_dev_support-5.4.5 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-5.4.4 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-5.4.3 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-5.4.2 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-5.4.1 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-5.4.0 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-5.3.1 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-5.3.0 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-5.2.0 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-5.1.0 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-5.0.1 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-5.0.0 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-4.2.1 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-4.2.0 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-4.1.3 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-4.1.2 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-4.1.1 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb
ndr_dev_support-4.1.0 lib/ndr_dev_support/rake_ci/commit_cop/concerns/deputisable.rb