app/helpers/coco/integration_helper.rb in coveragebook_components-0.15.0 vs app/helpers/coco/integration_helper.rb in coveragebook_components-0.16.0

- old
+ new

@@ -1,11 +1,33 @@ module Coco module IntegrationHelper - def coco_stylesheet_tag(context, dev: ENV["COCO_PATH"], **) + def coco_stylesheet_tag(context = "coco", dev: ENV["COCO_PATH"], **) stylesheet_link_tag("coco#{"/dev" if dev}/#{context}", **) end - def coco_stylesheet_file_path(context, dev: ENV["COCO_PATH"], **opts) - File.join(Coco::Engine.root, "app/assets/build/coco#{"/dev" if dev}/#{context}.css") + def coco_stylesheet_file_path(...) + IntegrationHelper.stylesheet_file_path(...) + end + + def coco_javascript_file_path(...) + IntegrationHelper.javascript_file_path(...) + end + + def coco_tailwind_preset_path(...) + IntegrationHelper.tailwind_preset_path(...) + end + + class << self + def stylesheet_file_path(context = "coco", dev: ENV["COCO_PATH"], **opts) + File.join(Coco::Engine.root, "app/assets/build/coco#{"/dev" if dev}/#{context}.css") + end + + def javascript_file_path(context = "coco", dev: ENV["COCO_PATH"], **opts) + File.join(Coco::Engine.root, "app/assets/build/coco#{"/dev" if dev}/#{context}.js") + end + + def tailwind_preset_path + File.join(Coco::Engine.root, "app/assets/build/coco/tailwind.preset.js") + end end end end