This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
RCurtain 1.0 - Refactor code and update version #11
Open
lucasqueiroz
wants to merge
52
commits into
wirecardBrasil:master
Choose a base branch
from
lucasqueiroz:master
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.
Conversation
This file contains 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
Follow ruby style guide Add methods to retrieve feature information
Add method to delete all users from feature
Add CircleCI Integration
Update Pull Request Template Add Issue Template
Refactor RCurtain
lucasqueiroz
requested review from
GuiSipoloni,
carlosmenezes,
rfocosi,
diegoicosta,
ecolabardini and
evandromoip
July 11, 2018 23:05
rfocosi
reviewed
Jul 14, 2018
def allowed_percentage(feature_name) | ||
allowed_percentage = RCurtain.feature.percentage(feature_name) | ||
default_percentage = RCurtain.configuration.default_percentage | ||
allowed_percentage.nil? ? default_percentage : allowed_percentage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aqui você poderia ter feito:
def allowed_percentage(feature_name)
RCurtain.feature.percentage(feature_name) || RCurtain.configuration.default_percentage
end
rfocosi
reviewed
Jul 14, 2018
def percentage_allowed?(feature_name) | ||
allowed_percentage = allowed_percentage(feature_name).to_i | ||
rand_percentage = rand(0..100) | ||
rand_percentage <= allowed_percentage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essa variável rand_percentage
é desnecessária. Crie um método pro rand(0..100)
no lugar de criar uma variável.
rfocosi
reviewed
Jul 14, 2018
users.nil? || users.empty? | ||
end | ||
def percentage_allowed?(feature_name) | ||
allowed_percentage = allowed_percentage(feature_name).to_i |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outra variável desnecessária
rfocosi
reviewed
Jul 14, 2018
@redis = Redis.new(url: RCurtain.configuration.url) | ||
end | ||
|
||
def add_users(feature_name, users) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deveria criar classes para Users
e Percentage
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
RCurtain 1.0 - Refactor code and update version
Description