Skip to content

Commit 8976f67

Browse files
committed
first release
0 parents  commit 8976f67

10 files changed

+357
-0
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.1.0 - First Release
2+
* Every feature added
3+
* Every bug fixed

LICENSE.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2015 Arata
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

LICENSE.md~

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2015 <Your name here>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# language-pyresttest package
2+
3+
Pyresttest language support in Atom
4+
5+
![A screenshot of your package](https://f.cloud.github.com/assets/69169/2290250/c35d867a-a017-11e3-86be-cd7c5bf3ff9b.gif)

README.md~

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# language-pyresttest package
2+
3+
A short description of your package.
4+
5+
![A screenshot of your package](https://f.cloud.github.com/assets/69169/2290250/c35d867a-a017-11e3-86be-cd7c5bf3ff9b.gif)

grammars/pyresttest.cson

+223
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
'scopeName': 'source.yaml'
2+
'name': 'PyRestTest'
3+
'fileTypes': ['yaml']
4+
'patterns': [
5+
{ 'include': '#comment' }
6+
{ 'include': '#yaml' }
7+
]
8+
'repository':
9+
'comment':
10+
'match': '^(\\s*)#.*$'
11+
'name': 'comment.line.number-sign.pyresttest'
12+
'constant':
13+
'match': '\\b(?:true|false|null)\\b'
14+
'name': 'constant.language.pyresttest'
15+
'number':
16+
'comment': 'handles integer and decimal numbers'
17+
'match': '-?(?=[1-9]|0(?!\\d))\\d+(\\.\\d+)?([eE][+-]?\\d+)?'
18+
'name': 'constant.numeric.pyresttest'
19+
'escape_char':
20+
'match': '\\\\\\S'
21+
'name': 'constant.character.escape.pyresttest'
22+
'single_quoted_string':
23+
'begin': '\''
24+
'beginCaptures':
25+
'0':
26+
'name': 'punctuation.definition.string.begin.pyresttest'
27+
'end': '\''
28+
'endCaptures':
29+
'0':
30+
'name': 'punctuation.definition.string.end.pyresttest'
31+
'name': 'string.quoted.simple'
32+
'patterns': [
33+
{ 'include': '#escape_char' }
34+
{ 'include': '#variable' }
35+
{ 'include': '#url' }
36+
{ 'include': '#object' }
37+
]
38+
'double_quoted_string':
39+
'begin': '"'
40+
'beginCaptures':
41+
'0':
42+
'name': 'punctuation.definition.string.begin.pyresttest'
43+
'end': '"'
44+
'endCaptures':
45+
'0':
46+
'name': 'punctuation.definition.string.end.pyresttest'
47+
'name': 'string.quoted.simple'
48+
'patterns': [
49+
{ 'include': '#escape_char' }
50+
{ 'include': '#variable' }
51+
{ 'include': '#url' }
52+
{ 'include': '#object' }
53+
]
54+
'variable':
55+
'patterns': [
56+
{
57+
'match': '(\\$)[a-zA-Z_][a-zA-Z0-9_]*'
58+
'captures':
59+
'1':
60+
'name': 'punctuation.definition.variable.pyresttest'
61+
'name': 'variable.other.normal.pyresttest'
62+
}
63+
]
64+
'pyresttest_constant':
65+
'match': 'template|jmespath|jsonpath_mini|comparator|expected|schema|file'
66+
'name': 'constant.language.pyresttest'
67+
'object':
68+
'begin':'\\{'
69+
'beginCaptures':
70+
'0':
71+
'name': 'punctuation.definition.dictionary.begin.pyresttest'
72+
'end':'\\}'
73+
'endCaptures':
74+
'0':
75+
'name': 'punctuation.definition.dictionary.end.pyresttest'
76+
'name': 'meta.structure.dictionary.pyresttest'
77+
'patterns': [
78+
{
79+
'comment': 'the JSON object key'
80+
'include': '#key'
81+
}
82+
{
83+
'begin': ':'
84+
'beginCaptures':
85+
'0':
86+
'name': 'punctuation.separator.dictionary.key-value.pyresttest'
87+
'end': '(,)|(?=\\})'
88+
'endCaptures':
89+
'1':
90+
'name': 'punctuation.separator.dictionary.pair.pyresttest'
91+
'name': 'meta.structure.dictionary.value.pyresttest'
92+
'patterns': [
93+
{
94+
'comment': 'the JSON object value'
95+
'include': '#value'
96+
}
97+
]
98+
}
99+
]
100+
'yaml':
101+
'begin': '^(?:\\s*)(?:(-)\\s*)'
102+
'beginCaptures':
103+
'1':
104+
'name': 'punctuation.definition.entry.yaml'
105+
'end': '$'
106+
'patterns': [
107+
{
108+
'comment': 'the YAML tag'
109+
'include': '#yaml_tag'
110+
}
111+
{
112+
'begin': ':'
113+
'beginCaptures':
114+
'0':
115+
'name': 'punctuation.separator.yaml.tag-value.pyresttest'
116+
'end': '(?=$)'
117+
'name': 'meta.structure.yaml.value.pyresttest'
118+
'patterns': [
119+
{
120+
'comment': 'the YAML value'
121+
'include': '#yaml_value'
122+
}
123+
]
124+
}
125+
]
126+
'key':
127+
'patterns': [
128+
{ 'include': '#pyresttest_constant' }
129+
{ 'include': '#single_quoted_string' }
130+
{ 'include': '#double_quoted_string' }
131+
{
132+
'match': '\\w+'
133+
'name': 'entity.name.type.dictionary.key.pyresttest'
134+
}
135+
]
136+
'yaml_tag':
137+
'patterns': [
138+
{
139+
'match': '\\w+'
140+
'name': 'entity.name.tag.pyresttest'
141+
}
142+
{
143+
'begin': '\''
144+
'beginCaptures':
145+
'0':
146+
'name': 'punctuation.definition.string.begin.pyresttest'
147+
'end': '\''
148+
'endCaptures':
149+
'0':
150+
'name': 'punctuation.definition.string.end.pyresttest'
151+
'name': 'entity.name.tag.pyresttest'
152+
'patterns': [
153+
{ 'include': '#escape_char' }
154+
]
155+
}
156+
{
157+
'begin': '"'
158+
'beginCaptures':
159+
'0':
160+
'name': 'punctuation.definition.string.begin.pyresttest'
161+
'end': '"'
162+
'endCaptures':
163+
'0':
164+
'name': 'punctuation.definition.string.end.pyresttest'
165+
'name': 'entity.name.tag.pyresttest'
166+
'patterns': [
167+
{ 'include': '#escape_char' }
168+
]
169+
}
170+
]
171+
'yaml_value':
172+
'patterns': [
173+
{ 'include': '#single_quoted_string' }
174+
{ 'include': '#double_quoted_string' }
175+
{ 'include': '#url' }
176+
{ 'include': '#object' }
177+
]
178+
'value':
179+
'patterns': [
180+
{ 'include': '#constant' }
181+
{ 'include': '#number' }
182+
{ 'include': '#url' }
183+
{ 'include': '#single_quoted_string' }
184+
{ 'include': '#double_quoted_string' }
185+
{ 'include': '#variable' }
186+
{ 'include': '#array' }
187+
{ 'include': '#object' }
188+
]
189+
'array':
190+
'begin': '\\['
191+
'beginCaptures':
192+
'0':
193+
'name': 'punctuation.definition.array.begin.pyresttest'
194+
'end': '\\]'
195+
'endCaptures':
196+
'0':
197+
'name': 'punctuation.definition.array.end.pyresttest'
198+
'name': 'meta.structure.array.json'
199+
'patterns': [
200+
{ 'include': '#value' }
201+
{
202+
'match': ','
203+
'name': 'punctuation.separator.array.pyresttest'
204+
}
205+
{
206+
'match': '[^\\s\\]]'
207+
'name': 'invalid.illegal.expected-array-separator.pyresttest'
208+
}
209+
]
210+
'url_parameter_key':
211+
'match': '(?:\\?|&)(\\w+)(?=\\=)'
212+
'captures':
213+
'1':
214+
'name': 'url.parameter.key.pyresttest'
215+
'url':
216+
'match': '(?:(?:https?:\\/)|(?:\\.+))?(\\/[\\w\\.\\-\\?=\\$\\&]*)+'
217+
'name': 'markup.link.pyresttest'
218+
'captures':
219+
'1':
220+
'patterns': [
221+
{ 'include': '#url_parameter_key' }
222+
{ 'include': '#variable'}
223+
]

package.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "language-pyresttest",
3+
"version": "0.0.0",
4+
"description": "Pyresttest language support in Atom",
5+
"engines": {
6+
"atom": "*",
7+
"node": "*"
8+
},
9+
"homepage": "https://github.com/BastienAr/language-pyresttest",
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/BastienAr/language-pyresttest.git"
13+
},
14+
"license": "MIT",
15+
"bugs": {
16+
"url": "https://github.com/BastienAr/language-pyresttest/issues"
17+
},
18+
"devDependencies": {
19+
"coffeelint": "^1.10.1"
20+
}
21+
}

