fusuma 0.7.0 → 0.7.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
  SHA1:
3
- metadata.gz: ac0fbe0303830adea0e5cd8c832ecf0cdeb2a940
4
- data.tar.gz: 93e0a151d905833b5794e21fd5a29c6ffae354c2
3
+ metadata.gz: e5e7633611c459a64db5cba4070e79049a6cf054
4
+ data.tar.gz: f5c6cdfaf53b3ccd80940dcbfef20111e7511c18
5
5
  SHA512:
6
- metadata.gz: e1e335a827ba3dbfaaff2eb01d534f036547da876d919638e2f610eb84e2b409fa59c31f8a37a0801506ee05b5c61e47c6f5581d399b2da8cf3df257ec699ff3
7
- data.tar.gz: 410c8ce3fc7f2575f9f3f6042a8d54d3189f93136de037e12ca1607af943dad5a7272600ff6982f8d4d305d097f125899a8d9bebd96403ee051d141feae55c33
6
+ metadata.gz: 207655e6474d8abcea5c75d8e2a7993d4410af1620c15bdfc90530930adafe04134f96cce9870603e3c798535addae9d7c8b132b0748a50aaf0509c9788b8997
7
+ data.tar.gz: 691af29a6416febc5fca48835f5ea2606c306eb1f6f50ac5188d7abd9a9669805c9ee2de12f30ab437a582dbb9bce6461442a7b1a393b5000fe6d041b818028c
data/exe/fusuma CHANGED
@@ -7,8 +7,8 @@ option = {}
7
7
  OptionParser.new do |opt|
8
8
  opt.on('-c',
9
9
  '--config=path/to/file',
10
- 'Use an alternative config file') do |config|
11
- option[:config] = config
10
+ 'Use an alternative config file') do |config_path|
11
+ option[:config_path] = config_path
12
12
  end
13
13
 
14
14
  opt.on('-d',
@@ -24,12 +24,8 @@ OptionParser.new do |opt|
24
24
  end
25
25
 
26
26
  opt.on('--version',
27
- 'Show fusuma version') do |_version|
28
- puts "Fusuma: #{Fusuma::VERSION}"
29
- puts "OS: #{`uname -rsv`}"
30
- puts "Distribution: #{`cat /etc/issue`}"
31
- puts "Desktop session: #{`echo $DESKTOP_SESSION`}"
32
- exit 0
27
+ 'Show fusuma version') do |version|
28
+ option[:version] = version
33
29
  end
34
30
 
35
31
  opt.parse!(ARGV)
@@ -17,23 +17,39 @@ module Fusuma
17
17
  class Runner
18
18
  class << self
19
19
  def run(option = {})
20
- Signal.trap('INT') { exit } # Trap ^C
21
- Signal.trap('TERM') { exit } # Trap `Kill `
22
-
20
+ set_trap
23
21
  read_options(option)
24
22
  instance = new
25
23
  instance.read_libinput
26
24
  end
27
25
 
26
+ private
27
+
28
+ def set_trap
29
+ Signal.trap('INT') { puts exit } # Trap ^C
30
+ Signal.trap('TERM') { puts exit } # Trap `Kill `
31
+ end
32
+
33
+ def print_version
34
+ puts "---------------------------------------------"
35
+ puts "Fusuma: #{Fusuma::VERSION}"
36
+ puts "OS: #{`uname -rsv`}"
37
+ puts "Distribution: #{`cat /etc/issue`}"
38
+ puts "Desktop session: #{`echo $DESKTOP_SESSION`}"
39
+ puts "---------------------------------------------"
40
+ end
41
+
42
+ def reload_custom_config(config_path)
43
+ MultiLogger.info "use custom path: #{config_path}"
44
+ Config.instance.custom_path = config_path
45
+ Config.reload
46
+ end
47
+
28
48
  def read_options(option)
29
- option.fetch(:version, nil)
30
- config_path = option.fetch(:config, nil)
31
- if config_path
32
- Config.instance.custom_path = config_path
33
- Config.reload
34
- end
35
- MultiLogger.instance.debug_mode = true if option.fetch(:verbose, nil)
36
- Process.daemon if option.fetch(:daemon, nil)
49
+ print_version if option[:version] || option[:verbose]
50
+ reload_custom_config(option[:config_path]) if option[:config_path]
51
+ MultiLogger.instance.debug_mode = true if option[:verbose]
52
+ Process.daemon if option[:daemon]
37
53
  end
38
54
  end
39
55
 
@@ -1,3 +1,3 @@
1
1
  module Fusuma
2
- VERSION = '0.7.0'.freeze
2
+ VERSION = '0.7.1'.freeze
3
3
  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: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - iberianpig