Sha256: 28b0a9678fbff4504818b9a1e626c00a7184f3939e1e742f1df393a639ea7135

Contents?: true

Size: 940 Bytes

Versions: 2

Compression:

Stored size: 940 Bytes

Contents

# =========================================================================
#   CMock - Automatic Mock Generation for C
#   ThrowTheSwitch.org
#   Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams
#   SPDX-License-Identifier: MIT
# =========================================================================

module CMockVersion
  # Where is the header file from here?
  path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'src', 'cmock.h'))

  # Actually look up the version in the header file
  a = [0, 0, 0]
  begin
    File.readlines(path).each do |line|
      %w[VERSION_MAJOR VERSION_MINOR VERSION_BUILD].each_with_index do |field, i|
        m = line.match(/CMOCK_#{field}\s+(\d+)/)
        a[i] = m[1] unless m.nil?
      end
    end
  rescue StandardError
    abort('Can\'t find my header file.')
  end

  # splat it to return the final value
  CMOCK_VERSION = a.join('.')

  GEM = CMOCK_VERSION
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ceedling-1.0.1 vendor/cmock/lib/cmock_version.rb
ceedling-1.0.0 vendor/cmock/lib/cmock_version.rb