Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/camertron/ohey
A rewrite of the platform detection logic in ohai, but with fewer dependencies and 100% less metaprogramming.
https://github.com/camertron/ohey
Last synced: 2 months ago
JSON representation
A rewrite of the platform detection logic in ohai, but with fewer dependencies and 100% less metaprogramming.
- Host: GitHub
- URL: https://github.com/camertron/ohey
- Owner: camertron
- License: mit
- Created: 2021-05-09T03:59:30.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-05-09T04:08:22.000Z (over 3 years ago)
- Last Synced: 2024-10-11T12:23:19.803Z (3 months ago)
- Language: Ruby
- Size: 15.6 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.com/camertron/ohey.svg?branch=master)](https://travis-ci.com/camertron/ohey)
## 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:
```ruby
gem 'ohey', '~> 1.0'
```## Usage
### Detecting the current platform:
```ruby
platform = Ohey.current_platformplatform.name # => "mac_os_x"
platform.family # => "mac_os_x
platform.build # => "19H1030"
platform.version # => "10.15.7"
```### Registering a new platform:
```ruby
Ohey.register_platform(:name, PlatformClass.new)
```The second argument must respond to the `name`, `family`, `build`, and `version` methods.
### Listing Registered Plaforms
```ruby
Ohey.registered_platforms # => {:darwin=>#, ...}
```## License
Licensed under the MIT license. See LICENSE for details.
## Authors
* The numerous authors who contributed to https://github.com/chef/ohai.
* Adapted by Cameron C. Dutro: https://github.com/camertron