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

Add engine_config class #13

Merged
merged 1 commit into from
Oct 19, 2015
Merged

Conversation

BlakeWilliams
Copy link
Contributor

This adds the EngineConfig class for normalizing the passed in engine
config in a single place instead of using fetch all over the codebase
with hardcoded paths.

This also fixes the path mass_threshold looks for when fetching the
config.

@BlakeWilliams
Copy link
Contributor Author

cc @codeclimate/review

map[language.downcase] = {}
end
elsif languages.is_a?(Hash)
languages.each_with_object({}) do |language, map|
Copy link
Contributor

Choose a reason for hiding this comment

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

What if we did something like |(key, value), map| here instead of doing the deconstructing in the line below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hah, I did [] last time. Too much Elixir. 😄

@BlakeWilliams
Copy link
Contributor Author

Good to go?

@@ -29,7 +29,7 @@ def run
end

def mass_threshold
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe now is not the time, but it seems like these per-language main classes are a good case for inheritance?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I started thinking the same thing and was going to look into it after this PR is good to go.

@wfleming
Copy link
Contributor

One refactor suggestion, but maybe it should be saved for later. LGTM.

@BlakeWilliams
Copy link
Contributor Author

Yeah, I think it's a separate concern so I'll handle that in another PR.

@BlakeWilliams
Copy link
Contributor Author

Thanks for the reviews!

This adds the `EngineConfig` class for normalizing the passed in engine
config in a single place instead of using `fetch` all over the codebase
with hardcoded paths.

This also fixes the path `mass_threshold` looks for when fetching the
config.
@BlakeWilliams BlakeWilliams force-pushed the bmw-engine-config-refactor branch from 1823f3a to 2b3e74b Compare October 19, 2015 18:38
@BlakeWilliams BlakeWilliams merged commit 2b3e74b into master Oct 19, 2015
@BlakeWilliams BlakeWilliams deleted the bmw-engine-config-refactor branch October 19, 2015 18:40
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.

4 participants