rouge-gtk_theme_loader 0.3.0 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67ce26a90c9b7b856cfd86206f3b428566989deb3cf7a5a9a39f05e63bfba449
4
- data.tar.gz: 8745540d1b8abe6f2bebde7ea537839248b8d8a8a780b49fe19c7422bd0a9076
3
+ metadata.gz: d67d1e8cb8dc82d230472e916c32c59a666917015a7b5e147f7928c2596bbf58
4
+ data.tar.gz: e6a2816937838310a3f778e33ec7a021ec78f1e737e773c2079d24a290bde44e
5
5
  SHA512:
6
- metadata.gz: 4567bcb3f7ea5f36fb4d841efffa4d3b1cde1ed1c6bae6a115cf587dd0f4ac7cb0ca8706df7ee00bdd51a8edc2e5a040c5c665e5200819f856b78b518345c29c
7
- data.tar.gz: 6b1989094738e428d8659fb3d131a1dea5591d7d8fedc05f01456222b743f439c69eb7ae9b974ba40c8a3c0aed1911e14fef47aac76f1d2f19db727cb495146c
6
+ metadata.gz: aa915a5dabf80736613975c3ea865431ebc5e7a264fc968b129646e8dbac3de49e210cdd55ffeb3486dc39386b46f47ba245b0c4b78e00807c2f025bf7115808
7
+ data.tar.gz: 56422be1692e264b616becd2cee3b3cd4e263af070dea18fdffeb7a676353b30cf7d8c776435ddf8a15989e2aac1159e563b98da6abdfb1e961aa294e1340dea
data/README.md CHANGED
@@ -10,9 +10,19 @@ Install the gem and add to the application's Gemfile by executing:
10
10
 
11
11
  ## Usage
12
12
 
13
- Require Rouge first. Then require 'rouge/gtk_theme_loader' and it will attempt to load any installed
14
- GtkSourceView themes into Rouge. If you want to install your own custom GtkSourceView
15
- themes, you can install them in ~/.config/rouge/themes/
13
+ Require Rouge first. Then require 'rouge/gtk_theme_loader' and it will attempt to load
14
+ any installed GtkSourceView themes into Rouge. If you want to install your own custom
15
+ GtkSourceView themes, you can install them in
16
+ `~/.local/share/gtksourceview-4/styles`, or if you want them to only
17
+ apply to Rouge, you can drop them in `~/.local/share/rouge/styles` (NOTE: This
18
+ path has changed to match XDG specs better, and to match GtkSourceView
19
+ naming convention better). It will also check /usr/share/gtksourceview-4
20
+ as well as gtksourceview-2.0 and gtksourceview-3.0 directories.
21
+
22
+ For a source of GtkSourceView style files that have been mostly
23
+ tested with this gem, check out:
24
+
25
+ <https://github.com/trusktr/gedit-color-schemes/tree/master>
16
26
 
17
27
  ## Development
18
28
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rouge
4
4
  class GtkThemeLoader
5
- VERSION = "0.3.0"
5
+ VERSION = "0.3.2"
6
6
  end
7
7
  end
@@ -16,10 +16,14 @@ module Rouge
16
16
  "/usr/share/gtksourceview-2.0/styles/*.xml",
17
17
  "/usr/share/gtksourceview-3.0/styles/*.xml",
18
18
  "/usr/share/gtksourceview-4/styles/*.xml",
19
- "~/.config/rouge/themes/*.xml"
19
+ "~/.local/share/gtksourceview-2.0/styles/*.xml",
20
+ "~/.local/share/gtksourceview-3.0/styles/*.xml",
21
+ "~/.local/share/gtksourceview-4/styles/*.xml",
22
+ "~/.local/share/rouge/styles/*.xml"
20
23
  ]
21
24
 
22
- # Mapping of GTK source view mappings.
25
+ # GTK source view mappings to Rouge token mappings
26
+ # This is incomplete.
23
27
  GTKMAPPING = {
24
28
  "def:string" => Literal::String,
25
29
  "def:constant" => Literal,
@@ -32,6 +36,16 @@ module Rouge
32
36
  "def:identifier" => Name::Builtin,
33
37
  "def:emphasis" => Generic::Emph,
34
38
  "def:preprocessor" => Name::Builtin,
39
+ "def:builtin" => Name::Builtin,
40
+ "def:instance-variable" => Name::Variable::Instance,
41
+ "def:operator" => Operator,
42
+ "def:boolean" => Keyword::Pseudo,
43
+
44
+ # FIXME: Use theme specific ones as fallbacks only.
45
+ "ruby:global-variable" => Name::Variable::Global,
46
+ "ruby:instance-variable" => Name::Variable::Instance,
47
+ "ruby:constant" => Name::Constant,
48
+ "ruby:builtin" => Name::Builtin,
35
49
  }
36
50
 
37
51
  def self.load!
@@ -76,13 +90,13 @@ module Rouge
76
90
  if @text
77
91
 
78
92
  theme.style(Text,
79
- :fg => @text.attr("foreground").to_sym,
80
- :bg => @text.attr("background").to_sym
93
+ :fg => @text&.attr("foreground")&.to_sym,
94
+ :bg => @text&.attr("background")&.to_sym
81
95
  )
82
96
  else
83
97
  bgp = xml.xpath("//style[@name='background-pattern']")
84
98
  if bgp
85
- bg = bgp.attr("background").value
99
+ bg = bgp&.attr("background")&.value
86
100
  end
87
101
  bg ||= "#000000"
88
102
  if bg[0] == ?#
data/screenshots/1.png ADDED
Binary file
data/screenshots/2.png ADDED
Binary file
data/screenshots/3.png ADDED
Binary file
data/screenshots/4.png ADDED
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rouge-gtk_theme_loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vidar Hokstad
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-05 00:00:00.000000000 Z
11
+ date: 2023-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rouge
@@ -36,6 +36,10 @@ files:
36
36
  - Rakefile
37
37
  - lib/rouge/gtk_theme_loader.rb
38
38
  - lib/rouge/gtk_theme_loader/version.rb
39
+ - screenshots/1.png
40
+ - screenshots/2.png
41
+ - screenshots/3.png
42
+ - screenshots/4.png
39
43
  - sig/rouge/gtk_theme_loader.rbs
40
44
  homepage: https://github.com/vidarh/rouge-gtk_theme_loader
41
45
  licenses: