lib/pdd.rb in pdd-0.2.3 vs lib/pdd.rb in pdd-0.3
- old
+ new
@@ -64,14 +64,19 @@
# Generate XML.
def xml
dir = @opts.source? ? @opts[:source] : Dir.pwd
PDD.log.info "reading #{dir}"
+ sources = Sources.new(dir)
+ @opts[:exclude].each do |p|
+ sources = sources.exclude(p)
+ PDD.log.info "excluding #{p}"
+ end unless @opts[:exclude].nil?
sanitize(
Nokogiri::XML::Builder.new do |xml|
xml << '<?xml-stylesheet type="text/xsl" href="puzzles.xsl"?>'
xml.puzzles do
- Sources.new(dir).fetch.each do |source|
+ sources.fetch.each do |source|
source.puzzles.each do |puzzle|
PDD.log.info "puzzle #{puzzle.props[:ticket]}:" \
"#{puzzle.props[:estimate]}/#{puzzle.props[:role]}" \
" at #{puzzle.props[:file]}"
render puzzle, xml