uh-wm 0.0.14 → 0.0.15

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
  SHA1:
3
- metadata.gz: d30b881b7363a539a259011ee767eb42b941fe65
4
- data.tar.gz: 4ae10cdb8a3d9a1da9b9ec4c55bf1c88890a6897
3
+ metadata.gz: 93340993456f1f3a39b10ddc49214ee5ad04d5f1
4
+ data.tar.gz: b3bebda8c21cbcfb0a4cdd62983bee0856174db9
5
5
  SHA512:
6
- metadata.gz: 0bdbddabd4ed09e97349bd80ed38b011aa33a816a8feab4b3e5cf9f417500921e1ffe943df8697217cef4d3d4d00450ae91d370abda2ed60060048bf749bc0fd
7
- data.tar.gz: af6bc893f76cc828b33dc78bd02ed6f182ee580dc375653cc206810892380b370c75c65d81017800d2b768cec82c2e9126c2328283b82dc67c7cdc9601c89c90
6
+ metadata.gz: c9c1584f9095e127b583d46937765c1d5375f1ae06667b81d67cc26bd703dda943f079513c6f28d9f484e2ed55e8ab137a221dbf5ed93110d8dc4704af1df30c
7
+ data.tar.gz: 345099514c28a6fcf154e75e4a2ad3392e9f86d3a53e64f54e854db28731da3e7e0675a377fea876596eaf804918bd29aeb94346937fdf32c501ab3b07e66d3f
data/README.md CHANGED
@@ -405,7 +405,7 @@ _I get a \`cannot load such file -- uh/wm (LoadError)\` how do I fix?_
405
405
 
406
406
  You are probably not using the gem. If you want to use uhwm from a
407
407
  local git clone or if you did a custom install, try to use bundler or
408
- to modify the ruby load path (set `RUBYOPT=lib` for example).
408
+ to modify the ruby load path (set `RUBYOPT=-Ilib` for example).
409
409
 
410
410
 
411
411
 
@@ -29,6 +29,7 @@ module Uh
29
29
  RuntimeError = Class.new(RuntimeError)
30
30
  ArgumentError = Class.new(Error)
31
31
  RunControlEvaluationError = Class.new(RuntimeError)
32
+ RunControlArgumentError = Class.new(ArgumentError)
32
33
 
33
34
  class OtherWMRunningError < RuntimeError
34
35
  def message
@@ -94,7 +94,14 @@ module Uh
94
94
  # @example
95
95
  # modifier :mod1 # Use `mod1' as modifier
96
96
  # @param keysym [Symbol] X key sym
97
+ # @raise [RunControlArgumentError] if any given modifier is invalid
97
98
  def modifier keysym, ignore: []
99
+ [keysym, *ignore].each do |mod|
100
+ unless KEY_MODIFIERS.keys.include? mod
101
+ fail RunControlArgumentError,
102
+ "invalid modifier keysym `#{mod.inspect}'"
103
+ end
104
+ end
98
105
  @env.modifier = keysym
99
106
  @env.modifier_ignore = [*ignore]
100
107
  end
@@ -121,7 +128,11 @@ module Uh
121
128
  # worker :mux, timeout: 1
122
129
  # @param type [Symbol] Worker type: `:block`, `:kqueue` or `:mux`
123
130
  # @param options [Hash] Worker options
131
+ # @raise [RunControlArgumentError] if worker type is invalid
124
132
  def worker type, **options
133
+ unless Workers.type? type
134
+ fail RunControlArgumentError, "invalid worker type `#{type}'"
135
+ end
125
136
  @env.worker = [type, options]
126
137
  end
127
138
 
@@ -1,5 +1,5 @@
1
1
  module Uh
2
2
  module WM
3
- VERSION = '0.0.14'
3
+ VERSION = '0.0.15'
4
4
  end
5
5
  end
@@ -12,6 +12,10 @@ module Uh
12
12
  FACTORIES.keys
13
13
  end
14
14
 
15
+ def type? type
16
+ FACTORIES.key? type
17
+ end
18
+
15
19
  def build type, **options
16
20
  (FACTORIES[type] or fail ArgumentError, "unknown worker: `#{type}'")
17
21
  .call options
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uh-wm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibault Jouan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-02 00:00:00.000000000 Z
11
+ date: 2015-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rb-kqueue
@@ -167,4 +167,3 @@ signing_key:
167
167
  specification_version: 4
168
168
  summary: minimalistic tiling and stacking X window manager
169
169
  test_files: []
170
- has_rdoc: