Sha256: 706ca2b1bbc90c9ca996a869c367b828ccb8801e66a1145a006f06e247308e6a

Contents?: true

Size: 1.17 KB

Versions: 7

Compression:

Stored size: 1.17 KB

Contents

class ProjectFilesGenerator < Rails::Generators::Base
  source_root File.expand_path('../templates', __FILE__) #this is for thor

  def copy_template_files
    gem_template_dir = File.expand_path('../templates', __FILE__) #this is for me : )
    app_root         = destination_root

    #copy view templates
    cmd = "mkdir -v #{app_root}/lib/templates"
    puts `#{cmd}`
    cmd = "cp -vR #{gem_template_dir}/view_templates/* #{app_root}/lib/templates/"
    puts `#{cmd}`

    #make shared dir
    cmd = "mkdir -v #{app_root}/app/views/shared/"
    puts `#{cmd}`
    
    #copy shared 
    cmd = "cp -vR #{gem_template_dir}/views/shared/* #{app_root}/app/views/shared/"
    puts `#{cmd}`
    
    #copy layout
    cmd = "cp -vR #{gem_template_dir}/views/application.html.haml  #{app_root}/app/views/layouts/"
    puts `#{cmd}`

    #remove erb layout file here
    cmd = "rm #{app_root}/app/views/layouts/application.html.erb"
    puts `#{cmd}`

    #copy images
    cmd = "cp -vR #{gem_template_dir}/images/* #{app_root}/public/images/"
    puts `#{cmd}`

    #copy stylesheets
    cmd = "cp -vR #{gem_template_dir}/stylesheets/* #{app_root}/public/stylesheets/"
    puts `#{cmd}`


    
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pixelearth-3.2.4 lib/generators/project_files/project_files_generator.rb
pixelearth-3.2.2 lib/generators/project_files/project_files_generator.rb
pixelearth-0.0.7 lib/generators/project_files/project_files_generator.rb
pixelearth-0.0.6 lib/generators/project_files/project_files_generator.rb
pixelearth-0.0.5 lib/generators/project_files/project_files_generator.rb
pixelearth-0.0.4 lib/generators/project_files/project_files_generator.rb
pixelearth-0.0.3 lib/generators/project_files/project_files_generator.rb