aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks/actiontext.rake
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2018-10-02 16:05:03 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2018-10-02 16:05:03 -0700
commite11f84ee3a6d9a7fe77e3b1e112a6625c1df0ee4 (patch)
treed5bfaadb69565208c7ee8e778cc72b1f74ff01c9 /lib/tasks/actiontext.rake
parentd28ce034b51a7ea08e81ee319383ab35ca25cb32 (diff)
downloadrails-e11f84ee3a6d9a7fe77e3b1e112a6625c1df0ee4.tar.gz
rails-e11f84ee3a6d9a7fe77e3b1e112a6625c1df0ee4.tar.bz2
rails-e11f84ee3a6d9a7fe77e3b1e112a6625c1df0ee4.zip
Use an app template installer instead for nicer overwriting checks
Diffstat (limited to 'lib/tasks/actiontext.rake')
-rw-r--r--lib/tasks/actiontext.rake32
1 files changed, 6 insertions, 26 deletions
diff --git a/lib/tasks/actiontext.rake b/lib/tasks/actiontext.rake
index 6ec30f86e7..4f90e4930c 100644
--- a/lib/tasks/actiontext.rake
+++ b/lib/tasks/actiontext.rake
@@ -5,36 +5,16 @@ namespace :action_text do
Rake::Task["install:migrations"].clear_comments
desc "Copy over the migration, stylesheet, and JavaScript files"
- task install: %w( environment copy_migrations copy_stylesheet copy_fixtures yarn_add )
+ task install: %w( environment run_installer copy_migrations )
+
+ task :run_installer do
+ installer_template = File.expand_path("../templates/installer.rb", __dir__)
+ system "#{RbConfig.ruby} ./bin/rails app:template LOCATION=#{installer_template}"
+ end
task :copy_migrations do
Rake::Task["active_storage:install:migrations"].invoke
Rake::Task["railties:install:migrations"].reenable # Otherwise you can't run 2 migration copy tasks in one invocation
Rake::Task["action_text:install:migrations"].invoke
end
-
- STYLESHEET_TEMPLATE_PATH = File.expand_path("../templates/actiontext.css", __dir__)
- STYLESHEET_APP_PATH = Rails.root.join("app/assets/stylesheets/actiontext.css")
-
- task :copy_stylesheet do
- unless File.exist?(STYLESHEET_APP_PATH)
- FileUtils.cp STYLESHEET_TEMPLATE_PATH, STYLESHEET_APP_PATH
- end
- end
-
- FIXTURE_TEMPLATE_PATH = File.expand_path("../templates/fixtures.yml", __dir__)
- FIXTURE_APP_DIR_PATH = Rails.root.join("test/fixtures/action_text")
- FIXTURE_APP_PATH = FIXTURE_APP_DIR_PATH.join("rich_texts.yml")
-
- task :copy_fixtures do
- unless File.exist?(FIXTURE_APP_PATH)
- FileUtils.mkdir FIXTURE_APP_DIR_PATH
- FileUtils.cp FIXTURE_TEMPLATE_PATH, FIXTURE_APP_PATH
- end
- end
-
- task :yarn_add do
- # FIXME: Replace with release version on release
- system "yarn add https://github.com/basecamp/actiontext"
- end
end