Sha256: 83b1feffb853fbfe028b695c8731285578cccfd5fb9f0c85f70dbbffd0e56ba8

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

require 'securerandom'

class OpenConferenceWare::InstallGenerator < Rails::Generators::Base
  source_root File.expand_path('../templates', __FILE__)

  argument :mount_point,
    type: :string,
    default: "/",
    desc: "The path where OpenConferenceWare should be mounted",
    banner: "MOUNT_POINT (Default: /)"

  def copy_config_initializer
    template "config_initializer.rb", "config/initializers/01_open_conference_ware.rb"
  end

  def copy_omniauth_initializer
    copy_file "omniauth_initializer.rb", "config/initializers/02_omniauth.rb"
  end

  def generate_secrets_yml
    template "secrets.yml.erb", "config/secrets.yml"
  end

  def mount_engine
    route %Q{mount OpenConferenceWare::Engine => "#{mount_point}"}
  end

  def replace_secret_token_initializer
    template "secret_token.rb.erb", "config/initializers/secret_token.rb"
  end

  def include_engine_seeds
    append_to_file "db/seeds.rb" do
      <<-SEED

# Include OpenConferenceWare's seed data
OpenConferenceWare::Engine.load_seed
      SEED
    end
  end

  def run_setup_rake_task
    rake "open_conference_ware:setup"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
open_conference_ware-1.0.0.pre4 lib/generators/open_conference_ware/install/install_generator.rb
open_conference_ware-1.0.0.pre3 lib/generators/open_conference_ware/install/install_generator.rb