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

jdantonio / concurrent-ruby / #714

23 May 2014 08:08PM UTC coverage: 40.697% (-56.5%) from 97.237%
#714

push

jdantonio
Merge pull request #96 from jdantonio/refactor/errors

Moved all custom errors into a single file and into the Concurrent module

17 of 18 new or added lines in 10 files covered. (94.44%)

1432 existing lines in 56 files now uncovered.

1028 of 2526 relevant lines covered (40.7%)

0.53 hits per line

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

69.23
/lib/concurrent/options_parser.rb
1
module Concurrent
1✔
2

3
  # A mixin module for parsing options hashes related to gem-level configuration.
4
  module OptionsParser
1✔
5

6
    # Get the requested `Executor` based on the values set in the options hash.
7
    #
8
    # @param [Hash] opts the options defining the requested executor
9
    # @option opts [Executor] :executor (`nil`) when set use the given `Executor` instance
10
    # @option opts [Boolean] :operation (`false`) when true use the global operation pool
11
    # @option opts [Boolean] :task (`true`) when true use the global task pool
12
    #
13
    # @return [Executor] the requested thread pool (default: global task pool)
14
    def get_executor_from(opts = {})
1✔
15
      if opts[:executor]
1✔
UNCOV
16
        opts[:executor]
×
17
      elsif opts[:operation] == true || opts[:task] == false
1✔
UNCOV
18
        Concurrent.configuration.global_operation_pool
×
19
      else
20
        Concurrent.configuration.global_task_pool
1✔
21
      end
22
    end
23

24
    # Get the requested `Executor` based on the values set in the options hash.
25
    #
26
    # @param [Hash] opts the options defining the requested executor
27
    # @option opts [Executor] :task_executor (`nil`) when set use the given `Executor` instance
28
    #
29
    # @return [Executor] the requested thread pool (default: global task pool)
30
    def get_task_executor_from(opts = {})
1✔
UNCOV
31
      opts[:task_executor] || opts[:executor] || Concurrent.configuration.global_task_pool
×
32
    end
33

34
    # Get the requested `Executor` based on the values set in the options hash.
35
    #
36
    # @param [Hash] opts the options defining the requested executor
37
    # @option opts [Executor] :task_executor (`nil`) when set use the given `Executor` instance
38
    #
39
    # @return [Executor] the requested thread pool (default: global operation pool)
40
    def get_operation_executor_from(opts = {})
1✔
UNCOV
41
      opts[:operation_executor] || opts[:executor] || Concurrent.configuration.global_operation_pool
×
42
    end
43

44
    extend self
1✔
45
  end
46
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

© 2026 Coveralls, Inc