Skip to content

Commit

Permalink
Newline fun across platforms. It was only working on the mac because …
Browse files Browse the repository at this point in the history
…of some differences in newline handling.
  • Loading branch information
hackerdude committed Jul 17, 2010
1 parent 73e4846 commit f31de38
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require 'rubygems'
require 'rake'
require 'echoe'

Echoe.new("mediainfo-ruby", "0.1.4") do |p|
Echoe.new("mediainfo-ruby", "0.1.6") do |p|
p.description = "MediaInfo Ruby Bridge. Call MediaInfo lib directly"
p.url = "http://github.com/hackerdude/mediainfo-ruby"
p.author = "David Martinez"
Expand Down
8 changes: 5 additions & 3 deletions lib/mediainfo-ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,22 @@ def option_definitions(remove_deprecated=true)
current = :general
switching = true
current_map = option_map[:general]
option_defs = self.option("Info_Parameters_CSV", "").split("\r").each{|row|
option_defs = self.option("Info_Parameters_CSV", "").each_line{|row|
if row.strip == ""
switching = true
else
kv = row.split(";")
if kv.length == 1 && switching
topic = kv[0].downcase.to_sym
topic = kv[0].chomp.downcase.to_sym
current_map = option_map[topic]
if current_map.nil?
option_map[topic] = current_map = {}
end
switching = false
else
current_map[kv[0]] = kv[1] unless remove_deprecated && kv[1].nil? ? false : kv[1].include?("Deprecated")
key = kv[0]
value = kv[1].nil? ? nil : kv[1].chomp
current_map[key] = value unless remove_deprecated && kv[1].nil? ? false : kv[1].include?("Deprecated")
end
end
}
Expand Down

0 comments on commit f31de38

Please sign in to comment.