Class: DarcsConnection
- Inherits:
-
Object
- Object
- DarcsConnection
- Defined in:
- app/reporters/darcs_connection.rb
Instance Method Summary collapse
- #changes(options = nil) ⇒ Object
- #diff(patch_hash) ⇒ Object
-
#initialize(settings = DarcsSettingsProvider.new, runner = Runner.new, temp_repo = DarcsTempRepo.new) ⇒ DarcsConnection
constructor
A new instance of DarcsConnection.
- #pull ⇒ Object
Constructor Details
#initialize(settings = DarcsSettingsProvider.new, runner = Runner.new, temp_repo = DarcsTempRepo.new) ⇒ DarcsConnection
Returns a new instance of DarcsConnection.
27 28 29 30 31 32 |
# File 'app/reporters/darcs_connection.rb', line 27 def initialize(settings=DarcsSettingsProvider.new, runner=Runner.new, temp_repo = DarcsTempRepo.new) @settings = settings @runner = ChdirRunner.new(temp_repo.path, runner) end |
Instance Method Details
#changes(options = nil) ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'app/reporters/darcs_connection.rb', line 34 def changes(=nil) command = 'darcs changes --xml' if .nil? command += " --last=#{@settings.package_size}" elsif :all != command += " --from-match=\"hash #{}\"" + " --to-match=\"hash #{}\"" end @runner.run(command) end |
#diff(patch_hash) ⇒ Object
49 50 51 |
# File 'app/reporters/darcs_connection.rb', line 49 def diff(patch_hash) @runner.run("darcs diff -u --match \"hash #{patch_hash}\"") end |
#pull ⇒ Object
45 46 47 |
# File 'app/reporters/darcs_connection.rb', line 45 def pull @runner.run("darcs pull -a #{@settings.repo_url}") end |