Permalink
Browse files

Added the tag view to the Tag#inspect method

  • Loading branch information...
Jack Chen
Jack Chen committed Apr 19, 2010
1 parent 6107519 commit 4214a8d2af2f12b79be76f7fe7c916f9351382c3
Showing with 6 additions and 6 deletions.
  1. +1 −1 lib/dmap.rb
  2. +5 −5 lib/dmap/tag.rb
View
@@ -2,7 +2,7 @@
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
class DMAP
- VERSION = '0.2.5'
+ VERSION = '0.2.6'
end
Dir[File.dirname(__FILE__) + "/dmap/**.rb"].each { |f| require f }
View
@@ -65,22 +65,22 @@ def inspect(level = 0)
case value
when Array
if value.any? { |e| e.is_a? Tag }
- (["#{pad}#{code}[#{length}]:"] + value.map{ |v| v.inspect(level + 1) }).join("\n")
+ (["#{pad}#{code}[#{length}]: #{tag}"] + value.map{ |v| v.inspect(level + 1) }).join("\n")
else
- "#{pad}#{code}[#{length}]: #{value.inspect}"
+ "#{pad}#{code}[#{length}]: #{value.inspect} - #{tag}"
end
else
- "#{pad}#{code}[#{length}]: #{value.inspect}"
+ "#{pad}#{code}[#{length}]: #{value.inspect} - #{tag}"
end
end
def to_dsl(level = 0)
pad = ' ' * (level * 2)
case value
when Array
- (["#{pad}#{code} do # #{@tag}"] + value.map{ |v| v.to_dsl(level + 1) } + ["#{pad}end"]).join("\n")
+ (["#{pad}#{code} do # #{tag}"] + value.map{ |v| v.to_dsl(level + 1) } + ["#{pad}end"]).join("\n")
else
- "#{pad}#{code} #{value.inspect} # #{@tag}"
+ "#{pad}#{code} #{value.inspect} # #{tag}"
end
end

0 comments on commit 4214a8d

Please sign in to comment.