Class: CreateRubyGem::Detection::Runtime

Inherits:
Object
  • Object
show all
Defined in:
lib/create_ruby_gem/detection/runtime.rb

Overview

Detects the current Ruby, RubyGems, and Bundler versions.

Instance Method Summary collapse

Constructor Details

#initialize(bundler_detector: BundlerVersion.new) ⇒ Runtime



18
19
20
# File 'lib/create_ruby_gem/detection/runtime.rb', line 18

def initialize(bundler_detector: BundlerVersion.new)
  @bundler_detector = bundler_detector
end

Instance Method Details

#detect!RuntimeInfo

Raises:



24
25
26
27
28
29
30
# File 'lib/create_ruby_gem/detection/runtime.rb', line 24

def detect!
  RuntimeInfo.new(
    ruby: Gem::Version.new(RUBY_VERSION),
    rubygems: Gem::Version.new(Gem::VERSION),
    bundler: @bundler_detector.detect!
  )
end