Module: Libddprof

Defined in:
lib/libddprof.rb,
lib/libddprof/version.rb

Constant Summary collapse

LIB_VERSION =

Current libddprof version

"0.6.0"
VERSION =

The gem version scheme is lib_version.gem_major.gem_minor. This allows a version constraint such as ~> 0.2.0.1.0 in the consumer (ddtrace), in essence pinning the libddprof to a specific version like = 0.2.0, but still allow a) introduction of a gem-level breaking change by bumping gem_major and b) allow to push automatically picked up bugfixes by bumping gem_minor.

"#{LIB_VERSION}.#{GEM_MAJOR_VERSION}.#{GEM_MINOR_VERSION}#{GEM_PRERELEASE_VERSION}"

Class Method Summary collapse

Class Method Details

.available_binariesObject

This should only be used for debugging/logging



7
8
9
# File 'lib/libddprof.rb', line 7

def self.available_binaries
  File.directory?(vendor_directory) ? (Dir.entries(vendor_directory) - [".", ".."]) : []
end

.pkgconfig_folder(pkgconfig_file_name = "ddprof_ffi_with_rpath.pc") ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/libddprof.rb', line 11

def self.pkgconfig_folder(pkgconfig_file_name = "ddprof_ffi_with_rpath.pc")
  current_platform = Gem::Platform.local.to_s

  return unless available_binaries.include?(current_platform)

  pkgconfig_file = Dir.glob("#{vendor_directory}/#{current_platform}/**/#{pkgconfig_file_name}").first

  return unless pkgconfig_file

  File.absolute_path(File.dirname(pkgconfig_file))
end