Class: Motion::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#add_client_to_application_packObject



26
27
28
29
30
31
# File 'lib/generators/motion/install_generator.rb', line 26

def add_client_to_application_pack
  append_to_file(
    "app/javascript/packs/application.js",
    'import "motion"'
  )
end

#copy_client_initializerObject



19
20
21
22
23
24
# File 'lib/generators/motion/install_generator.rb', line 19

def copy_client_initializer
  template(
    "motion.js",
    "app/javascript/motion.js"
  )
end

#copy_initializerObject



12
13
14
15
16
17
# File 'lib/generators/motion/install_generator.rb', line 12

def copy_initializer
  template(
    "motion.rb",
    "config/initializers/motion.rb"
  )
end