From 3d252b86cb9b8a472b8fb26fc752fd2b51f8dac5 Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Tue, 26 Apr 2016 13:57:01 +0900 Subject: [PATCH] Add Platform.windows? --- lib/grntest/platform.rb | 24 ++++++++++++++++++++++++ lib/grntest/test-runner.rb | 1 + 2 files changed, 25 insertions(+) create mode 100644 lib/grntest/platform.rb diff --git a/lib/grntest/platform.rb b/lib/grntest/platform.rb new file mode 100644 index 0000000..f7bf54f --- /dev/null +++ b/lib/grntest/platform.rb @@ -0,0 +1,24 @@ +# Copyright (C) 2016 Kouhei Sutou +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +module Grntest + module Platform + class << self + def windows? + /mswin|mingw|cygwin/ === RUBY_PLATFORM + end + end + end +end diff --git a/lib/grntest/test-runner.rb b/lib/grntest/test-runner.rb index 4a84370..9735e84 100644 --- a/lib/grntest/test-runner.rb +++ b/lib/grntest/test-runner.rb @@ -19,6 +19,7 @@ require "json" +require "grntest/platform" require "grntest/error" require "grntest/log-parser" require "grntest/executors"