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 +4 -4
- data/lib/britebox/cli.rb +14 -0
- data/lib/britebox/file_job.rb +3 -0
- data/lib/britebox/file_job_pool.rb +12 -0
- data/lib/britebox/version.rb +1 -1
- data/resources/assets/javascripts/compiled-coffee.js +8 -0
- data/resources/assets/javascripts/controllers/settings_ctrl.coffee +2 -2
- data/resources/public/javascripts/application.js +8 -0
- 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: c1c00185a346814ccf212ae94af05ab53388b33e
|
4
|
+
data.tar.gz: 0598112a0cebcce6152771cc2838e847301ccd2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9002a8e7934f4f497dcd94619ea2d5d125d3becebaf7db0a9daa8457dd055aca596013c2201d4873a20f78a4cac215f12c7838159ea38149ded866c99b756aa0
|
7
|
+
data.tar.gz: 1a4f87174f2b7e9cd07486a8238e7b3cf4c9f5d8d0c8b888ea5d68f6d203407f73e4af61c82fdd1b3629d653a3c4e1ba2914643a59d8d3412c78b57db8f9d18e
|
data/lib/britebox/cli.rb
CHANGED
@@ -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
|
|
data/lib/britebox/file_job.rb
CHANGED
@@ -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)
|
data/lib/britebox/version.rb
CHANGED
@@ -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
|
-
|
14
|
-
|
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.
|
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-
|
12
|
+
date: 2013-08-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: brite-api
|