Class: Danger::GitRepo
- Inherits:
-
Object
- Object
- Danger::GitRepo
- Defined in:
- lib/danger/scm_source/git_repo.rb
Instance Attribute Summary collapse
-
#diff ⇒ Object
Returns the value of attribute diff.
-
#log ⇒ Object
Returns the value of attribute log.
Instance Method Summary collapse
Instance Attribute Details
#diff ⇒ Object
Returns the value of attribute diff.
7 8 9 |
# File 'lib/danger/scm_source/git_repo.rb', line 7 def diff @diff end |
#log ⇒ Object
Returns the value of attribute log.
7 8 9 |
# File 'lib/danger/scm_source/git_repo.rb', line 7 def log @log end |
Instance Method Details
#diff_for_folder(folder, from: "master", to: 'HEAD') ⇒ Object
9 10 11 12 13 |
# File 'lib/danger/scm_source/git_repo.rb', line 9 def diff_for_folder(folder, from: "master", to: 'HEAD') repo = Git.open folder self.diff = repo.diff(from, to) self.log = repo.log.between(from, to) end |
#exec(string) ⇒ Object
15 16 17 |
# File 'lib/danger/scm_source/git_repo.rb', line 15 def exec(string) `git #{string}`.strip end |