Skip to content

Commit 803755c

Browse files
author
Mostafa Kamal
committed
ruby
1 parent 54c319e commit 803755c

File tree

4 files changed

+213
-0
lines changed

4 files changed

+213
-0
lines changed

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.DS_Store
2+
npm-debug.log
3+
node_modules

LICENSE.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2015 Vuong Phan
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.

package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "atom-ruby",
3+
"version": "0.0.0",
4+
"description": "ruby snippets >> Snippet >> atom-ruby by @code4mk & 0devco",
5+
"keywords": [
6+
"ruby",
7+
"snippet",
8+
"code4mk",
9+
"0devco"
10+
],
11+
"repository": {
12+
"type": "git",
13+
"url": "https://github.com/code4mk/atom-ruby"
14+
},
15+
"license": "MIT",
16+
"engines": {
17+
"atom": ">=1.0.0 <2.0.0"
18+
},
19+
"dependencies": {}
20+
}

snippets/basic.cson

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
'.source.ruby':
2+
3+
"comment->ruby":
4+
"prefix": "rb-comment"
5+
"body": """
6+
# $1
7+
"""
8+
"comment 2->ruby":
9+
"prefix": "rb-comment2"
10+
"body": """
11+
=begin
12+
$1
13+
=end
14+
"""
15+
"gets->ruby":
16+
"prefix": "rb-gets"
17+
"body": """
18+
gets
19+
"""
20+
"puts ->ruby":
21+
"prefix": "rb-puts"
22+
"body": """
23+
puts "$1"
24+
"""
25+
"print->ruby":
26+
"prefix": "rb-print"
27+
"body": """
28+
print "$1"
29+
"""
30+
"var->ruby":
31+
"prefix": "rb-var"
32+
"body": """
33+
age = $1
34+
"""
35+
"global var->ruby":
36+
"prefix": "rb-varglobal"
37+
"body": """
38+
$age = $1
39+
"""
40+
"constant var->ruby":
41+
"prefix": "rb-varconstant"
42+
"body": """
43+
AGE = $1
44+
"""
45+
"instance var->ruby":
46+
"prefix": "rb-varinstance"
47+
"body": """
48+
@age = $1
49+
"""
50+
"class var->ruby":
51+
"prefix": "rb-varclass"
52+
"body": """
53+
@@age = $1
54+
"""
55+
56+
"hash {}->ruby":
57+
"prefix": "rb-hash"
58+
"body": """
59+
users = {
60+
"name" => "kamal$1"
61+
}
62+
"""
63+
"hash element {=>}->ruby":
64+
"prefix": "rb-hashelement"
65+
"body": """
66+
"age" => "21$1"
67+
"""
68+
"if->ruby":
69+
"prefix": "rb-if"
70+
"body": """
71+
if $1
72+
$2
73+
end
74+
"""
75+
"if else ->ruby":
76+
"prefix": "rb-ifelse"
77+
"body": """
78+
if $1
79+
$2
80+
else
81+
$3
82+
end
83+
"""
84+
"else if ->ruby":
85+
"prefix": "rb-elif"
86+
"body": """
87+
elif $1
88+
$2
89+
"""
90+
"case (switch) ->ruby":
91+
"prefix": "rb-case"
92+
"body": """
93+
case $1
94+
when $2
95+
$3
96+
else
97+
$4
98+
end
99+
"""
100+
"when (case)->ruby":
101+
"prefix": "rb-when"
102+
"body": """
103+
when $1
104+
$2
105+
"""
106+
"for->ruby":
107+
"prefix": "rb-for"
108+
"body": """
109+
for i in $1 do
110+
$2
111+
end
112+
"""
113+
"while->ruby":
114+
"prefix": "rb-while"
115+
"body": """
116+
while $1
117+
$2
118+
end
119+
"""
120+
"until->ruby":
121+
"prefix": "rb-until"
122+
"body": """
123+
until $1
124+
$2
125+
end
126+
"""
127+
128+
"method->ruby":
129+
"prefix": "rb-method"
130+
"body": """
131+
def method_name$1()
132+
$2
133+
end
134+
"""
135+
136+
"class->ruby":
137+
"prefix": "rb-class"
138+
"body": """
139+
class Name$1
140+
$1
141+
end
142+
"""
143+
"class object->ruby":
144+
"prefix": "rb-classobject"
145+
"body": """
146+
variable = Name$1.new
147+
"""
148+
"class extends->ruby":
149+
"prefix": "rb-classextends"
150+
"body": """
151+
< Name$1
152+
"""
153+
154+
"module->ruby":
155+
"prefix": "rb-module"
156+
"body": """
157+
module Name$1
158+
$1
159+
end
160+
"""
161+
"call module class->ruby":
162+
"prefix": "rb-moduleclasscall"
163+
"body": """
164+
variable = ModuleName.ClassName$1.new
165+
"""
166+
"module include->ruby":
167+
"prefix": "rb-moduleinclude"
168+
"body": """
169+
include ModuleName
170+
"""

0 commit comments

Comments
 (0)