Permalink
Browse files

Merge pull request #20 from jbarnette/tests

More test cleanup
  • Loading branch information...
2 parents 362bd19 + 5ab5fb9 commit d26300b427a6971baf6169d521bcff60ee2f068b @dgraham dgraham committed Sep 12, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/vines/store.rb
View
@@ -43,10 +43,12 @@ def certs
unless @@sources
pattern = /-{5}BEGIN CERTIFICATE-{5}\n.*?-{5}END CERTIFICATE-{5}\n/m
pairs = Dir[File.join(@dir, '*.crt')].map do |name|
- pems = File.read(name).scan(pattern)
- certs = pems.map {|pem| OpenSSL::X509::Certificate.new(pem) }
- certs.reject! {|cert| cert.not_after < Time.now }
- [name, certs]
+ File.open(name, "r:UTF-8") do |f|
+ pems = f.read.scan(pattern)
+ certs = pems.map {|pem| OpenSSL::X509::Certificate.new(pem) }
+ certs.reject! {|cert| cert.not_after < Time.now }
+ [name, certs]
+ end
end
@@sources = Hash[pairs]
end

0 comments on commit d26300b

Please sign in to comment.