Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dhanushnehru/runtime_environment
A rust package to check runtime environment using Rust
https://github.com/dhanushnehru/runtime_environment
crate-solutions crates crates-io crates-of-the-week cratesio environment hacktobefest2024 hacktoberfest hacktoberfest-accepted opensource package-manager packages runtime runtime-environment rust rust-crate rust-crates rust-lang rust-library rustlang
Last synced: about 1 month ago
JSON representation
A rust package to check runtime environment using Rust
- Host: GitHub
- URL: https://github.com/dhanushnehru/runtime_environment
- Owner: DhanushNehru
- License: mit
- Created: 2024-06-07T14:50:24.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-06-07T15:47:06.000Z (6 months ago)
- Last Synced: 2024-10-12T15:21:50.121Z (about 1 month ago)
- Topics: crate-solutions, crates, crates-io, crates-of-the-week, cratesio, environment, hacktobefest2024, hacktoberfest, hacktoberfest-accepted, opensource, package-manager, packages, runtime, runtime-environment, rust, rust-crate, rust-crates, rust-lang, rust-library, rustlang
- Language: Rust
- Homepage: https://crates.io/crates/runtime_environment
- Size: 9.77 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# runtime_environment
A Rust library to check the operating system at runtime.
## Installation
In your `Cargo.toml`, add the following line under the `[dependencies]` section:
```rust
runtime_environment = "0.1.0"
```## Usage
This is an example usage someone might do:```rust
use runtime_environment::{is_mac_os, is_windows, is_linux};fn main() {
if is_mac_os() {
println!("Running on macOS");
} else if is_windows() {
println!("Running on Windows");
} else if is_linux() {
println!("Running on Linux");
} else {
println!("Running on an unknown OS");
}
}
```
## Functionsis_mac_os() -> bool
Returns true if the operating system is macOS.
is_windows() -> bool
Returns true if the operating system is Windows.
is_linux() -> bool
Returns true if the operating system is Linux.
## Testing
To run the tests, use the following command:```rust
cargo test
```## License
This project is licensed under the MIT License.
Replace `"0.1.0"` with the actual version number of your package when you publish it.
This `README.md` file provides a clear overview of the library, installation instructions, example usage, and information on the available functions.
## Gitpod
In the cloud-free development runtime_environment where you can directly start coding.
You can use Gitpod in the cloud [![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/DhanushNehru/runtime_environment/)
----
Feel free to update the README.md or raise issues if any to enhance the project