Sha256: 7a10b55e5d57207a7ba555b74e7e3b3336e5833e7b97ad296adc702b7fe0269d

Contents?: true

Size: 832 Bytes

Versions: 6

Compression:

Stored size: 832 Bytes

Contents

module Chap
  class Task
    def self.setup(options={})
      puts "Generating config files" unless options[:quiet]
      setup = File.expand_path("../../setup", __FILE__)
      output = options[:output] || '.'
      Dir.glob("#{setup}/*").each do |source|
        dest = "#{output}/#{File.basename(source)}"
        if File.exist?(dest)
          if options[:force]
            puts "Overwriting: #{dest}" unless options[:quiet]
            FileUtils.cp(source, dest)
          else
            puts "Already exist: #{dest}" unless options[:quiet]
          end
        else
          FileUtils.cp(source, dest)
          puts "Created: #{dest}" unless options[:quiet]
        end
      end
    end

    def self.deploy(options)
      runner = options.empty? ? Runner.new : Runner.new(options)
      runner.deploy
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
chap-0.0.6 lib/chap/task.rb
chap-0.0.5 lib/chap/task.rb
chap-0.0.4 lib/chap/task.rb
chap-0.0.3 lib/chap/task.rb
chap-0.0.2 lib/chap/task.rb
chap-0.0.1 lib/chap/task.rb