113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
# File 'lib/isodoc/gem_tasks.rb', line 113
def compile_scss(filename)
require "sassc-embedded"
require "isodoc/sassc_importer"
isodoc_path = if Gem.loaded_specs["isodoc"]
File.join(Gem.loaded_specs["isodoc"].full_gem_path,
"lib", "isodoc")
else
File.join("lib", "isodoc")
end
[isodoc_path,
File.dirname(filename)].each do |name|
SassC.load_paths << name
end
Dir.mktmpdir do |dir|
variables_file_path = File.join(dir, "variables.scss")
File.write(variables_file_path, fonts_placeholder)
SassC.load_paths << dir
sheet_content = File.read(filename, encoding: "UTF-8")
SassC::Engine.new(%<@use "variables" as *;\n#{sheet_content}>,
syntax: :scss,
importer: SasscImporter)
.render
end
end
|