Sha256: a2a63f80bfeafbaeeee05aa2c72a13db8b7f8b7c72f0d4921b4dae07a60a7e34

Contents?: true

Size: 868 Bytes

Versions: 2

Compression:

Stored size: 868 Bytes

Contents

module Rna
  class Tasks
    def self.init(project_root=".",options={})
      puts "Settin up rna project" unless options[:quiet]
      FileUtils.mkdir("#{project_root}/config") unless File.exist?("#{project_root}/config")
      %w/rna.rb s3.yml/.each do |name|
        source = File.expand_path("../../files/#{name}", __FILE__)
        dest = "#{project_root}/config/#{File.basename(source)}"
        if File.exist?(dest)
          puts "already exists: #{dest}" unless options[:quiet]
        else
          puts "creating: #{dest}" unless options[:quiet]
          FileUtils.cp(source, dest)
        end
      end
    end
    def self.build(options)
      new(options).build
    end

    def initialize(options={})
      @options = options
      @dsl = DSL.new
    end
    def build
      @dsl.evaluate
      @dsl.build
      @dsl.output(@options)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rna-0.1.1 lib/rna/tasks.rb
rna-0.1.0 lib/rna/tasks.rb