Class: SCSS

Inherits:
Zarchitect show all
Defined in:
lib/zarchitect/scss.rb

Constant Summary

Constants inherited from Zarchitect

Zarchitect::ASSETDIR, Zarchitect::ASSETSDIR, Zarchitect::BUILDIR, Zarchitect::CONFIGDIR, Zarchitect::DEBUGSDIR, Zarchitect::DRAFTDIR, Zarchitect::FILEDIR, Zarchitect::FILESDIR, Zarchitect::HTMLDIR, Zarchitect::LAYOUTDIR, Zarchitect::NODEDIR, Zarchitect::SHARESDIR, Zarchitect::VERSION

Class Method Summary collapse

Methods inherited from Zarchitect

#initialize, #main, #rss

Constructor Details

This class inherits a constructor from Zarchitect

Class Method Details

.runObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/zarchitect/scss.rb', line 3

def self.run
  if Zarchitect.conf.has_option? "scss_enabled"
    Zarchitect.conf.read("scss_enabled").each do |str|
      path = File.join(ASSETDIR, str)
      npath = path.clone
      npath.gsub!(".scss", ".css")
      update(path, npath)
    end
  else
    Dir[ File.join(ASSETDIR, "**", "*") ].reverse.reject do |path|
      unless File.directory?(path)
        if File.extname(path) == ".scss"
          npath = path.clone
          npath.gsub!('.scss', '.css')
          update(path, npath)
        end
      end
    end
  end
end

.update(path, npath) ⇒ Object



24
25
26
27
28
29
# File 'lib/zarchitect/scss.rb', line 24

def self.update(path, npath)
  cmd = "scss #{path} #{npath}"
  GPI.print cmd
  r = %x{ #{cmd} }
  GPI.print r unless r == ""
end