fusuma-plugin-appmatcher 0.1.0 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d226043c98f0533823ed38981d0a412ef2024f74651a2b637838b8c0d0fdd40a
4
- data.tar.gz: c5f28764fb1382f56fb862a51fce6e891448169e886360dcccb44420c1147042
3
+ metadata.gz: b1c04d2c342048c76a7c283be8234f8aea320df6b7a781549ff1beab90a988d3
4
+ data.tar.gz: a562949e3a67b209846564945c230c77079812b2491a60dd1ac134ffbdc227ac
5
5
  SHA512:
6
- metadata.gz: 901f6476d9350bbe963e0b38ea0e8d68593ecd5e0ca2f18b90dc253b710649d330641d6598e669396db8f5f9a92e582060a549a612964cf495b278d190cf13f3
7
- data.tar.gz: 4852a78ff0c699a194ad0a325271006a84fa8c66c7c9cbfd025b0b9db8b3077a1556f39cbe11dd823d6f2b618b34e4c0c449e52426665d8a1659d9ee2d306e54
6
+ metadata.gz: 77472b7bdec3c9e923e39ac1267920aa4802494bfc47e49c90fe4ebe1b9cc037d77b06c3d5893a756cc1506aed0bd50b686a182f2cfd61203af2dbb7a475095f
7
+ data.tar.gz: a25404e58fbb3ac32e604ff61e9302387684c4086d1080ff224e141781dd0ec1002922a5f2939b5556c8966a14b098f3e192ca2aca7192f49c6dc0e8d5fc6761
@@ -16,10 +16,8 @@ Gem::Specification.new do |spec|
16
16
  spec.license = 'MIT'
17
17
 
18
18
  # Specify which files should be added to the gem when it is released.
19
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
20
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
21
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
- end
19
+ spec.files = Dir['{bin,lib,exe}/**/*', 'LICENSE*', 'README*', '*.gemspec']
20
+ spec.test_files = Dir['{test,spec,features}/**/*']
23
21
  spec.bindir = 'exe'
24
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
23
  spec.require_paths = ['lib']
@@ -3,7 +3,7 @@
3
3
  module Fusuma
4
4
  module Plugin
5
5
  module Appmatcher
6
- VERSION = '0.1.0'
6
+ VERSION = '0.1.1'
7
7
  end
8
8
  end
9
9
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ require 'spec_helper'
4
+
5
+ RSpec.describe Fusuma::Plugin::Appmatcher do
6
+ it 'has a version number' do
7
+ expect(Fusuma::Plugin::Appmatcher::VERSION).not_to be nil
8
+ end
9
+ end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ require 'fusuma/plugin/detectors/detector'
6
+ require 'fusuma/plugin/buffers/buffer'
7
+
8
+ require './lib/fusuma/plugin/buffers/appmatcher_buffer'
9
+ require './lib/fusuma/plugin/detectors/appmatcher_detector'
10
+
11
+ module Fusuma
12
+ module Plugin
13
+ module Detectors
14
+ RSpec.describe AppmatcherDetector do
15
+ before do
16
+ @detector = AppmatcherDetector.new
17
+ @buffer = Buffers::AppmatcherBuffer.new
18
+ end
19
+
20
+ describe '#detector' do
21
+ context 'with no appmatcher event in buffer' do
22
+ before do
23
+ @buffer.clear
24
+ end
25
+
26
+ it { expect(@detector.detect([@buffer])).to eq nil }
27
+ end
28
+ end
29
+
30
+ context 'with appmatcher events in buffer' do
31
+ before do
32
+ record = Events::Records::AppmatcherRecord.new(name: 'dummy')
33
+ event = Events::Event.new(tag: 'appmatcher_parser', record: record)
34
+
35
+ @buffer.buffer(event)
36
+ end
37
+ it { expect(@detector.detect([@buffer])).to be_a Events::Event }
38
+ it 'should detect ContextRecord' do
39
+ expect(@detector.detect([@buffer]).record).to be_a Events::Records::ContextRecord
40
+ end
41
+ it 'should detect context: { application: dummy }' do
42
+ record = @detector.detect([@buffer]).record
43
+ expect(record.name).to eq :application
44
+ expect(record.value).to eq 'dummy'
45
+ end
46
+ end
47
+
48
+ context 'with two different appmatcher events in buffer' do
49
+ before do
50
+ record1 = Events::Records::AppmatcherRecord.new(name: 'dummy1')
51
+ record2 = Events::Records::AppmatcherRecord.new(name: 'dummy2')
52
+ event1 = Events::Event.new(tag: 'appmatcher_parser', record: record1)
53
+ event2 = Events::Event.new(tag: 'appmatcher_parser', record: record2)
54
+
55
+ @buffer.buffer(event1)
56
+ @buffer.buffer(event2)
57
+ end
58
+
59
+ it 'should detect latest application' do
60
+ record = @detector.detect([@buffer]).record
61
+ expect(record.name).to eq :application
62
+ expect(record.value).to eq 'dummy2'
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/setup'
4
+ require 'fusuma/plugin/appmatcher'
5
+
6
+ RSpec.configure do |config|
7
+ # Enable flags like --only-failures and --next-failure
8
+ config.example_status_persistence_file_path = '.rspec_status'
9
+
10
+ # Disable RSpec exposing methods globally on `Module` and `main`
11
+ config.disable_monkey_patching!
12
+
13
+ config.expect_with :rspec do |c|
14
+ c.syntax = :expect
15
+ end
16
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fusuma-plugin-appmatcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
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-12 00:00:00.000000000 Z
11
+ date: 2021-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iniparse
@@ -61,14 +61,8 @@ executables:
61
61
  extensions: []
