module ScssFolder

Constants

ALL_FILE
BASE_DIR
SASS_DIR

Your code goes here…

SECTIONS_DIR
SECTION_BASE_FILE
STYLE_FILE
VERSION

Public Class Methods

build() click to toggle source
# File lib/scss_folder.rb, line 11
def self.build
  Dir.mkdir SASS_DIR unless Dir.exists?SASS_DIR
  Dir.chdir SASS_DIR
  SECTIONS_DIR.each do |f|
    Dir.mkdir f unless Dir.exists?f
    Dir.chdir f do
      File.new("#{ALL_FILE}.scss", "w+").close  
    end
  end
  File.new("#{STYLE_FILE}.scss", "w+").close
  Dir.chdir BASE_DIR
  SECTION_BASE_FILE.each do |f|
    File.new("_#{f}.scss", "w+").close
  end
  File.open("#{ALL_FILE}.scss", "w+") do |file|
    SECTION_BASE_FILE.each do |f|
      file.write("@import \"#{f}\";\n")
    end
  end
  Dir.chdir ".."
  File.open("#{STYLE_FILE}.scss", "w+") do |file|
    SECTIONS_DIR.each do |f|
      file.write("@import \"#{f}/#{ALL_FILE}\";\n")
    end
  end
end