Class: Gf::Repositry
- Inherits:
-
Object
- Object
- Gf::Repositry
- Defined in:
- lib/gf.rb
Instance Attribute Summary collapse
-
#owner_slash_repo ⇒ Object
readonly
Returns the value of attribute owner_slash_repo.
Instance Method Summary collapse
- #collect_pull_requested_files ⇒ Object
-
#initialize(owner_slash_repo) ⇒ Repositry
constructor
A new instance of Repositry.
Constructor Details
#initialize(owner_slash_repo) ⇒ Repositry
Returns a new instance of Repositry.
126 127 128 129 |
# File 'lib/gf.rb', line 126 def initialize(owner_slash_repo) @client = nil @owner_slash_repo = owner_slash_repo end |
Instance Attribute Details
#owner_slash_repo ⇒ Object (readonly)
Returns the value of attribute owner_slash_repo.
124 125 126 |
# File 'lib/gf.rb', line 124 def owner_slash_repo @owner_slash_repo end |
Instance Method Details
#collect_pull_requested_files ⇒ Object
131 132 133 134 135 136 137 138 139 |
# File 'lib/gf.rb', line 131 def collect_pull_requested_files pulls = client.pulls(owner_slash_repo, state: 'open').map { |pull| PullRequest.new(pull) } pulls.each_with_object(Hash.new {|h, path| h[path] = DiffFile.new(path) }) do |pull, files| pull.changed_files.each do |path| files[path] << pull end end end |