Sha256: dcf329442d01eab1d52f11ab90854a0bd48ea627a1c79c1867771748ee2a0b5b

Contents?: true

Size: 448 Bytes

Versions: 15

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

15 entries across 15 versions & 1 rubygems

Version Path
capybara-screenshot-diff-1.7.1 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.7.0 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.6.3 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.6.2 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.6.1 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.6.0 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.5.5 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.5.4 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.5.3 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.5.2 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.5.1 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.5.0 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.4.2 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.4.1 lib/capybara/screenshot/diff/os.rb
capybara-screenshot-diff-1.4.0 lib/capybara/screenshot/diff/os.rb