Sha256: 3c3be6611c76becb82648c0b34d40f62ee3842ab23e40f410c8360dbcbc3e005

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

Thor::Actions::WARNINGS[:unchanged_no_flag] = 'unchanged'

def template(location)
  system "#{RbConfig.ruby} #{Rails.root.join("bin")}/rails app:template " + 
    "LOCATION=#{File.expand_path(location, __dir__)}"
end

namespace :ruby2js do
  namespace :install do
    desc "Install Ruby2JS with LitElement support"
    task :litelement do
      template 'install/litelement.rb'
    end

    desc "Install Ruby2JS with React support"
    task :react do
      template 'install/react.rb'
      Rake::Task['webpacker:install:react'].invoke
    end

    namespace :stimulus do
      desc "Install Ruby2JS with Stimulus Sprockets support"
      task :sprockets => :"stimulus:install:asset_pipeline" do
        template 'install/stimulus-sprockets.rb'
      end

      desc "Install Ruby2JS with Stimulus Webpacker support"
      task :webpacker => :"stimulus:install" do
        template 'install/stimulus-webpacker.rb'
      end
    end
  end
end

namespace :webpacker do
  namespace :install do
    desc "Install everything needed for Ruby2JS"
    task :ruby2js do
      template 'install/webpacker.rb'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby2js-4.0.5 lib/tasks/ruby2js_tasks.rake
ruby2js-4.0.4 lib/tasks/ruby2js_tasks.rake