feat: rename process module to os and add Platform class with name and isPosix methods

Rename the "process" module to "os" across all source files, documentation, tests, and build configuration. Add a new Platform class to the os module with static methods `name` (returns OS string like "Windows", "Linux", "OS X", "iOS", "Unix", "POSIX", or "Unknown") and `isPosix` (returns bool indicating POSIX compliance). Update all import paths from "process" to "os" in test files and module registrations. Move process.c/h to os.c/h, rename processSetArguments to osSetArguments, and regenerate the os.wren.inc bytecode source. Add documentation pages for the os module and Platform class.
This commit is contained in:
Bob Nystrom
2016-05-21 19:44:17 +00:00
parent c5e1c2e57f
commit 95ef1a2814
20 changed files with 170 additions and 65 deletions
+1 -1
View File
@@ -44,6 +44,6 @@ applications that want to embed Wren.
[libuv]: http://libuv.org
* [io](io)
* [process](process)
* [os](os)
* [scheduler](scheduler)
* [timer](timer)
+7
View File
@@ -0,0 +1,7 @@
^title Module "os"
The os module exposes classes for accessing capabilities provided by the
underlying operating system.
* [Platform](platform.html)
* [Process](process.html)
+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.
@@ -1,6 +1,6 @@
^title Process Class
The Process class lets you work with operating processes, including the
The Process class lets you work with operating system processes, including the
currently running one.
## Static Methods
@@ -22,11 +22,12 @@
<nav class="big">
<ul>
<li><a href="../">Modules</a></li>
<li><a href="./">process</a></li>
<li><a href="./">os</a></li>
</ul>
<section>
<h2>process classes</h2>
<h2>os classes</h2>
<ul>
<li><a href="platform.html">Platform</a></li>
<li><a href="process.html">Process</a></li>
</ul>
</section>
@@ -35,14 +36,15 @@
<table>
<tr>
<td><a href="../">Modules</a></td>
<td><a href="./">process</a></td>
<td><a href="./">os</a></td>
</tr>
<tr>
<td colspan="2"><h2>process classes</h2></td>
<td colspan="2"><h2>os classes</h2></td>
</tr>
<tr>
<td>
<ul>
<li><a href="platform.html">Platform</a></li>
<li><a href="process.html">Process</a></li>
</ul>
</td>
-5
View File
@@ -1,5 +0,0 @@
^title Module "process"
The process module exposes a single class for working with operating processes.
* [Process](process.html)
+2 -2
View File
@@ -37,7 +37,7 @@
<h2>cli</h2>
<ul>
<li><a href="io">io</a></li>
<li><a href="process">process</a></li>
<li><a href="os">os</a></li>
<li><a href="scheduler">scheduler</a></li>
<li><a href="timer">timer</a></li>
</ul>
@@ -65,7 +65,7 @@
<td>
<ul>
<li><a href="io">io</a></li>
<li><a href="process">process</a></li>
<li><a href="os">os</a></li>
<li><a href="scheduler">scheduler</a></li>
<li><a href="timer">timer</a></li>
</ul>