How to use ruby_version method of Platform Package

Best Selenium code snippet using Platform.ruby_version

Appraisals

Source:Appraisals Github

copy

Full Screen

1appraise "default" do2end3# GraphViz4appraise "graphviz_0.9.17" do5 gem "ruby-graphviz", "0.9.17"6end7appraise "graphviz_0.9.21" do8 gem "ruby-graphviz", "0.9.21"9end10appraise "graphviz_1.0.0" do11 gem "ruby-graphviz", "1.0.0"12end13appraise "graphviz_1.0.3" do14 gem "ruby-graphviz", "1.0.3"15end16appraise "graphviz_1.0.8" do17 gem "ruby-graphviz", "1.0.8"18end19# ActiveRecord integrations20if RUBY_VERSION < "1.9.1"21 appraise "active_record_2.0.0" do22 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]23 gem "activerecord", "2.0.0"24 gem "activerecord-jdbcsqlite3-adapter", "1.2.7", :platform => :jruby25 end26 27 appraise "active_record_2.0.5" do28 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]29 gem "activerecord", "2.0.5"30 gem "activerecord-jdbcsqlite3-adapter", "1.2.7", :platform => :jruby31 end32 33 appraise "active_record_2.1.0" do34 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]35 gem "activerecord", "2.1.0"36 gem "activerecord-jdbcsqlite3-adapter", "1.2.7", :platform => :jruby37 end38 39 appraise "active_record_2.1.2" do40 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]41 gem "activerecord", "2.1.2"42 gem "activerecord-jdbcsqlite3-adapter", "1.2.7", :platform => :jruby43 end44 45 appraise "active_record_2.2.3" do46 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]47 gem "activerecord", "2.2.3"48 gem "activerecord-jdbcsqlite3-adapter", "1.2.7", :platform => :jruby49 end50end51if RUBY_VERSION < "1.9.2"52 appraise "active_record_2.3.5" do53 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]54 gem "activerecord", "2.3.5"55 gem "activerecord-jdbcsqlite3-adapter", "1.2.7", :platform => :jruby56 end57end58if RUBY_VERSION < "2.0.0"59 appraise "active_record_2.3.12" do60 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]61 gem "activerecord", "2.3.12"62 gem "activerecord-jdbcsqlite3-adapter", "1.2.7", :platform => :jruby63 end64end65if RUBY_VERSION > "1.8.6" && RUBY_PLATFORM != "java"66 appraise "active_record_3.0.0" do67 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]68 gem "activerecord", "3.0.0"69 gem "activerecord-jdbcsqlite3-adapter", "1.2.7", :platform => :jruby70 end71end72if RUBY_VERSION > "1.8.6"73 appraise "active_record_3.0.5" do74 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]75 gem "activerecord", "3.0.5"76 gem "activerecord-jdbcsqlite3-adapter", "1.2.7", :platform => :jruby77 end78end79if RUBY_VERSION > "1.8.6" && RUBY_VERSION != "1.9.1" && RUBY_VERSION < "2.0.0"80 appraise "active_record_3.1.1" do81 gem "sqlite3", "1.3.6", :platform => [:ruby, :mswin, :mingw]82 gem "activerecord", "3.1.1"83 gem "activerecord-jdbcsqlite3-adapter", "1.2.7", :platform => :jruby84 end85 86 appraise "active_record_3.2.12" do87 gem "sqlite3", "1.3.6", :platform => [:ruby, :mswin, :mingw]88 gem "activerecord", "3.2.12"89 gem "activerecord-jdbcsqlite3-adapter", "1.2.7", :platform => :jruby90 end91end92if RUBY_VERSION > "1.8.6" && RUBY_VERSION != "1.9.1"93 appraise "active_record_3.2.13.rc1" do94 gem "sqlite3", "1.3.6", :platform => [:ruby, :mswin, :mingw]95 gem "activerecord", "3.2.13.rc1"96 gem "activerecord-jdbcsqlite3-adapter", "1.2.7", :platform => :jruby97 end98end99if RUBY_VERSION > "1.9.2"100 appraise "active_record_4.0.0" do101 gem "sqlite3", "1.3.6"102 gem "activerecord", "4.0.0.beta1", :git => "git://github.com/rails/rails.git", :ref => "92d6dac"103 gem "activerecord-deprecated_finders", "0.0.3"104 gem "protected_attributes", "1.0.0"105 gem "rails-observers", "0.1.1"106 end107end108# ActiveModel integrations109if RUBY_VERSION > "1.8.6" && RUBY_VERSION < "2.0.0"110 appraise "active_model_3.0.0" do111 gem "activemodel", "3.0.0"112 end113 appraise "active_model_3.0.5" do114 gem "activemodel", "3.0.5"115 end116 appraise "active_model_3.1.1" do117 gem "activemodel", "3.1.1"118 end119 120 appraise "active_model_3.2.12" do121 gem "activemodel", "3.2.12"122 end123end124if RUBY_VERSION > "1.8.6"125 appraise "active_model_3.2.13.rc1" do126 gem "activemodel", "3.2.13.rc1"127 end128end129if RUBY_VERSION > "1.9.2"130 appraise "active_model_4.0.0" do131 gem "activemodel", "4.0.0.beta", :git => "git://github.com/rails/rails.git", :ref => "4e286bf"132 gem "rails-observers", "0.1.1"133 gem "protected_attributes", "1.0.0"134 end135end136# MongoMapper integrations137if RUBY_VERSION > "1.8.6" && RUBY_VERSION < "1.9.1"138 appraise "mongo_mapper_0.5.5" do139 gem "activesupport", "2.3.11"140 gem "mongo_mapper", "0.5.5"141 end142end143if RUBY_VERSION > "1.8.6" && RUBY_VERSION < "2.0.0"144 appraise "mongo_mapper_0.5.8" do145 gem "activesupport", "2.3.11"146 gem "mongo_mapper", "0.5.8"147 end148 appraise "mongo_mapper_0.6.0" do149 gem "activesupport", "2.3.11"150 gem "mongo_mapper", "0.6.0"151 end152 appraise "mongo_mapper_0.6.10" do153 gem "activesupport", "2.3.11"154 gem "mongo_mapper", "0.6.10"155 end156 appraise "mongo_mapper_0.7.0" do157 gem "activesupport", "2.3.11"158 gem "mongo_mapper", "0.7.0"159 end160end161if RUBY_VERSION > "1.8.6" && RUBY_VERSION < "2.0.0" && (!defined?(RUBY_ENGINE) || RUBY_ENGINE != 'rbx')162 appraise "mongo_mapper_0.7.5" do163 gem "activesupport", "2.3.11"164 gem "mongo_mapper", "0.7.5"165 end166 appraise "mongo_mapper_0.8.0" do167 gem "activesupport", "2.3.11"168 gem "mongo", "1.0.1"169 gem "plucky", "0.3.0"170 gem "mongo_mapper", "0.8.0"171 end172 appraise "mongo_mapper_0.8.3" do173 gem "activesupport", "2.3.11"174 gem "mongo", "1.0.1"175 gem "plucky", "0.3.3"176 gem "mongo_mapper", "0.8.3"177 end178end179if RUBY_VERSION > "1.8.6" && RUBY_VERSION < "2.0.0"180 appraise "mongo_mapper_0.8.4" do181 gem "activesupport", "2.3.11"182 gem "mongo_mapper", "0.8.4"183 end184 appraise "mongo_mapper_0.8.6" do185 gem "activesupport", "2.3.11"186 gem "mongo_mapper", "0.8.6"187 end188end189# MongoMapper 0.9.0+ breaks on Ruby 1.9.1190if RUBY_VERSION > "1.8.6" && RUBY_VERSION != "1.9.1" && RUBY_VERSION < "2.0.0"191 appraise "mongo_mapper_0.9.0" do192 gem "mongo_mapper", "0.9.0"193 end194end195if RUBY_VERSION > "1.8.6" && RUBY_VERSION != "1.9.1"196 appraise "mongo_mapper_0.10.0" do197 gem "activemodel", "3.2.13.rc1"198 gem "mongo_mapper", "0.10.0"199 end200 201 appraise "mongo_mapper_0.11.2" do202 gem "activemodel", "3.2.13.rc1"203 gem "mongo", "~> 1.7.0"204 gem "mongo_mapper", "0.11.2"205 end206 207 appraise "mongo_mapper_0.12.0" do208 gem "activemodel", "3.2.13.rc1"209 gem "mongo", "~> 1.7.0"210 gem "mongo_mapper", "0.12.0"211 end212end213# Mongoid integrations214if RUBY_VERSION > "1.8.6" && RUBY_VERSION < "2.0.0"215 appraise "mongoid_2.0.0" do216 gem "activemodel", "~> 3.1.0"217 gem "mongo", "~> 1.7.0"218 gem "mongoid", "2.0.0"219 end220 221 appraise "mongoid_2.1.4" do222 gem "activemodel", "~> 3.1.0"223 gem "mongo", "~> 1.7.0"224 gem "mongoid", "2.1.4"225 end226 227 appraise "mongoid_2.2.4" do228 gem "activemodel", "~> 3.1.0"229 gem "mongo", "~> 1.7.0"230 gem "mongoid", "2.2.4"231 end232 233 appraise "mongoid_2.3.3" do234 gem "activemodel", "~> 3.1.0"235 gem "mongo", "~> 1.7.0"236 gem "mongoid", "2.3.3"237 end238end239if RUBY_VERSION > "1.8.6"240 appraise "mongoid_2.4.0" do241 gem "activemodel", "3.2.13.rc1"242 gem "mongo", "~> 1.7.0"243 gem "mongoid", "2.4.0"244 end245 246 appraise "mongoid_2.4.10" do247 gem "activemodel", "3.2.13.rc1"248 gem "mongo", "~> 1.7.0"249 gem "mongoid", "2.4.10"250 end251 252 appraise "mongoid_2.5.2" do253 gem "activemodel", "3.2.13.rc1"254 gem "mongo", "~> 1.7.0"255 gem "mongoid", "2.5.2"256 end257 258 appraise "mongoid_2.6.0" do259 gem "activemodel", "3.2.13.rc1"260 gem "mongo", "~> 1.7.0"261 gem "mongoid", "2.6.0"262 end263end264if RUBY_VERSION > "1.9.2"265 appraise "mongoid_3.0.0" do266 gem "activemodel", "3.2.13.rc1"267 gem "mongoid", "3.0.0"268 end269 270 appraise "mongoid_3.0.22" do271 gem "activemodel", "3.2.13.rc1"272 gem "mongoid", "3.0.22"273 end274 275 appraise "mongoid_3.1.0" do276 gem "activemodel", "3.2.13.rc1"277 gem "mongoid", "3.1.0"278 end279end280# Sequel integrations281if RUBY_VERSION < "1.9.2"282 appraise "sequel_2.8.0" do283 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]284 gem "jdbc-sqlite3", "3.7.2", :platform => :jruby285 gem "sequel", "2.8.0"286 end287 appraise "sequel_2.11.0" do288 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]289 gem "jdbc-sqlite3", "3.7.2", :platform => :jruby290 gem "sequel", "2.11.0"291 end292 appraise "sequel_2.12.0" do293 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]294 gem "jdbc-sqlite3", "3.7.2", :platform => :jruby295 gem "sequel", "2.12.0"296 end297 appraise "sequel_3.0.0" do298 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]299 gem "jdbc-sqlite3", "3.7.2", :platform => :jruby300 gem "sequel", "3.0.0"301 end302 appraise "sequel_3.4.0" do303 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]304 gem "jdbc-sqlite3", "3.7.2", :platform => :jruby305 gem "sequel", "3.4.0"306 end307end308appraise "sequel_3.10.0" do309 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]310 gem "jdbc-sqlite3", "3.7.2", :platform => :jruby311 gem "sequel", "3.10.0"312end313appraise "sequel_3.13.0" do314 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]315 gem "jdbc-sqlite3", "3.7.2", :platform => :jruby316 gem "sequel", "3.13.0"317end318appraise "sequel_3.14.0" do319 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]320 gem "jdbc-sqlite3", "3.7.2", :platform => :jruby321 gem "sequel", "3.14.0"322end323appraise "sequel_3.23.0" do324 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]325 gem "jdbc-sqlite3", "3.7.2", :platform => :jruby326 gem "sequel", "3.23.0"327end328appraise "sequel_3.24.0" do329 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]330 gem "jdbc-sqlite3", "3.7.2", :platform => :jruby331 gem "sequel", "3.24.0"332end333appraise "sequel_3.29.0" do334 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]335 gem "jdbc-sqlite3", "3.7.2", :platform => :jruby336 gem "sequel", "3.29.0"337end338appraise "sequel_3.34.0" do339 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]340 gem "jdbc-sqlite3", "3.7.2", :platform => :jruby341 gem "sequel", "3.34.0"342end343if RUBY_VERSION > "1.8.6"344 appraise "sequel_3.35.0" do345 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]346 gem "jdbc-sqlite3", "3.7.2", :platform => :jruby347 gem "sequel", "3.35.0"348 end349 350 appraise "sequel_3.44.0" do351 gem "sqlite3-ruby", "1.3.1", :platform => [:ruby, :mswin, :mingw]352 gem "jdbc-sqlite3", "3.7.2", :platform => :jruby353 gem "sequel", "3.44.0"354 end355end356# DataMapper357if RUBY_VERSION < "1.9.1" && RUBY_PLATFORM != 'java' && (!defined?(RUBY_ENGINE) || RUBY_ENGINE != 'rbx')358 appraise "data_mapper_0.9.4" do359 gem "dm-core", "0.9.4"360 gem "dm-migrations", "0.9.4"361 gem "dm-validations", "0.9.4"362 gem "dm-observer", "0.9.4"363 gem "data_objects", "0.9.4"364 gem "do_sqlite3", "0.9.4"365 end366 appraise "data_mapper_0.9.7" do367 gem "extlib", "0.9.8"368 gem "dm-core", "0.9.7"369 gem "dm-migrations", "0.9.7"370 gem "dm-validations", "0.9.7"371 gem "dm-observer", "0.9.7"372 gem "data_objects", "0.9.7"373 gem "do_sqlite3", "0.9.7"374 end375 appraise "data_mapper_0.9.11" do376 gem "extlib", "0.9.11"377 gem "dm-core", "0.9.11"378 gem "dm-migrations", "0.9.11"379 gem "dm-validations", "0.9.11"380 gem "dm-observer", "0.9.11"381 gem "data_objects", "0.9.11"382 gem "do_sqlite3", "0.9.11"383 end384 appraise "data_mapper_0.10.2" do385 gem "extlib", "0.9.16"386 gem "dm-core", "0.10.2"387 gem "dm-migrations", "0.10.2"388 gem "dm-validations", "0.10.2"389 gem "dm-observer", "0.10.2"390 gem "data_objects", "0.10.2"391 gem "do_sqlite3", "0.10.2"392 end393end394appraise "data_mapper_1.0.0" do395 gem "dm-core", "1.0.0"396 gem "dm-migrations", "1.0.0"397 gem "dm-validations", "1.0.0"398 gem "dm-observer", "1.0.0"399 gem "dm-transactions", "1.0.0"400 gem "dm-sqlite-adapter", "1.0.0"401end402appraise "data_mapper_1.0.1" do403 gem "dm-core", "1.0.1"404 gem "dm-migrations", "1.0.1"405 gem "dm-validations", "1.0.1"406 gem "dm-observer", "1.0.1"407 gem "dm-transactions", "1.0.1"408 gem "dm-sqlite-adapter", "1.0.1"409end410appraise "data_mapper_1.0.2" do411 gem "dm-core", "1.0.2"412 gem "dm-migrations", "1.0.2"413 gem "dm-validations", "1.0.2"414 gem "dm-observer", "1.0.2"415 gem "dm-transactions", "1.0.2"416 gem "dm-sqlite-adapter", "1.0.2"417end418if RUBY_VERSION > "1.8.6"419 appraise "data_mapper_1.1.0" do420 gem "dm-core", "1.1.0"421 gem "dm-migrations", "1.1.0"422 gem "dm-validations", "1.1.0"423 gem "dm-observer", "1.1.0"424 gem "dm-transactions", "1.1.0"425 gem "dm-sqlite-adapter", "1.1.0"426 end427 428 appraise "data_mapper_1.2.0" do429 gem "dm-core", "1.2.0"430 gem "dm-migrations", "1.2.0"431 gem "dm-validations", "1.2.0"432 gem "dm-observer", "1.2.0"433 gem "dm-transactions", "1.2.0"434 gem "dm-sqlite-adapter", "1.2.0"435 end436end...

