Sha256: e5460a999dfb9f5bd0859ee2ad1589e0f44a199ba5d26f4cc6a8a4c58fe96091

Contents?: true

Size: 468 Bytes

Versions: 15

Compression:

Stored size: 468 Bytes

Contents

# encoding: utf-8

module Ace
  class DSL
    attr_accessor :rules, :generators
    def initialize
      @rules, @generators = Hash.new, Array.new
    end

    def rule(klass, *globs)
      paths = globs.map { |glob| Dir.glob("content/#{glob}") }
      files = paths.flatten.select { |path| File.file?(path) }
      self.rules[klass] ||= Array.new
      self.rules[klass].push(*files)
    end

    def generator(klass)
      self.generators << klass
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ace-0.4.9 lib/ace/dsl.rb
ace-0.4.8 lib/ace/dsl.rb
ace-0.4.7 lib/ace/dsl.rb
ace-0.4.6 lib/ace/dsl.rb
ace-0.4.5 lib/ace/dsl.rb
ace-0.4.4 lib/ace/dsl.rb
ace-0.4.3 lib/ace/dsl.rb
ace-0.4.2 lib/ace/dsl.rb
ace-0.4.1 lib/ace/dsl.rb
ace-0.4 lib/ace/dsl.rb
ace-0.3.3 lib/ace/dsl.rb
ace-0.3.2 lib/ace/dsl.rb
ace-0.3.1 lib/ace/dsl.rb
ace-0.3 lib/ace/dsl.rb
ace-0.1 lib/ace/dsl.rb