diff --git a/cmd/brew-cask-tests.rb b/cmd/brew-cask-tests.rb index 1971299363..92ef3ddd90 100755 --- a/cmd/brew-cask-tests.rb +++ b/cmd/brew-cask-tests.rb @@ -1,18 +1,3 @@ -#!/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -W0 -EUTF-8:UTF-8 -# encoding: UTF-8 - -# Ruby version check -unless RUBY_VERSION.split(".").first.to_i >= 2 - alt_ruby = which "ruby" - alt_ruby_version = `#{alt_ruby} --version`.chomp[%r{\d\.\d}, 0] if alt_ruby - - unless alt_ruby && alt_ruby_version.split(".").first.to_i >= 2 - abort "Ruby 2.0 or above is required. You can install it with `brew install ruby`." - end - - exec alt_ruby, "-W0", "-I#{HOMEBREW_LIBRARY_PATH}", "-rglobal", __FILE__, *ARGV -end - require "English" repo_root = Pathname(__FILE__).realpath.parent.parent diff --git a/cmd/brew-cask.rb b/cmd/brew-cask.rb index 4066177afa..825c4cb818 100755 --- a/cmd/brew-cask.rb +++ b/cmd/brew-cask.rb @@ -1,18 +1,3 @@ -#!/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -W0 -EUTF-8:UTF-8 -# encoding: UTF-8 - -# Ruby version check -unless RUBY_VERSION.split(".").first.to_i >= 2 - alt_ruby = which "ruby" - alt_ruby_version = `#{alt_ruby} --version`.chomp[%r{\d\.\d}, 0] if alt_ruby - - unless alt_ruby && alt_ruby_version.split(".").first.to_i >= 2 - abort "Ruby 2.0 or above is required. You can install it with `brew install ruby`." - end - - exec alt_ruby, "-W0", "-I#{HOMEBREW_LIBRARY_PATH}", "-rglobal", __FILE__, *ARGV -end - require "pathname" $LOAD_PATH.unshift(File.expand_path("../../lib", Pathname.new(__FILE__).realpath)) diff --git a/developer/bin/list_running_app_ids b/developer/bin/list_running_app_ids index bd4133407b..136a578d40 100755 --- a/developer/bin/list_running_app_ids +++ b/developer/bin/list_running_app_ids @@ -21,8 +21,8 @@ $opt_test = nil ### def check_ruby - if RUBY_VERSION.to_f < 1.9 - print "You are currently using Ruby ", RUBY_VERSION, ", but version 1.9 or above is required." + if RUBY_VERSION.to_f < 2.0 + print "You are currently using Ruby ", RUBY_VERSION, ", but version 2.0 or above is required." exit 1 end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b1ffbbbc0d..e86e200274 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,9 +7,6 @@ if ENV["COVERAGE"] Coveralls.wear_merged! end -# just in case -raise "brew-cask: Ruby 2.0 or greater is required." if RUBY_VERSION.to_i < 2 - project_root = Pathname.new(File.expand_path("../..", __FILE__)) # add Homebrew to load path diff --git a/test/syntax_test.rb b/test/syntax_test.rb index 1c7f735460..0ea832bde6 100644 --- a/test/syntax_test.rb +++ b/test/syntax_test.rb @@ -3,23 +3,14 @@ require "test_helper" describe "Syntax check" do project_root = Pathname.new(File.expand_path("#{File.dirname(__FILE__)}/../")) backend_files = Dir[project_root.join("**", "*.rb")].reject { |f| f.match %r{/vendor/|/Casks/} } - %w[2.0 2.1].each do |major_version| - describe "under Ruby #{major_version}" do - interpreter = Pathname.new("/System/Library/Frameworks/Ruby.framework/Versions/#{major_version}/usr/bin/ruby") - interpreter = Pathname.new(Dir["#{ENV['HOME']}/.rbenv/versions/#{major_version}*/bin/ruby"].first.to_s) unless interpreter.exist? - interpreter = Pathname.new(Dir["#{ENV['HOME']}/.rvm/rubies/ruby-#{major_version}*/bin/ruby"].first.to_s) unless interpreter.exist? - interpreter = Pathname.new(Dir["/usr/local/bin/ruby{-,}#{major_version}*"].first.to_s) unless interpreter.exist? - interpreter = Pathname.new(Dir["/opt/local/bin/ruby{-,}#{major_version}*"].first.to_s) unless interpreter.exist? - flags = %w[-c] - flags.unshift "--disable-all" - backend_files.each do |file| - it "#{file} is valid Ruby" do - skip("Ruby #{major_version} not found") unless interpreter.exist? - args = flags + ["--", file] - shutup do - raise SyntaxError, "#{file} failed syntax check" unless system(interpreter, *args) - end - end + interpreter = RUBY_PATH + flags = %w[-c] + flags.unshift "--disable-all" + backend_files.each do |file| + it "#{file} is valid Ruby" do + args = flags + ["--", file] + shutup do + raise SyntaxError, "#{file} failed syntax check" unless system(interpreter, *args) end end end diff --git a/test/test_helper.rb b/test/test_helper.rb index 58b72201bb..dfe2484ed1 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -7,9 +7,6 @@ if ENV["COVERAGE"] Coveralls.wear_merged! end -# just in case -raise "brew-cask: Ruby 2.0 or greater is required." if RUBY_VERSION.to_i < 2 - project_root = Pathname.new(File.expand_path("../..", __FILE__)) # add Homebrew to load path