uh-layout 0.2.1 → 0.2.2

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: 1d3336013e15f3956f77812f3ec6cc29237fbc4d
4
- data.tar.gz: 6f4ada4af6ef14fb00bdaa9ea019edbe4c5c2266
3
+ metadata.gz: 8bb65a2c71c6948855c070300fbb8443d885b386
4
+ data.tar.gz: adfd597c14c3a6cb6e96b08f5e5e06605b38dac9
5
5
  SHA512:
6
- metadata.gz: 1a3eb01f8b875302f54756e2cb4feb1f4931de03d712c328aa810a1a18f6efaed2f82418a9511bcc97a034f509526279de5d665c4ace9dadc3a9a2a7fb207abf
7
- data.tar.gz: 8c23c11fa6005d389f42274bcffe857b440685bc324908f8bccd21911c5b5977377520b736bbcf8909013a42c44323d799730f708f110909d69ce53e8972e1a4
6
+ metadata.gz: 4899027dd185969f9cc7bcbaefaa68133017aa628b54489a72700a00a15ee78913bd49741f8a6b7a7ae0a280bcaf81d484a15f246398dd5932bf77e3552b8a7f
7
+ data.tar.gz: 0a34f78194a89f3a4aae7e4ef15efa540d9c39ba77bd078f48a9dfc7f01e7c6b9ce526b4ac938ed77f7e3e44897b7114889feb0ad2fdb242cbc3c6ab479e4a0c
data/.travis.yml CHANGED
@@ -1,7 +1,16 @@
1
+ sudo: false
1
2
  language: ruby
3
+ cache: bundler
2
4
  rvm:
3
- - 2.0
4
- - 2.1
5
5
  - 2.2
6
+ - 2.1
6
7
  - ruby-head
7
8
  - rbx-2
9
+ matrix:
10
+ allow_failures:
11
+ - rvm:
12
+ - ruby-head
13
+ - rbx-2
14
+ notifications:
15
+ email:
16
+ - tj+travis_uh_layout@a13.fr
@@ -1,5 +1,5 @@
1
1
  module Uh
2
2
  class Layout
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.2'
4
4
  end
5
5
  end
data/lib/uh/layout.rb CHANGED
@@ -86,6 +86,10 @@ module Uh
86
86
  update_widgets
87
87
  end
88
88
 
89
+ def update client
90
+ update_widgets unless client.hidden?
91
+ end
92
+
89
93
  def handle_screen_sel(direction)
90
94
  screens.sel direction
91
95
  current_client.focus if current_client
@@ -128,7 +128,27 @@ module Uh
128
128
  end
129
129
  end
130
130
 
131
- describe 'handle_screen_sel' do
131
+ describe '#update' do
132
+ context 'when given client is visible' do
133
+ before { client.show }
134
+
135
+ it 'updates the widgets' do
136
+ expect(layout).to receive :update_widgets
137
+ layout.update client
138
+ end
139
+ end
140
+
141
+ context 'when client is hidden' do
142
+ before { client.hide }
143
+
144
+ it 'does not update the widget' do
145
+ expect(layout).not_to receive :update_widgets
146
+ layout.update client
147
+ end
148
+ end
149
+ end
150
+
151
+ describe '#handle_screen_sel' do
132
152
  it 'selects consecutive screen in given direction' do
133
153
  expect { layout.handle_screen_sel :succ }
134
154
  .to change { layout.current_screen.id }.from(0).to(1)
@@ -146,7 +166,7 @@ module Uh
146
166
  end
147
167
  end
148
168
 
149
- describe 'handle_screen_set' do
169
+ describe '#handle_screen_set' do
150
170
  before { layout << client }
151
171
 
152
172
  it 'removes current client from origin screen' do
@@ -173,7 +193,7 @@ module Uh
173
193
  end
174
194
  end
175
195
 
176
- describe 'handle_tag_sel' do
196
+ describe '#handle_tag_sel' do
177
197
  before { layout << client }
178
198
 
179
199
  it 'hides clients on previously selected tag' do
@@ -216,7 +236,7 @@ module Uh
216
236
  end
217
237
  end
218
238
 
219
- describe 'handle_tag_set' do
239
+ describe '#handle_tag_set' do
220
240
  context 'without client' do
221
241
  it 'does not raise any error' do
222
242
  expect { layout.handle_tag_set '2' }.not_to raise_error
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uh-layout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibault Jouan