settings/language-pyresttest.cson

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'.source.yaml':
2+
'editor':
3+
'autoIndentOnPaste': false
4+
'commentStart': '# '
5+
'foldEndPattern': '^\\s*$|^\\s*\\}|^\\s*\\]|^\\s*\\)'
6+
'increaseIndentPattern': '^\\s*.*(:|-) ?(&\\w+)?(\\{[^}"\']*|\\([^)"\']*)?$'
7+
'decreaseIndentPattern': '^\\s+\\}$'
8+
'tabType': 'soft'

snippets/snippets.cson

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
'.source.yaml':
2+
'Configuration':
3+
'prefix': 'config'
4+
'body': """
5+
---
6+
- config:
7+
- testset: '${1:Test name}'
8+
- variable_binds: \{${2:key: value, comma separated}\}
9+
10+
$3
11+
"""
12+
13+
'Test':
14+
'prefix': 'test'
15+
'body': """
16+
- test:
17+
- group: '${1:Group name}'
18+
- name: '${2:Test name}'
19+
- url: ${3:/relative/url}
20+
$4
21+
"""
22+
23+
'Template':
24+
'prefix': 'template'
25+
'body': """
26+
\{template: ${2:value}\}$2
27+
"""
28+
29+
'Extract compare':
30+
'prefix': 'compare'
31+
'body': """
32+
- compare: \{${1:extractor}: "${2:extractor args}", comparator: "${3:function}", expected: ${4:value}\}$5
33+
"""
34+
35+
'Extract test':
36+
'prefix': 'extract-test'
37+
'body': """
38+
- extract_test: \{${1:extractor}: "${2:extractor args}", test: "${3:test}"\}$4
39+
"""

spec/pyresttest-spec.coffee

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
describe "PyRestTest grammar", ->
2+
grammar = null
3+
4+
beforeEach ->
5+
waitsForPromise ->
6+
atom.packages.activatePackage('language-pyresttest')
7+
8+
runs ->
9+
grammar = atom.grammars.grammarForScopeName('source.yaml')
10+
11+
it "parses the grammar", ->
12+
expect(grammar).toBeDefined()
13+
expect(grammar.scopeName).toBe 'source.yaml'

0 commit comments

Comments
 (0)