Skip to content

Commit

Permalink
updated tagging to work with comments rather than a method
Browse files Browse the repository at this point in the history
  • Loading branch information
drewolson committed May 20, 2008
1 parent 4e5077a commit d79f292
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 21 deletions.
1 change: 0 additions & 1 deletion lib/test_sweet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require 'need'
need{'test_sweet/page'}
need{'test_sweet/site'}
need{'test_sweet/tag'}
need{'test_sweet/filter_error'}

module TestSweet
Expand Down
2 changes: 1 addition & 1 deletion lib/test_sweet/site.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Site
attr_reader :environment

def self.flow(name,&block)
class_eval{define_method(name,&block)}
self.send(:define_method,name,&block)
end

def initialize
Expand Down
3 changes: 0 additions & 3 deletions lib/test_sweet/tag.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/test_sweet/tag_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def filter(pattern,tags)

def contains_tags?(file_name,tags)
file_string = File.open(file_name).read
tags.all? { |tag| file_string =~ /TestSweet\.tag( :\w+,)* :#{tag}( :\w+,)*/ }
tags.all? { |tag| file_string =~ /#\s?tags:(\s?\w+,)* #{tag},?(\s?\w+,)*/ }
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/tag_files/tag_file_a.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TestSweet.tag :a
#tags: a
2 changes: 1 addition & 1 deletion test/tag_files/tag_file_a_b.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TestSweet.tag :a, :b
# tags: a, b
2 changes: 1 addition & 1 deletion test/tag_files/tag_file_b.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
TestSweet.tag :b
#tags: b
12 changes: 0 additions & 12 deletions test/test_tag.rb

This file was deleted.

0 comments on commit d79f292

Please sign in to comment.