Class: BetweenMeals::Repo

Inherits:
Object
  • Object
show all
Defined in:
lib/between_meals/repo.rb,
lib/between_meals/repo/git.rb,
lib/between_meals/repo/svn.rb

Overview

Local checkout wrapper

Direct Known Subclasses

Git, Svn

Defined Under Namespace

Classes: Git, Svn

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo_path, logger) ⇒ Repo

Returns a new instance of Repo.



25
26
27
28
29
30
31
32
33
34
# File 'lib/between_meals/repo.rb', line 25

def initialize(repo_path, logger)
  @repo_path = repo_path
  @logger = logger
  @repo = nil
  @bin = nil
  setup
rescue
  @logger.warn("Unable to read repo from #{File.expand_path(repo_path)}")
  exit(1)
end

Instance Attribute Details

#bin=(value) ⇒ Object (writeonly)

Sets the attribute bin

Parameters:

  • value

    the value to set the attribute bin to.



23
24
25
# File 'lib/between_meals/repo.rb', line 23

def bin=(value)
  @bin = value
end

#repo_pathObject (readonly)

Returns the value of attribute repo_path.



22
23
24
# File 'lib/between_meals/repo.rb', line 22

def repo_path
  @repo_path
end

Class Method Details

.get(type, repo_path, logger) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/between_meals/repo.rb', line 36

def self.get(type, repo_path, logger)
  case type
  when 'svn'
    require 'between_meals/repo/svn'
    BetweenMeals::Repo::Svn.new(repo_path, logger)
  when 'git'
    require 'between_meals/repo/git'
    BetweenMeals::Repo::Git.new(repo_path, logger)
  else
    fail "Do not know repo type #{type}"
  end
end

Instance Method Details

#changes(_start_ref, _end_ref) ⇒ Object

Return files changed between two revisions



86
87
88
# File 'lib/between_meals/repo.rb', line 86

def changes(_start_ref, _end_ref)
  fail 'Not implemented'
end

#checkoutObject



107
108
109
# File 'lib/between_meals/repo.rb', line 107

def checkout
  fail 'Not implemented'
end

#create(_url) ⇒ Object



81
82
83
# File 'lib/between_meals/repo.rb', line 81

def create(_url)
  fail 'Not implemented'
end

#exists?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/between_meals/repo.rb', line 49

def exists?
  fail 'Not implemented'
end

#filesObject

Return all files



95
96
97
# File 'lib/between_meals/repo.rb', line 95

def files
  fail 'Not implemented'
end

#headObject



103
104
105
# File 'lib/between_meals/repo.rb', line 103

def head
  fail 'Not implemented'
end

#head_msgObject



65
66
67
# File 'lib/between_meals/repo.rb', line 65

def head_msg
  fail 'Not implemented'
end

#head_msg=Object



69
70
71
# File 'lib/between_meals/repo.rb', line 69

def head_msg=
  fail 'Not implemented'
end

#head_parentsObject



73
74
75
# File 'lib/between_meals/repo.rb', line 73

def head_parents
  fail 'Not implemented'
end

#head_revObject



61
62
63
# File 'lib/between_meals/repo.rb', line 61

def head_rev
  fail 'Not implemented'
end

#last_authorObject



115
116
117
# File 'lib/between_meals/repo.rb', line 115

def last_author
  fail 'Not implemented'
end

#last_msgObject



119
120
121
# File 'lib/between_meals/repo.rb', line 119

def last_msg
  fail 'Not implemented'
end

#last_msg=Object



123
124
125
# File 'lib/between_meals/repo.rb', line 123

def last_msg=
  fail 'Not implemented'
end

#latest_revisionObject



77
78
79
# File 'lib/between_meals/repo.rb', line 77

def latest_revision
  fail 'Not implemented'
end

#setupObject



57
58
59
# File 'lib/between_meals/repo.rb', line 57

def setup
  fail 'Not implemented'
end

#statusObject



53
54
55
# File 'lib/between_meals/repo.rb', line 53

def status
  fail 'Not implemented'
end

#updateObject



90
91
92
# File 'lib/between_meals/repo.rb', line 90

def update
  fail 'Not implemented'
end