lib/signore/settings.rb in signore-0.6.0 vs lib/signore/settings.rb in signore-0.7.0
- old
+ new
@@ -1,7 +1,5 @@
-# frozen_string_literal: true
-
require 'pathname'
require_relative 'tags'
module Signore
class Settings
@@ -11,25 +9,19 @@
def action
args.first
end
- # :reek:UtilityFunction
- def repo_path
- dir = ENV.fetch('XDG_DATA_HOME') { File.expand_path('~/.local/share') }
- Pathname.new("#{dir}/signore/signatures.yml")
- 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[1..-1] or []
+ args.empty? ? [] : args[1..-1]
end
end
end