diff options
| author | Jack Nagel | 2015-04-25 22:07:06 -0400 |
|---|---|---|
| committer | Jack Nagel | 2015-04-25 23:14:05 -0400 |
| commit | 16dfe3dd4000ce3d97cb2a0087946c9b2ead5665 (patch) | |
| tree | 7ad33cac510a78e8d925c54e09be88294bdf39ab /Library/Homebrew/cmd | |
| parent | f5d6d80d5bac2c83a89021481812b461c54cfba3 (diff) | |
| download | brew-16dfe3dd4000ce3d97cb2a0087946c9b2ead5665.tar.bz2 | |
Add Formula#logs
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/gist-logs.rb | 5 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/postinstall.rb | 5 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/test.rb | 5 |
3 files changed, 6 insertions, 9 deletions
diff --git a/Library/Homebrew/cmd/gist-logs.rb b/Library/Homebrew/cmd/gist-logs.rb index 463fcc35c..768de6714 100644 --- a/Library/Homebrew/cmd/gist-logs.rb +++ b/Library/Homebrew/cmd/gist-logs.rb @@ -6,7 +6,7 @@ require 'stringio' module Homebrew def gistify_logs f - files = load_logs(f.name) + files = load_logs(f.logs) s = StringIO.new Homebrew.dump_verbose_config(s) @@ -58,9 +58,8 @@ module Homebrew request.basic_auth(user, password) end - def load_logs name + def load_logs(dir) logs = {} - dir = HOMEBREW_LOGS/name dir.children.sort.each do |file| contents = file.size? ? file.read : "empty log" logs[file.basename.to_s] = { :content => contents } diff --git a/Library/Homebrew/cmd/postinstall.rb b/Library/Homebrew/cmd/postinstall.rb index 5e9e956c8..b92eb40df 100644 --- a/Library/Homebrew/cmd/postinstall.rb +++ b/Library/Homebrew/cmd/postinstall.rb @@ -18,9 +18,8 @@ module Homebrew Utils.safe_fork do if Sandbox.available? && ARGV.sandbox? sandbox = Sandbox.new - logd = HOMEBREW_LOGS/formula.name - logd.mkpath - sandbox.record_log(logd/"sandbox.postinstall.log") + formula.logs.mkpath + sandbox.record_log(formula.logs/"sandbox.postinstall.log") sandbox.allow_write_temp_and_cache sandbox.allow_write_log(formula) sandbox.allow_write_cellar(formula) diff --git a/Library/Homebrew/cmd/test.rb b/Library/Homebrew/cmd/test.rb index 95736f3f0..8890797a8 100644 --- a/Library/Homebrew/cmd/test.rb +++ b/Library/Homebrew/cmd/test.rb @@ -38,9 +38,8 @@ module Homebrew Utils.safe_fork do if Sandbox.available? && ARGV.sandbox? sandbox = Sandbox.new - logd = HOMEBREW_LOGS/f.name - logd.mkpath - sandbox.record_log(logd/"sandbox.test.log") + formula.logs.mkpath + sandbox.record_log(formula.logs/"sandbox.test.log") sandbox.allow_write_temp_and_cache sandbox.allow_write_log(f) sandbox.exec(*args) |
