Add a Platform class.

- Rename the "process" module to "os".
- Add Platform to it.
- Static "name" method.
- Static "isPosix" method.
- Docs and tests!
This commit is contained in:
Bob Nystrom
2016-05-21 12:44:17 -07:00
parent 6bcc64eb61
commit 06731f66d4
20 changed files with 170 additions and 65 deletions
+26
View File
@@ -0,0 +1,26 @@
^title Platform Class
The Platform class exposes basic information about the operating system Wren is
running on top of.
## Static Methods
### **name**
The name of the platform. This roughly describes the operating system, and is
usually one of:
* "iOS"
* "Linux"
* "OS X"
* "POSIX"
* "Unix"
* "Windows"
If Wren was compiled for an unknown operating system, returns "Unknown".
### **isPosix**
Returns `true` if the host operating system is known to support the POSIX
standard. This is true for Linux and other Unices, as well as the various Apple
operating systems.