lib/pdd.rb in pdd-0.23.1 vs lib/pdd.rb in pdd-0.23.2
- old
+ new
@@ -1,6 +1,6 @@
-# Copyright (c) 2014-2022 Yegor Bugayenko
+# Copyright (c) 2014-2023 Yegor Bugayenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -28,11 +28,11 @@
require_relative 'pdd/rule/duplicates'
require_relative 'pdd/rule/roles'
# PDD main module.
# Author:: Yegor Bugayenko (yegor256@gmail.com)
-# Copyright:: Copyright (c) 2014-2022 Yegor Bugayenko
+# Copyright:: Copyright (c) 2014-2023 Yegor Bugayenko
# License:: MIT
module PDD
# If it breaks.
class Error < StandardError
end
@@ -143,10 +143,10 @@
def rules(xml)
doc = Nokogiri::XML(xml)
total = 0
list = @opts[:rule] || []
- unless list.select { |r| r.start_with?('max-duplicates:') }.empty?
+ unless list.none? { |r| r.start_with?('max-duplicates:') }
raise PDD::Error, 'You can\'t modify max-duplicates, it\'s always 1'
end
list.push('max-duplicates:1').map do |r|
name, value = r.split(':')