-
Notifications
You must be signed in to change notification settings - Fork 745
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into bugfix.reduce-ruby-warnings
- Loading branch information
Showing
28 changed files
with
1,969 additions
and
748 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<!-- | ||
# @title Using Docker | ||
--> | ||
# Using Docker | ||
|
||
So you want to help with Rouge development but aren't too keen on needing to | ||
install Ruby and whatever dependencies are required by Rouge? | ||
[Docker](https://www.docker.com/) to the rescue! | ||
|
||
Docker can be used as a way install Ruby, Rouge and the development dependencies | ||
in a self-contained environment for development. In addition to providing an | ||
alternative for users who don't want to install Ruby, it's also a good choice | ||
for users with an existing installation of Ruby with which they don't want to | ||
interfere. | ||
|
||
## Prerequisites | ||
|
||
This guide assumes you have Docker and Git installed. | ||
|
||
For a guide on installing Docker, we recommend [Docker's official | ||
documentation][dk-inst-docs]. For a guide on installing Git, take a look at | ||
[GitHub's documentation][gh-inst-docs]. | ||
|
||
[dk-inst-docs]: https://docs.docker.com/get-started/ | ||
[gh-inst-docs]: https://help.github.com/en/articles/set-up-git | ||
|
||
## Installing | ||
|
||
### Downloading Rouge | ||
|
||
Clone the project first, and navigate into your clone: | ||
|
||
```bash | ||
$ git clone https://github.com/rouge-ruby/rouge.git | ||
$ cd rouge | ||
``` | ||
|
||
### Configuring the Container | ||
|
||
The following line of code sets up Docker with Ruby and Rouge's development | ||
dependencies: | ||
|
||
```bash | ||
$ docker run -t -v $PWD:/app -v /tmp/vendor:/vendor -w /app -e BUNDLE_PATH=/vendor ruby bundle | ||
``` | ||
|
||
Pretty sweet. Let's unpack this: | ||
|
||
- `docker run -it`: Runs the command in a new container. `-t` is not strictly | ||
necessary but allows nice colors in the output. | ||
|
||
- `-v $PWD:app`: Maps the current folder into the `/app` path within the | ||
container. Used in conjunction with `-w` (see below), this allows the | ||
container to run as if it were inside this directory. | ||
|
||
- `-v /tmp/vendor:/vendor`: Maps an arbitrary `vendor` folder into the `/vendor` | ||
path within the container. This is to persist the installed dependencies | ||
across Docker commands, otherwise you would have to re-install each time as | ||
containers are ephemeral by nature. | ||
|
||
- `-e BUNDLE_PATH=/vendor`: Sets an environment variable inside the container | ||
that tells Bundler to lookup the dependencies from the `/vendor` path (that | ||
we've mapped to our host machine with the previous line) | ||
|
||
- `ruby`: Tells Docker which image to use for the container. The `ruby` image is | ||
part of the official library of "base" Docker images. | ||
|
||
- `bundle`: Runs the `bundle` command within the container. | ||
|
||
## Executing Commands | ||
|
||
### Running Rake | ||
|
||
Just replace the `bundle` command with `rake`: | ||
|
||
```bash | ||
$ docker run -t -v $PWD:/app -v /tmp/vendor:/vendor -w /app -e BUNDLE_PATH=/vendor ruby rake | ||
``` | ||
|
||
### Running Rack | ||
|
||
Similarly, we can run Rack by replacing `bundle` with `rackup`: | ||
|
||
```bash | ||
$ docker run -t -v $PWD:/app -v /tmp/vendor:/vendor -w /app -e BUNDLE_PATH=/vendor -p 9292:9292 ruby bundle exec rackup --host 0.0.0.0 | ||
``` | ||
|
||
The additional command line flags are: | ||
|
||
- `-p 9292:9292`: Exposes port 9292 of the container to the same port on the | ||
host. | ||
|
||
- `bundle exec rackup --host 0.0.0.0`: Runs Rack and asks it to listen on all | ||
addresses. Without this it will only listen on the `localhost` of the | ||
container and we won't be able to access the server from the host machine. | ||
|
||
You should be able to visit <http://localhost:9292> at this point. | ||
|
||
## Conclusion | ||
|
||
Now that you've got Docker set up, perhaps you'd like to work on | ||
{file:docs/LexerDevelopment.md a lexer}? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FORM | ||
"Hello World!" VIEW-AS TEXT AT COL 20 ROW 2 | ||
btnOK AT COL 20 ROW 4 | ||
WITH FRAME f SIZE 50 BY 5 NO-BOX THREE-D. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,13 @@ | ||
Function Get-IPv4Scopes | ||
<# | ||
.SYNOPSIS | ||
Read IPv4Scopes from an array of servers | ||
.PARAMETER Servers | ||
Specifies an array of servers | ||
.EXAMPLE | ||
Get-IPv4Scopes | ||
|
||
Will prompt for all inputs | ||
#> | ||
function Verb-Noun | ||
{ | ||
[CmdletBinding()] | ||
Param( | ||
# 1 | ||
[parameter( | ||
Mandatory=$true, | ||
Position=0, | ||
ValueFromPipelineByPropertyName=$true, | ||
HelpMessage="Server List" | ||
)] | ||
[string[]]$Servers, | ||
#2 | ||
[parameter(Mandatory=$false,ValueFromPipeline=$false)] | ||
[bool]$Unique=$false | ||
) #EndParam | ||
|
||
Begin {} | ||
|
||
Process { | ||
$arrayJobs=@() | ||
foreach ($server in $Servers) { | ||
$arrayJobs+=Invoke-Command -ComputerName $server -scriptblock {Get-DhcpServerv4Scope} -AsJob | ||
} | ||
$complete=$false | ||
while (-not $complete) { | ||
$arrayJobsInProgress= $arrayJobs | Where-Object { $_.State -match 'running' } | ||
if (-not $arrayJobsInProgress) { $complete=$true } | ||
} | ||
$Scopes=$arrayJobs|Receive-Job | ||
$UniqueScopes=$Scopes|Sort-Object -Property ScopeId -Unique | ||
} | ||
|
||
End { | ||
if ($Unique) { return $UniqueScopes } | ||
else { return $Scopes } | ||
} | ||
|
||
} #end function | ||
<# | ||
.SYNOPSIS | ||
Tells you what it does | ||
|
||
.DESCRIPTION | ||
Tells you what it does with more detail. | ||
#> | ||
param ([string]$Name, [string]$Extension = "txt", [string]$foo="bar") | ||
$name = $name + "." + $extension | ||
$name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
(: Authors named Bob Joe who didn't graduate from Harvard :) | ||
//author[first-name = "Joe" and last-name = "Bob"][degree/@from != "Harvard"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
declare namespace html = "http://www.w3.org/1999/xhtml"; | ||
|
||
declare function local:test-function($catalog as document-node()) { | ||
<html> | ||
<head> | ||
<title>XQuery example for the Rouge highlighter</title> | ||
<link href="style.css"/> | ||
</head> | ||
<body> | ||
<h1>List</h1> | ||
<ul> | ||
{for $product in $catalog/items/product[@sell-by > current-date()] return | ||
<li> | ||
<ul> | ||
<li>{data($product/name)}</li> | ||
<li>{$product/price * (1 + $product/tax)}$</li> | ||
</ul> | ||
</li>} | ||
</ul> | ||
</body> | ||
</html> | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.