opsask 2.3.3 → 2.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/opsask/app.rb +9 -9
- data/lib/opsask/helpers.rb +5 -2
- data/lib/opsask/main.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8033a523637bfb87b0e5669277c47cb67c94c572
|
4
|
+
data.tar.gz: 914baba2787613c969697d868f083cc5de0791a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44aebe8bb2f69217a2c89623dd9051ebbf8701f02b8e2ec2b4f9c035f3997cb0637de15c683702eaa1db8a499525a2324837f4008da76786fa21f25e54653311
|
7
|
+
data.tar.gz: c23e34baba316b3d278f9b09f54a17f08eee2513608c6adaca9385e8f1ee534799f42db66430413bbd562f2a90eb0250056b7dedb249683c7abd2d1485a60a6a
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.4
|
data/lib/opsask/app.rb
CHANGED
@@ -15,8 +15,8 @@ module OpsAsk
|
|
15
15
|
class App < Sinatra::Base
|
16
16
|
include OpsAsk::Helpers
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
@room = nil
|
19
|
+
@room_json = '{}'
|
20
20
|
|
21
21
|
set :root, OpsAsk::ROOT
|
22
22
|
|
@@ -78,16 +78,16 @@ module OpsAsk
|
|
78
78
|
get '/room' do
|
79
79
|
debug 'get-/room'
|
80
80
|
content_type :json
|
81
|
-
|
82
|
-
if
|
81
|
+
@room ||= {}
|
82
|
+
if @room.empty?
|
83
83
|
debug 'RECALC ROOM!'
|
84
|
-
(0..
|
84
|
+
(0..settings.config[:room_lookahead]).each do |n|
|
85
85
|
date = today n * one_day
|
86
|
-
|
86
|
+
@room[date] = room_for_new_jiras_for? date
|
87
87
|
end
|
88
|
-
|
88
|
+
@room_json = JSON.generate(@room)
|
89
89
|
end
|
90
|
-
|
90
|
+
@room_json
|
91
91
|
end
|
92
92
|
|
93
93
|
get '/untracked' do
|
@@ -200,7 +200,7 @@ module OpsAsk
|
|
200
200
|
| ]
|
201
201
|
end
|
202
202
|
|
203
|
-
|
203
|
+
@room = nil # will recalculate
|
204
204
|
redirect '/'
|
205
205
|
end
|
206
206
|
|
data/lib/opsask/helpers.rb
CHANGED
@@ -320,15 +320,18 @@ module OpsAsk
|
|
320
320
|
jira_count_for(date, really) < settings.config[:queue_size]
|
321
321
|
end
|
322
322
|
|
323
|
-
def date_for_new_jiras really=false
|
323
|
+
def date_for_new_jiras really=false, depth=0
|
324
|
+
logger.debug 'date_for_new_jiras really=%s' % really.inspect
|
324
325
|
if now.hour < settings.config[:cutoff_hour] || its_the_weekend?
|
325
326
|
return today if room_for_new_jiras_for? today, really
|
326
327
|
end
|
327
328
|
|
328
329
|
# Remove the two-day limit [OPS-1862]
|
329
|
-
n =
|
330
|
+
n = 0 # days from now
|
330
331
|
loop do
|
332
|
+
n += 1 # first call n=1, tomorrow
|
331
333
|
next_day = today n * one_day
|
334
|
+
logger.debug 'date_for_new_jiras next_day=%s' % next_day.inspect
|
332
335
|
return next_day if room_for_new_jiras_for? next_day, really
|
333
336
|
end
|
334
337
|
end
|
data/lib/opsask/main.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opsask
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Clemmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|