Sha256: a86e29b72420d32e6bd3a03fe25ee58e54a61f2531b36330087b145e3d7b1ef6

Contents?: true

Size: 741 Bytes

Versions: 1

Compression:

Stored size: 741 Bytes

Contents

module CI
  module Reporter
    module Internal
      def run_ruby_acceptance(cmd)
        ENV['CI_REPORTS'] ||= "acceptance/reports"
        if ENV['RUBYOPT']
          opts = ENV['RUBYOPT']
          ENV['RUBYOPT'] = nil
        else
          opts = "-rubygems"
        end
        begin
          result_proc = proc {|ok,*| puts "Failures above are expected." unless ok }
          ruby "-Ilib #{opts} #{cmd}", &result_proc
        ensure
          ENV['RUBYOPT'] = opts if opts != "-rubygems"
          ENV.delete 'CI_REPORTS'
        end
      end

      def save_env(v)
        ENV["PREV_#{v}"] = ENV[v]
      end

      def restore_env(v)
        ENV[v] = ENV["PREV_#{v}"]
        ENV.delete("PREV_#{v}")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ci_reporter-2.0.0.alpha1 lib/ci/reporter/internal.rb