fusuma 2.0.3 → 2.0.4

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: 5d8b83e60047931022dab6daf54c40da12ec392b638d44c21491528ec7e13bed
4
- data.tar.gz: 6e491edb08ad8b2c7f277986cf7d9226663867c1013fec52b04740649e35770d
3
+ metadata.gz: 8f19305771a0704b1f7294b9b54653f09d7d4f6153ffbdd19a6c23a753870b09
4
+ data.tar.gz: 3b6c9addcda816e7379e69bb258bd11f091ea39fbae37fc8e0ef4c9ca4b7dff7
5
5
  SHA512:
6
- metadata.gz: 015112ebf7229f9d48c00735007a598d727bda17e16f4da3b4a6b1d3c8f05ce106d709aabe300414c1232cebc1f52e834fb6cca1961507a60ce6f7528058513a
7
- data.tar.gz: c489bd3dbf6c6dd1227e3864abe9c075f6288cf448b8a2b7e85ef092c0586e75b24c76dda16e370ee92bc749fbe378e73bfa376d732dca474cfa43e580af6bfe
6
+ metadata.gz: 422dc7e58b8db650754c4939ec1946456bfdfb0a8e4af33d79a20d88d84190f393952e05e1d086f711fb1ee2e6c415c4ddf6861dba8d94bf84df4f4e0585374f
7
+ data.tar.gz: 02e75550adfd4a6f3e3d43b4a6326377d5182131bdd9d9f3ff3ca0abcb89888e0bca9eea8551868cc87edb0a706fb9b51ee97cc517e093566c7448729359ded2
@@ -42,7 +42,12 @@ module Fusuma
42
42
 
43
43
  # @return [Integer] return a latest line libinput debug-events
44
44
  def debug_events(writer)
45
- @debug_events ||= Process.spawn(debug_events_with_options, out: writer, in: '/dev/null')
45
+ @debug_events ||= begin
46
+ pid = Process.spawn(debug_events_with_options, out: writer,
47
+ in: '/dev/null')
48
+ Process.detach(pid)
49
+ pid
50
+ end
46
51
  end
47
52
 
48
53
  # @return [String] command
@@ -14,19 +14,19 @@ module Fusuma
14
14
  end
15
15
 
16
16
  def execute(event)
17
- search_command(event).tap do |command|
18
- break unless command
17
+ command = search_command(event)
19
18
 
20
- MultiLogger.info(command: command, args: event.record.args)
19
+ MultiLogger.info(command: command, args: event.record.args)
21
20
 
22
- accel = args_accel(event)
23
- additional_env = event.record.args
24
- .deep_transform_keys(&:to_s)
25
- .deep_transform_values { |v| (v * accel).to_s }
21
+ accel = args_accel(event)
22
+ additional_env = event.record.args
23
+ .deep_transform_keys(&:to_s)
24
+ .deep_transform_values { |v| (v * accel).to_s }
26
25
 
27
- pid = Process.spawn(additional_env, command.to_s)
28
- Process.detach(pid)
29
- end
26
+ pid = Process.spawn(additional_env, command.to_s)
27
+ Process.detach(pid)
28
+ rescue SystemCallError => e
29
+ MultiLogger.error("#{event.record.index.keys}": e.message.to_s)
30
30
  end
31
31
 
32
32
  def executable?(event)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fusuma
4
- VERSION = '2.0.3'
4
+ VERSION = '2.0.4'
5
5
  end
@@ -5,7 +5,9 @@ require './lib/fusuma/libinput_command'
5
5
 
6
6
  module Fusuma
7
7
  RSpec.describe LibinputCommand do
8
- let(:libinput_command) { described_class.new(libinput_options: libinput_options, commands: commands) }
8
+ let(:libinput_command) do
9
+ described_class.new(libinput_options: libinput_options, commands: commands)
10
+ end
9
11
  let(:libinput_options) { [] }
10
12
  let(:commands) { {} }
11
13
  describe '#version' do
@@ -79,7 +81,8 @@ module Fusuma
79
81
  before do
80
82
  dummy_io = StringIO.new('dummy')
81
83
  io = StringIO.new('dummy output')
82
- allow(Open3).to receive(:popen3).with(anything).and_return([dummy_io, io, dummy_io, dummy_io, nil])
84
+ allow(Open3).to receive(:popen3).with(anything).and_return([dummy_io, io, dummy_io,
85
+ dummy_io, nil])
83
86
  end
84
87
 
85
88
  context 'with the alternative command' do
@@ -119,7 +122,7 @@ module Fusuma
119
122
  describe 'debug_events' do
120
123
  before do
121
124
  @dummy_io = StringIO.new('dummy')
122
- allow(Process).to receive(:spawn).with(anything).and_return(0)
125
+ allow(Process).to receive(:detach).with(anything).and_return(nil)
123
126
  end
124
127
  subject { libinput_command.debug_events(@dummy_io) }
125
128
 
@@ -129,7 +132,8 @@ module Fusuma
129
132
  end
130
133
 
131
134
  it 'should call dummy events' do
132
- expect(Process).to receive(:spawn).with('dummy_debug_events', { out: @dummy_io, in: '/dev/null' }).once
135
+ expect(Process).to receive(:spawn).with('dummy_debug_events',
136
+ { out: @dummy_io, in: '/dev/null' }).once
133
137
  subject
134
138
  end
135
139
  end
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.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - iberianpig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-20 00:00:00.000000000 Z
11
+ date: 2021-04-24 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