Project

ohey

0.0
No commit activity in last 3 years
No release in over 3 years
A rewrite of the platform detection logic in ohai, but with fewer dependencies and 100% less metaprogramming.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.0
 Project Readme

Build Status

ohey

A rewrite of the platform detection logic in ohai, but with fewer dependencies and 100% less metaprogramming.

Installation

Install ohey by running gem install ohey or by adding it to your Gemfile:

gem 'ohey', '~> 1.0'

Usage

Detecting the current platform:

platform = Ohey.current_platform

platform.name     # => "mac_os_x"
platform.family   # => "mac_os_x
platform.build    # => "19H1030"
platform.version  # => "10.15.7"

Registering a new platform:

Ohey.register_platform(:name, PlatformClass.new)

The second argument must respond to the name, family, build, and version methods.

Listing Registered Plaforms

Ohey.registered_platforms  # => {:darwin=>#<Ohey::Darwin:0x00007ff9d51f1ef0>, ...}

License

Licensed under the MIT license. See LICENSE for details.

Authors