fusuma 0.1.7 → 0.1.8

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
  SHA1:
3
- metadata.gz: 26e39da7f47ffacd4695bdb7d8a89c92e835eabc
4
- data.tar.gz: 3632d10aca588e0399de163e971e98c868a09e41
3
+ metadata.gz: 9e54f849efbfb11bcf56c129f310e9b12b34e6ee
4
+ data.tar.gz: 79fff6396e15de51fa7427b21cc92e58ab10aefd
5
5
  SHA512:
6
- metadata.gz: cdb4a21360fc385b6d4961c56bf045d912df79381f3cb1c7fb723b6bee3040f46239c6dd7cebb630a389087ca00b1466d3bd37a4239eacefc171d52635cd50ac
7
- data.tar.gz: b4c7bf2e5a4aa3304c1491b5b73b82a2b457eca51c058758aefeda03ad358f5e0bd95cf503423a6a34e323cd3406cd0e71e0f208686ddb4808abeae9b094c685
6
+ metadata.gz: 060dc7031139ae57d334b0d1824f96620361244b53ce62753c511225537bb6d68730b2cd235b297bea037ef59cc32571254f62444d9d60ea847002ce5208be06
7
+ data.tar.gz: 3ae2d1a41001e113f57f398000892c67518910485a90520514ed5bbc0f7fd379f59aefc07f9aa0a7e29001145c81a20fb89d0ab9d8f6e6c453920a8a31796422
data/README.md CHANGED
@@ -63,6 +63,8 @@ pinch:
63
63
  shortcut: 'ctrl+minus'
64
64
  ```
65
65
 
66
+ if `shortcut: ` is blank, the swipe/pinch doesn't trigger a keyevent.
67
+
66
68
  ## Options
67
69
 
68
70
  * `-v` : Enable debug mode.
data/exe/fusuma CHANGED
@@ -1,6 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
+ require 'optparse'
3
4
  require_relative '../lib/fusuma'
4
5
 
5
- options = ARGV.getopts('hv')
6
- Fusuma::Runner.run(v: options['v'], h: options['h'])
6
+ option = {}
7
+ OptionParser.new do |opt|
8
+ opt.on('-v',
9
+ '--verbose',
10
+ 'shows details about the results of running fusuma') do |v|
11
+ option[:verbose] = v
12
+ end
13
+ opt.parse!(ARGV)
14
+ end
15
+
16
+ Fusuma::Runner.run(option)
data/lib/fusuma.rb CHANGED
@@ -5,7 +5,6 @@ require_relative 'fusuma/multi_logger'
5
5
  require 'logger'
6
6
  require 'open3'
7
7
  require 'yaml'
8
- require 'optparse'
9
8
 
10
9
  # for debug
11
10
  # require 'pry-byebug'
@@ -15,29 +14,15 @@ module Fusuma
15
14
  # main class
16
15
  class Runner
17
16
  class << self
18
- def run(args = {})
19
- read_options(args)
20
- return if @stop
17
+ def run(option = {})
18
+ read_options(option)
21
19
  instance = new
22
20
  instance.read_libinput
23
21
  end
24
22
 
25
- def read_options(args)
26
- debug = args.fetch(:v, false)
27
- help = args.fetch(:h, false)
23
+ def read_options(option)
24
+ debug = option.fetch(:verbose, false)
28
25
  MultiLogger.instance.debug_mode = true if debug
29
- @stop = if help
30
- print_help
31
- true
32
- else
33
- false
34
- end
35
- end
36
-
37
- def print_help
38
- puts 'Options:
39
- -h, print this help.
40
- -v, print to STDOUT with debug mode.'
41
26
  end
42
27
  end
43
28
 
@@ -97,12 +82,12 @@ module Fusuma
97
82
 
98
83
  def swipe(finger, direction)
99
84
  shortcut = event_map['swipe'][finger.to_i][direction]['shortcut']
100
- `xdotool key #{shortcut}`
85
+ `xdotool key #{shortcut}` unless shortcut.nil?
101
86
  end
102
87
 
103
88
  def pinch(zoom)
104
89
  shortcut = event_map['pinch'][zoom]['shortcut']
105
- `xdotool key #{shortcut}`
90
+ `xdotool key #{shortcut}` unless shortcut.nil?
106
91
  end
107
92
 
108
93
  def event_map
@@ -1,3 +1,3 @@
1
1
  module Fusuma
2
- VERSION = '0.1.7'.freeze
2
+ VERSION = '0.1.8'.freeze
3
3
  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: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - iberianpig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-10 00:00:00.000000000 Z
11
+ date: 2016-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler