Sha256: 83a3aa33523392d39746224cdcda8dd4369003e485baaaf81dec5ce93314491a

Contents?: true

Size: 1.87 KB

Versions: 1

Compression:

Stored size: 1.87 KB

Contents

#!/bin/env ruby

require File.dirname(__FILE__) + '/../config/boot'
require "#{RAILS_ROOT}/config/environment"
require 'rails_generator'
require 'rails_generator/scripts/generate'
# Load the monkeypatching for the migrations
require "#{TALIA_CODE_ROOT}/generators/generator_helpers.rb"

# First time plugin, has to be done this way since it can not be loaded in
# a different way
puts "Install and configure the restful authentication plugin"
ARGV = ['install', 'git://github.com/technoweenie/restful-authentication.git']
require 'commands/plugin'
orig_name = $0
$0 = 'generate'
Rails::Generator::Scripts::Generate.new.run(%w(authenticated user sessions))

puts "Install and configure role-requirements"
Commands::Plugin.parse!(['install', 'git://github.com/timcharper/role_requirement.git'])
Rails::Generator::Scripts::Generate.new.run(%w(roles Role User))

if(Rails::VERSION::MAJOR > 2 ||(Rails::VERSION::MAJOR == 2 && Rails::VERSION::MINOR > 2))
  # TODO: Needed only as long as ActiveScaffold depends on it
  puts "Install the render_component plugin for ActiveScaffold (optional since Rails 2.2)"
  Commands::Plugin.parse!(['install', 'git://github.com/lackac/render_component.git', '-r', 'rails-edge'])
end

puts "Install the auto completion plugin"
Commands::Plugin.parse!(['install', 'auto_complete'])

puts "Install the adminstration backend"
Rails::Generator::Scripts::Generate.new.run(%w(talia_admin))

# Add some dependencies that have been just installed
ActiveSupport::Dependencies.load_paths << File.join(RAILS_ROOT, 'vendor', 'plugins', 'restful-authentication', 'lib')
ActiveSupport::Dependencies.load_paths << File.join(RAILS_ROOT, 'vendor', 'plugins', 'role_requirement', 'lib')

# Init the auth thing for the migration
require "#{RAILS_ROOT}/vendor/plugins/restful-authentication/lib/init"

migration_path = File.join(RAILS_ROOT, 'db', 'migrate')
ActiveRecord::Migrator.migrate(migration_path)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
talia_core-0.4.20 generators/talia_base/templates/script/setup_talia_backend