Sha256: dbb14714a0654bcf72f3f2c23aeffa74ba112d2fb6ea55e0bee91286cf584856
Contents?: true
Size: 1010 Bytes
Versions: 9
Compression:
Stored size: 1010 Bytes
Contents
# frozen_string_literal: true say "Installing Phlex..." application_configuration_path = Rails.root.join("config/application.rb") application_configuration_content = File.read(application_configuration_path) pattern = %r(config.autoload_paths << (Rails.root.join\(.app.\)|.\#{root}/app.)\n) unless application_configuration_content.match?(pattern) inject_into_class( application_configuration_path, "Application", %( config.autoload_paths << "\#{root}/app"\n) ) end unless Rails.root.join("app/views/application_view.rb").exist? create_file(Rails.root.join("app/views/application_view.rb"), <<~RUBY) # frozen_string_literal: true module Views module ApplicationView include Rails.application.routes.url_helpers end end RUBY end tailwind_config_path = Rails.root.join("config/tailwind.config.js") if tailwind_config_path.exist? insert_into_file tailwind_config_path, after: "content: [" do "\n './app/views/**/*.rb'," end end say "Phlex successfully installed!"
Version data entries
9 entries across 9 versions & 1 rubygems