britebox 0.0.10 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2fa1811b0fba08e5510eb6d8ba5f7ec0bbbc50a1
4
- data.tar.gz: 683a9e4ab0215704e595707dd2b9e79e1ecdfa1a
3
+ metadata.gz: c1c00185a346814ccf212ae94af05ab53388b33e
4
+ data.tar.gz: 0598112a0cebcce6152771cc2838e847301ccd2a
5
5
  SHA512:
6
- metadata.gz: 4d7344b2279ca9eb703482056aa1cb1f5d462b46a98304213b3c2e4eba2a59e082268e94892324b1d94978b13796fd4299f025c50513ea8d885c61acb55dd56a
7
- data.tar.gz: 400ae595131e0cf4ff30c4b5ed40bd56b459ecc76660ce0a8cacb347c7872ece698c184c80852f825496760b27d330aadebeb82f9fec5310710b486ede7241ca
6
+ metadata.gz: 9002a8e7934f4f497dcd94619ea2d5d125d3becebaf7db0a9daa8457dd055aca596013c2201d4873a20f78a4cac215f12c7838159ea38149ded866c99b756aa0
7
+ data.tar.gz: 1a4f87174f2b7e9cd07486a8238e7b3cf4c9f5d8d0c8b888ea5d68f6d203407f73e4af61c82fdd1b3629d653a3c4e1ba2914643a59d8d3412c78b57db8f9d18e
@@ -53,6 +53,20 @@ module Britebox
53
53
  puts warn
54
54
  end
55
55
 
56
+ Thread.new do
57
+ loop do
58
+ sleep 20
59
+ if Config.recheck_enabled
60
+ Dir.glob(File.join(@out_dir, "*" + FileJob::FIRST_PASS + ".*")).each do |f|
61
+ if ((Time.now - Config.recheck_interval * 60 - 60) .. (Time.now - Config.recheck_interval * 60)).cover? File.mtime(f)
62
+ new_name = File.basename(f).sub(FileJob::FIRST_PASS, FileJob::SECOND_PASS)
63
+ File.rename f, File.join(@dir, new_name)
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+
56
70
  puts "Press Ctrl-C to quit"
57
71
  puts
58
72
 
@@ -9,6 +9,9 @@ module Britebox
9
9
 
10
10
  attr_accessor :size_processed
11
11
 
12
+ FIRST_PASS = ' (1st pass)'
13
+ SECOND_PASS = ' (2nd pass)'
14
+
12
15
  def initialize(file_name, brite_client, options = {})
13
16
  @file_name = file_name
14
17
  @brite_client = brite_client
@@ -52,6 +52,18 @@ module Britebox
52
52
  end
53
53
  when 'complete'
54
54
  File.delete file_name
55
+
56
+ if Config.recheck_enabled
57
+ if file.include?(FileJob::SECOND_PASS + '.')
58
+ # already processed twice, restore initial name
59
+ new_out_name = file.sub(FileJob::SECOND_PASS + '.', '.')
60
+ else
61
+ # processed once, add label
62
+ new_out_name = File.basename(file, File.extname(file)) + FileJob::FIRST_PASS + File.extname(file)
63
+ end
64
+
65
+ File.rename File.expand_path(file, out_dir), File.join(out_dir, new_out_name)
66
+ end
55
67
  when 'cancelled'
56
68
  cancelled_name = File.basename(file, File.extname(file)) + '_cancelled' + File.extname(file)
57
69
  File.rename file_name, File.expand_path(cancelled_name, out_dir)
@@ -1,3 +1,3 @@
1
1
  module Britebox
2
- VERSION = '0.0.10'
2
+ VERSION = '0.0.11'
3
3
  end
@@ -125,6 +125,14 @@
125
125
  }, {
126
126
  key: 'log_file',
127
127
  title: 'Log file'
128
+ }, {
129
+ key: 'recheck_enabled',
130
+ title: 'Enable re-checking csv files with unknown records',
131
+ type: 'checkbox'
132
+ }, {
133
+ key: 'recheck_interval',
134
+ title: 'Delay before re-checking, minutes',
135
+ help: 'only records with "unknown" status will be proceed second time'
128
136
  }
129
137
  ];
130
138
  $scope.texts = {
@@ -10,8 +10,8 @@ app.controller 'SettingsCtrl', ['$scope', '$http', '$injector', ($scope, $http,
10
10
  {key: 'port', title: 'Port', help: 'Launch web server on this port'}
11
11
  {key: 'logging_enabled', title: 'Enable logging', type: 'checkbox'}
12
12
  {key: 'log_file', title: 'Log file'}
13
- # {key: 'recheck_enabled', title: 'Enable re-checking csv files with unknown records', type: 'checkbox'}
14
- # {key: 'recheck_interval', title: 'Delay before re-checking, minutes', help: 'only records with "unknown" status will be proceed second time'}
13
+ {key: 'recheck_enabled', title: 'Enable re-checking csv files with unknown records', type: 'checkbox'}
14
+ {key: 'recheck_interval', title: 'Delay before re-checking, minutes', help: 'only records with "unknown" status will be proceed second time'}
15
15
  ]
16
16
 
17
17
  $scope.texts = {
@@ -125,6 +125,14 @@
125
125
  }, {
126
126
  key: 'log_file',
127
127
  title: 'Log file'
128
+ }, {
129
+ key: 'recheck_enabled',
130
+ title: 'Enable re-checking csv files with unknown records',
131
+ type: 'checkbox'
132
+ }, {
133
+ key: 'recheck_interval',
134
+ title: 'Delay before re-checking, minutes',
135
+ help: 'only records with "unknown" status will be proceed second time'
128
136
  }
129
137
  ];
130
138
  $scope.texts = {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: britebox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Shapiotko
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-28 00:00:00.000000000 Z
12
+ date: 2013-08-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: brite-api