Class: Dsu::Views::Project::Create
- Inherits:
-
Object
- Object
- Dsu::Views::Project::Create
- Includes:
- Support::Ask, Support::ColorThemable
- Defined in:
- lib/dsu/views/project/create.rb
Instance Method Summary collapse
-
#initialize(presenter:, options: {}) ⇒ Create
constructor
A new instance of Create.
- #render ⇒ Object
Methods included from Support::ColorThemable
apply_theme, #prompt_with_options
Methods included from Support::Ask
Constructor Details
#initialize(presenter:, options: {}) ⇒ Create
Returns a new instance of Create.
14 15 16 17 18 |
# File 'lib/dsu/views/project/create.rb', line 14 def initialize(presenter:, options: {}) @presenter = presenter @options = &.dup || {} @color_theme = Models::ColorTheme.find(theme_name: theme_name) end |
Instance Method Details
#render ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/dsu/views/project/create.rb', line 20 def render return display_project_errors if presenter.project_errors? return display_project_already_exists if presenter.project_already_exists? response = display_project_create_prompt if presenter.respond response: response else end rescue StandardError => e puts apply_theme(e., theme_color: color_theme.error) puts apply_theme(e.backtrace_locations.join("\n"), theme_color: color_theme.error) if Dsu.env.local? end |