Full Screen

Full Screen

platform.rb

Source:platform.rb Github

copy

Full Screen

...5 def initialize(options)6 @options = options7 end8 def run9 platforms, ruby_version = Bundler.ui.silence do10 locked_ruby_version = Bundler.locked_gems && Bundler.locked_gems.ruby_version11 gemfile_ruby_version = Bundler.definition.ruby_version && Bundler.definition.ruby_version.single_version_string12 [Bundler.definition.platforms.map {|p| "* #{p}" },13 locked_ruby_version || gemfile_ruby_version]14 end15 output = []16 if options[:ruby]17 if ruby_version18 output << ruby_version19 else20 output << "No ruby version specified"21 end22 else23 output << "Your platform is: #{RUBY_PLATFORM}"24 output << "Your app has gems that work on these platforms:\n#{platforms.join("\n")}"25 if ruby_version26 output << "Your Gemfile specifies a Ruby version requirement:\n* #{ruby_version}"27 begin28 Bundler.definition.validate_runtime!29 output << "Your current platform satisfies the Ruby version requirement."30 rescue RubyVersionMismatch => e31 output << e.message32 end33 else34 output << "Your Gemfile does not specify a Ruby version requirement."35 end36 end37 Bundler.ui.info output.join("\n\n")38 end39 end40end...

