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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51d05620360e3e9e71f076a5fd2c5540ebdd32d9
4
- data.tar.gz: 5c74ef794d3bbee8af04a29f027ed836563a2f2e
3
+ metadata.gz: 8033a523637bfb87b0e5669277c47cb67c94c572
4
+ data.tar.gz: 914baba2787613c969697d868f083cc5de0791a6
5
5
  SHA512:
6
- metadata.gz: 81b22a140fcb111016dac13fe9e669719d41d9d7b492a96e649b2faaadce4059346c71913c2ad1eaf312e2d6c1ecdd2af7b21c856c6fb5d02a1b08f880b49937
7
- data.tar.gz: 30efd17d6b0c1b37325ad91045cb492bafb773939ff804bb4f28371df77e7cf14e872a85d1186bf7c06cf9182dd9b8a78478b67fcad83c836a7049bbdc4c7897
6
+ metadata.gz: 44aebe8bb2f69217a2c89623dd9051ebbf8701f02b8e2ec2b4f9c035f3997cb0637de15c683702eaa1db8a499525a2324837f4008da76786fa21f25e54653311
7
+ data.tar.gz: c23e34baba316b3d278f9b09f54a17f08eee2513608c6adaca9385e8f1ee534799f42db66430413bbd562f2a90eb0250056b7dedb249683c7abd2d1485a60a6a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.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
- @@room = nil
19
- @@room_json = '{}'
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
- @@room ||= {}
82
- if @@room.empty?
81
+ @room ||= {}
82
+ if @room.empty?
83
83
  debug 'RECALC ROOM!'
84
- (0..365).each do |n|
84
+ (0..settings.config[:room_lookahead]).each do |n|
85
85
  date = today n * one_day
86
- @@room[date] = room_for_new_jiras_for? date
86
+ @room[date] = room_for_new_jiras_for? date
87
87
  end
88
- @@room_json = JSON.generate(@@room)
88
+ @room_json = JSON.generate(@room)
89
89
  end
90
- @@room_json
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
- @@room = nil # will recalculate
203
+ @room = nil # will recalculate
204
204
  redirect '/'
205
205
  end
206
206
 
@@ -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 = 1 # day, i.e. tomorrow
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
@@ -60,7 +60,8 @@ module OpsAsk
60
60
  jira_private_key: 'opsask.pem',
61
61
  jira_consumer_key: 'opsask-test',
62
62
  app_version: OpsAsk::VERSION,
63
- require_label: nil
63
+ require_label: nil,
64
+ room_lookahead: 90 # days
64
65
  }
65
66
 
66
67
  if options[:config]
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.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-21 00:00:00.000000000 Z
11
+ date: 2015-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor