Module: YardGhurt::Util

Extended by:
ClassMethods
Included in:
YardGhurt
Defined in:
lib/yard_ghurt/util.rb

Overview

Utility methods in a separate module/mixin, so that a programmer can require/load a sole task:

require 'yard_ghurt/gfm_fix_task'

Else, programmers would be required to always require/load the entire yard_ghurt module:

require 'yard_ghurt'

All internal code should use this module.

External code can either use this module or YardGhurt, which includes this module as a mixin.

Author:

  • Jonathan Bradley Whited

Since:

  • 1.0.0

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

TRUE_BOOLS =

Returns the lower-case Strings that will equal to true.

Returns:

  • (Array<String>)

    the lower-case Strings that will equal to true

Since:

  • 1.0.0

%w[ 1 on t true y yes ].freeze
SEM_VER_REGEX =

Returns a very flexible (non-strict) Semantic Versioning regex, ignoring pre-release/build-metadata.

Returns:

  • a very flexible (non-strict) Semantic Versioning regex, ignoring pre-release/build-metadata

Since:

  • 1.2.1

/(?<major>\d+)(?:\.(?<minor>\d+))?(?:\.(?<patch>\d+))?/.freeze

Class Method Summary collapse

Methods included from ClassMethods

parse_sem_ver, rm_exist, to_bool, yard_sem_ver

Class Method Details

.included(mod) ⇒ Object

If include Util is called, extend ClassMethods.

Parameters:

  • mod (Module)

    the module to extend

Since:

  • 1.0.0



40
41
42
# File 'lib/yard_ghurt/util.rb', line 40

def self.included(mod)
  mod.extend ClassMethods
end