language_colors 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +21 -0
- data/.gitignore +3 -0
- data/Gemfile +1 -2
- data/Gemfile.lock +18 -18
- data/README.md +10 -4
- data/Rakefile +6 -0
- data/language_colors.gemspec +2 -0
- data/lib/colors.json +429 -18
- data/lib/language_colors/version.rb +1 -1
- data/lib/language_colors.rb +6 -7
- data/lib/linguist_reader.rb +30 -9
- metadata +19 -9
- data/.travis.yml +0 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 32a9e99d8df26222f374b78f140572a02827e8c8c40e8a11f4c40a6e6ded3979
|
|
4
|
+
data.tar.gz: fdf5f267c8326b6e83e78f08e844d5abeab4df416001a66524d450a6b1788c32
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d554fceb67114a3778a42da6b68b2a5645b18fca4fe84832c63cce114af0382cf6ebe9c9bf9ff2c703724689d91ca8f87a64450cd8e252c7424e86a2cac0200
|
|
7
|
+
data.tar.gz: 41ff59ddd6640475651d002743c412ffceb0f4401a0015a5b249003468cc25820a5f1d4db94745a7e6a85b51d1f3ab87e38556fa6e451cf22cc073be063e682b
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
ruby: ['3.1', '3.2', '3.3', '3.4']
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
- uses: ruby/setup-ruby@v1
|
|
18
|
+
with:
|
|
19
|
+
ruby-version: ${{ matrix.ruby }}
|
|
20
|
+
bundler-cache: true
|
|
21
|
+
- run: bundle exec rspec
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
language_colors (0.1.
|
|
4
|
+
language_colors (0.1.4)
|
|
5
|
+
json (~> 2.0)
|
|
5
6
|
|
|
6
7
|
GEM
|
|
7
8
|
remote: https://rubygems.org/
|
|
8
9
|
specs:
|
|
9
|
-
diff-lcs (1.
|
|
10
|
-
json (2.
|
|
11
|
-
rake (
|
|
12
|
-
rspec (3.
|
|
13
|
-
rspec-core (~> 3.
|
|
14
|
-
rspec-expectations (~> 3.
|
|
15
|
-
rspec-mocks (~> 3.
|
|
16
|
-
rspec-core (3.
|
|
17
|
-
rspec-support (~> 3.
|
|
18
|
-
rspec-expectations (3.
|
|
10
|
+
diff-lcs (1.5.1)
|
|
11
|
+
json (2.21.1)
|
|
12
|
+
rake (13.4.2)
|
|
13
|
+
rspec (3.13.0)
|
|
14
|
+
rspec-core (~> 3.13.0)
|
|
15
|
+
rspec-expectations (~> 3.13.0)
|
|
16
|
+
rspec-mocks (~> 3.13.0)
|
|
17
|
+
rspec-core (3.13.0)
|
|
18
|
+
rspec-support (~> 3.13.0)
|
|
19
|
+
rspec-expectations (3.13.0)
|
|
19
20
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
20
|
-
rspec-support (~> 3.
|
|
21
|
-
rspec-mocks (3.
|
|
21
|
+
rspec-support (~> 3.13.0)
|
|
22
|
+
rspec-mocks (3.13.1)
|
|
22
23
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
23
|
-
rspec-support (~> 3.
|
|
24
|
-
rspec-support (3.
|
|
24
|
+
rspec-support (~> 3.13.0)
|
|
25
|
+
rspec-support (3.13.1)
|
|
25
26
|
|
|
26
27
|
PLATFORMS
|
|
27
28
|
ruby
|
|
28
29
|
|
|
29
30
|
DEPENDENCIES
|
|
30
|
-
json
|
|
31
31
|
language_colors!
|
|
32
|
-
rake (~>
|
|
32
|
+
rake (~> 13.0)
|
|
33
33
|
rspec (~> 3.0)
|
|
34
34
|
|
|
35
35
|
BUNDLED WITH
|
|
36
|
-
2.
|
|
36
|
+
2.5.21
|
data/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# language_colors
|
|
2
2
|
|
|
3
3
|
This gem was created as a fast way to get the colors that Github uses to describe languages. returns a string in the form of `'#00ff00'`.
|
|
4
4
|
|
|
5
|
+
[Link to RubyGems](https://rubygems.org/gems/language_colors)
|
|
6
|
+
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
Add this line to your application's Gemfile:
|
|
@@ -22,13 +24,17 @@ Or install it yourself as:
|
|
|
22
24
|
|
|
23
25
|
```ruby
|
|
24
26
|
lc = LanguageColors::LanguageColors.new
|
|
25
|
-
lc.color('
|
|
27
|
+
lc.color('C++')
|
|
26
28
|
=> "#f34b7d"
|
|
27
29
|
```
|
|
28
30
|
|
|
29
|
-
## Development
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
## Updating the color list
|
|
33
|
+
|
|
34
|
+
The colors are generated from [GitHub Linguist](https://github.com/github/linguist)'s
|
|
35
|
+
`languages.yml`. To refresh `lib/colors.json` with the latest data:
|
|
36
|
+
|
|
37
|
+
$ rake colors
|
|
32
38
|
|
|
33
39
|
## Contributing
|
|
34
40
|
|
data/Rakefile
CHANGED
data/language_colors.gemspec
CHANGED
data/lib/colors.json
CHANGED
|
@@ -1,140 +1,384 @@
|
|
|
1
1
|
{
|
|
2
2
|
"1C Enterprise": "#814CCC",
|
|
3
|
+
"2-Dimensional Array": "#38761D",
|
|
4
|
+
"4D": "#004289",
|
|
3
5
|
"ABAP": "#E8274B",
|
|
6
|
+
"ABAP CDS": "#555e25",
|
|
4
7
|
"AGS Script": "#B9D9FF",
|
|
8
|
+
"AIDL": "#34EB6B",
|
|
9
|
+
"AL": "#3AA2B5",
|
|
10
|
+
"ALGOL": "#D1E0DB",
|
|
5
11
|
"AMPL": "#E6EFBB",
|
|
6
12
|
"ANTLR": "#9DC3FF",
|
|
7
13
|
"API Blueprint": "#2ACCA8",
|
|
8
14
|
"APL": "#5A8164",
|
|
9
|
-
"ASP": "#
|
|
15
|
+
"ASP.NET": "#9400ff",
|
|
10
16
|
"ATS": "#1ac620",
|
|
11
17
|
"ActionScript": "#882B0F",
|
|
12
18
|
"Ada": "#02f88c",
|
|
19
|
+
"Adblock Filter List": "#800000",
|
|
20
|
+
"Adobe Font Metrics": "#fa0f00",
|
|
13
21
|
"Agda": "#315665",
|
|
22
|
+
"Aiken": "#640ff8",
|
|
14
23
|
"Alloy": "#64C800",
|
|
24
|
+
"Alpine Abuild": "#0D597F",
|
|
25
|
+
"Altium Designer": "#A89663",
|
|
15
26
|
"AngelScript": "#C7D7DC",
|
|
27
|
+
"Answer Set Programming": "#A9CC29",
|
|
28
|
+
"Ant Build System": "#A9157E",
|
|
29
|
+
"Antlers": "#ff269e",
|
|
30
|
+
"ApacheConf": "#d12127",
|
|
31
|
+
"Apex": "#1797c0",
|
|
32
|
+
"Apollo Guidance Computer": "#0B3D91",
|
|
16
33
|
"AppleScript": "#101F1F",
|
|
17
34
|
"Arc": "#aa2afe",
|
|
35
|
+
"AsciiDoc": "#73a0c5",
|
|
18
36
|
"AspectJ": "#a957b0",
|
|
19
37
|
"Assembly": "#6E4C13",
|
|
20
|
-
"
|
|
38
|
+
"Astro": "#ff5a03",
|
|
39
|
+
"Asymptote": "#ff0000",
|
|
40
|
+
"Augeas": "#9CC134",
|
|
21
41
|
"AutoHotkey": "#6594b9",
|
|
22
42
|
"AutoIt": "#1C3552",
|
|
43
|
+
"Avro IDL": "#0040FF",
|
|
44
|
+
"Awk": "#c30e9b",
|
|
45
|
+
"B (Formal Method)": "#8aa8c5",
|
|
46
|
+
"B4X": "#00e4ff",
|
|
47
|
+
"BAML": "#a855f7",
|
|
48
|
+
"BASIC": "#ff0000",
|
|
49
|
+
"BQN": "#2b7067",
|
|
23
50
|
"Ballerina": "#FF5000",
|
|
24
51
|
"Batchfile": "#C1F12E",
|
|
52
|
+
"Beef": "#a52f4e",
|
|
53
|
+
"Berry": "#15A13C",
|
|
54
|
+
"BibTeX": "#778899",
|
|
55
|
+
"Bicep": "#519aba",
|
|
56
|
+
"Bikeshed": "#5562ac",
|
|
57
|
+
"Bison": "#6A463F",
|
|
58
|
+
"BitBake": "#00bce4",
|
|
59
|
+
"Blade": "#f7523f",
|
|
60
|
+
"BlitzBasic": "#00FFAE",
|
|
25
61
|
"BlitzMax": "#cd6400",
|
|
62
|
+
"Blueprint": "#3584E4",
|
|
63
|
+
"Bluespec": "#12223c",
|
|
64
|
+
"Bluespec BH": "#12223c",
|
|
26
65
|
"Boo": "#d4bec1",
|
|
66
|
+
"Boogie": "#c80fa0",
|
|
27
67
|
"Brainfuck": "#2F2530",
|
|
68
|
+
"BrighterScript": "#66AABB",
|
|
69
|
+
"Brightscript": "#662D91",
|
|
70
|
+
"Browserslist": "#ffd539",
|
|
71
|
+
"Bru": "#F4AA41",
|
|
72
|
+
"BuildStream": "#006bff",
|
|
28
73
|
"C": "#555555",
|
|
29
|
-
"C#": "#
|
|
74
|
+
"C#": "#7355dd",
|
|
30
75
|
"C++": "#f34b7d",
|
|
31
|
-
"
|
|
76
|
+
"C3": "#2563eb",
|
|
77
|
+
"CAP CDS": "#0092d1",
|
|
78
|
+
"CLIPS": "#00A300",
|
|
79
|
+
"CMake": "#DA3434",
|
|
80
|
+
"COLLADA": "#F1A42B",
|
|
81
|
+
"CQL": "#006091",
|
|
82
|
+
"CSON": "#244776",
|
|
83
|
+
"CSS": "#663399",
|
|
84
|
+
"CSV": "#237346",
|
|
85
|
+
"CUE": "#5886E1",
|
|
86
|
+
"CWeb": "#00007a",
|
|
87
|
+
"Cabal Config": "#483465",
|
|
88
|
+
"Caddyfile": "#22b638",
|
|
89
|
+
"Cadence": "#00ef8b",
|
|
90
|
+
"Cairo": "#ff4a48",
|
|
91
|
+
"Cairo Zero": "#ff4a48",
|
|
92
|
+
"CameLIGO": "#3be133",
|
|
93
|
+
"Cangjie": "#00868B",
|
|
94
|
+
"Cap'n Proto": "#c42727",
|
|
95
|
+
"Carbon": "#222222",
|
|
32
96
|
"Ceylon": "#dfa535",
|
|
33
97
|
"Chapel": "#8dc63f",
|
|
98
|
+
"ChucK": "#3f8000",
|
|
99
|
+
"Circom": "#707575",
|
|
34
100
|
"Cirru": "#ccccff",
|
|
35
101
|
"Clarion": "#db901e",
|
|
102
|
+
"Clarity": "#5546ff",
|
|
103
|
+
"Classic ASP": "#6a40fd",
|
|
36
104
|
"Clean": "#3F85AF",
|
|
37
105
|
"Click": "#E4E6F3",
|
|
38
106
|
"Clojure": "#db5855",
|
|
107
|
+
"Closure Templates": "#0d948f",
|
|
108
|
+
"Cloud Firestore Security Rules": "#FFA000",
|
|
109
|
+
"Clue": "#0009b5",
|
|
110
|
+
"CodeQL": "#140f46",
|
|
39
111
|
"CoffeeScript": "#244776",
|
|
40
112
|
"ColdFusion": "#ed2cd6",
|
|
113
|
+
"ColdFusion CFC": "#ed2cd6",
|
|
41
114
|
"Common Lisp": "#3fb68b",
|
|
42
115
|
"Common Workflow Language": "#B5314C",
|
|
43
116
|
"Component Pascal": "#B0CE4E",
|
|
117
|
+
"Cooklang": "#E15A29",
|
|
44
118
|
"Crystal": "#000100",
|
|
119
|
+
"Csound": "#1a1a1a",
|
|
120
|
+
"Csound Document": "#1a1a1a",
|
|
121
|
+
"Csound Score": "#1a1a1a",
|
|
45
122
|
"Cuda": "#3A4E3A",
|
|
123
|
+
"Curry": "#531242",
|
|
124
|
+
"Cylc": "#00b3fd",
|
|
125
|
+
"Cypher": "#34c0eb",
|
|
126
|
+
"Cython": "#fedf5b",
|
|
46
127
|
"D": "#ba595e",
|
|
128
|
+
"D2": "#526ee8",
|
|
47
129
|
"DM": "#447265",
|
|
48
130
|
"Dafny": "#FFEC25",
|
|
131
|
+
"Darcs Patch": "#8eff23",
|
|
49
132
|
"Dart": "#00B4AB",
|
|
133
|
+
"Daslang": "#d3d3d3",
|
|
50
134
|
"DataWeave": "#003a52",
|
|
135
|
+
"Debian Package Control File": "#D70751",
|
|
136
|
+
"DenizenScript": "#FBEE96",
|
|
51
137
|
"Dhall": "#dfafff",
|
|
138
|
+
"DirectX 3D File": "#aace60",
|
|
52
139
|
"Dockerfile": "#384d54",
|
|
53
140
|
"Dogescript": "#cca760",
|
|
141
|
+
"Dotenv": "#e5d559",
|
|
142
|
+
"Dune": "#89421e",
|
|
54
143
|
"Dylan": "#6c616e",
|
|
55
144
|
"E": "#ccce35",
|
|
56
145
|
"ECL": "#8a1267",
|
|
146
|
+
"ECLiPSe": "#001d9d",
|
|
147
|
+
"EJS": "#a91e50",
|
|
57
148
|
"EQ": "#a78649",
|
|
58
|
-
"
|
|
149
|
+
"Earthly": "#2af0ff",
|
|
150
|
+
"Easybuild": "#069406",
|
|
151
|
+
"Ecere Projects": "#913960",
|
|
152
|
+
"Ecmarkup": "#eb8131",
|
|
153
|
+
"Edge": "#0dffe0",
|
|
154
|
+
"EdgeQL": "#31A7FF",
|
|
155
|
+
"EditorConfig": "#fff1f2",
|
|
156
|
+
"Eiffel": "#4d6977",
|
|
59
157
|
"Elixir": "#6e4a7e",
|
|
60
158
|
"Elm": "#60B5CC",
|
|
159
|
+
"Elvish": "#55BB55",
|
|
160
|
+
"Elvish Transcript": "#55BB55",
|
|
61
161
|
"Emacs Lisp": "#c065db",
|
|
62
162
|
"EmberScript": "#FFF4F3",
|
|
63
163
|
"Erlang": "#B83998",
|
|
164
|
+
"Euphoria": "#FF790B",
|
|
64
165
|
"F#": "#b845fc",
|
|
65
166
|
"F*": "#572e30",
|
|
167
|
+
"FIGlet Font": "#FFDDBB",
|
|
168
|
+
"FIRRTL": "#2f632f",
|
|
66
169
|
"FLUX": "#88ccff",
|
|
67
170
|
"Factor": "#636746",
|
|
68
171
|
"Fancy": "#7b9db4",
|
|
69
172
|
"Fantom": "#14253c",
|
|
70
173
|
"Faust": "#c37240",
|
|
174
|
+
"Fennel": "#fff3d7",
|
|
175
|
+
"Filebench WML": "#F6B900",
|
|
176
|
+
"FlatBuffers": "#ed284a",
|
|
177
|
+
"Flix": "#d44a45",
|
|
178
|
+
"Fluent": "#ffcc33",
|
|
71
179
|
"Forth": "#341708",
|
|
72
180
|
"Fortran": "#4d41b1",
|
|
181
|
+
"Fortran Free Form": "#4d41b1",
|
|
182
|
+
"FreeBASIC": "#141AC9",
|
|
73
183
|
"FreeMarker": "#0050b2",
|
|
74
184
|
"Frege": "#00cafe",
|
|
75
185
|
"Futhark": "#5f021f",
|
|
76
186
|
"G-code": "#D08CF2",
|
|
77
187
|
"GAML": "#FFC766",
|
|
188
|
+
"GAMS": "#f49a22",
|
|
189
|
+
"GAP": "#0000cc",
|
|
190
|
+
"GCC Machine Description": "#FFCFAB",
|
|
78
191
|
"GDScript": "#355570",
|
|
192
|
+
"GDShader": "#478CBF",
|
|
193
|
+
"GEDCOM": "#003058",
|
|
194
|
+
"GLSL": "#5686a5",
|
|
195
|
+
"GSC": "#FF6800",
|
|
79
196
|
"Game Maker Language": "#71b417",
|
|
197
|
+
"Gemfile.lock": "#701516",
|
|
198
|
+
"Gemini": "#ff6900",
|
|
199
|
+
"Genero 4gl": "#63408e",
|
|
200
|
+
"Genero per": "#d8df39",
|
|
80
201
|
"Genie": "#fb855d",
|
|
202
|
+
"Genshi": "#951531",
|
|
203
|
+
"Gentoo Ebuild": "#9400ff",
|
|
204
|
+
"Gentoo Eclass": "#9400ff",
|
|
205
|
+
"Gerber Image": "#d20b00",
|
|
81
206
|
"Gherkin": "#5B2063",
|
|
207
|
+
"Git Attributes": "#F44D27",
|
|
208
|
+
"Git Commit": "#F44D27",
|
|
209
|
+
"Git Config": "#F44D27",
|
|
210
|
+
"Git Revision List": "#F44D27",
|
|
211
|
+
"Gleam": "#ffaff3",
|
|
212
|
+
"Glimmer JS": "#F5835F",
|
|
213
|
+
"Glimmer TS": "#3178c6",
|
|
82
214
|
"Glyph": "#c1ac7f",
|
|
83
215
|
"Gnuplot": "#f0a9f0",
|
|
84
216
|
"Go": "#00ADD8",
|
|
217
|
+
"Go Checksums": "#00ADD8",
|
|
218
|
+
"Go Module": "#00ADD8",
|
|
219
|
+
"Go Template": "#00ADD8",
|
|
220
|
+
"Go Workspace": "#00ADD8",
|
|
221
|
+
"Godot Resource": "#355570",
|
|
85
222
|
"Golo": "#88562A",
|
|
86
223
|
"Gosu": "#82937f",
|
|
87
|
-
"
|
|
88
|
-
"
|
|
224
|
+
"Grace": "#615f8b",
|
|
225
|
+
"Gradle": "#02303a",
|
|
226
|
+
"Gradle Kotlin DSL": "#02303a",
|
|
227
|
+
"Grammatical Framework": "#ff0000",
|
|
228
|
+
"GraphQL": "#e10098",
|
|
229
|
+
"Graphviz (DOT)": "#2596be",
|
|
230
|
+
"Groovy": "#4298b8",
|
|
231
|
+
"Groovy Server Pages": "#4298b8",
|
|
232
|
+
"GtkRC": "#7fe719",
|
|
233
|
+
"HAProxy": "#106da9",
|
|
234
|
+
"HCL": "#844FBA",
|
|
235
|
+
"HIP": "#4F3A4F",
|
|
236
|
+
"HLSL": "#aace60",
|
|
237
|
+
"HOCON": "#9ff8ee",
|
|
89
238
|
"HTML": "#e34c26",
|
|
239
|
+
"HTML+ECR": "#2e1052",
|
|
240
|
+
"HTML+EEX": "#6e4a7e",
|
|
241
|
+
"HTML+ERB": "#701516",
|
|
242
|
+
"HTML+PHP": "#4f5d95",
|
|
243
|
+
"HTML+Razor": "#512be4",
|
|
244
|
+
"HTTP": "#005C9C",
|
|
245
|
+
"HXML": "#f68712",
|
|
90
246
|
"Hack": "#878787",
|
|
247
|
+
"Haml": "#ece2a9",
|
|
248
|
+
"Handlebars": "#f7931e",
|
|
91
249
|
"Harbour": "#0e60e3",
|
|
250
|
+
"Hare": "#9d7424",
|
|
92
251
|
"Haskell": "#5e5086",
|
|
93
252
|
"Haxe": "#df7900",
|
|
94
253
|
"HiveQL": "#dce200",
|
|
95
254
|
"HolyC": "#ffefaf",
|
|
255
|
+
"Hosts File": "#308888",
|
|
256
|
+
"Hurl": "#FF0288",
|
|
96
257
|
"Hy": "#7790B2",
|
|
97
258
|
"IDL": "#a3522f",
|
|
98
259
|
"IGOR Pro": "#0000cc",
|
|
260
|
+
"IL Assembly": "#512BD4",
|
|
261
|
+
"INI": "#d1dbe0",
|
|
262
|
+
"ISPC": "#2D68B1",
|
|
99
263
|
"Idris": "#b30000",
|
|
264
|
+
"Ignore List": "#000000",
|
|
265
|
+
"ImageJ Macro": "#99AAFF",
|
|
266
|
+
"Imba": "#16cec6",
|
|
267
|
+
"Inno Setup": "#264b99",
|
|
100
268
|
"Io": "#a9188d",
|
|
101
269
|
"Ioke": "#078193",
|
|
102
270
|
"Isabelle": "#FEFE00",
|
|
271
|
+
"Isabelle ROOT": "#FEFE00",
|
|
103
272
|
"J": "#9EEDFF",
|
|
273
|
+
"JAR Manifest": "#b07219",
|
|
274
|
+
"JCL": "#d90e09",
|
|
275
|
+
"JFlex": "#DBCA00",
|
|
276
|
+
"JSON": "#292929",
|
|
277
|
+
"JSON with Comments": "#292929",
|
|
278
|
+
"JSON5": "#267CB9",
|
|
279
|
+
"JSONLD": "#0c479c",
|
|
104
280
|
"JSONiq": "#40d47e",
|
|
281
|
+
"Jac": "#FC792D",
|
|
282
|
+
"Jai": "#ab8b4b",
|
|
283
|
+
"Janet": "#0886a5",
|
|
284
|
+
"Jasmin": "#d03600",
|
|
105
285
|
"Java": "#b07219",
|
|
286
|
+
"Java Properties": "#2A6277",
|
|
287
|
+
"Java Server Pages": "#2A6277",
|
|
288
|
+
"Java Template Engine": "#2A6277",
|
|
106
289
|
"JavaScript": "#f1e05a",
|
|
290
|
+
"JavaScript+ERB": "#f1e05a",
|
|
291
|
+
"Jest Snapshot": "#15c213",
|
|
292
|
+
"JetBrains MPS": "#21D789",
|
|
293
|
+
"Jinja": "#a52a22",
|
|
294
|
+
"Jison": "#56b3cb",
|
|
295
|
+
"Jison Lex": "#56b3cb",
|
|
107
296
|
"Jolie": "#843179",
|
|
108
297
|
"Jsonnet": "#0064bd",
|
|
109
298
|
"Julia": "#a270ba",
|
|
299
|
+
"Julia REPL": "#a270ba",
|
|
110
300
|
"Jupyter Notebook": "#DA5B0B",
|
|
301
|
+
"Just": "#384d54",
|
|
302
|
+
"KCL": "#7ABABF",
|
|
303
|
+
"KDL": "#ffb3b3",
|
|
304
|
+
"KFramework": "#4195c5",
|
|
111
305
|
"KRL": "#28430A",
|
|
112
|
-
"
|
|
306
|
+
"Kaitai Struct": "#773b37",
|
|
307
|
+
"KakouneScript": "#6f8042",
|
|
308
|
+
"KerboScript": "#41adf0",
|
|
309
|
+
"KiCad Layout": "#2f4aab",
|
|
310
|
+
"KiCad Legacy Layout": "#2f4aab",
|
|
311
|
+
"KiCad Schematic": "#2f4aab",
|
|
312
|
+
"KoLmafia ASH": "#B9D9B9",
|
|
313
|
+
"Koka": "#215166",
|
|
314
|
+
"Kotlin": "#A97BFF",
|
|
113
315
|
"LFE": "#4C3023",
|
|
114
316
|
"LLVM": "#185619",
|
|
115
317
|
"LOLCODE": "#cc9900",
|
|
116
318
|
"LSL": "#3d9970",
|
|
319
|
+
"LabVIEW": "#fede06",
|
|
320
|
+
"Lambdapi": "#8027a3",
|
|
321
|
+
"Langium": "#2c8c87",
|
|
322
|
+
"Lark": "#2980B9",
|
|
117
323
|
"Lasso": "#999999",
|
|
324
|
+
"Latte": "#f2a542",
|
|
325
|
+
"Leo": "#C4FFC2",
|
|
326
|
+
"Less": "#1d365d",
|
|
118
327
|
"Lex": "#DBCA00",
|
|
328
|
+
"LigoLANG": "#0e74ff",
|
|
329
|
+
"LilyPond": "#9ccc7c",
|
|
330
|
+
"Liquid": "#67b8de",
|
|
331
|
+
"Liquidsoap": "#990066",
|
|
332
|
+
"Literate Agda": "#315665",
|
|
333
|
+
"Literate CoffeeScript": "#244776",
|
|
334
|
+
"Literate Haskell": "#5e5086",
|
|
335
|
+
"LiveCode Script": "#0c5ba5",
|
|
119
336
|
"LiveScript": "#499886",
|
|
337
|
+
"Logtalk": "#295b9a",
|
|
120
338
|
"LookML": "#652B81",
|
|
121
339
|
"Lua": "#000080",
|
|
340
|
+
"Luau": "#00A2FF",
|
|
341
|
+
"M3U": "#179C7D",
|
|
122
342
|
"MATLAB": "#e16737",
|
|
123
343
|
"MAXScript": "#00a6a6",
|
|
344
|
+
"MDX": "#fcb32c",
|
|
124
345
|
"MLIR": "#5EC8DB",
|
|
125
346
|
"MQL4": "#62A8D6",
|
|
126
347
|
"MQL5": "#4A76B8",
|
|
127
348
|
"MTML": "#b7e1f4",
|
|
128
349
|
"Macaulay2": "#d8ffff",
|
|
129
350
|
"Makefile": "#427819",
|
|
351
|
+
"Mako": "#7e858d",
|
|
352
|
+
"Markdown": "#083fa1",
|
|
353
|
+
"Marko": "#42bff2",
|
|
130
354
|
"Mask": "#f97732",
|
|
355
|
+
"Mathematical Programming System": "#0530ad",
|
|
131
356
|
"Max": "#c4a79c",
|
|
357
|
+
"MeTTa": "#6a5acd",
|
|
132
358
|
"Mercury": "#ff2b2b",
|
|
359
|
+
"Mermaid": "#ff3670",
|
|
133
360
|
"Meson": "#007800",
|
|
134
361
|
"Metal": "#8f14e9",
|
|
362
|
+
"MiniYAML": "#ff1111",
|
|
363
|
+
"MiniZinc": "#06a9e6",
|
|
364
|
+
"Mint": "#02b046",
|
|
135
365
|
"Mirah": "#c7a938",
|
|
366
|
+
"Modelica": "#de1d31",
|
|
367
|
+
"Modula-2": "#10253f",
|
|
136
368
|
"Modula-3": "#223388",
|
|
369
|
+
"Mojo": "#ff4c1f",
|
|
370
|
+
"Monkey C": "#8D6747",
|
|
371
|
+
"MoonBit": "#b92381",
|
|
372
|
+
"MoonScript": "#ff4585",
|
|
373
|
+
"Motoko": "#fbb03b",
|
|
374
|
+
"Motorola 68K Assembly": "#005daa",
|
|
375
|
+
"Move": "#4a137a",
|
|
376
|
+
"Mustache": "#724b3b",
|
|
137
377
|
"NCL": "#28431f",
|
|
378
|
+
"NMODL": "#00356B",
|
|
379
|
+
"NPM Config": "#cb3837",
|
|
380
|
+
"NWScript": "#111522",
|
|
381
|
+
"Nasal": "#1d2c4e",
|
|
138
382
|
"Nearley": "#990000",
|
|
139
383
|
"Nemerle": "#3d3c6e",
|
|
140
384
|
"NetLinx": "#0aa0ff",
|
|
@@ -142,11 +386,23 @@
|
|
|
142
386
|
"NetLogo": "#ff6375",
|
|
143
387
|
"NewLisp": "#87AED7",
|
|
144
388
|
"Nextflow": "#3ac486",
|
|
389
|
+
"Nginx": "#009639",
|
|
390
|
+
"Nickel": "#E0C3FC",
|
|
145
391
|
"Nim": "#ffc200",
|
|
146
392
|
"Nit": "#009917",
|
|
147
393
|
"Nix": "#7e7eff",
|
|
394
|
+
"Noir": "#2f1f49",
|
|
148
395
|
"Nu": "#c9df40",
|
|
149
|
-
"
|
|
396
|
+
"NumPy": "#9C8AF9",
|
|
397
|
+
"Nunjucks": "#3d8137",
|
|
398
|
+
"Nushell": "#4E9906",
|
|
399
|
+
"OASv2-json": "#85ea2d",
|
|
400
|
+
"OASv2-yaml": "#85ea2d",
|
|
401
|
+
"OASv3-json": "#85ea2d",
|
|
402
|
+
"OASv3-yaml": "#85ea2d",
|
|
403
|
+
"OCaml": "#ef7a08",
|
|
404
|
+
"OMNeT++ MSG": "#a0e0a0",
|
|
405
|
+
"OMNeT++ NED": "#08607c",
|
|
150
406
|
"ObjectScript": "#424893",
|
|
151
407
|
"Objective-C": "#438eff",
|
|
152
408
|
"Objective-C++": "#6866fb",
|
|
@@ -154,12 +410,27 @@
|
|
|
154
410
|
"Odin": "#60AFFE",
|
|
155
411
|
"Omgrofl": "#cabbff",
|
|
156
412
|
"Opal": "#f7ede0",
|
|
413
|
+
"Open Policy Agent": "#7d9199",
|
|
414
|
+
"OpenAPI Specification v2": "#85ea2d",
|
|
415
|
+
"OpenAPI Specification v3": "#85ea2d",
|
|
416
|
+
"OpenCL": "#ed2e2d",
|
|
417
|
+
"OpenEdge ABL": "#5ce600",
|
|
157
418
|
"OpenQASM": "#AA70FF",
|
|
419
|
+
"OpenSCAD": "#e5cd45",
|
|
420
|
+
"Option List": "#476732",
|
|
421
|
+
"Org": "#77aa99",
|
|
422
|
+
"OverPy": "#78b355",
|
|
423
|
+
"OverpassQL": "#cce2aa",
|
|
158
424
|
"Oxygene": "#cdd0e3",
|
|
159
425
|
"Oz": "#fab738",
|
|
160
426
|
"P4": "#7055b5",
|
|
427
|
+
"PDDL": "#0d00ff",
|
|
428
|
+
"PEG.js": "#234d6b",
|
|
161
429
|
"PHP": "#4F5D95",
|
|
162
430
|
"PLSQL": "#dad8d8",
|
|
431
|
+
"PLpgSQL": "#336790",
|
|
432
|
+
"POV-Ray SDL": "#6bac65",
|
|
433
|
+
"Pact": "#F7A8B8",
|
|
163
434
|
"Pan": "#cc0000",
|
|
164
435
|
"Papyrus": "#6600cc",
|
|
165
436
|
"Parrot": "#f3ca0a",
|
|
@@ -167,100 +438,240 @@
|
|
|
167
438
|
"Pawn": "#dbb284",
|
|
168
439
|
"Pep8": "#C76F5B",
|
|
169
440
|
"Perl": "#0298c3",
|
|
441
|
+
"PicoLisp": "#6067af",
|
|
170
442
|
"PigLatin": "#fcd7de",
|
|
171
443
|
"Pike": "#005390",
|
|
444
|
+
"Pip Requirements": "#FFD343",
|
|
445
|
+
"Pkl": "#6b9543",
|
|
446
|
+
"PlantUML": "#fbbd16",
|
|
172
447
|
"PogoScript": "#d80074",
|
|
448
|
+
"Polar": "#ae81ff",
|
|
449
|
+
"Portugol": "#f8bd00",
|
|
450
|
+
"PostCSS": "#dc3a0c",
|
|
173
451
|
"PostScript": "#da291c",
|
|
452
|
+
"Power Query": "#d38e0d",
|
|
174
453
|
"PowerBuilder": "#8f0f8d",
|
|
175
454
|
"PowerShell": "#012456",
|
|
455
|
+
"Praat": "#c8506d",
|
|
456
|
+
"Prisma": "#0c344b",
|
|
457
|
+
"Pro*C": "#bb8368",
|
|
176
458
|
"Processing": "#0096D8",
|
|
459
|
+
"Procfile": "#3B2F63",
|
|
177
460
|
"Prolog": "#74283c",
|
|
461
|
+
"Promela": "#de0000",
|
|
178
462
|
"Propeller Spin": "#7fa2a7",
|
|
463
|
+
"Pug": "#a86454",
|
|
179
464
|
"Puppet": "#302B6D",
|
|
180
465
|
"PureBasic": "#5a6986",
|
|
181
466
|
"PureScript": "#1D222D",
|
|
467
|
+
"Pyret": "#ee1e10",
|
|
182
468
|
"Python": "#3572A5",
|
|
469
|
+
"Python console": "#3572A5",
|
|
470
|
+
"Python traceback": "#3572A5",
|
|
471
|
+
"Q#": "#fed659",
|
|
183
472
|
"QML": "#44a51c",
|
|
473
|
+
"Qt Script": "#00b841",
|
|
184
474
|
"Quake": "#882233",
|
|
475
|
+
"QuakeC": "#975777",
|
|
476
|
+
"QuickBASIC": "#008080",
|
|
477
|
+
"Quint": "#9d6ce5",
|
|
185
478
|
"R": "#198CE7",
|
|
186
479
|
"RAML": "#77d9fb",
|
|
480
|
+
"RAScript": "#2C97FA",
|
|
481
|
+
"RBS": "#701516",
|
|
482
|
+
"RDoc": "#701516",
|
|
483
|
+
"REXX": "#d90e09",
|
|
484
|
+
"RMarkdown": "#198ce7",
|
|
485
|
+
"RON": "#a62c00",
|
|
486
|
+
"ROS Interface": "#22314e",
|
|
487
|
+
"RPGLE": "#2BDE21",
|
|
187
488
|
"RUNOFF": "#665a4e",
|
|
188
489
|
"Racket": "#3c5caa",
|
|
189
490
|
"Ragel": "#9d5200",
|
|
190
491
|
"Raku": "#0000fb",
|
|
191
492
|
"Rascal": "#fffaa0",
|
|
493
|
+
"ReScript": "#ed5051",
|
|
192
494
|
"Reason": "#ff5847",
|
|
495
|
+
"ReasonLIGO": "#ff5847",
|
|
193
496
|
"Rebol": "#358a5b",
|
|
497
|
+
"Record Jar": "#0673ba",
|
|
194
498
|
"Red": "#f50000",
|
|
499
|
+
"Redscript": "#f44336",
|
|
500
|
+
"Regular Expression": "#009a00",
|
|
195
501
|
"Ren'Py": "#ff7f7f",
|
|
502
|
+
"Rez": "#FFDAB3",
|
|
196
503
|
"Ring": "#2D54CB",
|
|
197
504
|
"Riot": "#A71E49",
|
|
505
|
+
"RobotFramework": "#00c0b5",
|
|
506
|
+
"Roc": "#7c38f5",
|
|
507
|
+
"Rocq Prover": "#d0b68c",
|
|
198
508
|
"Roff": "#ecdebe",
|
|
509
|
+
"Roff Manpage": "#ecdebe",
|
|
199
510
|
"Rouge": "#cc0088",
|
|
511
|
+
"RouterOS Script": "#DE3941",
|
|
200
512
|
"Ruby": "#701516",
|
|
201
513
|
"Rust": "#dea584",
|
|
202
514
|
"SAS": "#B34936",
|
|
515
|
+
"SCSS": "#c6538c",
|
|
516
|
+
"SPARQL": "#0C4597",
|
|
203
517
|
"SQF": "#3F3F3F",
|
|
518
|
+
"SQL": "#e38c00",
|
|
519
|
+
"SQLPL": "#e38c00",
|
|
204
520
|
"SRecode Template": "#348a34",
|
|
521
|
+
"STL": "#373b5e",
|
|
522
|
+
"SVG": "#ff9900",
|
|
523
|
+
"Sail": "#259dd5",
|
|
205
524
|
"SaltStack": "#646464",
|
|
525
|
+
"Sass": "#a53b70",
|
|
206
526
|
"Scala": "#c22d40",
|
|
527
|
+
"Scaml": "#bd181a",
|
|
528
|
+
"Scenic": "#fdc700",
|
|
207
529
|
"Scheme": "#1e4aec",
|
|
530
|
+
"Scilab": "#ca0f21",
|
|
208
531
|
"Self": "#0579aa",
|
|
532
|
+
"ShaderLab": "#222c37",
|
|
209
533
|
"Shell": "#89e051",
|
|
534
|
+
"ShellCheck Config": "#cecfcb",
|
|
210
535
|
"Shen": "#120F14",
|
|
536
|
+
"Simple File Verification": "#C9BFED",
|
|
537
|
+
"Singularity": "#64E6AD",
|
|
538
|
+
"Slang": "#1fbec9",
|
|
211
539
|
"Slash": "#007eff",
|
|
212
540
|
"Slice": "#003fa2",
|
|
541
|
+
"Slim": "#2b2b2b",
|
|
542
|
+
"Slint": "#2379F4",
|
|
213
543
|
"SmPL": "#c94949",
|
|
214
544
|
"Smalltalk": "#596706",
|
|
545
|
+
"Smarty": "#f0c040",
|
|
546
|
+
"Smithy": "#c44536",
|
|
547
|
+
"Snakemake": "#419179",
|
|
215
548
|
"Solidity": "#AA6746",
|
|
216
|
-
"SourcePawn": "#
|
|
549
|
+
"SourcePawn": "#f69e1d",
|
|
550
|
+
"SpiceDB Schema": "#a5318a",
|
|
217
551
|
"Squirrel": "#800000",
|
|
218
552
|
"Stan": "#b2011d",
|
|
219
553
|
"Standard ML": "#dc566d",
|
|
220
554
|
"Starlark": "#76d275",
|
|
555
|
+
"Stata": "#1a5f91",
|
|
556
|
+
"StringTemplate": "#3fb34f",
|
|
557
|
+
"Stylus": "#ff6347",
|
|
558
|
+
"SubRip Text": "#9e0101",
|
|
559
|
+
"SugarSS": "#2fcc9f",
|
|
221
560
|
"SuperCollider": "#46390b",
|
|
222
|
-
"
|
|
561
|
+
"SurrealQL": "#ff00a0",
|
|
562
|
+
"Survex data": "#ffcc99",
|
|
563
|
+
"Svelte": "#ff3e00",
|
|
564
|
+
"Sway": "#00F58C",
|
|
565
|
+
"Sweave": "#198ce7",
|
|
566
|
+
"Swift": "#F05138",
|
|
223
567
|
"SystemVerilog": "#DAE1C2",
|
|
224
568
|
"TI Program": "#A0AA87",
|
|
569
|
+
"TL-Verilog": "#C40023",
|
|
570
|
+
"TLA": "#4b0079",
|
|
571
|
+
"TMDL": "#f0c913",
|
|
572
|
+
"TOML": "#9c4221",
|
|
573
|
+
"TSQL": "#e38c00",
|
|
574
|
+
"TSV": "#237346",
|
|
575
|
+
"TSX": "#3178c6",
|
|
576
|
+
"TXL": "#0178b8",
|
|
577
|
+
"Tact": "#48b5ff",
|
|
578
|
+
"Talon": "#333333",
|
|
225
579
|
"Tcl": "#e4cc98",
|
|
226
580
|
"TeX": "#3D6117",
|
|
581
|
+
"Teal": "#00B1BC",
|
|
227
582
|
"Terra": "#00004c",
|
|
583
|
+
"Terraform Template": "#7b42bb",
|
|
584
|
+
"TextGrid": "#c8506d",
|
|
585
|
+
"TextMate Properties": "#df66e4",
|
|
586
|
+
"Textile": "#ffe7ac",
|
|
587
|
+
"Thrift": "#D12127",
|
|
588
|
+
"Toit": "#c2c9fb",
|
|
589
|
+
"Tor Config": "#59316b",
|
|
590
|
+
"Tree-sitter Query": "#8ea64c",
|
|
228
591
|
"Turing": "#cf142b",
|
|
229
|
-
"
|
|
592
|
+
"Twig": "#c1d026",
|
|
593
|
+
"TypeScript": "#3178c6",
|
|
594
|
+
"TypeSpec": "#4A3665",
|
|
595
|
+
"Typst": "#239dad",
|
|
596
|
+
"Unified Parallel C": "#4e3617",
|
|
597
|
+
"Unity3D Asset": "#222c37",
|
|
598
|
+
"Uno": "#9933cc",
|
|
230
599
|
"UnrealScript": "#a54c4d",
|
|
231
|
-
"
|
|
600
|
+
"Untyped Plutus Core": "#36adbd",
|
|
601
|
+
"UrWeb": "#ccccee",
|
|
602
|
+
"V": "#4f87c4",
|
|
232
603
|
"VBA": "#867db1",
|
|
233
604
|
"VBScript": "#15dcdc",
|
|
234
605
|
"VCL": "#148AA8",
|
|
235
606
|
"VHDL": "#adb2cb",
|
|
236
|
-
"Vala": "#
|
|
607
|
+
"Vala": "#a56de2",
|
|
608
|
+
"Valve Data Format": "#f26025",
|
|
609
|
+
"Velocity Template Language": "#507cff",
|
|
610
|
+
"Vento": "#ff0080",
|
|
237
611
|
"Verilog": "#b2b7f8",
|
|
238
|
-
"Vim
|
|
612
|
+
"Vim Help File": "#199f4b",
|
|
613
|
+
"Vim Script": "#199f4b",
|
|
614
|
+
"Vim Snippet": "#199f4b",
|
|
239
615
|
"Visual Basic .NET": "#945db7",
|
|
616
|
+
"Visual Basic 6.0": "#2c6353",
|
|
240
617
|
"Volt": "#1F1F1F",
|
|
241
|
-
"Vue": "#
|
|
618
|
+
"Vue": "#41b883",
|
|
619
|
+
"Vyper": "#9F4CF2",
|
|
620
|
+
"WDL": "#42f1f4",
|
|
621
|
+
"WGSL": "#1a5e9a",
|
|
622
|
+
"Web Ontology Language": "#5b70bd",
|
|
242
623
|
"WebAssembly": "#04133b",
|
|
624
|
+
"WebAssembly Interface Type": "#6250e7",
|
|
625
|
+
"Whiley": "#d5c397",
|
|
626
|
+
"Wikitext": "#fc5757",
|
|
627
|
+
"Windows Registry Entries": "#52d5ff",
|
|
628
|
+
"Witcher Script": "#ff0000",
|
|
629
|
+
"Wolfram Language": "#dd1100",
|
|
243
630
|
"Wollok": "#a23738",
|
|
631
|
+
"World of Warcraft Addon Data": "#f7e43f",
|
|
632
|
+
"Wren": "#383838",
|
|
244
633
|
"X10": "#4B6BEF",
|
|
245
634
|
"XC": "#99DA07",
|
|
635
|
+
"XML": "#0060ac",
|
|
636
|
+
"XML Property List": "#0060ac",
|
|
246
637
|
"XQuery": "#5232e7",
|
|
247
638
|
"XSLT": "#EB8CEB",
|
|
639
|
+
"Xmake": "#22a079",
|
|
640
|
+
"Xojo": "#81bd41",
|
|
641
|
+
"Xonsh": "#285EEF",
|
|
642
|
+
"Xtend": "#24255d",
|
|
643
|
+
"YAML": "#cb171e",
|
|
248
644
|
"YARA": "#220000",
|
|
249
645
|
"YASnippet": "#32AB90",
|
|
250
646
|
"Yacc": "#4B6C4B",
|
|
647
|
+
"Yul": "#794932",
|
|
251
648
|
"ZAP": "#0d665e",
|
|
252
649
|
"ZIL": "#dc75e5",
|
|
253
650
|
"ZenScript": "#00BCD1",
|
|
254
651
|
"Zephir": "#118f9e",
|
|
255
652
|
"Zig": "#ec915c",
|
|
653
|
+
"Zimpl": "#d67711",
|
|
654
|
+
"Zmodel": "#ff7100",
|
|
655
|
+
"crontab": "#ead7ac",
|
|
256
656
|
"eC": "#913960",
|
|
257
|
-
"
|
|
657
|
+
"fish": "#4aae47",
|
|
658
|
+
"hoon": "#00b171",
|
|
659
|
+
"iCalendar": "#ec564c",
|
|
660
|
+
"jq": "#c7254e",
|
|
661
|
+
"kvlang": "#1da6e0",
|
|
662
|
+
"mIRC Script": "#3d57c3",
|
|
258
663
|
"mcfunction": "#E22837",
|
|
664
|
+
"mdsvex": "#5f9ea0",
|
|
665
|
+
"mupad": "#244963",
|
|
666
|
+
"nanorc": "#2d004d",
|
|
259
667
|
"nesC": "#94B0C7",
|
|
260
668
|
"ooc": "#b0b77e",
|
|
669
|
+
"pkg-config": "#2b5e82",
|
|
261
670
|
"q": "#0040cd",
|
|
671
|
+
"reStructuredText": "#141414",
|
|
262
672
|
"sed": "#64b970",
|
|
263
|
-
"
|
|
673
|
+
"templ": "#66D0DD",
|
|
674
|
+
"vCard": "#ee2647",
|
|
264
675
|
"wisp": "#7582D1",
|
|
265
676
|
"xBase": "#403a40"
|
|
266
677
|
}
|
data/lib/language_colors.rb
CHANGED
|
@@ -6,18 +6,17 @@ require 'json'
|
|
|
6
6
|
# Module to hold the class
|
|
7
7
|
module LanguageColors
|
|
8
8
|
class Error < StandardError; end
|
|
9
|
-
# Your code goes here...
|
|
10
|
-
@hash = Hash.new(false)
|
|
11
9
|
|
|
12
|
-
#
|
|
10
|
+
# Looks up the GitHub/Linguist color for a language name.
|
|
13
11
|
class LanguageColors
|
|
12
|
+
COLORS_FILE = File.join(__dir__, 'colors.json')
|
|
13
|
+
|
|
14
14
|
def initialize
|
|
15
|
-
|
|
16
|
-
File.open(file) do |f|
|
|
17
|
-
@hash = JSON.parse(f.read)
|
|
18
|
-
end
|
|
15
|
+
@hash = JSON.parse(File.read(COLORS_FILE))
|
|
19
16
|
end
|
|
20
17
|
|
|
18
|
+
# Returns the hex color string (e.g. "#f34b7d") for +lang+,
|
|
19
|
+
# or nil if the language is unknown.
|
|
21
20
|
def color(lang)
|
|
22
21
|
@hash[lang]
|
|
23
22
|
end
|
data/lib/linguist_reader.rb
CHANGED
|
@@ -4,15 +4,36 @@ require 'open-uri'
|
|
|
4
4
|
require 'yaml'
|
|
5
5
|
require 'json'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
# Regenerates lib/colors.json from GitHub Linguist's languages.yml.
|
|
8
|
+
# Run with: ruby lib/linguist_reader.rb (or `rake colors`)
|
|
9
|
+
module LinguistReader
|
|
10
|
+
SOURCE_URL = 'https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml'
|
|
11
|
+
OUTPUT_FILE = File.join(__dir__, 'colors.json')
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
module_function
|
|
14
|
+
|
|
15
|
+
def fetch
|
|
16
|
+
URI.parse(SOURCE_URL).open(&:read)
|
|
17
|
+
rescue OpenURI::HTTPError, SocketError => e
|
|
18
|
+
abort "Failed to download Linguist languages.yml: #{e.message}"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def build(yaml_content)
|
|
22
|
+
YAML.safe_load(yaml_content).each_with_object({}) do |(name, props), colors|
|
|
23
|
+
color = props['color']
|
|
24
|
+
colors[name] = color unless color.nil?
|
|
25
|
+
end.sort.to_h
|
|
26
|
+
end
|
|
15
27
|
|
|
16
|
-
|
|
17
|
-
|
|
28
|
+
def write(colors)
|
|
29
|
+
File.write(OUTPUT_FILE, "#{JSON.pretty_generate(colors)}\n")
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def run
|
|
33
|
+
colors = build(fetch)
|
|
34
|
+
write(colors)
|
|
35
|
+
puts "Wrote #{colors.size} language colors to #{OUTPUT_FILE}"
|
|
36
|
+
end
|
|
18
37
|
end
|
|
38
|
+
|
|
39
|
+
LinguistReader.run if $PROGRAM_NAME == __FILE__
|
metadata
CHANGED
|
@@ -1,25 +1,37 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: language_colors
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Syed AbuTalib
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
12
|
-
dependencies:
|
|
13
|
-
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: json
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '2.0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '2.0'
|
|
14
26
|
email:
|
|
15
27
|
- syedabutalib@github.com
|
|
16
28
|
executables: []
|
|
17
29
|
extensions: []
|
|
18
30
|
extra_rdoc_files: []
|
|
19
31
|
files:
|
|
32
|
+
- ".github/workflows/ci.yml"
|
|
20
33
|
- ".gitignore"
|
|
21
34
|
- ".rspec"
|
|
22
|
-
- ".travis.yml"
|
|
23
35
|
- CODE_OF_CONDUCT.md
|
|
24
36
|
- Gemfile
|
|
25
37
|
- Gemfile.lock
|
|
@@ -40,7 +52,6 @@ metadata:
|
|
|
40
52
|
homepage_uri: https://github.com/SyedAbutalib/language_colors
|
|
41
53
|
source_code_uri: https://github.com/SyedAbutalib/language_colors
|
|
42
54
|
changelog_uri: https://github.com/SyedAbutalib/language_colors
|
|
43
|
-
post_install_message:
|
|
44
55
|
rdoc_options: []
|
|
45
56
|
require_paths:
|
|
46
57
|
- lib
|
|
@@ -55,8 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
55
66
|
- !ruby/object:Gem::Version
|
|
56
67
|
version: '0'
|
|
57
68
|
requirements: []
|
|
58
|
-
rubygems_version:
|
|
59
|
-
signing_key:
|
|
69
|
+
rubygems_version: 4.0.16
|
|
60
70
|
specification_version: 4
|
|
61
71
|
summary: Get a language's color on github.
|
|
62
72
|
test_files: []
|