-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added simple and present expressions
- Loading branch information
Showing
14 changed files
with
2,705 additions
and
314 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,11 @@ | ||
# nearley-tutorial | ||
# Nearley Tutorial | ||
|
||
This README outlines the details of collaborating on this Ember application. | ||
A short introduction of this app could easily go here. | ||
This is the code companion to my [Nearley: When Regex Isn't Enough](https://crunchingnumbers.live/), presented at the Ember ATX Meetup on 1/24/2019. | ||
|
||
## Prerequisites | ||
You can check how the project should look after each step, by running `git checkout` and specifying the branch name: | ||
|
||
You will need the following things properly installed on your computer. | ||
|
||
* [Git](https://git-scm.com/) | ||
* [Node.js](https://nodejs.org/) (with npm) | ||
* [Ember CLI](https://ember-cli.com/) | ||
* [Google Chrome](https://google.com/chrome/) | ||
|
||
## Installation | ||
|
||
* `git clone <repository-url>` this repository | ||
* `cd nearley-tutorial` | ||
* `npm install` | ||
|
||
## Running / Development | ||
|
||
* `ember serve` | ||
* Visit your app at [http://localhost:4200](http://localhost:4200). | ||
* Visit your tests at [http://localhost:4200/tests](http://localhost:4200/tests). | ||
|
||
### Code Generators | ||
|
||
Make use of the many generators for code, try `ember help generate` for more details | ||
|
||
### Running Tests | ||
|
||
* `ember test` | ||
* `ember test --server` | ||
|
||
### Linting | ||
|
||
* `npm run lint:hbs` | ||
* `npm run lint:js` | ||
* `npm run lint:js -- --fix` | ||
|
||
### Building | ||
|
||
* `ember build` (development) | ||
* `ember build --environment production` (production) | ||
|
||
### Deploying | ||
|
||
Specify what it takes to deploy your app. | ||
|
||
## Further Reading / Useful Links | ||
|
||
* [ember.js](https://emberjs.com/) | ||
* [ember-cli](https://ember-cli.com/) | ||
* Development Browser Extensions | ||
* [ember inspector for chrome](https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi) | ||
* [ember inspector for firefox](https://addons.mozilla.org/en-US/firefox/addon/ember-inspector/) | ||
| Branch name | Added features | | ||
| ----------- | ------------------------------------ | | ||
| starter | Starter project | | ||
| master | Added simple and present expressions | |
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,25 +1,26 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>NearleyTutorial</title> | ||
<meta name="description" content=""> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>Nearley Tutorial</title> | ||
<meta name="author" content="Isaac J. Lee"> | ||
<meta name="description" content="Ember-Nearley tutorial for Ember ATX Meetup"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
{{content-for "head"}} | ||
{{content-for "head"}} | ||
|
||
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css"> | ||
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/nearley-tutorial.css"> | ||
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/vendor.css"> | ||
<link integrity="" rel="stylesheet" href="{{rootURL}}assets/nearley-tutorial.css"> | ||
|
||
{{content-for "head-footer"}} | ||
</head> | ||
<body> | ||
{{content-for "body"}} | ||
{{content-for "head-footer"}} | ||
</head> | ||
<body> | ||
{{content-for "body"}} | ||
|
||
<script src="{{rootURL}}assets/vendor.js"></script> | ||
<script src="{{rootURL}}assets/nearley-tutorial.js"></script> | ||
<script src="{{rootURL}}assets/vendor.js"></script> | ||
<script src="{{rootURL}}assets/nearley-tutorial.js"></script> | ||
|
||
{{content-for "body-footer"}} | ||
</body> | ||
{{content-for "body-footer"}} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import ldapFilterGrammar from 'ldap-filter-grammar'; | ||
import nearley from 'nearley'; | ||
|
||
export default { | ||
createLdapObject(ldapFilter) { | ||
try { | ||
const parser = new nearley.Parser(nearley.Grammar.fromCompiled(ldapFilterGrammar)); | ||
|
||
parser.feed(ldapFilter); | ||
const results = parser.results; | ||
|
||
// If there is a match, return the first result | ||
if (results.length > 0) { | ||
return results[0]; | ||
} | ||
|
||
} catch (error) { | ||
// If there is no match, return false | ||
return false; | ||
|
||
} | ||
|
||
return false; | ||
}, | ||
}; |
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,5 @@ | ||
nearleyc ./vendor/ldap-filter-grammar.ne -o ./vendor/ldap-filter-grammar-temp.js | ||
browserify ./vendor/ldap-filter-grammar-temp.js -o ./vendor/ldap-filter-grammar.js -s ldap-filter-grammar | ||
rm ./vendor/ldap-filter-grammar-temp.js | ||
|
||
nearley-railroad ./vendor/ldap-filter-grammar.ne -o ./vendor/ldap-filter-grammar.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"jquery-integration": true | ||
"jquery-integration": false | ||
} |
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.