Class: Six::Repositories::Rsync::App

Inherits:
Object
  • Object
show all
Defined in:
lib/six/rsync-app.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(folder) ⇒ App

Returns a new instance of App.



30
31
32
33
# File 'lib/six/rsync-app.rb', line 30

def initialize(folder)
  @folder = folder
  @repo = Six::Repositories::Rsync.open(folder, :log => logger)
end

Instance Attribute Details

#repoObject (readonly)

Returns the value of attribute repo.



24
25
26
# File 'lib/six/rsync-app.rb', line 24

def repo
  @repo
end

Class Method Details

.clone(folder) ⇒ Object



64
65
66
67
68
69
70
71
72
# File 'lib/six/rsync-app.rb', line 64

def self.clone(folder)
  pa = if folder[/[\/|\\]/]
    folder = File.basename(folder) 
    File.dirname(folder)
  else
    Dir.pwd
  end
  @repo = Six::Repositories::Rsync.clone(Six::Repositories::Rsync.host, folder, :path => pa, :log => Six::Repositories::Rsync.logger)
end

.commit(folder) ⇒ Object



46
47
48
49
50
# File 'lib/six/rsync-app.rb', line 46

def self.commit(folder)
  app = self.new(folder)
  app.repo.commit
  app
end

.convert(folder) ⇒ Object



82
83
84
85
86
87
88
# File 'lib/six/rsync-app.rb', line 82

def self.convert(folder)
#          if File.exists?(folder)
#            logger.error "#{folder} already exists!"
#            Process.exit
#          end
  Six::Repositories::Rsync.convert(folder, :log => Six::Repositories::Rsync.logger)
end

.info(folder) ⇒ Object



35
36
37
38
39
# File 'lib/six/rsync-app.rb', line 35

def self.info(folder)
  app = self.new(folder)
  app.repo.info
  app
end

.init(folder) ⇒ Object



74
75
76
77
78
79
80
# File 'lib/six/rsync-app.rb', line 74

def self.init(folder)
#          if File.exists?(folder)
#            logger.error "#{folder} already exists!"
#            Process.exit
#          end
  Six::Repositories::Rsync.init(folder, :log => Six::Repositories::Rsync.logger)
end

.open(folder) ⇒ Object



41
42
43
44
# File 'lib/six/rsync-app.rb', line 41

def self.open(folder)
  app = self.new(folder)
  app
end

.status(folder) ⇒ Object



58
59
60
61
62
# File 'lib/six/rsync-app.rb', line 58

def self.status(folder)
  app = self.new(folder)
  app.repo.status
  app
end

.update(folder) ⇒ Object



52
53
54
55
56
# File 'lib/six/rsync-app.rb', line 52

def self.update(folder)
  app = self.new(folder)
  app.repo.update
  app
end

Instance Method Details

#loggerObject



26
27
28
# File 'lib/six/rsync-app.rb', line 26

def logger
  Six::Repositories::Rsync.logger
end