Class: RubyDeployer::FileSystemRepository

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_deployer/file_system_repository.rb

Instance Method Summary collapse

Constructor Details

#initializeFileSystemRepository

Returns a new instance of FileSystemRepository.



3
4
5
6
# File 'lib/ruby_deployer/file_system_repository.rb', line 3

def initialize
  @location = File.expand_path('~/.rubydeployer/artifacts')
  `mkdir -p #{@location}`
end

Instance Method Details

#get_latestObject



12
13
14
# File 'lib/ruby_deployer/file_system_repository.rb', line 12

def get_latest
  Dir.glob(File.join(@location, '*.zip')).last
end

#publish(file) ⇒ Object



8
9
10
# File 'lib/ruby_deployer/file_system_repository.rb', line 8

def publish file
  FileUtils.copy file, @location
end