Sha256: 5e38f27aac55199273b7f08361e692d397968e0657788e1cac65c409a281ca33

Contents?: true

Size: 796 Bytes

Versions: 17

Compression:

Stored size: 796 Bytes

Contents

# frozen_string_literal: true

module LicenseFinder
  module CLI
    module MakesDecisions
      def self.included(mod)
        mod.extend(ClassMethods)
      end

      module ClassMethods
        def auditable
          method_option :who, desc: 'The person making this decision'
          method_option :why, desc: 'The reason for making this decision'
          method_option :version, desc: 'The version that will be approved'
        end
      end

      private

      def txn
        @txn ||= {
          who: options[:who],
          why: options[:why],
          versions: options[:version] ? [options[:version]] : [],
          when: Time.now.getutc
        }
      end

      def modifying
        yield
        decisions.save!(config.decisions_file_path)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
license_finder-5.11.1 lib/license_finder/cli/makes_decisions.rb
license_finder-5.11.0 lib/license_finder/cli/makes_decisions.rb
license_finder-5.10.2 lib/license_finder/cli/makes_decisions.rb
license_finder-5.10.1 lib/license_finder/cli/makes_decisions.rb
license_finder-5.10.0 lib/license_finder/cli/makes_decisions.rb
license_finder-5.9.2 lib/license_finder/cli/makes_decisions.rb
license_finder-5.9.1 lib/license_finder/cli/makes_decisions.rb
license_finder-5.9.0 lib/license_finder/cli/makes_decisions.rb
license_finder-5.8.0 lib/license_finder/cli/makes_decisions.rb
license_finder-5.7.1 lib/license_finder/cli/makes_decisions.rb
license_finder-5.7.0 lib/license_finder/cli/makes_decisions.rb
license_finder-5.6.2 lib/license_finder/cli/makes_decisions.rb
license_finder-5.6.1 lib/license_finder/cli/makes_decisions.rb
license_finder-5.6.0 lib/license_finder/cli/makes_decisions.rb
license_finder-5.5.2 lib/license_finder/cli/makes_decisions.rb
license_finder-5.5.1 lib/license_finder/cli/makes_decisions.rb
license_finder-5.5.0 lib/license_finder/cli/makes_decisions.rb