Class: Upstream::PathChecker
- Inherits:
-
Object
- Object
- Upstream::PathChecker
- Defined in:
- lib/upstream.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(path) ⇒ PathChecker
constructor
A new instance of PathChecker.
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
#path ⇒ Object (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
50 51 52 |
# File 'lib/upstream.rb', line 50 def self.has_upstream?(path) new(path).check end |
Instance Method Details
#check ⇒ Object
54 55 56 |
# File 'lib/upstream.rb', line 54 def check `cd #{path} && git remote -v`.match(/upstream/) ? true : false end |