Class: Insync::Repository
- Inherits:
-
Object
- Object
- Insync::Repository
- Defined in:
- lib/insync.rb
Instance Method Summary collapse
-
#initialize(path) ⇒ Repository
constructor
A new instance of Repository.
- #log ⇒ Object
- #path ⇒ Object
- #remote_log ⇒ Object
- #remote_origin_exists? ⇒ Boolean
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
#log ⇒ Object
19 20 21 |
# File 'lib/insync.rb', line 19 def log @branch.log end |
#path ⇒ Object
15 16 17 |
# File 'lib/insync.rb', line 15 def path @path end |
#remote_log ⇒ Object
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
29 30 31 |
# File 'lib/insync.rb', line 29 def remote_origin_exists? return @repo.remotes.any? { |remote| remote.name == "origin/master" } end |