Class: ThreddedCreateApp::Tasks::Base Abstract

Inherits:
Object
  • Object
show all
Includes:
Logging, RunCommand
Defined in:
lib/thredded_create_app/tasks/base.rb

Overview

This class is abstract.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RunCommand

#run

Methods included from Logging

#log_command, #log_error, #log_info, #log_stderr, #log_verbose, #log_warn, #program_name

Constructor Details

#initialize(app_path:, verbose: false, database:, webpack_js: true, simple_form: true, **_args) ⇒ Base

rubocop:disable Metrics/ParameterLists



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/thredded_create_app/tasks/base.rb', line 19

def initialize( # rubocop:disable Metrics/ParameterLists
  app_path:, verbose: false, database:, webpack_js: true,
  simple_form: true, **_args
)
  @app_path = app_path
  @app_name = File.basename(File.expand_path(app_path))
  @app_hostname = "#{@app_name.tr(' ', '_').downcase}.com"
  @verbose = verbose
  @database_adapter_name = database.to_s
  @gems = []
  @simple_form = simple_form
  @webpack_js = webpack_js
end

Instance Attribute Details

#app_hostnameObject (readonly)

Returns the value of attribute app_hostname.



17
18
19
# File 'lib/thredded_create_app/tasks/base.rb', line 17

def app_hostname
  @app_hostname
end

#app_nameObject (readonly)

Returns the value of attribute app_name.



17
18
19
# File 'lib/thredded_create_app/tasks/base.rb', line 17

def app_name
  @app_name
end

#app_pathObject (readonly)

Returns the value of attribute app_path.



17
18
19
# File 'lib/thredded_create_app/tasks/base.rb', line 17

def app_path
  @app_path
end

#gemsObject (readonly)

Returns the value of attribute gems.



17
18
19
# File 'lib/thredded_create_app/tasks/base.rb', line 17

def gems
  @gems
end

Instance Method Details

#after_bundleObject



51
# File 'lib/thredded_create_app/tasks/base.rb', line 51

def after_bundle; end

#before_bundleObject



49
# File 'lib/thredded_create_app/tasks/base.rb', line 49

def before_bundle; end

#devise_form_fields_begin_patternObject



37
38
39
40
41
42
43
# File 'lib/thredded_create_app/tasks/base.rb', line 37

def devise_form_fields_begin_pattern
  if @simple_form
    %(<div class="form-inputs">\n)
  else
    %r{render "devise/shared/error_messages", resource: resource %>\n\n}
  end
end

#summaryObject



45
46
47
# File 'lib/thredded_create_app/tasks/base.rb', line 45

def summary
  self.class.name
end

#webpack_js?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/thredded_create_app/tasks/base.rb', line 33

def webpack_js?
  @webpack_js
end