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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
# File 'lib/yogi.rb', line 63
def yogify
count_hash = []
buffer = File.open('.git/.ignoremefile.txt', 'r').read
file_sample = JSON.parse(buffer)
file_sample.each do |file_name|
text = File.open(file_name, "r"){ |file| file.read }
$pre_counted_comma = count_em(text,",")
$pre_counted_semicolon = count_em(text,";")
$pre_counted_l = count_em(text,"ll")
$pre_counted_3 = count_em(text,"3")
$pre_counted_s = count_em(text,/[s]$/)
$pre_counted_bracket = count_em(text,"}")
$pre_counted_px = count_em(text,"px")
$pre_counted_sq_bracket = count_em(text,">")
$pre_counted_equal = count_em(text,"==")
$pre_counted_sdot = count_em(text,/s\./)
$pre_counted_underscore = count_em(text,"_")
new_contents1 = text.gsub(";"){rand(2).zero? ? ";" : ":"}
new_contents2 = new_contents1.gsub(","){rand(2).zero? ? "," : " "}
new_contents3 = new_contents2.gsub("ll"){rand(2).zero? ? "ll" : "l1"}
new_contents4 = new_contents3.gsub("3"){rand(2).zero? ? "3" : "E"}
new_contents5 = new_contents4.gsub(/[s]$/){rand(2).zero? ? " " : "5"}
new_contents6 = new_contents5.gsub("}"){rand(2).zero? ? "}" : ")"}
new_contents7 = new_contents6.gsub("px"){rand(2).zero? ? "px" : "xp"}
new_contents8 = new_contents7.gsub(">"){rand(2).zero? ? "<" : ">"}
new_contents9 = new_contents8.gsub("=="){rand(2).zero? ? "==" : "="}
new_contents10 = new_contents9.gsub(/s\./){rand(2).zero? ? ".s" : "."}
new_contents11 = new_contents10.gsub("_"){rand(2).zero? ? "" : "-"}
File.open(file_name, "w") {|file| file.puts new_contents11 }
text = File.open(file_name, "r"){ |file| file.read } post_counted_comma = count_em(text,",")
post_counted_semicolon = count_em(text,";")
post_counted_l = count_em(text,"ll")
post_counted_3 = count_em(text,"3")
post_counted_s = count_em(text,/[s]$/)
post_counted_bracket = count_em(text,"}")
post_counted_px = count_em(text,"px")
post_counted_sq_bracket = count_em(text,">")
post_counted_equal = count_em(text,"==")
post_counted_sdot = count_em(text,/s\./)
post_counted_underscore = count_em(text,"_")
$pre_diff_comma = $pre_counted_comma - post_counted_comma
$pre_diff_semicolon = $pre_counted_semicolon - post_counted_semicolon
$pre_diff_l = $pre_counted_l - post_counted_l
$pre_diff_3 = $pre_counted_3 - post_counted_3
$pre_diff_s = $pre_counted_s - post_counted_s
$pre_diff_bracket = $pre_counted_bracket - post_counted_bracket
$pre_diff_px = $pre_counted_px - post_counted_px
$pre_diff_sq_bracket = $pre_counted_sq_bracket - post_counted_sq_bracket
$pre_diff_equal = $pre_counted_equal - post_counted_equal
$pre_diff_sdot = $pre_counted_sdot - post_counted_sdot
$pre_diff_underscore = $pre_counted_underscore - post_counted_underscore
pre_count_hash = {file_name => {
"pre_counted_comma": $pre_counted_comma,
"pre_counted_semicolon": $pre_counted_semicolon,
"pre_counted_l": $pre_counted_l,
"pre_counted_3": $pre_counted_3,
"pre_counted_s": $pre_counted_s,
"pre_counted_bracket": $pre_counted_bracket,
"pre_counted_px": $pre_counted_px,
"pre_counted_sq_bracket": $pre_counted_sq_bracket,
"pre_counted_equal": $pre_counted_equal,
"pre_counted_sdot": $pre_counted_sdot,
"pre_counted_underscore": $pre_counted_underscore,
"pre_diff_comma": $pre_diff_comma,
"pre_diff_semicolon": $pre_diff_semicolon,
"pre_diff_l": $pre_diff_l,
"pre_diff_3": $pre_diff_3,
"pre_diff_s": $pre_diff_s,
"pre_diff_bracket": $pre_diff_bracket,
"pre_diff_px": $pre_diff_px,
"pre_diff_sq_bracket": $pre_diff_sq_bracket,
"pre_diff_equal": $pre_diff_equal,
"pre_diff_sdot": $pre_diff_sdot,
"pre_diff_underscore": $pre_diff_underscore
}}
count_hash << pre_count_hash
end
File.open('.git/.ignoreme.json', "a") {|file| file.write count_hash.to_json}
puts "You can start your debugging now, #{$account}!"
puts "To check your progess type ..'checkme'"
puts "If your are sick of it, just type...'fixme'"
if OS.mac?
file = File.join(__dir__, 'sound', 'activated.mp3')
escfile = Shellwords.escape(file)
cmd = "afplay #{escfile}"
system cmd
end
end
|