Class: HGTK::Hg
- Inherits:
-
Object
- Object
- HGTK::Hg
- Defined in:
- lib/hgtk/hg.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
Instance Method Summary collapse
-
#incoming ⇒ Object
Check for incoming changesets.
-
#initialize(**kwargs) ⇒ Hg
constructor
A new instance of Hg.
-
#outgoing ⇒ Object
Check for outgoing changesets.
-
#status ⇒ Object
Check repo status (uncommitted changes).
-
#sync ⇒ Object
Synchronize repository by pulling, then pushing.
Constructor Details
#initialize(**kwargs) ⇒ Hg
Returns a new instance of Hg.
14 15 16 |
# File 'lib/hgtk/hg.rb', line 14 def initialize **kwargs @dir = kwargs.fetch :dir, Dir.pwd end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
9 10 11 |
# File 'lib/hgtk/hg.rb', line 9 def dir @dir end |
Instance Method Details
#incoming ⇒ Object
Check for incoming changesets.
28 29 |
# File 'lib/hgtk/hg.rb', line 28 def incoming end |
#outgoing ⇒ Object
Check for outgoing changesets.
32 33 |
# File 'lib/hgtk/hg.rb', line 32 def outgoing end |
#status ⇒ Object
Check repo status (uncommitted changes).
19 20 21 22 23 24 25 |
# File 'lib/hgtk/hg.rb', line 19 def status Dir["#{@dir}/*/.hg"] .map { |path| File.absolute_path File.dirname path } .each do |path| repo = HGTK::Repo.new path end end |
#sync ⇒ Object
Synchronize repository by pulling, then pushing.
36 37 |
# File 'lib/hgtk/hg.rb', line 36 def sync end |