-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
Going further towards reimplementing Nokogiri… Also add tests. /cc @czj
This gem is turning into a monster "just" to get a float from TNT each month :( |
<p><b>Voici le barème applicable avec l'historique des dernières semaines :<br /> | ||
</b><br /> | ||
<div class="cms-c-text text one_column componentbottommargin cms-u-padding__top- cms-u-padding__bottom-"> | ||
<p>Veuillez noter qu'il y aura un <b>décalage de deux semaines dans l'application des indices.</b> Par exemple, au 7 janvier 2019, la surcharge sera calculée en fonction du prix comptant moyen relevé le 28 décembre. Les modifications apportées à la surcharge carburant seront effectives chaque lundi. Les informations relatives à la surcharge seront disponibles chaque semaine approximativement le vendredi précédent l'application de la surcharge.<br /> |
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.
[Misspell] "exemple" is a misspelling of "example" (link)
posted by Sider
<div class="cms-c-text text one_column componentbottommargin cms-u-padding__top- cms-u-padding__bottom-"> | ||
<h2>Surcharge carburant pour vos envois en France</h2> | ||
|
||
<p>Cette surcharge s'applique à l'ensemble de vos expéditions nationales. Elle est indexée sur la moyenne mensuelle du prix à la pompe du gazole (hors TVA), en euros par litre tel que publié mensuellement par le Comité National Routier (CNR).<br /> |
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.
[Misspell] "nationales" is a misspelling of "nationals" (link)
posted by Sider
|
||
assert_kind_of String, time_period | ||
assert time_period.downcase.start_with?(current_month) | ||
assert (time_period.downcase.start_with?(current_month) || time_period.downcase.start_with?(previous_month)) |
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.
[RuboCop] Lint/ParenthesesAsGroupedExpression: (...)
interpreted as grouped expression. (link)
posted by Sider
|
||
assert_kind_of String, time_period | ||
assert time_period.downcase.start_with?(current_month) | ||
assert (time_period.downcase.start_with?(current_month) || time_period.downcase.start_with?(previous_month)) |
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.
[RuboCop] Performance/DoubleStartEndWith: Use time_period.downcase.start_with?(current_month, previous_month)
instead of time_period.downcase.start_with?(current_month) || time_period.downcase.start_with?(previous_month)
. (link)
posted by Sider
|
||
assert_kind_of String, time_period | ||
assert time_period.downcase.start_with?(current_month) | ||
assert (time_period.downcase.start_with?(current_month) || time_period.downcase.start_with?(previous_month)) |
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.
[RuboCop] Lint/ParenthesesAsGroupedExpression: (...)
interpreted as grouped expression. (link)
posted by Sider
@@ -16,7 +16,9 @@ def road_percentage | |||
end | |||
|
|||
def air_percentage | |||
air_value&.last&.to_s | |||
if value = air_value&.dig("list", 0, "surcharge") |
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.
[RuboCop] Lint/AssignmentInCondition: Use ==
if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition. (link)
posted by Sider
|
||
assert_kind_of String, time_period | ||
assert time_period.downcase.start_with?(current_month) | ||
assert (time_period.downcase.start_with?(current_month) || time_period.downcase.start_with?(previous_month)) |
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.
[RuboCop] Performance/DoubleStartEndWith: Use time_period.downcase.start_with?(current_month, previous_month)
instead of time_period.downcase.start_with?(current_month) || time_period.downcase.start_with?(previous_month)
. (link)
posted by Sider
Closes #58