britebox 0.0.9 → 0.0.10

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: 4b54286d6165fb16b7e7c0e920bb750b9de039c6
4
- data.tar.gz: 43bfdc620b9a7d81dff3f87576ae02a3a7ca7745
3
+ metadata.gz: 2fa1811b0fba08e5510eb6d8ba5f7ec0bbbc50a1
4
+ data.tar.gz: 683a9e4ab0215704e595707dd2b9e79e1ecdfa1a
5
5
  SHA512:
6
- metadata.gz: 0fcdb8abec1665bb6a984307dd75a150862949ff20f38fd6cebbc33d7dd627b4c1e23441056820a46fe155d4f134a7a99c0a83a4157cf2aee4b61aaf4de2455c
7
- data.tar.gz: 7b4d2bfb68404e0a260a91250d11d46fa966002b4baa83812c07e9c6879e37eb0203162f388d12fb76841b7424609098deba73b2cd53a9b82546ef288a5385e6
6
+ metadata.gz: 4d7344b2279ca9eb703482056aa1cb1f5d462b46a98304213b3c2e4eba2a59e082268e94892324b1d94978b13796fd4299f025c50513ea8d885c61acb55dd56a
7
+ data.tar.gz: 400ae595131e0cf4ff30c4b5ed40bd56b459ecc76660ce0a8cacb347c7872ece698c184c80852f825496760b27d330aadebeb82f9fec5310710b486ede7241ca
@@ -9,8 +9,9 @@ module Britebox
9
9
 
10
10
  OPTIONS = [
11
11
  :threads, :api_key, :watch_dir, :out_dir, :port, :ui_enabled, :simulate,
12
- :logging_enabled, :log_file
12
+ :logging_enabled, :log_file, :recheck_enabled, :recheck_interval
13
13
  ]
14
+
14
15
  OPTIONS.each { |o| attr_accessor(o) }
15
16
 
16
17
  MAX_THREADS = 10
@@ -18,13 +19,16 @@ module Britebox
18
19
  validates_presence_of :threads, :api_key, :watch_dir, :out_dir, :port, :log_file
19
20
  validates_inclusion_of :port, in: 1..65535, message: ' should be in range 1..65535'
20
21
  validates_inclusion_of :threads, in: 1..MAX_THREADS, message: "should be in range 1..#{MAX_THREADS}"
22
+ validates_inclusion_of :recheck_interval, in: 1..1440, message: 'should be in range 1..1440'
21
23
  validate :watch_dir_present
22
24
 
23
25
  DEFAULT_OPTIONS = {
24
26
  threads: 10,
25
27
  port: 7000,
26
28
  logging_enabled: false,
27
- log_file: '~/britebox.log'
29
+ log_file: '~/britebox.log',
30
+ recheck_enabled: false,
31
+ recheck_interval: 5
28
32
  }
29
33
 
30
34
  CONFIG_PATH = '~/.britebox.json'
@@ -56,7 +56,7 @@ module Britebox
56
56
  cancelled_name = File.basename(file, File.extname(file)) + '_cancelled' + File.extname(file)
57
57
  File.rename file_name, File.expand_path(cancelled_name, out_dir)
58
58
  else
59
- raise "unexpected error, status: #{fj.status}"
59
+ raise "unexpected error, #{fj.id}, status: #{fj.status}"
60
60
  end
61
61
 
62
62
  EventLog.add 'processing', "#{file}: Finished processing with status #{fj.status}"
@@ -1,3 +1,3 @@
1
1
  module Britebox
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
@@ -145,13 +145,24 @@
145
145
  });
146
146
  };
147
147
  $scope.save = function(cb_ok, cb_error) {
148
+ var k, sett, v, _ref;
148
149
  if (cb_ok == null) {
149
150
  cb_ok = null;
150
151
  }
151
152
  if (cb_error == null) {
152
153
  cb_error = null;
153
154
  }
154
- return $http.post('/settings', $scope.settings).success(function(data, status, headers, config) {
155
+ sett = {};
156
+ _ref = $scope.settings;
157
+ for (k in _ref) {
158
+ v = _ref[k];
159
+ if (typeof v === 'string' && v.match(/^[0-9]+$/)) {
160
+ sett[k] = parseInt(v);
161
+ } else {
162
+ sett[k] = v;
163
+ }
164
+ }
165
+ return $http.post('/settings', sett).success(function(data, status, headers, config) {
155
166
  $scope.errors = {};
156
167
  if (cb_ok) {
157
168
  cb_ok();
@@ -10,6 +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
15
  ]
14
16
 
15
17
  $scope.texts = {
@@ -30,7 +32,14 @@ app.controller 'SettingsCtrl', ['$scope', '$http', '$injector', ($scope, $http,
30
32
 
31
33
 
32
34
  $scope.save = (cb_ok = null, cb_error = null) ->
33
- $http.post('/settings', $scope.settings).success (data, status, headers, config) ->
35
+ sett = {}
36
+ for k, v of $scope.settings
37
+ if typeof v == 'string' && v.match /^[0-9]+$/
38
+ sett[k] = parseInt(v)
39
+ else
40
+ sett[k] = v
41
+
42
+ $http.post('/settings', sett).success (data, status, headers, config) ->
34
43
  $scope.errors = {}
35
44
  cb_ok() if cb_ok
36
45
  $injector.get('$rootScope').$broadcast('settingsUpdated')
@@ -145,13 +145,24 @@
145
145
  });
146
146
  };
147
147
  $scope.save = function(cb_ok, cb_error) {
148
+ var k, sett, v, _ref;
148
149
  if (cb_ok == null) {
149
150
  cb_ok = null;
150
151
  }
151
152
  if (cb_error == null) {
152
153
  cb_error = null;
153
154
  }
154
- return $http.post('/settings', $scope.settings).success(function(data, status, headers, config) {
155
+ sett = {};
156
+ _ref = $scope.settings;
157
+ for (k in _ref) {
158
+ v = _ref[k];
159
+ if (typeof v === 'string' && v.match(/^[0-9]+$/)) {
160
+ sett[k] = parseInt(v);
161
+ } else {
162
+ sett[k] = v;
163
+ }
164
+ }
165
+ return $http.post('/settings', sett).success(function(data, status, headers, config) {
155
166
  $scope.errors = {};
156
167
  if (cb_ok) {
157
168
  cb_ok();
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.9
4
+ version: 0.0.10
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-27 00:00:00.000000000 Z
12
+ date: 2013-08-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: brite-api