Module: DevopsHelper::GvcsHelper

Included in:
VcsHelper
Defined in:
lib/devops_helper/vcs_helper.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(mtd, *args, &block) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/devops_helper/vcs_helper.rb', line 29

def method_missing(mtd, *args, &block)
  ws = Gvcs::Workspace.new(vcs,@root)
  if ws.respond_to?(mtd)
    ws.send(mtd,*args,&block)
  else
    super
  end 
end

Instance Method Details

#has_new_changes?Boolean

Returns:

  • (Boolean)


17
18
19
20
21
22
23
# File 'lib/devops_helper/vcs_helper.rb', line 17

def has_new_changes?
  ws = Gvcs::Workspace.new(vcs,@root)
  
  nst, nf = ws.new_files

  nf.length > 0 
end

#has_pending_changes?Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
14
15
# File 'lib/devops_helper/vcs_helper.rb', line 8

def has_pending_changes?
  ws = Gvcs::Workspace.new(vcs,@root)
  
  mst, mf = ws.modified_files
  dst, df = ws.deleted_files

  mf.length > 0 or df.length > 0
end

#is_workspace?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/devops_helper/vcs_helper.rb', line 25

def is_workspace?
  Gvcs::Workspace.new(vcs,@root).is_workspace?
end