Class: HGTK::Hg
- Inherits:
-
Object
- Object
- HGTK::Hg
- Defined in:
- lib/hgtk/hg.rb
Instance Attribute Summary (collapse)
-
- (Object) dir
readonly
Returns the value of attribute dir.
Instance Method Summary (collapse)
-
- (Object) incoming
Check for incoming changesets.
-
- (Hg) initialize(**kwargs)
constructor
A new instance of Hg.
-
- (Object) outgoing
Check for outgoing changesets.
-
- (Object) status
Check repo status (uncommitted changes).
-
- (Object) sync
Synchronize repository by pulling, then pushing.
Constructor Details
- (Hg) initialize(**kwargs)
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
- (Object) dir (readonly)
Returns the value of attribute dir
9 10 11 |
# File 'lib/hgtk/hg.rb', line 9 def dir @dir end |
Instance Method Details
- (Object) incoming
Check for incoming changesets.
28 29 |
# File 'lib/hgtk/hg.rb', line 28 def incoming end |
- (Object) outgoing
Check for outgoing changesets.
32 33 |
# File 'lib/hgtk/hg.rb', line 32 def outgoing end |
- (Object) status
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 |
- (Object) sync
Synchronize repository by pulling, then pushing.
36 37 |
# File 'lib/hgtk/hg.rb', line 36 def sync end |