Class: Dsu::Views::Import
- Inherits:
-
Object
- Object
- Dsu::Views::Import
- Includes:
- Support::Ask, Support::ColorThemable
- Defined in:
- lib/dsu/views/import.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(presenter:, options:) ⇒ Import
constructor
A new instance of Import.
- #render ⇒ Object
Methods included from Support::ColorThemable
apply_theme, #prompt_with_options
Methods included from Support::Ask
Constructor Details
#initialize(presenter:, options:) ⇒ Import
Returns a new instance of Import.
13 14 15 16 17 |
# File 'lib/dsu/views/import.rb', line 13 def initialize(presenter:, options:) @presenter = presenter @options = &.dup || {} @color_theme = Models::ColorTheme.find(theme_name: theme_name) end |
Instance Method Details
#render ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/dsu/views/import.rb', line 19 def render return unless presenter.import_file_path_exist? return if presenter.nothing_to_import? response = display_import_prompt return unless response response = display_project_override_prompt if presenter.overriding_project? return unless response presenter.respond rescue StandardError => e puts apply_theme(e.backtrace_locations.join("\n"), theme_color: color_theme.error) if Dsu.env.local? = I18n.t('subcommands.import.messages.import_error_raised', error: e.) puts apply_theme(, theme_color: color_theme.error) end |