Full Screen

Full Screen

Gemfile

Source:Gemfile Github

copy

Full Screen

1source 'https://rubygems.org'2# Specify your gem's dependencies in bundle_outdated_formatter.gemspec3gemspec4if Gem::Version.create(RUBY_VERSION) < Gem::Version.create('2.4.0')5 gem 'simplecov', '< 0.18.0'6end7if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('2.3.0') && Gem::Version.create(RUBY_VERSION) < Gem::Version.create('2.4.0')8 if RUBY_PLATFORM !~ /mingw/9 gem 'rubocop', '< 0.82.0'10 gem 'rubocop-rspec', '< 1.39.0'11 end12end13if Gem::Version.create(RUBY_VERSION) < Gem::Version.create('2.3.0')14 gem 'psych', '< 3.0.0'15end16if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('2.2.0') && Gem::Version.create(RUBY_VERSION) < Gem::Version.create('2.3.0')17 if RUBY_PLATFORM !~ /mingw/18 gem 'rubocop', '< 0.69.0'19 gem 'rubocop-rspec', '< 1.33.0'20 end21end22if Gem::Version.create(RUBY_VERSION) < Gem::Version.create('2.2.0')23 gem 'parallel', '< 1.17.0'24 if RUBY_PLATFORM !~ /mingw/25 gem 'rubocop-rspec', '< 1.5.2'26 end27end28if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('2.1.0') && Gem::Version.create(RUBY_VERSION) < Gem::Version.create('2.2.0')29 if RUBY_PLATFORM !~ /mingw/30 gem 'rubocop', '< 0.58.0'31 end32end33if Gem::Version.create(RUBY_VERSION) < Gem::Version.create('2.1.0')34 if RUBY_PLATFORM !~ /mingw/35 gem 'rubocop', '< 0.51.0'36 end37end...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful