-
Notifications
You must be signed in to change notification settings - Fork 1
/
sample.rb
executable file
·107 lines (88 loc) · 1.45 KB
/
sample.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/env ruby
# dog When writing indent rules, you can use ‘treesit-check-indent’ to
# check if your indentation is correct. To debug what went wrong, set
# ‘treesit--indent-verbose’ to non-nil. Then when you indent, Emacs
# tells you which rule is applied in the echo area.
fred = 2
dog = while fred < 12
puts 'hi'
fred *= 4
fred
end
puts dog.inspect
dog = while fred > 12 do
fred *= 4
end
a + b *
c *
d +
12
call_me("today",
"tomorrow")
array = [
9.9,
10,
11,
]
new_hash = {
frog: 12,
daft: 92,
egg: 99
}
hazy = 99 if europe != asia
hazy /= 12 while hazy > 99
while dog < fred
dog += 12
end
until fred > dog do
fred *= 1.2
next if friday
end
for value in [1, 2, 3] do
redo if ambivalent
puts value
break
end
class HaveNoClass
end
class MyClass < HaveNoClass
ConstAssign = 12
def sample(arg2, *args, **rest, &proc)
puts "12"
end
# dog has flees
def blob(arg12,
arg2, # bob
xxx,
yyy
)
case life
when "hard",
"shop",
"hot"
play("victim")
when /abcd/,
/efgh/
buy("twitter",
"friday"
)
end
happy = 99
if god != satin
sin += 12
egypt = 92
elsif
dog = 99
else
golf -= 18
end
unless bismark
sink += 12
end
i = 12
while i < 44
i += 2
end
puts i
end
end