Class: AgileNotifier::Git

Inherits:
SCM
  • Object
show all
Defined in:
lib/agile_notifier/git.rb

Defined Under Namespace

Classes: Repository

Instance Attribute Summary collapse

Attributes inherited from SCM

#args, #repositories, #url

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SCM

#add_repository, #repository

Constructor Details

#initialize(dir) ⇒ Git

Returns a new instance of Git.



7
8
9
# File 'lib/agile_notifier/git.rb', line 7

def initialize(dir)
  @repo = Repository.new(dir)
end

Instance Attribute Details

#repoObject

Returns the value of attribute repo.



5
6
7
# File 'lib/agile_notifier/git.rb', line 5

def repo
  @repo
end

Class Method Details

.combine_commands(*commands) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/agile_notifier/git.rb', line 12

def combine_commands(*commands)
  separator = ' && '
  combined_commands = commands.inject('') do |cmds, cmd|
    cmds += "#{cmd}#{separator}"
  end
  combined_commands.gsub!(/#{separator}$/, '')
end

.run_command(command) ⇒ Object



20
21
22
# File 'lib/agile_notifier/git.rb', line 20

def run_command(command)
  `#{command}`
end