ruby_engine-2.0.3/0000755000004100000410000000000014632134567014065 5ustar www-datawww-dataruby_engine-2.0.3/Gemfile.lock0000755000004100000410000000117114632134567016312 0ustar www-datawww-dataPATH remote: . specs: ruby_engine (2.0.3) GEM remote: https://rubygems.org/ specs: diff-lcs (1.5.1) rake (13.2.1) rspec (3.13.0) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) rspec-core (3.13.0) rspec-support (~> 3.13.0) rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) PLATFORMS java ruby DEPENDENCIES rake (~> 13.2) rspec (~> 3.13) ruby_engine! BUNDLED WITH 2.2.22 ruby_engine-2.0.3/.gitignore0000644000004100000410000000002114632134567016046 0ustar www-datawww-dataGemfile.lock pkg ruby_engine-2.0.3/lib/0000755000004100000410000000000014632134567014633 5ustar www-datawww-dataruby_engine-2.0.3/lib/ruby_engine.rb0000644000004100000410000000120714632134567017466 0ustar www-datawww-data# frozen_string_literal: true module RubyEngine VERSION = '2.0.3' @interpreter = RUBY_ENGINE.to_s class << self def is?(what) what === @interpreter end alias is is? def to_s @interpreter.to_s end alias inspect to_s def mri? RubyEngine.is? 'ruby' end alias official_ruby? mri? alias ruby? mri? alias cruby? mri? def jruby? RubyEngine.is? 'jruby' end alias java? jruby? def rubinius? RubyEngine.is? 'rbx' end alias rbx? rubinius? def truffleruby? RubyEngine.is? 'truffleruby' end alias truffle? truffleruby? end end ruby_engine-2.0.3/spec/0000755000004100000410000000000014632134567015017 5ustar www-datawww-dataruby_engine-2.0.3/spec/spec_helper.rb0000644000004100000410000000017714632134567017642 0ustar www-datawww-datarequire 'rspec' require 'ruby_engine' RSpec.configure do |config| config.expect_with(:rspec) { |c| c.syntax = :should } end ruby_engine-2.0.3/spec/ruby_engine_spec.rb0000644000004100000410000000112314632134567020661 0ustar www-datawww-datarequire_relative 'spec_helper' describe 'RubyEngine' do before :all do RubyEngine.instance_variable_set(:@interpreter, "jruby") end it 'should display RUBY_ENGINE if called directly (to_s)' do RubyEngine.to_s.should == 'jruby' end describe '.is?' do it 'returns true if current ruby engine matches' do RubyEngine.is?('jruby').should == true end it 'returns false if current ruby engine does not match' do RubyEngine.is?('maglev').should == false end it 'also supports regex' do RubyEngine.is?(/ruby/).should == true end end end ruby_engine-2.0.3/.rspec0000644000004100000410000000004014632134567015174 0ustar www-datawww-data--colour --format documentation ruby_engine-2.0.3/Rakefile0000644000004100000410000000162414632134567015535 0ustar www-datawww-data# # # # Get gemspec info gemspec_file = Dir["*.gemspec"].first gemspec = eval File.read(gemspec_file), binding, gemspec_file info = "#{gemspec.name} | #{gemspec.version} | " \ "#{gemspec.runtime_dependencies.size} dependencies | " \ "#{gemspec.files.size} files" # # # # Gem build and install task desc info task :gem do puts info + "\n\n" print " "; sh "gem build #{gemspec_file}" FileUtils.mkdir_p "pkg" FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", "pkg" puts; sh %{gem install --no-document pkg/#{gemspec.name}-#{gemspec.version}.gem} end # # # # Start an IRB session with the gem loaded desc "#{gemspec.name} | IRB" task :irb do sh "irb -I ./lib -r #{gemspec.name.gsub '-','/'}" end # # # # Run specs begin require "rspec/core/rake_task" RSpec::Core::RakeTask.new(:spec) task test: :spec task default: :spec rescue LoadError warn("Failed to load rspec") end ruby_engine-2.0.3/ChangeLog.md0000644000004100000410000000121514632134567016235 0ustar www-datawww-data# Change Log ## 2.0.3 / 2024-04-22 * Drop rubygems-tasks dependency, fixes a Ruby 2.5 install problem ## 2.0.2 / 2024-04-22 * Upgrade RSpec to latest, remove Gemfile workaround ## 2.0.1 / 2024-04-02 * Add MFA to gemspec * Update CI ## 2.0.0 / 2020-01-04 * Refactor / update for current Rubies * Remove cardinal * Remove ree * Remove ironruby * Add truffelruby * Add `cruby?` alias to MRI ## 1.0.1 / 2014-01-15 * Fix RubyEngine.mri? * Fix VERSION constant ## 1.0.0 / 2014-01-14 * Return "ruby" for MRI (instead of "mri") * Return "unknown" if RUBY_ENGINE is not set (instead of "mri") * Moved from zucker 13.1 gem into its own gem ruby_engine-2.0.3/ruby_engine.gemspec0000644000004100000410000000171314632134567017742 0ustar www-datawww-data# -*- encoding: utf-8 -*- require File.expand_path('../lib/ruby_engine', __FILE__) Gem::Specification.new do |gem| gem.name = "ruby_engine" gem.version = RubyEngine::VERSION gem.summary = 'Adds the RubyEngine pseudo-constant.' gem.description = 'Gives you an RubyEngine class that simplifies checking for your Ruby implementation.' gem.license = "MIT" gem.authors = ["Jan Lelis"] gem.email = ["hi@ruby.consulting"] gem.homepage = "https://github.com/janlelis/ruby_engine" gem.files = Dir["{**/}{.*,*}"].select{ |path| File.file?(path) && path !~ /^pkg/ } gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) } gem.test_files = gem.files.grep(%r{^(test|spec|features)/}) gem.require_paths = ['lib'] gem.metadata = { "rubygems_mfa_required" => "true" } gem.add_development_dependency 'rake', '~> 13.2' gem.add_development_dependency 'rspec', '~> 3.13' end ruby_engine-2.0.3/Gemfile0000644000004100000410000000004714632134567015361 0ustar www-datawww-datasource 'https://rubygems.org' gemspec ruby_engine-2.0.3/MIT-LICENSE.txt0000644000004100000410000000204314632134567016336 0ustar www-datawww-dataCopyright (c) 2014, 2020 Jan Lelis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ruby_engine-2.0.3/README.md0000644000004100000410000000165414632134567015352 0ustar www-datawww-data# RubyEngine [Gem Version](https://badge.fury.io/rb/ruby_engine) [](https://github.com/janlelis/ruby_engine/actions?query=workflow%3ATest) Provides a `RubyEngine` constant for simple Ruby implementation checks. ## Setup On your command-line: $ gem install ruby_engine In Ruby: require 'ruby_engine' ## Usage # Output the interpreter name RubyEngine.to_s # true for JRuby RubyEngine.is? 'jruby' # There are some query methods defined: RubyEngine.cruby? RubyEngine.jruby? RubyEngine.truffle? ## Also See - https://github.com/janlelis/ruby_version - https://github.com/janlelis/ruby_info - https://github.com/rdp/os - https://github.com/janlelis/irbtools ## J-_-L Copyright (c) 2010-2014, 2020 Jan Lelis. MIT License. Originated from the zucker gem.