Sha256: e7e305ffa6baf31699cfcfbeb3b19f70cb69ca7a5d20e1c4c1e781cec68cf12a

Contents?: true

Size: 1.13 KB

Versions: 15

Compression:

Stored size: 1.13 KB

Contents

namespace:components do
  desc "Install component configuration from templates"
  task :genconfig do
    init = Adhearsion::Initializer.new(Rake.original_dir)
    init.bootstrap_rc
    init.load_all_init_files
    Adhearsion::AHN_CONFIG.components_to_load.each do |component|
      spec = Gem.searcher.find(component)
      if spec.nil?
        abort "ERROR: Required gem component #{component} not found."
      end

      yml = File.join(spec.full_gem_path, 'config', "#{component}.yml")
      target = File.join(AHN_ROOT, 'config', 'components', "#{component}.yml")
      Dir.mkdir(File.dirname(target)) if !File.exists?(File.dirname(target))
      if File.exists?(target)
        puts "Skipping existing configuration for component #{component}"
        next
      end
      if File.exists?(yml)
        begin
          FileUtils.cp(yml, target)
          puts "Installed default configuration for component #{component}"
        rescue => e
          abort "Error copying configuration for component #{component}: #{e.message}"
        end
      else
        puts "No template configuration found for component #{component}"
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
adhearsion-1.2.6 lib/adhearsion/tasks/components.rb
adhearsion-1.2.5 lib/adhearsion/tasks/components.rb
adhearsion-1.2.4 lib/adhearsion/tasks/components.rb
adhearsion-1.2.3 lib/adhearsion/tasks/components.rb
adhearsion-1.2.1 lib/adhearsion/tasks/components.rb
adhearsion-1.2.0 lib/adhearsion/tasks/components.rb
adhearsion-1.1.1 lib/adhearsion/tasks/components.rb
adhearsion-1.1.0 lib/adhearsion/tasks/components.rb
adhearsion-1.0.3 lib/adhearsion/tasks/components.rb
adhearsion-1.0.2 lib/adhearsion/tasks/components.rb
adhearsion-cw-1.0.2.3 lib/adhearsion/tasks/components.rb
adhearsion-cw-1.0.2.2 lib/adhearsion/tasks/components.rb
adhearsion-cw-1.0.2.1 lib/adhearsion/tasks/components.rb
adhearsion-1.0.1 lib/adhearsion/tasks/components.rb
adhearsion-1.0.0 lib/adhearsion/tasks/components.rb