ruby-engine-1.0.1/0000755000175000017500000000000012665576115011521 5ustar chchruby-engine-1.0.1/metadata.yml0000644000175000017500000000602212665576115014024 0ustar chch--- !ruby/object:Gem::Specification name: ruby_engine version: !ruby/object:Gem::Version version: 1.0.1 platform: ruby authors: - Jan Lelis autorequire: bindir: bin cert_chain: [] date: 2014-01-15 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: bundler requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '1.0' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '1.0' - !ruby/object:Gem::Dependency name: rake requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '10.0' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '10.0' - !ruby/object:Gem::Dependency name: rdoc requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '3.0' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '3.0' - !ruby/object:Gem::Dependency name: rspec requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '2.4' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '2.4' - !ruby/object:Gem::Dependency name: rubygems-tasks requirement: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '0.2' type: :development prerelease: false version_requirements: !ruby/object:Gem::Requirement requirements: - - "~>" - !ruby/object:Gem::Version version: '0.2' description: Gives you an RubyEngine class that simplifies checking for your Ruby implementation. email: mail@janlelis.de executables: [] extensions: [] extra_rdoc_files: [] files: - ".gitignore" - ".rspec" - ".travis.yml" - ChangeLog.rdoc - Gemfile - Gemfile.lock - LICENSE.txt - README.rdoc - Rakefile - lib/ruby_engine.rb - pkg/ruby_engine-1.0.0.gem - ruby_engine.gemspec - spec/ruby_engine_spec.rb - spec/spec_helper.rb homepage: https://github.com/janlelis/ruby_engine licenses: - MIT metadata: {} post_install_message: rdoc_options: [] require_paths: - lib required_ruby_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' required_rubygems_version: !ruby/object:Gem::Requirement requirements: - - ">=" - !ruby/object:Gem::Version version: '0' requirements: [] rubyforge_project: rubygems_version: 2.2.0 signing_key: specification_version: 4 summary: Adds the RubyEngine pseudo-constant. test_files: - spec/ruby_engine_spec.rb - spec/spec_helper.rb ruby-engine-1.0.1/.gitignore0000644000175000017500000000002112665576115013502 0ustar chchGemfile.lock pkg ruby-engine-1.0.1/.travis.yml0000644000175000017500000000017312665576115013633 0ustar chchlanguage: ruby rvm: - ruby-head - 2.1.0 - 2.0.0 - 1.9.3 - 1.9.2 - 1.8.7 - ree - jruby - jruby-19mode - jruby-18mode - rbx ruby-engine-1.0.1/Gemfile.lock0000644000175000017500000000127712665576115013752 0ustar chchPATH remote: . specs: ruby_engine (1.0.1) GEM remote: https://rubygems.org/ specs: diff-lcs (1.2.5) json (1.8.1) json (1.8.1-java) rake (10.1.1) rdoc (3.12.2) json (~> 1.4) rspec (2.14.1) rspec-core (~> 2.14.0) rspec-expectations (~> 2.14.0) rspec-mocks (~> 2.14.0) rspec-core (2.14.7) rspec-expectations (2.14.4) diff-lcs (>= 1.1.3, < 2.0) rspec-mocks (2.14.4) rubygems-tasks (0.2.4) rubysl-date (2.0.6) rubysl-singleton (2.0.0) PLATFORMS java ruby DEPENDENCIES bundler (~> 1.0) rake (~> 10.0) rdoc (~> 3.0) rspec (~> 2.4) ruby_engine! rubygems-tasks (~> 0.2) rubysl-date rubysl-singleton ruby-engine-1.0.1/ChangeLog.rdoc0000644000175000017500000000037112665576115014222 0ustar chch=== 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-1.0.1/LICENSE.txt0000644000175000017500000000203512665576115013344 0ustar chchCopyright (c) 2014 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-1.0.1/ruby_engine.gemspec0000644000175000017500000000203412665576115015373 0ustar chch# -*- 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 = "mail@janlelis.de" gem.homepage = "https://github.com/janlelis/ruby_engine" gem.files = Dir['{**/}{.*,*}'].select { |path| File.file?(path) } 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.add_development_dependency 'bundler', '~> 1.0' gem.add_development_dependency 'rake', '~> 10.0' gem.add_development_dependency 'rdoc', '~> 3.0' gem.add_development_dependency 'rspec', '~> 2.4' gem.add_development_dependency 'rubygems-tasks', '~> 0.2' end ruby-engine-1.0.1/.rspec0000644000175000017500000000004012665576115012630 0ustar chch--colour --format documentation ruby-engine-1.0.1/README.rdoc0000644000175000017500000000153012665576115013326 0ustar chch= RubyEngine {}[https://travis-ci.org/janlelis/ruby_engine] Provides a +RubyEngine+ to simplify checking on which implementation your Ruby programs is running. == 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.mri? RubyEngine.jruby? RubyEngine.rubinius? RubyEngine.ree? RubyEngine.ironruby? RubyEngine.macruby? RubyEngine.cardinal? == Also See https://github.com/janlelis/ruby_version | https://github.com/janlelis/ruby_info | https://github.com/rdp/os == J-_-L Copyright (c) 2010-2014 Jan Lelis. MIT License. Originated from the zucker gem. ruby-engine-1.0.1/lib/0000755000175000017500000000000012665576115012267 5ustar chchruby-engine-1.0.1/lib/ruby_engine.rb0000644000175000017500000000216212665576115015123 0ustar chchmodule RubyEngine VERSION = '1.0.1' @interpreter = case when RUBY_PLATFORM == 'parrot' 'cardinal' when Object.const_defined?(:RUBY_ENGINE) if RUBY_ENGINE == 'ruby' if RUBY_DESCRIPTION =~ /Enterprise/ 'ree' else 'ruby' end else RUBY_ENGINE.to_s # jruby, rbx, ironruby, macruby, etc. end else 'unknown' end class << self def is?(what) what === @interpreter end alias is is? def to_s @interpreter.to_s end alias inspect to_s # ask methods def mri? RubyEngine.is? 'ruby' end alias official_ruby? mri? alias ruby? mri? def jruby? RubyEngine.is? 'jruby' end alias java? jruby? def rubinius? RubyEngine.is? 'rbx' end alias rbx? rubinius? def ree? RubyEngine.is? 'ree' end alias enterprise? ree? def ironruby? RubyEngine.is? 'ironruby' end alias iron_ruby? ironruby? def cardinal? RubyEngine.is? 'cardinal' end alias parrot? cardinal? alias perl? cardinal? end end # J-_-L ruby-engine-1.0.1/Gemfile0000644000175000017500000000015212665576115013012 0ustar chchsource 'https://rubygems.org' gemspec platform :rbx do gem 'rubysl-date' gem 'rubysl-singleton' end ruby-engine-1.0.1/pkg/0000755000175000017500000000000012665576115012302 5ustar chchruby-engine-1.0.1/pkg/ruby_engine-1.0.0.gem0000644000175000017500000001700012665576115015732 0ustar chchmetadata.gz0000444000000000000000000000133312265340463013443 0ustar00wheelwheel000000000000003RVMo0 Wh8iNVhCC:a0dȒ'Aa|.Eў8-Q$LL~] nɲK4h@FRÕot4b)KI|mHB?sMAI¯NZܐRfDD?~{Iфi,\;)]Fho6+ܟt|_:l[${aYl PW-BJX2zւҜ+;'F-_9Nϒ=,Fs$=;Z1[IF xll|~lG%8aeV.ѕ(zNQ_sOlZBbF6FA%b#p2V<lL]٦LG}PdǗZ!NkHNƒ޾]i.N, d>Y~j=ғ}FQ8:lQMb!rdo i̛;.z^-GEjZW2>[obUVq<=3;b9_}Gyps?oԋ"6 ahw1u (UvnϴX{iם%ېyAIyo@S/AY ra\(2M.3W]vx /yVT_f W$ZDQ eZ#LKb|(cJ %j!ȢSdoREp qXR}OX]kV;ʷ  tF1Mhi:b( HTAz.]G^c"#kwtOX~͢/06D$> n do q[3twKZsv2Q* 0X80)@qrc+EJd+ƅ(׼i~%ž%0d5KպBX"p#n Iv[|rB.z =scF1ZtAM!./)B\0ݞн泻<"dIUFJVٴȉPߓdvz%zP@q86aEPQF9mnuH+[ 6y (67c7mjI gQuQy%?L8~r#+ Օ5R^jF3+ ЎNe |Zn玈;![Gew5g59wg5.*AqF\9s3rꤹ+thi]RWElqT!Dkr}G5yg5fNɿ %/tSd[HڒER[÷}QB&22D Xc9;G 2rIұiJ浙:3h3viiBDmaWYs29o.M>!Xnı_O>xKZzo_2Fco$΂s]_|֏=O5 es:^LߞhYV5V`:=NQu }bs`]omr^T{uoIHk^,IL{ޯ1Վm'eVvP G<ٌ[QH|2N`yIQ@.7Fh|5B;6Z;-ޥZfVI_[lUGihBvskY(})yƋJQӵr*[2kǒd.O\|֜YZ%i\mWpg A8#D9PRIb$i~$V4Gl(NnMԀsk~J? ~t7tm(#!y./_۔67]^qv_  3.+Eh<^1>![+C>-bn G~\گOFT:)ZъV~5Pchecksums.yaml.gz0000444000000000000000000000041612265340463014612 0ustar00wheelwheel000000000000003Re9@ y|`ֱ>/X8XfM+z=缣_~xh0qhiARE}2{&vfeVYdiIՍ]9cb: a3,;V:9}V:ַ@Dc֒DW^p4[3Fc=#{#m 0,Mǎ^I[)ԨGY},=m/j; v.ճ\5Bruby-engine-1.0.1/spec/0000755000175000017500000000000012665576115012453 5ustar chchruby-engine-1.0.1/spec/ruby_engine_spec.rb0000644000175000017500000000111212665576115016313 0ustar chchrequire '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-1.0.1/spec/spec_helper.rb0000644000175000017500000000004612665576115015271 0ustar chchrequire 'rspec' require 'ruby_engine' ruby-engine-1.0.1/Rakefile0000644000175000017500000000113212665576115013163 0ustar chch# encoding: utf-8 require 'rubygems' begin require 'bundler' rescue LoadError => e warn e.message warn "Run `gem install bundler` to install Bundler." exit -1 end begin Bundler.setup(:development) rescue Bundler::BundlerError => e warn e.message warn "Run `bundle install` to install missing gems." exit e.status_code end require 'rake' require 'rubygems/tasks' Gem::Tasks.new require 'rdoc/task' RDoc::Task.new do |rdoc| rdoc.title = "ruby_version" end task :doc => :rdoc require 'rspec/core/rake_task' RSpec::Core::RakeTask.new task :test => :spec task :default => :spec