Skip to content

Commit 1da393c

Browse files
committed
Moving initializer template to erb
1 parent 4cedfd0 commit 1da393c

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

lib/generators/lit/install_generator.rb

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,22 @@ class InstallGenerator < ::Rails::Generators::Base
1111
desc 'Automates Lit installation'
1212

1313
def set_authentication_function
14-
@authentication_function = options['authentication-function'].presence ||
15-
ask("What's the authentication function, ie. :authenticate_user! :").presence ||
16-
nil
14+
@authentication_function =
15+
options['authentication-function'].presence ||
16+
ask("What's the authentication function, ie. :authenticate_user! :").presence || nil
1717
end
1818

1919
def set_key_value_engine
20-
@key_value_engine = options['key-value-engine'].presence ||
21-
ask("What's the key value engine? ([hash] OR redis):").presence ||
22-
:hash
20+
@key_value_engine =
21+
options['key-value-engine'].presence || ask("What's the key value engine? ([hash] OR redis):").presence ||
22+
:hash
2323
end
2424

2525
def add_redis_dependency
2626
if @key_value_engine == 'redis'
2727
puts 'Adding redis dependency'
2828
gem 'redis'
29-
Bundler.with_clean_env do
30-
run 'bundle install'
31-
end
29+
Bundler.with_clean_env { run 'bundle install' }
3230
end
3331
end
3432

@@ -42,7 +40,7 @@ def add_lit_initializer
4240
puts 'Skipping config/initializers/lit.rb creation, file already exists!'
4341
else
4442
puts 'Adding lit initializer (config/initializers/lit.rb)...'
45-
template 'initializer.rb', path
43+
template 'initializer.erb', path
4644
end
4745
end
4846

0 commit comments

Comments
 (0)