module Hookshot
Constants
- VERSION
Public Class Methods
current_working_directory()
click to toggle source
# File lib/hookshot.rb, line 29 def self.current_working_directory path = @current_working_directory || Dir.pwd Pathname.new(path) end
link(current_working_directory: nil)
click to toggle source
# File lib/hookshot.rb, line 14 def self.link(current_working_directory: nil) @current_working_directory = current_working_directory HooksDirectory.create_with_default_hooks unless HooksDirectory.exists? HooksDirectory.hooks.each do |hook| git_hook = GitHook.new(name: hook.name) next if git_hook.symlink? git_hook.backup if git_hook.file? git_hook.symlink(to: hook) end end
with_captured_stdout() { || ... }
click to toggle source
# File lib/hookshot.rb, line 34 def self.with_captured_stdout old_stdout = $stdout $stdout = StringIO.new yield $stdout.string ensure $stdout = old_stdout end