Sha256: bdff0275041640985a93e70e7ac6e4d4c71ada9333e82a3f884f0d870667b79b

Contents?: true

Size: 448 Bytes

Versions: 8

Compression:

Stored size: 448 Bytes

Contents

# frozen_string_literal: true

module Capybara
  module Screenshot
    module Os
      ON_WINDOWS = !!(RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)
      ON_MAC = !!(RbConfig::CONFIG['host_os'] =~ /darwin/)
      ON_LINUX = !!(RbConfig::CONFIG['host_os'] =~ /linux/)

      def os_name
        return 'windows' if ON_WINDOWS
        return 'macos' if ON_MAC
        return 'linux' if ON_LINUX

        'unknown'
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
capybara-screenshot-diff-1.3.1 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.3.0 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.2.1 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.2.0 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.1.0 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.0.2 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.0.1 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.0.0 lib/capybara/screenshot/diff/os.rb