Permalink
Browse files

Add --non-transitive-tag TAG to mark a tag as not transitive

Closes #571
  • Loading branch information...
lsegal committed Jul 14, 2012
1 parent 02db880 commit 09c9596f99b179a58cfbc2a8276ce77c355b1c10
Showing with 12 additions and 2 deletions.
  1. +6 −2 lib/yard/cli/yardoc.rb
  2. +6 −0 spec/cli/yardoc_spec.rb
View
@@ -790,8 +790,12 @@ def tag_options(opts)
self.hidden_tags |= [tag.to_sym]
end
- opts.on('--transitive-tag TAG', 'Adds a transitive tag') do |tag|
- Tags::Library.transitive_tags += [tag.to_sym]
+ opts.on('--transitive-tag TAG', 'Marks a tag as transitive') do |tag|
+ Tags::Library.transitive_tags |= [tag.to_sym]
+ end
+
+ opts.on('--non-transitive-tag TAG', 'Marks a tag as not transitive') do |tag|
+ Tags::Library.transitive_tags -= [tag.to_sym]
end
end
end
View
@@ -681,6 +681,12 @@ def tag_hidden(tag)
@yardoc.parse_arguments('--transitive-tag', 'foo')
Tags::Library.transitive_tags.should include(:foo)
end
+
+ it "should accept --non-transitive-tag" do
+ Tags::Library.transitive_tags |= [:foo]
+ @yardoc.parse_arguments('--non-transitive-tag', 'foo')
+ Tags::Library.transitive_tags.should_not include(:foo)
+ end
end
describe 'Safe mode' do

0 comments on commit 09c9596

Please sign in to comment.