agric 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/agric/compass/stylesheets/agric/_icons.scss +270 -270
- data/lib/agric/compass/stylesheets/agric/_paths.scss +5 -5
- data/lib/agric/compiler/reference.yml +379 -379
- data/lib/agric/compiler.rb +17 -7
- data/lib/agric/version.rb +1 -1
- data/lib/assets/fonts/agric.eot +0 -0
- data/lib/assets/fonts/agric.svg +270 -270
- data/lib/assets/fonts/agric.ttf +0 -0
- data/lib/assets/fonts/agric.woff +0 -0
- data/src/002-agri/font.svg +6 -6
- metadata +4 -3
data/lib/agric/compiler.rb
CHANGED
@@ -140,27 +140,37 @@ module Agric
|
|
140
140
|
|
141
141
|
reference_file = compiler_dir.join('reference.yml')
|
142
142
|
reference = YAML.load_file(reference_file)
|
143
|
+
reference = {} unless reference.is_a?(Hash)
|
143
144
|
|
144
145
|
icons = {}
|
145
146
|
|
146
147
|
Dir.chdir(glyphs) do
|
147
|
-
|
148
|
-
name = cf.split(/\./).first
|
149
|
-
|
150
|
-
|
151
|
-
|
148
|
+
Dir.glob("*.svg").sort.collect do |cf|
|
149
|
+
name = cf.split(/\./).first.to_s
|
150
|
+
unless reference.has_key?(name)
|
151
|
+
reference[name] = (reference.values.sort.last || "efff").to_i(16).succ.to_s(16)
|
152
|
+
end
|
153
|
+
icons[name] = reference[name]
|
152
154
|
end
|
153
155
|
end
|
154
|
-
|
156
|
+
|
155
157
|
# Removes undefined glyphs from reference
|
156
158
|
for ref in reference.keys
|
157
159
|
reference.delete(ref) unless icons.keys.include?(ref)
|
158
160
|
end
|
159
161
|
|
160
162
|
File.open(reference_file, "wb") do |f|
|
161
|
-
f.write
|
163
|
+
f.write "# Auto-updated. Nothing to touch.\n"
|
164
|
+
for name, code in reference
|
165
|
+
f.write "'#{name}': '#{code}'\n"
|
166
|
+
end
|
162
167
|
end
|
163
168
|
|
169
|
+
# Build glyphs
|
170
|
+
config["glyphs"] = icons.sort{|a,b| a[1] <=> b[1]}.collect do |name, unicode|
|
171
|
+
{"css" => name, "code" => unicode.to_i(16)}
|
172
|
+
end
|
173
|
+
|
164
174
|
File.open(config_file, "wb") do |f|
|
165
175
|
f.write config.to_yaml
|
166
176
|
end
|
data/lib/agric/version.rb
CHANGED
data/lib/assets/fonts/agric.eot
CHANGED
Binary file
|