file_monitoring 0.0.2 → 0.0.3
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/bin/file_monitoring +5 -1
- data/lib/file_monitoring/file_monitoring.rb +7 -2
- metadata +37 -58
data/bin/file_monitoring
CHANGED
@@ -6,6 +6,10 @@
|
|
6
6
|
# A log file is written with all incremental changes of files.
|
7
7
|
#
|
8
8
|
# Install:
|
9
|
+
# gem install file_monitoring
|
10
|
+
#
|
11
|
+
# Local Install:
|
12
|
+
# go to bbfs directory.
|
9
13
|
# gem build file_monitoring.gemspec
|
10
14
|
# gem install file_monitoring
|
11
15
|
#
|
@@ -43,7 +47,7 @@ if ARGV.length > 2
|
|
43
47
|
end
|
44
48
|
|
45
49
|
puts "Config taken from:" + conf_file_path
|
46
|
-
pid_dir = File.expand_path('~/.bbfs/run/'
|
50
|
+
pid_dir = File.expand_path('~/.bbfs/run/')
|
47
51
|
FileUtils.mkdir_p(pid_dir)
|
48
52
|
puts "pid dir:" + pid_dir
|
49
53
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'file_monitoring/monitor_path.rb'
|
1
|
+
require './file_monitoring/monitor_path.rb'
|
2
2
|
require 'algorithms'
|
3
3
|
require 'fileutils'
|
4
4
|
require 'yaml'
|
@@ -6,6 +6,11 @@ require 'yaml'
|
|
6
6
|
# The main method. Loops on all paths each time span and monitors them.
|
7
7
|
def monitor_files(config_path)
|
8
8
|
config_yml = YAML::load_file(config_path)
|
9
|
+
if config_yml
|
10
|
+
puts "Error loading config file, exiting."
|
11
|
+
return
|
12
|
+
end
|
13
|
+
|
9
14
|
conf_array = config_yml["paths"]
|
10
15
|
|
11
16
|
pq = Containers::PriorityQueue.new
|
@@ -13,7 +18,7 @@ def monitor_files(config_path)
|
|
13
18
|
priority = (Time.now + elem["scan_period"]).to_i
|
14
19
|
pq.push([priority, elem, DirStat.new(elem["path"], elem["stable_state"])], -priority)
|
15
20
|
}
|
16
|
-
|
21
|
+
|
17
22
|
log_path = File.expand_path("~/.bbfs/log/file_monitoring.log")
|
18
23
|
if config_yml.key?("log_path")
|
19
24
|
log_path = File.expand_path(config_yml["log_path"])
|
metadata
CHANGED
@@ -1,91 +1,70 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: file_monitoring
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
version: 0.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Gena Petelko, Kolman Vornovitsky
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-01-01 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: algorithms
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70118919911460 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
- 0
|
30
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
31
22
|
type: :runtime
|
32
|
-
version_requirements: *id001
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: daemons
|
35
23
|
prerelease: false
|
36
|
-
|
24
|
+
version_requirements: *70118919911460
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: daemons
|
27
|
+
requirement: &70118919911020 !ruby/object:Gem::Requirement
|
37
28
|
none: false
|
38
|
-
requirements:
|
39
|
-
- -
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
|
42
|
-
- 0
|
43
|
-
version: "0"
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
44
33
|
type: :runtime
|
45
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70118919911020
|
46
36
|
description: Deamon for monitoring file changes.
|
47
37
|
email: kolmanv@gmail.com
|
48
|
-
executables:
|
38
|
+
executables:
|
49
39
|
- file_monitoring
|
50
40
|
extensions: []
|
51
|
-
|
52
41
|
extra_rdoc_files: []
|
53
|
-
|
54
|
-
files:
|
42
|
+
files:
|
55
43
|
- lib/file_monitoring/file_monitoring.rb
|
56
44
|
- lib/file_monitoring/monitor_path.rb
|
57
45
|
- bin/file_monitoring
|
58
|
-
has_rdoc: true
|
59
46
|
homepage:
|
60
47
|
licenses: []
|
61
|
-
|
62
48
|
post_install_message:
|
63
49
|
rdoc_options: []
|
64
|
-
|
65
|
-
require_paths:
|
50
|
+
require_paths:
|
66
51
|
- lib
|
67
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
53
|
none: false
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
|
73
|
-
|
74
|
-
version: "0"
|
75
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ! '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
59
|
none: false
|
77
|
-
requirements:
|
78
|
-
- -
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
|
81
|
-
- 0
|
82
|
-
version: "0"
|
60
|
+
requirements:
|
61
|
+
- - ! '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
83
64
|
requirements: []
|
84
|
-
|
85
65
|
rubyforge_project:
|
86
|
-
rubygems_version: 1.
|
66
|
+
rubygems_version: 1.8.15
|
87
67
|
signing_key:
|
88
68
|
specification_version: 3
|
89
69
|
summary: Deamon for monitoring file changes.
|
90
70
|
test_files: []
|
91
|
-
|