File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -17,3 +17,7 @@ indent_style = tab
17
17
[* .json ]
18
18
indent_style = space
19
19
indent_size = 2
20
+
21
+ [* .rb ]
22
+ indent_style = space
23
+ indent_size = 2
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env ruby
2
+ require "yaml"
3
+
4
+ LANGUAGES_FILE = File . expand_path ( "../../languages.yaml" , __FILE__ )
5
+
6
+ languages = YAML . safe_load_file ( ARGV [ 0 ] || LANGUAGES_FILE , symbolize_names : true )
7
+
8
+ languages . each do |language , attributes |
9
+ icon = attributes [ :icon ]
10
+ next if icon . nil?
11
+ match = /\A \\ u\{ ([A-F0-9]{4,})\} \z /i . match ( icon )
12
+ raise "Icon for #{ language } is not in the correct format: `#{ icon } `" unless match
13
+ glyph = match . captures [ 0 ] . hex . chr ( "UTF-8" )
14
+ puts "#{ language } : #{ glyph } "
15
+ end
You can’t perform that action at this time.
0 commit comments