fusuma 2.0.0 → 2.0.1

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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fusuma/plugin/manager.rb +3 -3
  3. data/lib/fusuma/version.rb +1 -1
  4. data/spec/helpers/config_helper.rb +20 -0
  5. data/spec/lib/config/searcher_spec.rb +97 -0
  6. data/spec/lib/config_spec.rb +112 -0
  7. data/spec/lib/custom_process_spec.rb +28 -0
  8. data/spec/lib/device_spec.rb +98 -0
  9. data/spec/lib/dummy_config.yml +31 -0
  10. data/spec/lib/fusuma_spec.rb +103 -0
  11. data/spec/lib/libinput-list-devices_iberianpig-XPS-9360.txt +181 -0
  12. data/spec/lib/libinput-list-devices_magic_trackpad.txt +51 -0
  13. data/spec/lib/libinput-list-devices_razer_razer_blade.txt +252 -0
  14. data/spec/lib/libinput-list-devices_thejinx0r.txt +361 -0
  15. data/spec/lib/libinput-list-devices_unavailable.txt +36 -0
  16. data/spec/lib/libinput_command_spec.rb +167 -0
  17. data/spec/lib/plugin/base_spec.rb +74 -0
  18. data/spec/lib/plugin/buffers/buffer_spec.rb +80 -0
  19. data/spec/lib/plugin/buffers/dummy_buffer.rb +20 -0
  20. data/spec/lib/plugin/buffers/gesture_buffer_spec.rb +172 -0
  21. data/spec/lib/plugin/detectors/detector_spec.rb +43 -0
  22. data/spec/lib/plugin/detectors/dummy_detector.rb +24 -0
  23. data/spec/lib/plugin/detectors/pinch_detector_spec.rb +119 -0
  24. data/spec/lib/plugin/detectors/rotate_detector_spec.rb +125 -0
  25. data/spec/lib/plugin/detectors/swipe_detector_spec.rb +118 -0
  26. data/spec/lib/plugin/events/event_spec.rb +30 -0
  27. data/spec/lib/plugin/events/records/gesture_record_spec.rb +22 -0
  28. data/spec/lib/plugin/events/records/record_spec.rb +31 -0
  29. data/spec/lib/plugin/events/records/text_record_spec.rb +26 -0
  30. data/spec/lib/plugin/executors/command_executor_spec.rb +57 -0
  31. data/spec/lib/plugin/executors/executor_spec.rb +160 -0
  32. data/spec/lib/plugin/filters/filter_spec.rb +92 -0
  33. data/spec/lib/plugin/filters/libinput_filter_spec.rb +120 -0
  34. data/spec/lib/plugin/inputs/input_spec.rb +70 -0
  35. data/spec/lib/plugin/inputs/libinput_command_input_spec.rb +120 -0
  36. data/spec/lib/plugin/inputs/timer_input_spec.rb +40 -0
  37. data/spec/lib/plugin/manager_spec.rb +27 -0
  38. data/spec/lib/plugin/parsers/parser_spec.rb +45 -0
  39. data/spec/spec_helper.rb +20 -0
  40. metadata +74 -20
  41. data/.github/FUNDING.yml +0 -8
  42. data/.github/ISSUE_TEMPLATE/bug_report.md +0 -32
  43. data/.github/ISSUE_TEMPLATE/feature_request.md +0 -17
  44. data/.github/pull_request_template.md +0 -9
  45. data/.github/stale.yml +0 -18
  46. data/.gitignore +0 -17
  47. data/.reek.yml +0 -96
  48. data/.rspec +0 -2
  49. data/.rubocop.yml +0 -43
  50. data/.rubocop_todo.yml +0 -55
  51. data/.solargraph.yml +0 -16
  52. data/.travis.yml +0 -9
  53. data/CHANGELOG.md +0 -456
  54. data/CODE_OF_CONDUCT.md +0 -74
  55. data/CONTRIBUTING.md +0 -72
  56. data/Gemfile +0 -23
  57. data/Rakefile +0 -15
  58. data/fusuma.gemspec +0 -29
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+ require './lib/fusuma/plugin/parsers/parser'
5
+ require './lib/fusuma/plugin/events/event'
6
+
7
+ module Fusuma
8
+ module Plugin
9
+ module Parsers
10
+ class DummyParser < Parser
11
+ DEFAULT_SOURCE = 'dummy_input'
12
+ end
13
+
14
+ RSpec.describe Parser do
15
+ let(:parser) { DummyParser.new }
16
+
17
+ around do |example|
18
+ ConfigHelper.load_config_yml = <<~CONFIG
19
+ plugin:
20
+ parsers:
21
+ dummy_parser:
22
+ dummy: dummy
23
+ CONFIG
24
+
25
+ example.run
26
+
27
+ Config.custom_path = nil
28
+ end
29
+
30
+ describe '#source' do
31
+ subject { parser.source }
32
+
33
+ it { is_expected.to be DummyParser::DEFAULT_SOURCE }
34
+ end
35
+
36
+ describe '#parse' do
37
+ subject { parser.parse(event) }
38
+ let(:event) { Events::Event.new(tag: 'dummy_input', record: 'dummy') }
39
+
40
+ it { is_expected.to be event }
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/setup'
4
+ require 'helpers/config_helper'
5
+ require 'coveralls'
6
+ Coveralls.wear!
7
+
8
+ RSpec.configure do |config|
9
+ # Enable flags like --only-failures and --next-failure
10
+ config.example_status_persistence_file_path = '.rspec_status'
11
+
12
+ # Disable RSpec exposing methods globally on `Module` and `main`
13
+ config.disable_monkey_patching!
14
+
15
+ config.expect_with :rspec do |c|
16
+ c.syntax = :expect
17
+ end
18
+
19
+ config.include(Fusuma::ConfigHelper)
20
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fusuma
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - iberianpig
@@ -34,29 +34,11 @@ executables:
34
34
  extensions: []
