From 1a7a81ba1a1e32ee9499cfc72a05d08a826b5e1e Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Tue, 16 Apr 2013 22:40:07 +0200 Subject: Check ruby version when running taginfo --- bin/check-translations.rb | 8 ++++++++ web/taginfo.rb | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/bin/check-translations.rb b/bin/check-translations.rb index e96750b..9f76638 100755 --- a/bin/check-translations.rb +++ b/bin/check-translations.rb @@ -3,6 +3,14 @@ # check-translations.rb DIR LANG # +v=RUBY_VERSION.split('.').map{ |x| x.to_i } +if (v[0]*100+v[1])*100+v[0] < 10901 + STDERR.puts "You need at least Ruby 1.9.1 to run taginfo" + exit(1) +end + +#------------------------------------------------------------------------------ + require 'yaml' dir = ARGV[0] diff --git a/web/taginfo.rb b/web/taginfo.rb index 7e46415..f38db37 100755 --- a/web/taginfo.rb +++ b/web/taginfo.rb @@ -27,6 +27,14 @@ # #------------------------------------------------------------------------------ +v=RUBY_VERSION.split('.').map{ |x| x.to_i } +if (v[0]*100+v[1])*100+v[0] < 10901 + STDERR.puts "You need at least Ruby 1.9.1 to run taginfo" + exit(1) +end + +#------------------------------------------------------------------------------ + $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'json' -- cgit v1.2.3