Class: Upstream::PathChecker

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ PathChecker

Returns a new instance of PathChecker.



46
47
48
# File 'lib/upstream.rb', line 46

def initialize(path)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



44
45
46
# File 'lib/upstream.rb', line 44

def path
  @path
end

Class Method Details

.has_upstream?(path) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/upstream.rb', line 50

def self.has_upstream?(path)
  new(path).check
end

Instance Method Details

#checkObject



54
55
56
# File 'lib/upstream.rb', line 54

def check
  `cd #{path} && git remote -v`.match(/upstream/) ? true : false
end