35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/secrett11tto.rb', line 35
def secretify(range = 10..40)
str, klasses, parts = [], [], []
copy = self.chars
while copy.present?
parts.push copy.slice!(0...(rand(2)+1)).join
end
parts.each do |part|
tag = Utils.tag
klass = Utils.klass_name
str << ["<#{tag} class=#{klass}>" + Utils::ALL_VOCABULARY.sample(range.to_a.sample).join + "</#{tag}>", ERB::Util.h(part)].shuffle.join
klasses << klass
end
[
"<style>",
klasses.collect{|e| Utils.css_klass(e)}.join,
"</style>",
str.join,
].join.html_safe
end
|