35
35
  extra_rdoc_files: []
36
36
  files:
37
- - ".github/FUNDING.yml"
38
- - ".github/ISSUE_TEMPLATE/bug_report.md"
39
- - ".github/ISSUE_TEMPLATE/feature_request.md"
40
- - ".github/pull_request_template.md"
41
- - ".github/stale.yml"
42
- - ".gitignore"
43
- - ".reek.yml"
44
- - ".rspec"
45
- - ".rubocop.yml"
46
- - ".rubocop_todo.yml"
47
- - ".solargraph.yml"
48
- - ".travis.yml"
49
- - CHANGELOG.md
50
- - CODE_OF_CONDUCT.md
51
- - CONTRIBUTING.md
52
- - Gemfile
53
37
  - LICENSE
54
38
  - README.md
55
- - Rakefile
56
39
  - bin/console
57
40
  - bin/setup
58
41
  - exe/fusuma
59
- - fusuma.gemspec
60
42
  - lib/fusuma.rb
61
43
  - lib/fusuma/config.rb
62
44
  - lib/fusuma/config.yml
@@ -96,6 +78,42 @@ files:
96
78
  - lib/fusuma/plugin/parsers/parser.rb
97
79
  - lib/fusuma/string_support.rb
98
80
  - lib/fusuma/version.rb
