steroids 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cc4c174cf84cc87c0737e1087feb3df8855e3a0b9beb3f5d0fbdbb4dcae4269
4
- data.tar.gz: d34c3f56f1427f1b39f76d4e82587a788828796cd731d2e9a043bb1271afb75e
3
+ metadata.gz: f8a2af68c8251200d1a7833dca674712dfc99f502a726a8d4b22a7628f273078
4
+ data.tar.gz: 7df9af543003c550ea401825c6a8a31e7f3096932415bdbf7e8b02125f5f6c83
5
5
  SHA512:
6
- metadata.gz: 89d90f8485f8d8e19b4ac6c2912870fcdaab1cf993b8f69e9694a02b6e0461dc0b9c2580aa06cf1e98b614ea4a189db139b417d8569e76fff7c7c36094a1e1cd
7
- data.tar.gz: cd15b28ddb359af81fa4f54b131b6028094ea2e3d9f81027d7830bc6ff8dfe9406ebd4f897683647cb980be934d0be1eb5b07e5cd7c00e0d48f0b7b9db51550d
6
+ metadata.gz: 128536d751d3ea19efa5581752fca80114f11191ee0d09a1c6a7876b53a3188e7aa30f4075d26f5eea6e2b8f37b87983cf8982ce78c004bde7fb1cc41c24b7c7
7
+ data.tar.gz: 7e1ec08e4d2622342a05149e9e3175ce8a090881a5694157fc9fd4075c788ce53f286aa551f3d28a4cd1d3730c25f99c1da14c191b3765cb878656b391f0863b
@@ -16,11 +16,11 @@ module Steroids
16
16
  return given_arguments if self.rest?
17
17
 
18
18
  expected_arguments_count = self.least_arguments.count
19
- non_nil_arguments_count = given_arguments.take_while(&:present?).count
20
- applied_arguments = given_arguments.first([expected_arguments_count, non_nil_arguments_count].min)
19
+ non_nil_given_arguments_count = given_arguments.take_while(&:present?).count
20
+ applied_arguments = given_arguments.first([expected_arguments_count, non_nil_given_arguments_count].max)
21
21
  return applied_arguments if self.spread? && self.options.any?
22
22
 
23
- applied_arguments << given_options if applied_arguments.count < self.arguments.count
23
+ applied_arguments << given_options if applied_arguments.count < self.arguments.count && given_options.any?
24
24
  applied_arguments
25
25
  end
26
26
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Steroids
3
- VERSION = "1.6.0".freeze
3
+ VERSION = "1.6.1".freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steroids
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Reboh