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
|
# File 'lib/rails/generators/oboe/install_generator.rb', line 9
def copy_initializer
@tracing_mode = 'through'
@sample_rate = '300000'
@verbose = 'false'
while true do
print_body
user_tracing_mode = ask shell.set_color "* Tracing Mode? [through]:", :yellow
user_tracing_mode.downcase!
break if user_tracing_mode.blank?
valid = ['always', 'through', 'never'].include?(user_tracing_mode)
say shell.set_color "Valid values are 'always', 'through' or 'never'", :red, :bold unless valid
if valid
@tracing_mode = user_tracing_mode
break
end
end
template "oboe_initializer.rb", "config/initializers/oboe.rb"
end
|