81
+ - spec/helpers/config_helper.rb
82
+ - spec/lib/config/searcher_spec.rb
83
+ - spec/lib/config_spec.rb
84
+ - spec/lib/custom_process_spec.rb
85
+ - spec/lib/device_spec.rb
86
+ - spec/lib/dummy_config.yml
87
+ - spec/lib/fusuma_spec.rb
88
+ - spec/lib/libinput-list-devices_iberianpig-XPS-9360.txt
89
+ - spec/lib/libinput-list-devices_magic_trackpad.txt
90
+ - spec/lib/libinput-list-devices_razer_razer_blade.txt
91
+ - spec/lib/libinput-list-devices_thejinx0r.txt
92
+ - spec/lib/libinput-list-devices_unavailable.txt
93
+ - spec/lib/libinput_command_spec.rb
94
+ - spec/lib/plugin/base_spec.rb
95
+ - spec/lib/plugin/buffers/buffer_spec.rb
96
+ - spec/lib/plugin/buffers/dummy_buffer.rb
97
+ - spec/lib/plugin/buffers/gesture_buffer_spec.rb
98
+ - spec/lib/plugin/detectors/detector_spec.rb
99
+ - spec/lib/plugin/detectors/dummy_detector.rb
100
+ - spec/lib/plugin/detectors/pinch_detector_spec.rb
101
+ - spec/lib/plugin/detectors/rotate_detector_spec.rb
102
+ - spec/lib/plugin/detectors/swipe_detector_spec.rb
103
+ - spec/lib/plugin/events/event_spec.rb
104
+ - spec/lib/plugin/events/records/gesture_record_spec.rb
105
+ - spec/lib/plugin/events/records/record_spec.rb
106
+ - spec/lib/plugin/events/records/text_record_spec.rb
107
+ - spec/lib/plugin/executors/command_executor_spec.rb
108
+ - spec/lib/plugin/executors/executor_spec.rb
109
+ - spec/lib/plugin/filters/filter_spec.rb
110
+ - spec/lib/plugin/filters/libinput_filter_spec.rb
111
+ - spec/lib/plugin/inputs/input_spec.rb
112
+ - spec/lib/plugin/inputs/libinput_command_input_spec.rb
113
+ - spec/lib/plugin/inputs/timer_input_spec.rb
114
+ - spec/lib/plugin/manager_spec.rb
115
+ - spec/lib/plugin/parsers/parser_spec.rb
116
+ - spec/spec_helper.rb
99
117
  homepage: https://github.com/iberianpig/fusuma
100
118
  licenses:
101
119
  - MIT
@@ -120,4 +138,40 @@ rubygems_version: 3.1.4
120
138
  signing_key:
121
139
  specification_version: 4
122
140
  summary: Multitouch gestures with libinput driver, Linux
