-
Notifications
You must be signed in to change notification settings - Fork 5
Ajout de la CI Github action #2
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
Open
fwininger
wants to merge
36
commits into
fwininger:master
Choose a base branch
from
Cyberwatch:add_gh
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: jinxka <benjamin.balanger@epitech.eu>
New methods to get major.minor.patch
Add benchmark for comparing versions
Update SoftwareVersion::Version
Update gems versions
Fix SoftwareVersion::Version#sv
Update spec fixtures files
Signed-off-by: Florian Wininger <fw.centrale@gmail.com>
Signed-off-by: Florian Wininger <fw.centrale@gmail.com>
Configure travis
Signed-off-by: Florian Wininger <fw.centrale@gmail.com>
Signed-off-by: Florian Wininger <fw.centrale@gmail.com>
1.1-1-3 < 1.1-2 was false
Rather than splitting strings, the new comparison model uses a left-to-right version parser to extract the semantic of the versions, and compares the resulting tokens lexicographically. That way, we have v1.0.1 = 1.0p1 without requiring preprocessing from the caller. While more verbose, the new parser should make it easy to add special cases for magic words like pre-versions. Versions can now be compared to any stringizable objects for convenience. Regarding performance, this current implementation is about 5 times slower than the previous one, though this could be improved by profiling. The new implementation does not have special cases for distributions or architectures, which generate a huge difference when sorting heterogeneous versions, like with RPM.
Rather than writing `SoftwareVersion::Version.new('1.0')`, users will be
able to write `SoftwareVersion('1.0')` instead.
This removes the legacy parse_raw_version to use the new parser instead. This is a breaking change, as the semantics change slightly. The `KB.16.10.0012` is now read as major = 16, minor = 10 and patch = 12. Methods #version, #revision, #release and #arch have be deleted.
String#chunk is actually pretty slow, and makes us call #join afterwards. Implementing our own loop with #each_char is more verbose, but makes the benchmark 20% faster.
The overhead caused by the Struct slows down the benchmark by about 10%. Arrays are a bit less readable, but the code remains clear enough.
7bc3933 to
abde6ef
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.