Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
# Parse the existing file. def self.parse(file) unless file =~ /-([^-]+)$/ Puppet.warning "Could not extract interface name from %s; skipping" % file return nil end name = $1 instance = new(:name => name) return instance unless FileTest.exist?(file) File.readlines(file).each do |line| if line =~ /^(\w+)=(.+)$/ method = $1.downcase + "=" instance.send(method, $2) if instance.respond_to?(method) end end return instance end
This paste will be private.
From the Design Piracy series on my blog: