class NetguruBootstrapper::Generator
Public Class Methods
source_root()
click to toggle source
# File lib/netguru_bootstrapper/generator.rb, line 11 def self.source_root File.expand_path('../templates', __FILE__) end
Public Instance Methods
create_directories()
click to toggle source
# File lib/netguru_bootstrapper/generator.rb, line 20 def create_directories structure.directories.each do |dir| empty_directory "#{options[:path]}/#{dir}" create_files(dir, structure.files[dir]) end end
create_root_file()
click to toggle source
# File lib/netguru_bootstrapper/generator.rb, line 15 def create_root_file say "Using #{options[:path]} as root directory", :blue template 'application.scss', "#{options[:path]}/application.scss" end
Private Instance Methods
copy_template(dir, file)
click to toggle source
# File lib/netguru_bootstrapper/generator.rb, line 38 def copy_template(dir, file) template "#{dir}/#{file}.scss", "#{options[:path]}/#{dir}/#{file}.scss" end
create_files(dir, files)
click to toggle source
# File lib/netguru_bootstrapper/generator.rb, line 33 def create_files(dir, files) return create_file "#{options[:path]}/#{dir}/.gitkeep" if files.nil? files.each { |file| copy_template(dir, file) } end
structure()
click to toggle source
# File lib/netguru_bootstrapper/generator.rb, line 29 def structure StructureParser.new end