Sha256: 098743ae65160aad1f6c02630b7476fdf9c1321664d010ec943aa265d8ff12b1

Contents?: true

Size: 770 Bytes

Versions: 4

Compression:

Stored size: 770 Bytes

Contents

module Skellington
  class Generator
    attr_accessor :config, :path, :camelname, :files

    def initialize path
      @path = path
      @camelname = Skellington.camelise(@path)
      @config = YAML.load File.read File.join File.dirname(__FILE__), '..', '..', 'config/config.yaml'
      @files = @config['files']
    end

    def run
      generate
      git_init
      post_run
    end

    def generate
      puts ''
      @files.each do |k, v|
        t = Template.new k, self
        t.write
      end
    end

    def git_init
      Git.init @path
    end

    def post_run
      puts ''
      puts "Your new Sinatra app '#{Skellington.camelise(@path)}' has been created"
      t = Template.new 'post-run', self
      puts t.to_s
      puts ''
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
skellington-0.1.3 lib/skellington/generator.rb
skellington-0.1.2 lib/skellington/generator.rb
skellington-0.1.1 lib/skellington/generator.rb
skellington-0.1.0 lib/skellington/generator.rb