Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Fix load-order dependency #64

Merged
merged 1 commit into from
Apr 8, 2015
Merged

Conversation

iancanderson
Copy link
Contributor

This fixes an unitialized constant CC::Service::GitHubPullRequests,
which was happening if CC::Service::GithubPullRequests::Presenter was loaded
before CC::Service::GithubPullRequests. Loading order is non-deterministic and
can differ depending on OS, since services are loaded via Dir[]).

Going forward, services that need a presenter class can require the presenter
themselves.

This fixes an `unitialized constant CC::Service::GitHubPullRequests`,
which was happening if `CC::Service::GithubPullRequests::Presenter` was loaded
before `CC::Service::GithubPullRequests`. Loading order is non-deterministic and
can differ depending on OS, since services are loaded via `Dir[]`).

Going forward, services that need a presenter class can require the presenter
themselves.
@@ -0,0 +1,62 @@
module CC
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was just moved from lib/cc/services to a new lib/cc/presenters directory, and nested under module CC and class Service, which is less susceptible to load order issues than doing class CC::Service::GithubPullRequestsPresenter

@noahd1
Copy link
Contributor

noahd1 commented Apr 8, 2015

LGTM

iancanderson added a commit that referenced this pull request Apr 8, 2015
@iancanderson iancanderson merged commit 4e2f98b into master Apr 8, 2015
@iancanderson iancanderson deleted the ia-fix-load-order-dependency branch April 8, 2015 15:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants