class AnchorUi::Webpacker::CoreUi

Public Instance Methods

update() click to toggle source
# File lib/anchor_ui/webpacker/core_ui.rb, line 6
def update
  ensure_module
  compile_coreui_scss
  compile_variables_scss
  puts 'CoreUi updated'
end

Private Instance Methods

compile_coreui_scss() click to toggle source
Calls superclass method
# File lib/anchor_ui/webpacker/core_ui.rb, line 40
def compile_coreui_scss
  super(
    '~@coreui/coreui/scss',
    '~@coreui/icons/scss/coreui-icons'
  )
end
compile_variables_scss() click to toggle source
Calls superclass method
# File lib/anchor_ui/webpacker/core_ui.rb, line 47
      def compile_variables_scss
        super(
          <<~SCSS,
            @import
              '~bootstrap/scss/functions',
              '~bootstrap/scss/variables';

          SCSS
          <<~SCSS

            // Paths
            $simple-line-font-path: '~simple-line-icons/fonts/';
            $fa-font-path: '~font-awesome/fonts';
            $flag-icon-css-path: '~flag-icon-css/flags';
            $coreui-icons-font-path: '~@coreui/icons/fonts';
          SCSS
        )
      end
ensure_module() click to toggle source
# File lib/anchor_ui/webpacker/core_ui.rb, line 33
def ensure_module
  unless Dir.exists?(node_path)
    FileUtils.mkdir_p tmp_path
    system "cd #{tmp_path} && yarn install && yarn add chalk @coreui/coreui@#{version}"
  end
end
node_path() click to toggle source
# File lib/anchor_ui/webpacker/core_ui.rb, line 25
def node_path
  tmp_path.join 'node_modules/@coreui/coreui'
end
root_path() click to toggle source
# File lib/anchor_ui/webpacker/core_ui.rb, line 15
def root_path
  @tmp_path || begin
    Pathname.new File.expand_path("#{__dir__}/../../..")
  end
end
stylesheets_source_path() click to toggle source
# File lib/anchor_ui/webpacker/core_ui.rb, line 29
def stylesheets_source_path
  node_path.join stylesheets_relative_path
end
templates_path() click to toggle source
# File lib/anchor_ui/webpacker/core_ui.rb, line 21
def templates_path
  root_path.join 'lib/generators/anchor_ui/webpacker/templates'
end