• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-smart / support / #8

03 Jul 2024 08:24PM CUT coverage: 99.083%. Remained the same
#8

push

gonzo4711
## [1.5.0] - 2024-07-03
* **[add]** `RubySmart::Support::ThreadInfo.debugger?`-detection to determinate if a **Debugger** gem is active
* **[fix]** `String#to_boolean`-method to detect false-values (which makes all other values become true - similar to `::ActiveRecord::Type::Boolean`)

3 of 3 new or added lines in 2 files covered. (100.0%)

216 of 218 relevant lines covered (99.08%)

71.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/lib/ruby_smart/support/core_ext/ruby/array.rb
1
# frozen_string_literal: true
2

3
unless Array.method_defined? :only!
1✔
4
  class Array
1✔
5
    # refactors the same array with only given values (if exists)
6
    #
7
    # @example
8
    #   ary = [:foo, :bar, :bat]
9
    #   ary.only!(:bar, :moon)
10
    #   > ary == [:bar]
11
    #
12
    # @param [Array] values
13
    # @return [Array] self
14
    def only!(*values)
1✔
15
      reject! { |value| !values.include?(value) }
20✔
16
      self
5✔
17
    end
18
  end
19
end
20

21
unless Array.method_defined? :only
1✔
22
  class Array
1✔
23
    # returns a new array with only given values (if exists)
24
    #
25
    # @example
26
    #   ary = [:foo, :bar, :bat]
27
    #   ary.only(:bar, :bat, :moon)
28
    #   > [:bar, :bat]
29
    #
30
    # @param [Array] values
31
    # @return [Array] ary
32
    def only(*values)
1✔
33
      dup.only!(*values)
3✔
34
    end
35
  end
36
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc