Module: PartializerRuntime

Defined in:
lib/ceedling/partials/partializer_runtime.rb

Overview

=========================================================================

Ceedling - Test-Centered Build System for C ThrowTheSwitch.org Copyright (c) 2010-26 Mike Karlesky, Mark VanderVoord, & Greg Williams SPDX-License-Identifier: MIT

Class Method Summary collapse

Class Method Details

.raise_on_option(option) ⇒ String

Format a mistaken configuration parameter for error messages

Parameters:

  • option (Object)

    The mistaken value to format

Returns:

  • (String)

    Formatted string representation

Raises:

  • (ArgumentError)


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ceedling/partials/partializer_runtime.rb', line 13

def self.raise_on_option(option)
  str = ''

  case option
  when Symbol
    str = " :#{option}"
  when NilClass, nil
    str = ': nil'
  when String
    str = ": \"#{option}\""
  else
    str = ": #{option}"
  end

  raise ArgumentError, "Invalid internal option#{str}"
end