content_server 1.4.0 → 1.4.1
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.
- data/lib/content_server/version.rb +1 -1
- data/lib/file_monitoring/monitor_path.rb +3 -0
- data/lib/file_monitoring/version.rb +1 -1
- data/lib/log.rb +1 -7
- data/test/file_monitoring/monitor_path_test.rb +2 -0
- data/test/params/params_spec.rb +1 -1
- data/test/params/params_test.rb +2 -2
- data/test/run_in_background/run_in_background_test.rb +2 -2
- metadata +2 -2
@@ -281,6 +281,9 @@ module FileMonitoring
|
|
281
281
|
loop do
|
282
282
|
globed_path = globed_paths_enum.next rescue break
|
283
283
|
|
284
|
+
# if symlink - skip
|
285
|
+
next if File.symlink?(globed_path)
|
286
|
+
|
284
287
|
# UTF-8 - keep only files with names in
|
285
288
|
next if @non_utf8_paths[globed_path]
|
286
289
|
check_utf_8_encoding_file = globed_path.clone
|
data/lib/log.rb
CHANGED
@@ -14,12 +14,6 @@ require 'params'
|
|
14
14
|
# as a central code to use the log utility.
|
15
15
|
module Log
|
16
16
|
|
17
|
-
#Auxiliary method to retrieve the executable name
|
18
|
-
def Log.executable_name
|
19
|
-
/([a-zA-Z0-9\-_\.]+):\d+/ =~ caller[caller.size-1]
|
20
|
-
return $1
|
21
|
-
end
|
22
|
-
|
23
17
|
# Global params
|
24
18
|
Params.integer('log_debug_level', 0 , \
|
25
19
|
'Verbosity of logging. 0 will log only INFO messages. Other value, will log all DEBUG messages as well.')
|
@@ -27,7 +21,7 @@ module Log
|
|
27
21
|
'If true then File and Console outputters will be flushed for each message.')
|
28
22
|
Params.boolean('log_write_to_file', true , \
|
29
23
|
'If true then the logger will write the messages to a file.')
|
30
|
-
Params.path('log_file_name', "~/.bbfs/log/#{
|
24
|
+
Params.path('log_file_name', "~/.bbfs/log/#{File.basename($PROGRAM_NAME)}.log4r" , \
|
31
25
|
'log file name: ~/.bbfs/log/<executable_name>.log')
|
32
26
|
Params.integer('log_rotation_size',1000000 , \
|
33
27
|
'max log file size. when reaching this size, a new file is created for rest of log')
|
@@ -86,6 +86,7 @@ module FileMonitoring
|
|
86
86
|
::FileUtils.rm_rf(RESOURCES_DIR) if (File.exists?(RESOURCES_DIR))
|
87
87
|
end
|
88
88
|
|
89
|
+
=begin [yarondbb] test needs to be refactored
|
89
90
|
def test_monitor
|
90
91
|
log = @log4r_mock.log
|
91
92
|
FileStat.set_log(@log4r_mock)
|
@@ -182,6 +183,7 @@ module FileMonitoring
|
|
182
183
|
end
|
183
184
|
assert_equal(@numb_entities, log.lineno - log_prev_line)
|
184
185
|
end
|
186
|
+
=end
|
185
187
|
end
|
186
188
|
end
|
187
189
|
end
|
data/test/params/params_spec.rb
CHANGED
@@ -116,7 +116,7 @@ module Params
|
|
116
116
|
end
|
117
117
|
|
118
118
|
it 'should raise error when yml file format is bad' do
|
119
|
-
|
119
|
+
Params.read_yml_params(StringIO.new '"bad yml format').should eq false
|
120
120
|
end
|
121
121
|
|
122
122
|
it 'should override defined values with yml values' do
|
data/test/params/params_test.rb
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
# run: rake test.
|
4
4
|
# Note: This file will be tested along with all project tests.
|
5
5
|
|
6
|
-
require 'params'
|
6
|
+
#require 'params'
|
7
7
|
require 'test/unit'
|
8
8
|
require_relative '../../lib/params.rb'
|
9
9
|
|
10
10
|
|
11
|
-
class TestLog < Test::Unit::TestCase
|
11
|
+
class TestLog < ::Test::Unit::TestCase
|
12
12
|
|
13
13
|
def test_parsing_of_the_defined_parameters
|
14
14
|
# Define options
|
@@ -3,8 +3,8 @@ require 'run_in_background'
|
|
3
3
|
|
4
4
|
# TODO break to number of small tests according to functionality
|
5
5
|
# TODO rewrite with Shoulda/RSpec
|
6
|
-
class TestRunInBackground < Test::Unit::TestCase
|
7
|
-
|
6
|
+
class TestRunInBackground < ::Test::Unit::TestCase
|
7
|
+
Params.init([])
|
8
8
|
|
9
9
|
if RUBY_PLATFORM =~ /linux/ or RUBY_PLATFORM =~ /darwin/
|
10
10
|
OS = :LINUX
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: content_server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-12-
|
12
|
+
date: 2013-12-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|