62
62
  extra_rdoc_files: []
63
63
  files:
64
- - ".gitignore"
65
- - ".rspec"
66
- - ".travis.yml"
67
- - CODE_OF_CONDUCT.md
68
- - Gemfile
69
64
  - LICENSE.txt
70
65
  - README.md
71
- - Rakefile
72
66
  - bin/console
73
67
  - bin/setup
74
68
  - exe/fusuma-appmatcher
@@ -83,6 +77,9 @@ files:
83
77
  - lib/fusuma/plugin/events/records/appmatcher_record.rb
84
78
  - lib/fusuma/plugin/inputs/appmatcher_input.rb
85
79
  - lib/fusuma/plugin/parsers/appmatcher_parser.rb
80
+ - spec/fusuma/plugin/appmatcher_spec.rb
81
+ - spec/fusuma/plugin/inputs/appmatcher_detector_spec.rb
82
+ - spec/spec_helper.rb
86
83
  homepage: https://github.com/iberianpig/fusuma-plugin-appmatcher
87
84
  licenses:
88
85
  - MIT
@@ -106,4 +103,7 @@ rubygems_version: 3.1.4
106
103
  signing_key:
107
104
  specification_version: 4
108
105
  summary: Fusuma plugin to assign gesture mapping per application
109
- test_files: []
106
+ test_files:
107
+ - spec/fusuma/plugin/inputs/appmatcher_detector_spec.rb
108
+ - spec/fusuma/plugin/appmatcher_spec.rb
109
+ - spec/spec_helper.rb
data/.gitignore DELETED
@@ -1,13 +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
- .ruby-version
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.6.1
7
- before_install: gem install bundler -v 2.0.1
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at yhkyky@gmail.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile DELETED
@@ -1,18 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- # Specify your gem's dependencies in fusuma-plugin-appmatcher.gemspec
6
- gemspec
7
-
8
- gem 'bundler', '~> 2.0'
9
- gem 'github_changelog_generator', '~> 1.14'
10
- gem 'lefthook'
11
- gem 'pry-byebug', '~> 3.4'
12
- gem 'pry-doc'
13
- gem 'pry-inline'
14
- gem 'rake', '~> 13.0'
15
- gem 'reek'
16
- gem 'rspec', '~> 3.0'
17
- gem 'rubocop'
18
- gem 'yard'
data/Rakefile DELETED
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task default: :spec
9
-
10
- require 'github_changelog_generator/task'
11
-
12
- GitHubChangelogGenerator::RakeTask.new :changelog do |config|
13
- config.user = 'iberianpig'
14
- config.project = 'fusuma-plugin-appmatcher'
15
- end