123
- test_files: []
141
+ test_files:
142
+ - spec/lib/device_spec.rb
143
+ - spec/lib/config/searcher_spec.rb
144
+ - spec/lib/libinput-list-devices_iberianpig-XPS-9360.txt
145
+ - spec/lib/dummy_config.yml
146
+ - spec/lib/libinput-list-devices_magic_trackpad.txt
147
+ - spec/lib/custom_process_spec.rb
148
+ - spec/lib/plugin/base_spec.rb
149
+ - spec/lib/plugin/inputs/libinput_command_input_spec.rb
150
+ - spec/lib/plugin/inputs/input_spec.rb
151
+ - spec/lib/plugin/inputs/timer_input_spec.rb
152
+ - spec/lib/plugin/events/records/record_spec.rb
153
+ - spec/lib/plugin/events/records/gesture_record_spec.rb
154
+ - spec/lib/plugin/events/records/text_record_spec.rb
155
+ - spec/lib/plugin/events/event_spec.rb
156
+ - spec/lib/plugin/filters/libinput_filter_spec.rb
157
+ - spec/lib/plugin/filters/filter_spec.rb
158
+ - spec/lib/plugin/detectors/detector_spec.rb
159
+ - spec/lib/plugin/detectors/swipe_detector_spec.rb
160
+ - spec/lib/plugin/detectors/rotate_detector_spec.rb
161
+ - spec/lib/plugin/detectors/pinch_detector_spec.rb
162
+ - spec/lib/plugin/detectors/dummy_detector.rb
163
+ - spec/lib/plugin/manager_spec.rb
164
+ - spec/lib/plugin/buffers/dummy_buffer.rb
165
+ - spec/lib/plugin/buffers/buffer_spec.rb
166
+ - spec/lib/plugin/buffers/gesture_buffer_spec.rb
167
+ - spec/lib/plugin/parsers/parser_spec.rb
168
+ - spec/lib/plugin/executors/executor_spec.rb
169
+ - spec/lib/plugin/executors/command_executor_spec.rb
170
+ - spec/lib/libinput-list-devices_unavailable.txt
171
+ - spec/lib/libinput_command_spec.rb
172
+ - spec/lib/fusuma_spec.rb
173
+ - spec/lib/libinput-list-devices_razer_razer_blade.txt
174
+ - spec/lib/libinput-list-devices_thejinx0r.txt
175
+ - spec/lib/config_spec.rb
176
+ - spec/helpers/config_helper.rb
177
+ - spec/spec_helper.rb
data/.github/FUNDING.yml DELETED
@@ -1,8 +0,0 @@
1
- # These are supported funding model platforms
2
-
3
- github: [iberianpig] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
- patreon: iberianpig # Replace with a single Patreon username
5
- open_collective: # Replace with a single Open Collective username
6
- ko_fi: # Replace with a single Ko-fi username
7
- tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
- custom: # Replace with a single custom sponsorship URL
@@ -1,32 +0,0 @@
1
- ---
2
- name: Bug report
3
- about: Create a report to help us improve
4
-
5
- ---
6
-
7
- <!--
8
- Before create a report, please check below,
9
- * Read Documents. https://github.com/iberianpig/fusuma#installation
10
- * Checked that `libinput-debug-events` or `libinput debug-events` worked correctly.
11
- * Reproduced the problem in latest version. Update fusuma with `gem update fusuma`
12
- * Checked that your issue isn't already filed: https://github.com/iberianpig/fusuma/issues
13
- -->
14
-
15
- **Describe the bug**
16
- A clear and concise description of what the bug is.
17
-
18
- **To Reproduce**
19
- Steps to reproduce the behavior:
20
- 1. [First Step]
21
- 2. [Second Step]
22
- 3. [and so on...]
23
-
24
- **Expected behavior**
25
- A clear and concise description of what you expected to happen.
26
-
27
- **Versions**
28
- You can get this information from copy and paste the output of `fusuma --version` from the command line. Also, please include the OS and what version of the OS you're running.
29
-
30
-
31
- **Additional context**
32
- Any additional context, your `~/.config/fusuma/config.yml` or data that might be necessary to reproduce the issue.
@@ -1,17 +0,0 @@
1
- ---
2
- name: Feature request
3
- about: Suggest an idea for this project
4
-
5
- ---
6
-
7
- **Is your feature request related to a problem? Please describe.**
8
- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9
-
10
- **Describe the solution you'd like**
11
- A clear and concise description of what you want to happen.
12
-
13
- **Describe alternatives you've considered**
14
- A clear and concise description of any alternative solutions or features you've considered.
15
-
16
- **Additional context**
17
- Add any other context about the feature request here.
@@ -1,9 +0,0 @@
1
- Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
2
-
3
- - [ ] Make sure to open an issue as a [bug/issue](https://github.com/iberianpig/fusuma/issues) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea.
4
-
5
- - [ ] Follow the instructions in [CONTRIBUTING](https://github.com/iberianpig/fusuma/blob/master/CONTRIBUTING.md). Most importantly, ensure the tests and linter pass by running `bundle exec rspec` and `bundle exec rubocop`.
6
-
7
- - [ ] Update code documentation if necessary.
8
-
9
- closes: #<issue_number_goes_here>
data/.github/stale.yml DELETED
@@ -1,18 +0,0 @@
1
- # Number of days of inactivity before an issue becomes stale
2
- daysUntilStale: 60
3
- # Number of days of inactivity before a stale issue is closed
4
- daysUntilClose: 7
5
- # Issues with these labels will never be considered stale
6
- exemptLabels:
7
- - pinned
8
- - security
9
- # Label to use when marking an issue as stale
10
- staleLabel: wontfix
11
- # Comment to post when marking an issue as stale. Set to `false` to disable
12
- markComment: >
13
- This issue has been automatically marked as stale because it has not had
14
- recent activity. It will be closed if no further activity occurs. Thank you
15
- for your contributions.
16
- # Comment to post when closing a stale issue. Set to `false` to disable
17
- closeComment: false
18
-
data/.gitignore DELETED
@@ -1,17 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
-
11
- # rspec failure tracking
12
- .rspec_status
13
-
14
- .ruby-version
15
-
16
- # todo
17
- todo.md
data/.reek.yml DELETED
@@ -1,96 +0,0 @@
1
-
2
- ---
3
- ### enabled rules
4
- detectors:
5
- TooManyInstanceVariables:
6
- enabled: true
7
- exclude: []
8
- max_instance_variables: 50
9
- TooManyMethods:
10
- enabled: true
11
- exclude: []
12
- max_methods: 30
13
- TooManyStatements:
14
- enabled: true
15
- exclude: []
16
- max_statements: 80
17
- TooManyConstants:
18
- enabled: true
19
- exclude: []
20
- max_constants: 50
21
- LongParameterList:
22
- enabled: true
23
- exclude: []
24
- max_params: 8
25
- LongYieldList:
26
- enabled: true
27
- exclude: []
28
- max_params: 8
29
- NestedIterators:
30
- enabled: true
31
- exclude: []
32
- max_allowed_nesting: 5
33
- ignore_iterators:
34
- - tap
35
- ModuleInitialize:
36
- enabled: true
37
- exclude: []
38
- SubclassedFromCoreClass:
39
- enabled: true
40
- exclude: []
41
-
42
- ### unanabled rules
43
- Attribute:
44
- enabled: false
45
- exclude: []
46
- BooleanParameter:
47
- enabled: false
48
- exclude: []
49
- ClassVariable:
50
- enabled: false
51
- exclude: []
52
- ControlParameter:
53
- enabled: false
54
- exclude: []
55
- DataClump:
56
- enabled: false
57
- exclude: []
58
- DuplicateMethodCall:
59
- enabled: false
60
- exclude: []
61
- FeatureEnvy:
62
- enabled: false
63
- exclude: []
64
- InstanceVariableAssumption:
65
- enabled: false
66
- exclude: []
67
- IrresponsibleModule:
68
- enabled: false
69
- exclude: []
70
- ManualDispatch:
71
- enabled: false
72
- exclude: []
73
- NilCheck:
74
- enabled: false
75
- exclude: []
76
- RepeatedConditional:
77
- enabled: false
78
- exclude: []
79
- UncommunicativeMethodName:
80
- enabled: false
81
- exclude: []
82
- UncommunicativeModuleName:
83
- enabled: false
84
- exclude: []
85
- UncommunicativeParameterName:
86
- enabled: false
87
- exclude: []
88
- UncommunicativeVariableName:
89
- enabled: false
90
- exclude: []
91
- UnusedParameters:
92
- enabled: false
93
- exclude: []
94
- UtilityFunction:
95
- enabled: false
96
- exclude: []
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color
data/.rubocop.yml DELETED
@@ -1,43 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- AllCops:
4
- TargetRubyVersion: '2.5'
5
- NewCops: enable
6
-
7
- Metrics/ModuleLength:
8
- Exclude:
9
- - "**/*_spec.rb"
10
-
11
- Metrics/BlockLength:
12
- Exclude:
13
- - "**/*_spec.rb"
14
- - "fusuma.gemspec"
15
-
16
- Layout/LineLength:
17
- Max: 100
18
- Exclude:
19
- - "fusuma.gemspec"
20
- - "**/*_spec.rb"
21
-
22
- # For rubocop < 1.0.0
23
- Style/HashEachMethods:
24
- Enabled: true
25
-
26
- # For rubocop < 1.0.0
27
- Style/HashTransformKeys:
28
- Enabled: true
29
-
30
- # For rubocop < 1.0.0
31
- Style/HashTransformValues:
32
- Enabled: true
33
-
34
- Lint/RaiseException:
35
- Enabled: true
36
- Lint/StructNewOverride:
37
- Enabled: true
38
-
39
- # for declaring dummy classes in ./spec
40
- Lint/ConstantDefinitionInBlock:
41
- Exclude:
42
- - "**/*_spec.rb"
43
-