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

ruby-concurrency / concurrent-ruby / #2743

04 Mar 2015 02:59AM UTC coverage: 45.152% (-50.4%) from 95.548%
#2743

push

jdantonio
Merge pull request #258 from ruby-concurrency/clock_time

Closes #256

23 of 69 new or added lines in 7 files covered. (33.33%)

1563 existing lines in 88 files now uncovered.

1425 of 3156 relevant lines covered (45.15%)

0.65 hits per line

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

68.75
/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, nil] the requested thread pool, or nil when no option specified
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
      elsif opts[:operation] == false || opts[:task] == true
1✔
UNCOV
20
        Concurrent.configuration.global_task_pool
×
21
      else
22
        nil
23
      end
24
    end
25

26
    def get_arguments_from(opts = {})
1✔
UNCOV
27
      [*opts.fetch(:args, [])]
×
28
    end
29

30
    # Get the requested `Executor` based on the values set in the options hash.
31
    #
32
    # @param [Hash] opts the options defining the requested executor
33
    # @option opts [Executor] :task_executor (`nil`) when set use the given `Executor` instance
34
    #
35
    # @return [Executor] the requested thread pool (default: global task pool)
36
    def get_task_executor_from(opts = {})
1✔
37
      opts[:task_executor] || opts[:executor] || Concurrent.configuration.global_task_pool
6✔
38
    end
39

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

50
    extend self
1✔
51
  end
52
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