Module: RPMContrib::LanguageSupport

Extended by:
LanguageSupport
Included in:
LanguageSupport
Defined in:
lib/rpm_contrib/language_support.rb

Constant Summary collapse

@@forkable =
nil

Instance Method Summary collapse

Instance Method Details

#can_fork?Boolean

Returns:

  • (Boolean)


6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/rpm_contrib/language_support.rb', line 6

def can_fork?
  # this is expensive to check, so we should only check once
  return @@forkable if @@forkable != nil

  if Process.respond_to?(:fork)
    # if this is not 1.9.2 or higher, we have to make sure
    @@forkable = ::RUBY_VERSION < '1.9.2' ? test_forkability : true
  else
    @@forkable = false
  end

  @@forkable
end