Sha256: 41b0fc612c4f5fbcfb1ad505977194a5c5f13d33ff116130f0a988b0d16ea1e2

Contents?: true

Size: 768 Bytes

Versions: 5

Compression:

Stored size: 768 Bytes

Contents

require 'rails/generators'

module LSD
  class Source < Rails::Generators::Base
    source_root Pathname.new(__FILE__).dirname + '../templates'
    
    def self.init_source_folder
      new.source_directory_files
    end
    
    def source_directory_files
      app_source_folder = 'public/javascripts/Source'
      @app_name = LSD.detect_project_name
      
      empty_directory(app_source_folder)
      
      inside(app_source_folder) do
        root_template 'Application.js'
        root_template 'Widget.js'
        root_template 'package.yml'
        root_template 'app_name.js', @app_name + '.js'
      end
    end
    
    def root_template(source, desrination = nil)
      template(self.class.source_root + source, desrination || source)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lsd_rails-0.1.6 lib/lsd/source.rb
lsd_rails-0.1.5 lib/lsd/source.rb
lsd_rails-0.1.4 lib/lsd/source.rb
lsd_rails-0.1.3 lib/lsd/source.rb
lsd_rails-0.1.2 lib/lsd/source.rb