Class: Starling::Utils

Inherits:
Object
  • Object
show all
Defined in:
lib/starling/utils.rb

Overview

A collection of utility methods used across starling-ruby

Class Method Summary collapse

Class Method Details

.gem_infoString


6
7
8
9
# File 'lib/starling/utils.rb', line 6

def gem_info
  return 'starling-ruby' unless defined?(Starling::VERSION)
  "starling-ruby/v#{Starling::VERSION}"
end

.interpreter_versionString


25
26
27
# File 'lib/starling/utils.rb', line 25

def interpreter_version
  defined?(JRUBY_VERSION) ? JRUBY_VERSION : RUBY_VERSION
end

.ruby_engineString


12
13
14
# File 'lib/starling/utils.rb', line 12

def ruby_engine
  defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
end

.ruby_versionString


18
19
20
21
# File 'lib/starling/utils.rb', line 18

def ruby_version
  return RUBY_VERSION unless defined?(RUBY_PATCHLEVEL)
  RUBY_VERSION + "p#{RUBY_PATCHLEVEL}"
end