lib/tasks/abstractor_tasks.rake in abstractor-4.2.3 vs lib/tasks/abstractor_tasks.rake in abstractor-4.3.0
- old
+ new
@@ -1,9 +1,14 @@
require 'open-uri'
require 'zip'
require 'fileutils'
+require 'thor'
+class Hammer < Thor
+ include Thor::Actions
+end
+
namespace :abstractor do
namespace :setup do
desc 'Load abstractor system tables'
task :system => :environment do
Abstractor::Setup.system
@@ -45,9 +50,21 @@
if !File.exist?('config/abstractor/custom_nlp_providers.yml')
File.open('config/abstractor/custom_nlp_providers.yml', 'w+'){ |f|
f << template
}
+ end
+
+ puts "Warning! Warning! Warning!"
+ puts "Setting Abstractor::Engine.routes.default_url_options[:host] in config/environemnts/development.rb"
+ puts "Change it as appropriate."
+
+ hammer = Hammer.new
+ hammer.insert_into_file("#{Rails.root}/config/environments/development.rb", :after => /(::Application.configure do\n|application.configure do\n)/) do
+"
+ Abstractor::Engine.routes.default_url_options[:host] = 'https://moomin.com'
+
+"
end
end
end
private
\ No newline at end of file