Sha256: d6490423701eadc7bda9ed75d11ad646a2391118d95fdb02336e541ce1dd1f9c

Contents?: true

Size: 497 Bytes

Versions: 11

Compression:

Stored size: 497 Bytes

Contents

# encoding: utf-8

require "fileutils"
require "cli" # yes? etc

class SimpleTemplater
  class DSL
    include FileUtils
    attr_reader :generator, :context
    def initialize(generator)
      @generator = generator
      @context   = generator.context
    end

    def make_executable(path)
      sh "chmod +x '#{path}'"
    end
    
    def file(name, &block)
      File.open(name, "w", &block)
    end
    
    def hook(&block)
      block.call(self.generator, self.context)
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
simple-templater-0.0.1.6 lib/simple-templater/dsl.rb
simple-templater-0.0.1.5 lib/simple-templater/dsl.rb
simple-templater-0.0.1.4 lib/simple-templater/dsl.rb
simple-templater-0.0.1.3 lib/simple-templater/dsl.rb
simple-templater-0.2.pre lib/simple-templater/dsl.rb
simple-templater-0.0.1.2 lib/simple-templater/dsl.rb
simple-templater-0.0.1.1 lib/simple-templater/dsl.rb
rango-0.0.6 vendor/simple-templater/lib/simple-templater/dsl.rb
rango-0.1.pre vendor/simple-templater/lib/simple-templater/dsl.rb
simple-templater-0.1.pre lib/simple-templater/dsl.rb
simple-templater-0.0.1 lib/simple-templater/dsl.rb