Class: HotGlue::SetSearchInterfaceInstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/hot_glue/set_search_interface_install_generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ SetSearchInterfaceInstallGenerator

:nodoc:



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/generators/hot_glue/set_search_interface_install_generator.rb', line 12

def initialize(*args) #:nodoc:
  super

  ['date_range_picker',
   'time_range_picker',
   'search_form'].each do |file|


    system("./bin/rails generate stimulus #{file.titlecase.gsub(" ", "")}")
    copy_file "javascript/#{file}_controller.js", "#{filepath_prefix}app/javascript/controllers/#{file}_controller.js"
    puts "HOT GLUE --> copying #{file} stimulus controller into app/javascript/controllers/#{file}_controller.js"

  end
end

Instance Method Details

#filepath_prefixObject



7
8
9
10
# File 'lib/generators/hot_glue/set_search_interface_install_generator.rb', line 7

def filepath_prefix
  # todo: inject the context
  'spec/dummy/' if $INTERNAL_SPECS
end