Sha256: 48b104623202033d4444f4239b7cd4ba3529909753b8babe3667ca32eaa30728

Contents?: true

Size: 465 Bytes

Versions: 1

Compression:

Stored size: 465 Bytes

Contents

require 'pathname'
require_relative 'tags'

module Signore
  class Settings
    def initialize(args = [])
      @args = args
    end

    def action
      args.first
    end

    def tags
      negated, required = tag_names.partition { |name| name.start_with?('~') }
      Tags.new(forbidden: negated.map { |neg| neg[1..-1] }, required: required)
    end

    private

    attr_reader :args

    def tag_names
      args.empty? ? [] : args[1..-1]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
signore-0.7.0 lib/signore/settings.rb