class Reativo::InstallGenerator

Public Instance Methods

install() click to toggle source
# 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

Private Instance Methods

copy_component(name) click to toggle source
# File lib/generators/reativo/install_generator.rb, line 47
def copy_component(name)
  copy_file "theme/#{name}.js", "app/javascript/components/theme/#{name}.js"
end
copy_support(name) click to toggle source
# File lib/generators/reativo/install_generator.rb, line 51
def copy_support(name)
  copy_file "support/#{name}.js", "app/javascript/#{name}/index.js"
end