Class: Overcommit::HookContext::PrePush

Inherits:
Base
  • Object
show all
Defined in:
lib/overcommit/hook_context/pre_push.rb

Overview

Contains helpers related to contextual information used by pre-push hooks.

Defined Under Namespace

Classes: PushedRef

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#all_files, #cleanup_environment, #execute_hook, #hook_class_name, #hook_script_name, #hook_type_name, #initialize, #input_lines, #input_string, #modified_files, #setup_environment

Constructor Details

This class inherits a constructor from Overcommit::HookContext::Base

Instance Attribute Details

#argsObject

Returns the value of attribute args


4
5
6
# File 'lib/overcommit/hook_context/pre_push.rb', line 4

def args
  @args
end

Instance Method Details

#pushed_refsObject


14
15
16
17
18
# File 'lib/overcommit/hook_context/pre_push.rb', line 14

def pushed_refs
  input_lines.map do |line|
    PushedRef.new(*line.split(' '))
  end
end

#remote_nameObject


6
7
8
# File 'lib/overcommit/hook_context/pre_push.rb', line 6

def remote_name
  @args[0]
end

#remote_urlObject


10
11
12
# File 'lib/overcommit/hook_context/pre_push.rb', line 10

def remote_url
  @args[1]
end