Class: Reativo::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#installObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/generators/reativo/install_generator.rb', line 21

def install
  append_to_file 'app/javascript/packs/application.js' do <<~'RUBY'
    import store from '../store'
    window.store = store
    
    import theme from '../theme'

    import { setTheme } from 'reativo'
    setTheme(theme)
  RUBY
  end

  template "theme/layout.rb", 'app/concepts/theme/cell/layout.rb'
  copy_file "theme/layout.erb", 'app/concepts/theme/view/layout.erb'

  copy_component("Baseline")
  copy_component("Drawer")
  copy_component("MainBar")
  copy_component("Menu")
  copy_component("Snackbar")

  copy_support("theme")
  copy_support("store")
end