Class: Drupid::Updater::UpdateProjectAction

Inherits:
AbstractAction show all
Defined in:
lib/drupid/updater.rb

Direct Known Subclasses

InstallProjectAction

Instance Attribute Summary

Attributes inherited from AbstractAction

#component, #platform

Instance Method Summary collapse

Methods inherited from AbstractAction

#fire!, #pending?

Methods included from Drupid::Utils

#blah, #bzr, #compare_paths, #curl, #cvs, #debug, #dont_debug, #git, #hg, #ignore_interrupts, #interactive_shell, #odie, #ofail, #ohai, #owarn, #runBabyRun, #svn, #tempdir, #uncompress, #which, #writeFile

Constructor Details

#initialize(p, proj, opts = { :label => 'Update' }) ⇒ UpdateProjectAction

Returns a new instance of UpdateProjectAction.



592
593
594
595
596
597
# File 'lib/drupid/updater.rb', line 592

def initialize p, proj, opts = { :label => 'Update' }
  raise "#{proj.extended_name} does not exist locally" unless proj.exist?
  raise "Unknown type for #{proj.extended_name}" unless proj.proj_type
  @label = opts[:label]
  super(p, proj)
end

Instance Method Details

#msgObject



599
600
601
602
603
604
605
606
# File 'lib/drupid/updater.rb', line 599

def msg
  spc = ' ' * [0, 8 - @label.length].max
  if old_project = platform.get_project(component.name)
    "#{Tty.blue}[#{@label}]#{Tty.white}#{spc}#{component.name}: #{old_project.version.long} => #{component.version.long}#{Tty.reset} (#{platform.dest_path(component)})"
  else
    "#{Tty.blue}[#{@label}]#{Tty.white}#{spc}#{component.name}: => #{component.version.long}#{Tty.reset} (#{platform.dest_path(component)})"
  end
end