Class: Muwu::Publish

Inherits:
Object
  • Object
show all
Includes:
Muwu
Defined in:
lib/muwu/publish/publish.rb

Constant Summary

Constants included from Muwu

GEM_HOME_LIB, GEM_HOME_LIB_MUWU, VERSION

Instance Method Summary collapse

Methods included from Muwu

debug, read

Constructor Details

#initialize(project, args: []) ⇒ Publish

Returns a new instance of Publish.



8
9
10
11
12
13
# File 'lib/muwu/publish/publish.rb', line 8

def initialize(project, args: [])
  @path_local = project.path_compiled + File::SEPARATOR
  @path_remote = project.options.remote_publish
  @project = project
  @switches = args.push(project.options.rsync_options).flatten.sort.join(' ')
end

Instance Method Details

#upObject



16
17
18
19
20
21
22
# File 'lib/muwu/publish/publish.rb', line 16

def up
  if @project.exceptions_include?(ProjectException::OptionRemotePublishValueNil)
    raise ProjectExceptionHandler::Fatal.new(ProjectException::OptionRemotePublishValueNil.new)
  else
    exec_rsync(source: @path_local, target: @path_remote)
  end
end