Sha256: 83df7de5684cb855548760275ba71ba519559421cb39c7e50cd49d12272248ea

Contents?: true

Size: 1.31 KB

Versions: 7

Compression:

Stored size: 1.31 KB

Contents

require 'middleman-core/templates'

module Ember
  module Middleman
    class Templates < ::Middleman::Templates::Base
      class_option 'css_dir',
        :default => 'stylesheets',
        :desc    => 'The path to the css files'

      class_option 'js_dir',
        default: 'javascripts',
        desc:    'The path to the javascript files'

      class_option 'images_dir',
        :default => 'images',
        :desc    => 'The path to the image files'

      def self.source_root
        File.join(File.dirname(__FILE__), 'templates')
      end

      def build_scaffold
        template 'config.tt', File.join(location, 'config.rb')

        empty_directory File.join(location, 'source', options[:css_dir])
        empty_directory File.join(location, 'source', options[:images_dir])

        js_dir = File.join(location, 'source', options[:js_dir])

        directory File.join('source', 'javascripts'), js_dir

        empty_directory File.join(js_dir, 'models')
        empty_directory File.join(js_dir, 'controllers')
        empty_directory File.join(js_dir, 'helpers')
        empty_directory File.join(js_dir, 'views')
        empty_directory File.join(js_dir, 'templates')
        empty_directory File.join(js_dir, 'routes')
      end
    end
  end
end

Middleman::Templates.register(:ember, Ember::Middleman::Templates)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ember-middleman-0.0.8 lib/ember/middleman/templates.rb
ember-middleman-0.0.7 lib/ember/middleman/templates.rb
ember-middleman-0.0.6 lib/ember/middleman/templates.rb
ember-middleman-0.0.5 lib/ember/middleman/templates.rb
ember-middleman-0.0.4 lib/ember/middleman/templates.rb
ember-middleman-0.0.3 lib/ember/middleman/templates.rb
ember-middleman-0.0.2 lib/ember/middleman/templates.rb