fusuma 2.5.0 → 2.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/console +2 -2
- data/lib/fusuma/plugin/manager.rb +43 -22
- data/lib/fusuma/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9368eba481cbc496fb561cb449ec99c6b5f1eff8b4c8c4a9c8d61b4e7d5b4cf8
|
4
|
+
data.tar.gz: 3bea9acc54d3e2061f391ec282f9327ca2b3fd70463fa5f2394063a980b20613
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2af60b07cfa18ca3b3d13eedf9b0271ff5bfdea37776e66a51e59eb33ea2e6bd35fe1fdc4724738ca3ecec37c7a6811c202c4277bf1e4ff341fda81e8fdb9f58
|
7
|
+
data.tar.gz: 4583ee8007e36e364658f02a42d5f447adb947408e690cb0f554c004672869f0304e2e674335aebc2d9a267abcb01cbe2f559845e604d4acc945620d7fada1a7
|
data/bin/console
CHANGED
@@ -15,37 +15,51 @@ module Fusuma
|
|
15
15
|
fusuma_default_plugin_paths.each { |siblings_plugin| require(siblings_plugin) }
|
16
16
|
end
|
17
17
|
|
18
|
-
def fusuma_default_plugin_paths
|
19
|
-
search_key = File.join("../../", plugin_dir_name, "*.rb")
|
20
|
-
Dir.glob(File.expand_path("#{__dir__}/#{search_key}")).sort
|
21
|
-
end
|
22
|
-
|
23
18
|
def require_siblings_from_gems
|
24
19
|
fusuma_external_plugin_paths.each { |siblings_plugin| require(siblings_plugin) }
|
25
20
|
end
|
26
21
|
|
22
|
+
def exclude_path_pattern
|
23
|
+
%r{fusuma/plugin/[^/]*.rb}
|
24
|
+
end
|
25
|
+
|
26
|
+
def fusuma_default_plugin_paths
|
27
|
+
@_fusuma_default_plugin_paths ||= Dir.glob(File.expand_path("#{__dir__}/../../#{search_key}")).grep_v(exclude_path_pattern).sort
|
28
|
+
end
|
29
|
+
|
27
30
|
def fusuma_external_plugin_paths
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
31
|
+
@_fusuma_external_plugin_paths ||=
|
32
|
+
Gem.find_latest_files(search_key).map do |siblings_plugin|
|
33
|
+
next unless %r{fusuma-plugin-(.+).*/lib/#{plugin_dir_name}/.+\.rb}.match?(siblings_plugin)
|
34
|
+
|
35
|
+
match_data = siblings_plugin.match(%r{(.*)/(.*)/lib/(.*)})
|
36
|
+
gemspec_path = Dir.glob("#{match_data[1]}/#{match_data[2]}/*.gemspec").first
|
37
|
+
raise "Not Found: #{match_data[1]}/#{match_data[2]}/*.gemspec" unless gemspec_path
|
38
|
+
|
39
|
+
gemspec = Gem::Specification.load(gemspec_path)
|
40
|
+
fusuma_gemspec_path = File.expand_path("../../../fusuma.gemspec", __dir__)
|
41
|
+
fusuma_gemspec = Gem::Specification.load(fusuma_gemspec_path)
|
42
|
+
|
43
|
+
if gemspec.dependencies.find { |d| d.name == "fusuma" }&.match?(fusuma_gemspec)
|
44
|
+
siblings_plugin
|
45
|
+
else
|
46
|
+
MultiLogger.warn "#{gemspec.name} #{gemspec.version} is incompatible with running #{fusuma_gemspec.name} #{fusuma_gemspec.version}"
|
47
|
+
MultiLogger.warn "gemspec: #{gemspec_path}"
|
48
|
+
next
|
49
|
+
end
|
50
|
+
end.compact.grep_v(exclude_path_pattern).sort
|
51
|
+
end
|
52
|
+
|
53
|
+
def search_key
|
54
|
+
File.join(plugin_dir_name, "*rb")
|
45
55
|
end
|
46
56
|
|
47
57
|
private
|
48
58
|
|
59
|
+
# @example
|
60
|
+
# plugin_dir_name
|
61
|
+
# => "fusuma/plugin/detectors"
|
62
|
+
# @return [String]
|
49
63
|
def plugin_dir_name
|
50
64
|
@plugin_class.name.match(/(Fusuma::.*)::/)[1].to_s.underscore
|
51
65
|
end
|
@@ -70,6 +84,13 @@ module Fusuma
|
|
70
84
|
load_paths << plugin_path
|
71
85
|
|
72
86
|
manager = Manager.new(plugin_class)
|
87
|
+
|
88
|
+
@already_required ||= {}
|
89
|
+
|
90
|
+
key = manager.search_key
|
91
|
+
return if @already_required[key]
|
92
|
+
|
93
|
+
@already_required[key] = true
|
73
94
|
manager.require_siblings_from_plugin_dir
|
74
95
|
manager.require_siblings_from_gems
|
75
96
|
end
|
data/lib/fusuma/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fusuma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- iberianpig
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Fusuma is multitouch gesture recognizer. This gem makes your touchpad
|
14
14
|
on Linux able to recognize swipes or pinchs and assign command to them. Read installation
|