Class: Insync::Repository

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

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Repository

Returns a new instance of Repository.



9
10
11
12
13
# File 'lib/insync.rb', line 9

def initialize(path)
  @path = path
  @repo = Grit::Repo.new @path
  @branch = @repo    
end

Instance Method Details

#logObject



19
20
21
# File 'lib/insync.rb', line 19

def log
  @branch.log
end

#pathObject



15
16
17
# File 'lib/insync.rb', line 15

def path
  @path
end

#remote_logObject



23
24
25
26
27
# File 'lib/insync.rb', line 23

def remote_log
  g = Git.open @path
  g.fetch
  @branch.log("origin/master")
end

#remote_origin_exists?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/insync.rb', line 29

def remote_origin_exists?
  return @repo.remotes.any? { |remote| remote.name == "origin/master" }
end