Skip to content

Commit

Permalink
Fixing bug with tags that have multiple dashes.
Browse files Browse the repository at this point in the history
Documenting comments and custom tags.
  • Loading branch information
Brandon Arbini committed Aug 27, 2010
1 parent 6da4ddf commit 831dae7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,18 @@ Set an individual tag value:

m3u[:targetduration] = 100

Add a tag to the M3U index:
Add a tag to the M3U index (custom tags even):

m3u.add_tag do |tag|
tag.name = "VERSION"
tag.value = "1"
end

Add a comment:

m3u << "Comment"
m3u.add_comment("Comment")


NOTES
------
Expand Down
2 changes: 1 addition & 1 deletion lib/m3uzi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def add_tag(&block)
end

def [](key)
tag_name = key.to_s.upcase.sub("_", "-")
tag_name = key.to_s.upcase.gsub("_", "-")
obj = tags.detect{|tag| tag.name == tag_name }
obj && obj.value
end
Expand Down
2 changes: 1 addition & 1 deletion lib/m3uzi/tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Tag
attr_accessor :value

def name=(n)
@name = n.to_s.upcase.sub("_", "-")
@name = n.to_s.upcase.gsub("_", "-")
end

end
Expand Down
2 changes: 1 addition & 1 deletion lib/m3uzi/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class M3Uzi
VERSION = '0.1.1'
VERSION = '0.1.2'
end

0 comments on commit 831dae7

Please sign in to comment.