vncrec 1.0.2 → 1.0.3

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: 479e2213ac96c59299fee406b26817d3f3f53dd4
4
- data.tar.gz: e0a0d6a057dc4733689fe144a45557ed847fbc69
3
+ metadata.gz: 3feee74e40b84f5e30207f99e01b2444f8f18d54
4
+ data.tar.gz: 2da896794d70531e284c14b369e6f21c5c9085c1
5
5
  SHA512:
6
- metadata.gz: 7e7ebfb88b03546597ff4459d5c1c4518233ef231c0bd2b31507a9b395196129281a18a6d2d3ab2cc3f469b052369c569f6b4aab1a606cde19dbfd3fc9e1861b
7
- data.tar.gz: 7578e060ead7b9d5bd4dad3ad1d21efbe42509b49cc9819dcc1296e43682bc1c2e94e9e8c53594c91233aa561f1bbcf48e41ed594e58925ab94b86fec969b6ce
6
+ metadata.gz: 0c5ed155f4838c12c0b3a1b3288cd9b71c8526f6e04e2628187745b6bcd5ab02954e9a96816f3fa7cac5ac850345a31813ef116f173de96c949d3aef3100dcb5
7
+ data.tar.gz: 1c7e9cd361f129e87c298caaebecb70526a6767d49a877356e80e4931001ad5adbe41f37219ea61456d7eed2bcd1ef8d201e9f7570a35bf2cd06f5d47b3413b6
@@ -139,9 +139,8 @@ module VNCRec
139
139
  end
140
140
 
141
141
  def substitute_filename
142
- File.rename(@filename,
143
- @filename.gsub('DATE', '%Y_%m_%d_%Hh_%Mm_%Ss')
144
- ) if @recording_starttime && @filename['DATE']
142
+ File.rename(@filename, @filename.gsub(
143
+ 'DATE', @recording_starttime.strftime('%Y_%m_%d_%Hh_%Mm_%Ss'))) if @recording_starttime && @filename['DATE']
145
144
  end
146
145
 
147
146
  def close_proxy
@@ -1,3 +1,3 @@
1
1
  module VNCRec
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -153,6 +153,7 @@ describe Rec do
153
153
  let(:f1) { Rec.new }
154
154
  let(:f2) { Rec.new(filename: 'file') }
155
155
  let(:f3) { Rec.new(filename: '/root/file') }
156
+ let(:f4) { Rec.new(filename: 'rec_1_DATE.mp4').run; }
156
157
 
157
158
  context 'when no filename given' do
158
159
  it 'file with default name exists' do
@@ -174,9 +175,21 @@ describe Rec do
174
175
  expect { f3 }.to raise_error(/Cannot create file .*/)
175
176
  end
176
177
  end
178
+ context 'when template DATE is given' do
179
+ fit 'file with template substitute as name exist', port: true do
180
+ f4
181
+ launch_vnc_server 5900
182
+ expect do
183
+ sleep 3
184
+ `killall -KILL x11vnc`
185
+ sleep 0.5
186
+ puts Dir.glob('*')
187
+ end.to change { Dir.glob('rec_1_*_*_*_*h_*m_*s.mp4').grep(/_\d\dh_/).size }.from(0).to(1)
188
+ end
189
+ end
177
190
  end
178
191
  end
179
- describe 'filesize do', port: true, focus: true do
192
+ describe 'filesize do', port: true do
180
193
  let(:rec) { Rec.new(filename: 'somefile.mp4') }
181
194
  context 'when running' do
182
195
  it 'returns > 0' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vncrec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - d-theus
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-23 00:00:00.000000000 Z
11
+ date: 2015-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler