Class: DockerizeRails
- Inherits:
-
Thor
- Object
- Thor
- DockerizeRails
- Includes:
- Thor::Actions
- Defined in:
- lib/rails/dockerize_rails.rb
Overview
Ask variables and render templates
Instance Attribute Summary collapse
-
#database ⇒ Object
Returns the value of attribute database.
-
#id_rsa ⇒ Object
Returns the value of attribute id_rsa.
-
#ruby_version ⇒ Object
Returns the value of attribute ruby_version.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#database ⇒ Object
Returns the value of attribute database.
5 6 7 |
# File 'lib/rails/dockerize_rails.rb', line 5 def database @database end |
#id_rsa ⇒ Object
Returns the value of attribute id_rsa.
5 6 7 |
# File 'lib/rails/dockerize_rails.rb', line 5 def id_rsa @id_rsa end |
#ruby_version ⇒ Object
Returns the value of attribute ruby_version.
5 6 7 |
# File 'lib/rails/dockerize_rails.rb', line 5 def ruby_version @ruby_version end |
Class Method Details
.source_root ⇒ Object
8 9 10 |
# File 'lib/rails/dockerize_rails.rb', line 8 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#generate_files ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/rails/dockerize_rails.rb', line 13 def generate_files ruby_version = ask('Ruby Version (default 2.5.1):') ruby_version = '2.5.1-slim' if ruby_version == '' database = ask('What is your Database?', limited_to: ['postgresql', 'mysql']) id_rsa = ask('Would you need your id_rsa file to connect with GitHub? Type yes or no (default no):') id_rsa = 'no' if id_rsa == '' render_templates(ruby_version: ruby_version, database: database, id_rsa: id_rsa) end |