Sha256: 6a2f324eeaef96a7e4e8d25a1b70d464cc583b45bc388cbdf660755758a95f44
Contents?: true
Size: 917 Bytes
Versions: 3
Compression:
Stored size: 917 Bytes
Contents
def run_stimulus_install_template(path) system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{File.expand_path("../install/#{path}.rb", __dir__)}" end namespace :stimulus do desc "Install Stimulus into the app" task :install do if Rails.root.join("config/importmap.rb").exist? Rake::Task["stimulus:install:importmap"].invoke elsif Rails.root.join("package.json").exist? Rake::Task["stimulus:install:node"].invoke else puts "You must either be running with node (package.json) or importmap-rails (config/importmap.rb) to use this gem." end end namespace :install do desc "Install Stimulus on an app running importmap-rails" task :importmap do run_stimulus_install_template "stimulus_with_importmap" end desc "Install Stimulus on an app running node" task :node do run_stimulus_install_template "stimulus_with_node" end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
stimulus-rails-0.4.2 | lib/tasks/stimulus_tasks.rake |
stimulus-rails-0.4.1 | lib/tasks/stimulus_tasks.rake |
stimulus-rails-0.4.0 | lib/tasks/stimulus_tasks.rake |