Skip to content
Browse files

changed test file names. minor comment typos

git-svn-id: svn+ssh://rubyforge.org/var/svn/builder/trunk@108 b15df707-ad1a-0410-81b8-e991873a3486
  • Loading branch information...
1 parent a0d873b commit 3893715f432bd7fbebce23ef5570701e2c1fa28a jimweirich committed Aug 25, 2007
View
34 Rakefile
@@ -158,6 +158,40 @@ task :dbg do
FileList['**/*.rb'].egrep /\bDBG|\bbreakpoint\b/
end
+
+# RCov ---------------------------------------------------------------
+begin
+ require 'rcov/rcovtask'
+
+ Rcov::RcovTask.new do |t|
+ t.libs << "test"
+ t.rcov_opts = [
+ '-xRakefile', '--text-report'
+ ]
+ t.test_files = FileList[
+ 'test/test*.rb'
+ ]
+ t.output_dir = 'coverage'
+ t.verbose = true
+ end
+rescue LoadError
+ # No rcov available
+end
+
+# Tags file ----------------------------------------------------------
+
+namespace "tags" do
+ desc "Create a TAGS file"
+ task :emacs => "TAGS"
+
+ TAGS = 'xctags -e'
+
+ file "TAGS" => SRC_RB do
+ puts "Makings TAGS"
+ sh "#{TAGS} #{SRC_RB}", :verbose => false
+ end
+end
+
# --------------------------------------------------------------------
# Creating a release
View
96 TAGS
@@ -0,0 +1,96 @@
+
+lib/blankslate.rb,456
+class BlankSlateBlankSlate17,621
+ def hide(name)hide22,788
+ def find_hidden_method(name)find_hidden_method31,1032
+ def reveal(name)reveal38,1268
+module KernelKernel59,2019
+ def method_added(name)method_added65,2195
+class ObjectObject77,2474
+ def method_added(name)method_added83,2649
+ def find_hidden_method(name)find_hidden_method90,2810
+class ModuleModule103,3241
+ def append_features(mod)append_features105,3314
+
+lib/builder.rb,0
+
+lib/builder/blankslate.rb,30
+module BuilderBuilder18,555
+
+lib/builder/css.rb,1102
+module BuilderBuilder23,757
+ class CSS < BlankSlateCSS92,2139
+ def initialize(indent=2)initialize101,2424
+ def +(part)+108,2562
+ def >>(part)>>113,2623
+ def >(part)>118,2684
+ def |(part)|123,2745
+ def target!target!129,2845
+ def comment!(comment_text)comment!134,2934
+ def id!(arg, &block)id!138,3017
+ def class!(arg, &block)class!145,3170
+ def store!(sym, &block)store!152,3326
+ def group!(*args, &block)group!156,3399
+ def method_missing(sym, *args, &block)method_missing171,3712
+ def nil?nil?190,4216
+ def _unify_block_unify_block195,4262
+ def _join_with_op!(op)_join_with_op!200,4343
+ def _text(text)_text205,4464
+ def _css_block(block)_css_block209,4514
+ def _end_block_end_block216,4634
+ def _newline_newline221,4696
+ def _indent_indent225,4743
+ def _nested_structures(block)_nested_structures229,4794
+ def _start_container(sym, atts = {}, with_bracket = true)_start_container235,4917
+ def _end_container_end_container242,5192
+ def _css_line(sym, *args)_css_line246,5244
+
+lib/builder/xchar.rb,316
+module BuilderBuilder11,321
+ def self.check_for_name_collision(klass, method_name, defined_constant=nil)check_for_name_collision12,336
+module BuilderBuilder26,793
+ module XChar # :nodoc:XChar32,992
+class FixnumFixnum89,2943
+ def xchrxchr93,3034
+class StringString108,3356
+ def to_xsto_xs110,3401
+
+lib/builder/xmlbase.rb,619
+module BuilderBuilder5,51
+ class IllegalBlockError < RuntimeError; endIllegalBlockError8,97
+ class XmlBase < BlankSlateXmlBase12,264
+ def initialize(indent=0, initial=0)initialize22,602
+ def tag!(sym, *args, &block)tag!30,881
+ def method_missing(sym, *args, &block)method_missing37,1138
+ def text!(text)text!80,2188
+ def <<(text)<<97,2847
+ def nil?nil?107,3278
+ def _escape(text)_escape114,3357
+ def _escape_quote(text)_escape_quote118,3405
+ def _newline_newline122,3494
+ def _indent_indent127,3570
+ def _nested_structures(block)_nested_structures132,3681
+
+lib/builder/xmlevents.rb,216
+module BuilderBuilder14,315
+ class XmlEvents < XmlMarkupXmlEvents48,1598
+ def text!(text)text!49,1628
+ def _start_tag(sym, attrs, end_too=false)_start_tag53,1682
+ def _end_tag(sym)_end_tag58,1804
+
+lib/builder/xmlmarkup.rb,774
+module BuilderBuilder16,425
+ class XmlMarkup < XmlBaseXmlMarkup160,5949
+ def initialize(options={})initialize185,7002
+ def target!target!193,7227
+ def comment!(comment_text)comment!197,7266
+ def declare!(inst, *args, &block)declare!208,7562
+ def instruct!(directive_tag=:xml, attrs={})instruct!238,8253
+ def cdata!(text)cdata!259,8788
+ def _text(text)_text270,9112
+ def _special(open, close, data=nil, attrs=nil, order=[])_special275,9202
+ def _start_tag(sym, attrs, end_too=false)_start_tag286,9536
+ def _end_tag(sym)_end_tag294,9735
+ def _insert_attributes(attrs, order=[])_insert_attributes299,9844
+ def _attr_value(value)_attr_value310,10159
+ def _ensure_no_block(got_block)_ensure_no_block319,10304
View
2 lib/builder/xchar.rb
@@ -10,7 +10,7 @@
module Builder
def self.check_for_name_collision(klass, method_name, defined_constant=nil)
- if klass.instance_methods.include?(method_name)
+ if klass.instance_methods.include?(method_name.to_s)
fail RuntimeError,
"Name Collision: Method '#{method_name}' is already defined in #{klass}"
end
View
6 lib/builder/xmlbase.rb
@@ -25,7 +25,7 @@ def initialize(indent=0, initial=0)
end
# Create a tag named +sym+. Other than the first argument which
- # is the tag name, the arguements are the same as the tags
+ # is the tag name, the arguments are the same as the tags
# implemented via <tt>method_missing</tt>.
def tag!(sym, *args, &block)
method_missing(sym.to_sym, *args, &block)
@@ -74,15 +74,15 @@ def method_missing(sym, *args, &block)
end
# Append text to the output target. Escape any markup. May be
- # used within the markup brakets as:
+ # used within the markup brackets as:
#
# builder.p { |b| b.br; b.text! "HI" } #=> <p><br/>HI</p>
def text!(text)
_text(_escape(text))
end
# Append text to the output target without escaping any markup.
- # May be used within the markup brakets as:
+ # May be used within the markup brackets as:
#
# builder.p { |x| x << "<br/>HI" } #=> <p><br/>HI</p>
#
View
0 test/testblankslate.rb → test/test_blankslate.rb
File renamed without changes.
View
0 test/testcssbuilder.rb → test/test_cssbuilder.rb
File renamed without changes.
View
0 test/testeventbuilder.rb → test/test_eventbuilder.rb
File renamed without changes.
View
0 test/testmarkupbuilder.rb → test/test_markupbuilder.rb
File renamed without changes.
View
29 test/test_namecollision.rb
@@ -0,0 +1,29 @@
+#!/usr/bin/env ruby
+
+require 'test/unit'
+require 'builder/xchar'
+
+class TestNameCollisions < Test::Unit::TestCase
+ module Collide
+ def xchr
+ end
+ end
+
+ def test_no_collision
+ assert_nothing_raised do
+ Builder.check_for_name_collision(Collide, :not_defined)
+ end
+ end
+
+ def test_collision
+ assert_raise RuntimeError do
+ Builder.check_for_name_collision(Collide, "xchr")
+ end
+ end
+
+ def test_collision_with_symbol
+ assert_raise RuntimeError do
+ Builder.check_for_name_collision(Collide, :xchr)
+ end
+ end
+end

0 comments on commit 3893715

Please sign in to comment.
Something went wrong with that request. Please try again.