Sha256: 710ddc3b8e862580abce80091d057a31fd6914f38f82c0a3e00eb10ef52e16d8

Contents?: true

Size: 467 Bytes

Versions: 1

Compression:

Stored size: 467 Bytes

Contents

module Vue
  class PackGenerator < Rails::Generators::NamedBase
    source_root File.expand_path('../templates', __FILE__)

    def generate_pack
      template 'Pack.template', Rails.root.join("app", "javascript", "packs", "#{pack_name}.js")
    end

    private
    def pack_name
      file = name.split("/").last
      if file.downcase.ends_with?(".js") || file.downcase.ends_with?(".vue")
        file = file.split(".")[0]
      end
      file
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vue-generators-0.1.3 lib/vue/generators/vue/pack/pack_generator.rb