xres2tlx 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/README.md +6 -3
- data/lib/xres2tlx/converter.rb +6 -3
- data/lib/xres2tlx/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0aefd922bebb7e08195ea7ddc757bffdc23ff592ba4b55d38d1a9ed89222b06d
|
4
|
+
data.tar.gz: ab96c735b32fb7f912f3314c98fbc94f5d803cca1f3bee275cd4fb1dc193ef75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58c2e5e3a05f96851495f68c086edbdbaf354e492380fbd6258a1a5822dd45678b20400c2810ae472fe2d1f7587eeedf7d392f52ece1a2eeb1b923692fbe7d8c
|
7
|
+
data.tar.gz: 58b6e8f3760c3b5e3dd00183caa82b0d4b6ffc68aa358963094f8690fcc14474ba72145e7afa9268da157d57da9bcb6fe629c759535fffb1de03519dca266c91
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2022 Rory Dudley
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -15,12 +15,15 @@ gem install xres2tlx
|
|
15
15
|
__From source__
|
16
16
|
##### One-liner
|
17
17
|
```
|
18
|
-
|
18
|
+
git clone git@github.com:pinecat/xres2tlx.git && cd xres2tlx && gem build && gem install xres2tlx-*.gem
|
19
19
|
```
|
20
20
|
##### Manual
|
21
21
|
```
|
22
|
-
|
22
|
+
$ git clone git@github.com:pinecat/xres2tlx.git
|
23
|
+
$ cd xres2tlx
|
24
|
+
$ gem build
|
25
|
+
$ gem install xres2tlx-*.gem
|
23
26
|
```
|
24
27
|
|
25
28
|
## License
|
26
|
-
|
29
|
+
This program is licensed under the MIT license. For more information, please see the [LICENSE](https://github.com/pinecat/xres2tlx/blob/master/LICENSE).
|
data/lib/xres2tlx/converter.rb
CHANGED
@@ -12,7 +12,7 @@ class Converter
|
|
12
12
|
|
13
13
|
# Set the xres_filepath
|
14
14
|
@xres_filepath = filepath
|
15
|
-
@unordered_pref = {palette:
|
15
|
+
@unordered_pref = {palette: {}}
|
16
16
|
@tlx_pref = nil
|
17
17
|
end
|
18
18
|
|
@@ -37,10 +37,13 @@ class Converter
|
|
37
37
|
# Palette
|
38
38
|
# Only set palette if line just includes "color", NOT "colorBD"
|
39
39
|
unless line.include? "colorBD"
|
40
|
-
@unordered_pref[:palette].
|
40
|
+
@unordered_pref[:palette][line.split(":").first.scan(/\d/).join("").to_i] = color if line.include? "color"
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
44
|
+
|
45
|
+
# Sort colors
|
46
|
+
@unordered_pref[:palette] = @unordered_pref[:palette].sort.to_h
|
44
47
|
end
|
45
48
|
|
46
49
|
def set_tlx_pref
|
@@ -55,7 +58,7 @@ class Converter
|
|
55
58
|
"highlight-background-color": "#000000",
|
56
59
|
"highlight-foreground-color": "#FFFFFF",
|
57
60
|
name: @xres_filepath.split("/").last.strip.chomp,
|
58
|
-
palette: @unordered_pref[:palette],
|
61
|
+
palette: @unordered_pref[:palette].values,
|
59
62
|
"use-badge-color": false,
|
60
63
|
"use-bold-color": true,
|
61
64
|
"use-cursor-color": true,
|
data/lib/xres2tlx/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xres2tlx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rory Dudley
|
@@ -21,6 +21,7 @@ extra_rdoc_files: []
|
|
21
21
|
files:
|
22
22
|
- ".standard.yml"
|
23
23
|
- Gemfile
|
24
|
+
- LICENSE
|
24
25
|
- README.md
|
25
26
|
- Rakefile
|
26
27
|
- bin/xres2tlx
|