Sha256: ebff50c3b01aed84c0b08bea85f641d1c9712cbf9b97ce1e1297c86b1207fac1
Contents?: true
Size: 1.48 KB
Versions: 16
Compression:
Stored size: 1.48 KB
Contents
# frozen_string_literal: true module Diffend # Module responsible for building local context module LocalContext # Module responsible for building platform information from local context module Platform class << self # Build platform information # # @return [Hash] def call { 'bundler' => { 'version' => Bundler::VERSION }, 'environment' => environment, 'ruby' => ruby_information, 'rubygems' => { 'specification_version' => Gem::Specification::CURRENT_SPECIFICATION_VERSION, 'version' => Gem::VERSION } }.freeze end private # Build platform ruby information # # @return [Hash] def ruby_information if defined?(JRUBY_VERSION) revision = JRUBY_REVISION.to_s version = JRUBY_VERSION else revision = RUBY_REVISION.to_s version = RUBY_ENGINE_VERSION end { 'engine' => RUBY_ENGINE, 'patchlevel' => RUBY_PATCHLEVEL, 'release_date' => RUBY_RELEASE_DATE, 'revision' => revision, 'version' => version } end # Build platform environment information # # @return [String] def environment ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development' end end end end end
Version data entries
16 entries across 16 versions & 2 rubygems