Class: S3gb::JGit

Inherits:
Base
  • Object
show all
Defined in:
lib/s3gb/jgit.rb

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#backup, #collect_files, #commit_changes, #initialize

Constructor Details

This class inherits a constructor from S3gb::Base

Instance Method Details

#installObject



5
6
7
8
9
10
11
12
13
# File 'lib/s3gb/jgit.rb', line 5

def install
  require 'open-uri'
  page = open('http://www.eclipse.org/jgit/download/').read
  url = page.match(/"(.*?org.eclipse.jgit.*?.sh)"/)[1]
  file = File.basename(url)
  to = '/usr/bin/jgit'
  `sudo rm #{to}`
  `cd /tmp && rm #{file} ; wget #{url} && sudo mv #{file} #{to} && sudo chmod 755 #{to}`
end

#prepareObject



15
16
17
18
# File 'lib/s3gb/jgit.rb', line 15

def prepare
  ensure_jgit_config
  ensure_jgit_repo
end

#pushObject



20
21
22
# File 'lib/s3gb/jgit.rb', line 20

def push
  cmd "cd #{cache_dir} && jgit push s3 refs/heads/master"
end