Class: Commenter::GitHubIssueRetriever
- Inherits:
-
Object
- Object
- Commenter::GitHubIssueRetriever
- Defined in:
- lib/commenter/github_integration.rb
Instance Method Summary collapse
-
#initialize(config_path) ⇒ GitHubIssueRetriever
constructor
A new instance of GitHubIssueRetriever.
- #retrieve_observations_from_yaml(yaml_file, options = {}) ⇒ Object
Constructor Details
#initialize(config_path) ⇒ GitHubIssueRetriever
Returns a new instance of GitHubIssueRetriever.
299 300 301 302 303 304 |
# File 'lib/commenter/github_integration.rb', line 299 def initialize(config_path) @session = GitHubSession.new(config_path) @config = @session.config @github_client = @session.client @repo = @session.repo end |
Instance Method Details
#retrieve_observations_from_yaml(yaml_file, options = {}) ⇒ Object
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 |
# File 'lib/commenter/github_integration.rb', line 306 def retrieve_observations_from_yaml(yaml_file, = {}) data = YAML.load_file(yaml_file) comment_sheet = CommentSheet.from_hash(data) results = [] comment_sheet.comments.each do |comment| next unless comment.has_github_issue? result = if [:dry_run] preview_observation_retrieval(comment, ) else retrieve_observation(comment, ) end results << result end # Update YAML with observations (unless dry run) update_yaml_with_observations(yaml_file, comment_sheet, ) unless [:dry_run] results end |