lib/pdd.rb in pdd-0.20.5 vs lib/pdd.rb in pdd-0.20.6
- old
+ new
@@ -1,6 +1,6 @@
-# Copyright (c) 2014-2019 Yegor Bugayenko
+# Copyright (c) 2014-2020 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-2019 Yegor Bugayenko
+# Copyright:: Copyright (c) 2014-2020 Yegor Bugayenko
# License:: MIT
module PDD
# If it breaks.
class Error < StandardError
end
@@ -85,14 +85,12 @@
def xml
dir = @opts[:source] ? @opts[:source] : Dir.pwd
PDD.log.info "Reading #{dir}"
require_relative 'pdd/sources'
sources = Sources.new(dir)
- unless @opts[:exclude].nil?
- @opts[:exclude].each do |p|
- sources = sources.exclude(p)
- PDD.log.info "Excluding #{p}"
- end
+ @opts[:exclude]&.each do |p|
+ sources = sources.exclude(p)
+ PDD.log.info "Excluding #{p}"
end
sanitize(
rules(
Nokogiri::XML::Builder.new do |xml|
xml << "<?xml-stylesheet type='text/xsl' href='#{xsl}'?>"