Sha256: 3e59b897b7cce67f9ffc159245edf2a95e3d939c89f58bee072dc00217344ee8
Contents?: true
Size: 1.1 KB
Versions: 28
Compression:
Stored size: 1.1 KB
Contents
require 'rubygems' require 'rake' require 'rubocop/rake_task' task default: :ios # Run sh and ignore exception # rubocop:disable Lint/HandleExceptions def run_sh(cmd) sh cmd rescue end # Run cmd. On failure run install and try again. def bash(cmd) sh cmd do |successful, result| # exitstatus 7 means bundle install failed # exitstatus 1 means the test failed if !successful && result.exitstatus == 7 Rake::Task['install'].execute run_sh cmd end end end # Run a single test with: # rake ios['ios/element/generic'] # # rake ios['driver'] # # Run all tests with: # rake ios desc 'Run the iOS tests' task :ios, :args, :test_file do |_args, test_file| # rake android['ok'] # args = android # test_file = {:args=>"ok"} test_file = test_file[:args] cmd = 'bundle exec ruby ./lib/run.rb ios' cmd += %( "#{test_file}") if test_file bash cmd end desc 'Run bundle install' task :install do sh 'bundle install' end desc 'Execute RuboCop static code analysis' RuboCop::RakeTask.new(:rubocop) do |t| t.patterns = %w(**/*.rb) t.options = %w(-D) t.fail_on_error = false end
Version data entries
28 entries across 28 versions & 1 rubygems