Sha256: bd7b29a472fb2505e4d78df94a478c1ec80f01e088b07dc699727062aca24f3d
Contents?: true
Size: 587 Bytes
Versions: 4
Compression:
Stored size: 587 Bytes
Contents
module Vue class ComponentGenerator < Rails::Generators::NamedBase source_root File.expand_path('../templates', __FILE__) def generate_component template 'Component.template', Rails.root.join("app", "javascript", "components", *path, "#{component_name}.vue") end private def component_name file = name.split("/").last if file.downcase.ends_with?(".js") || file.downcase.ends_with?(".vue") file = file.split(".")[0] end file end def path parts = name.split("/") parts.pop parts end end end
Version data entries
4 entries across 4 versions & 1 rubygems