Class: RubyDeployer::FileSystemRepository
- Inherits:
-
Object
- Object
- RubyDeployer::FileSystemRepository
- Defined in:
- lib/ruby_deployer/file_system_repository.rb
Instance Method Summary collapse
- #get_latest ⇒ Object
-
#initialize ⇒ FileSystemRepository
constructor
A new instance of FileSystemRepository.
- #publish(file) ⇒ Object
Constructor Details
#initialize ⇒ FileSystemRepository
Returns a new instance of FileSystemRepository.
3 4 5 6 |
# File 'lib/ruby_deployer/file_system_repository.rb', line 3 def initialize @location = File.('~/.rubydeployer/artifacts') `mkdir -p #{@location}` end |
Instance Method Details
#get_latest ⇒ Object
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 |