-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor *VersionHelpers to use an object #203
Comments
Another benefit of refactoring this to be objects, and to have instance methods on them, is that it would be easier to refactor that to not rely on the various env vars like |
Some work have already been started in the Currently, only the model for Android versioning have been started to be worked on (and haven't been fully tested), so there's still work to do in order to apply the same ideas for iOS version objects. This migration/refactoring would also make it easier to support multiple apps, in particular easily support both WordPress and Jetpack in the same repository, by passing the right parameters (Jetpack or WP config file paths) when constructing the |
Today
ios_version_helper
andandroid_version_helper
consist of freeform, module-static methods which take various and heterogeneous types of parameters depending on the method (sometimes aString
for versionName, sometimes aHash
, etc)It would make way more sense, and make the code way easier to understand, if instead of freeform methods, we created a
class Version
which would expose the appropriate instance properties (e.g. for Android,name
andcode
) and instance methods to manipulate those versions, inspired byGem::Version
and its methods.This would make the implementation way easier to understand and document (not having to repeat the parameter type documentation methods taking similar inputs), but also clearer at call-site and more idiomatic.
Some ideas / inspiration for possible API, e.g. for the Android one in the
Fastlane::Helper::Android
module:Or, alternatively, something like:
The text was updated successfully, but these errors were encountered: