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
28 29 30 31 32 33 |
# File 'app/reporters/darcs_connection.rb', line 28 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
35 36 37 38 39 40 41 42 43 44 |
# File 'app/reporters/darcs_connection.rb', line 35 def changes(=nil) command = 'darcs changes --xml' if .nil? command += " --last=#{@settings.package_size}" elsif :all != command += " --from-match=\"hash #{options}\"" + " --to-match=\"hash #{options}\"" end @runner.run(command) end |
#diff(patch_hash) ⇒ Object
50 51 52 |
# File 'app/reporters/darcs_connection.rb', line 50 def diff(patch_hash) @runner.run("darcs diff -u --match \"hash #{patch_hash}\"") end |
#pull ⇒ Object
46 47 48 |
# File 'app/reporters/darcs_connection.rb', line 46 def pull @runner.run("darcs pull -a #{@settings.repo_url}") end |