Sha256: fe7912fe0279fe6db26002d604aecfb58d832a65e3e118a87723b15be158731d

Contents?: true

Size: 1.81 KB

Versions: 3

Compression:

Stored size: 1.81 KB

Contents

bin_path = ENV["BUNDLE_BIN"] || "./bin"
namespace :vue do  
  desc "Setup your Vue on Rails project"
  task :setup do
    template = File.expand_path("../install/setup.rb", __dir__)
    base_path =
    if Rails::VERSION::MAJOR >= 5
      "#{RbConfig.ruby} #{bin_path}/rails app:template"
    else
      "#{RbConfig.ruby} #{bin_path}/rake rails:template"
    end

    exec "#{base_path} LOCATION=#{template}"
  end

  desc "install turbolinks"
  task :turbolinks do
    template = File.expand_path("../install/turbolinks.rb", __dir__)
    base_path =
    if Rails::VERSION::MAJOR >= 5
      "#{RbConfig.ruby} #{bin_path}/rails app:template"
    else
      "#{RbConfig.ruby} #{bin_path}/rake rails:template"
    end

    exec "#{base_path} LOCATION=#{template}"
  end

  desc "setup Vue on Rails to be ready for Jest tests"
  task :test do
    template = File.expand_path("../install/test.rb", __dir__)
    base_path =
    if Rails::VERSION::MAJOR >= 5
      "#{RbConfig.ruby} #{bin_path}/rails app:template"
    else
      "#{RbConfig.ruby} #{bin_path}/rake rails:template"
    end

    exec "#{base_path} LOCATION=#{template}"
  end

  desc "install Vuex and vuex-rails-plugins"
  task :vuex do
    template = File.expand_path("../install/vuex.rb", __dir__)
    base_path =
    if Rails::VERSION::MAJOR >= 5
      "#{RbConfig.ruby} #{bin_path}/rails app:template"
    else
      "#{RbConfig.ruby} #{bin_path}/rake rails:template"
    end

    exec "#{base_path} LOCATION=#{template}"
  end

  desc "make this Rails project Vue-ui compatible"
  task :ui do
    template = File.expand_path("../install/ui.rb", __dir__)
    base_path =
    if Rails::VERSION::MAJOR >= 5
      "#{RbConfig.ruby} #{bin_path}/rails app:template"
    else
      "#{RbConfig.ruby} #{bin_path}/rake rails:template"
    end

    exec "#{base_path} LOCATION=#{template}"    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vuejs-1.1.0.beta7 lib/tasks/setup.rake
vuejs-1.1.0.beta6 lib/tasks/setup.rake
vuejs-1.1.0.beta5 lib/tasks/setup.rake