baby-bro 0.0.15 → 0.0.16
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/.rvmrc +1 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +13 -0
- data/VERSION +1 -1
- data/baby-bro-0.0.15.gem +0 -0
- data/baby-bro.gemspec +40 -41
- data/lib/baby-bro/monitor.rb +14 -14
- metadata +31 -16
- data/.gitignore +0 -1
data/.rvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
rvm use
|
|
1
|
+
rvm use ree-1.8.7-2011.03@babybro
|
data/Gemfile
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
gem 'baby-bro', :path => '/Users/billdoughty/src/capitalthought/baby-bro'
|
data/Gemfile.lock
ADDED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.16
|
data/baby-bro-0.0.15.gem
ADDED
|
Binary file
|
data/baby-bro.gemspec
CHANGED
|
@@ -1,75 +1,74 @@
|
|
|
1
1
|
# Generated by jeweler
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = %q{baby-bro}
|
|
8
|
-
s.version = "0.0.
|
|
8
|
+
s.version = "0.0.16"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Bill Doughty"]
|
|
12
|
-
s.date = %q{2011-
|
|
12
|
+
s.date = %q{2011-11-29}
|
|
13
13
|
s.default_executable = %q{bro}
|
|
14
14
|
s.description = %q{Baby Bro monitors timestamp changes of files and and estimates time spent actively working in project directories.}
|
|
15
15
|
s.email = %q{billdoughty@capitalthought.com}
|
|
16
16
|
s.executables = ["bro"]
|
|
17
17
|
s.extra_rdoc_files = [
|
|
18
18
|
"LICENSE",
|
|
19
|
-
|
|
19
|
+
"README.rdoc"
|
|
20
20
|
]
|
|
21
21
|
s.files = [
|
|
22
|
-
".
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
22
|
+
".rvmrc",
|
|
23
|
+
"Gemfile",
|
|
24
|
+
"Gemfile.lock",
|
|
25
|
+
"History.txt",
|
|
26
|
+
"LICENSE",
|
|
27
|
+
"Manifest.txt",
|
|
28
|
+
"PostInstall.txt",
|
|
29
|
+
"README.rdoc",
|
|
30
|
+
"Rakefile",
|
|
31
|
+
"VERSION",
|
|
32
|
+
"baby-bro-0.0.15.gem",
|
|
33
|
+
"baby-bro.gemspec",
|
|
34
|
+
"bin/bro",
|
|
35
|
+
"config/babybrorc.example",
|
|
36
|
+
"lib/baby-bro.rb",
|
|
37
|
+
"lib/baby-bro/base_config.rb",
|
|
38
|
+
"lib/baby-bro/exec.rb",
|
|
39
|
+
"lib/baby-bro/files.rb",
|
|
40
|
+
"lib/baby-bro/hash_object.rb",
|
|
41
|
+
"lib/baby-bro/monitor.rb",
|
|
42
|
+
"lib/baby-bro/monitor_config.rb",
|
|
43
|
+
"lib/baby-bro/project.rb",
|
|
44
|
+
"lib/baby-bro/reporter.rb",
|
|
45
|
+
"lib/baby-bro/session.rb",
|
|
46
|
+
"lib/extensions/fixnum.rb",
|
|
47
|
+
"script/console",
|
|
48
|
+
"script/destroy",
|
|
49
|
+
"script/generate",
|
|
50
|
+
"spec/baby-bro_spec.rb",
|
|
51
|
+
"spec/spec.opts",
|
|
52
|
+
"spec/spec_helper.rb",
|
|
53
|
+
"tasks/rspec.rake"
|
|
52
54
|
]
|
|
53
55
|
s.homepage = %q{http://github.com/capitalthought/baby-bro}
|
|
54
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
|
55
56
|
s.require_paths = ["lib"]
|
|
56
|
-
s.rubygems_version = %q{1.
|
|
57
|
+
s.rubygems_version = %q{1.6.2}
|
|
57
58
|
s.summary = %q{File activity monitor for time tracking.}
|
|
58
|
-
s.test_files = [
|
|
59
|
-
"spec/baby-bro_spec.rb",
|
|
60
|
-
"spec/spec_helper.rb"
|
|
61
|
-
]
|
|
62
59
|
|
|
63
60
|
if s.respond_to? :specification_version then
|
|
64
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
|
65
61
|
s.specification_version = 3
|
|
66
62
|
|
|
67
63
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
64
|
+
s.add_runtime_dependency(%q<baby-bro>, [">= 0"])
|
|
68
65
|
s.add_development_dependency(%q<rspec>, [">= 1.3.1"])
|
|
69
66
|
else
|
|
67
|
+
s.add_dependency(%q<baby-bro>, [">= 0"])
|
|
70
68
|
s.add_dependency(%q<rspec>, [">= 1.3.1"])
|
|
71
69
|
end
|
|
72
70
|
else
|
|
71
|
+
s.add_dependency(%q<baby-bro>, [">= 0"])
|
|
73
72
|
s.add_dependency(%q<rspec>, [">= 1.3.1"])
|
|
74
73
|
end
|
|
75
74
|
end
|
data/lib/baby-bro/monitor.rb
CHANGED
|
@@ -11,7 +11,7 @@ module BabyBro
|
|
|
11
11
|
def initialize( options )
|
|
12
12
|
load_config( options )
|
|
13
13
|
end
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
def start
|
|
16
16
|
if pid = active_pid && !( @config.force_start )
|
|
17
17
|
puts "ERROR: PID file detected. Cannot start baby-bro."
|
|
@@ -24,7 +24,7 @@ module BabyBro
|
|
|
24
24
|
Kernel.trap( "SIGINT" ) do
|
|
25
25
|
print "Baby Bro monitor is shutting down..."
|
|
26
26
|
$stdout.flush
|
|
27
|
-
@continue = false;
|
|
27
|
+
@continue = false;
|
|
28
28
|
if @previous_SIGINT_handler != "DEFAULT" && @previous_SIGINT_handler != "IGNORE"
|
|
29
29
|
Kernel.trap( "SIGINT" ) { @previous_SIGINT_handler.call }
|
|
30
30
|
end
|
|
@@ -41,7 +41,7 @@ module BabyBro
|
|
|
41
41
|
end
|
|
42
42
|
return true
|
|
43
43
|
end
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
def stop
|
|
46
46
|
unless pid = active_pid
|
|
47
47
|
puts "ERROR: No pid file found for Baby Bro (#{pid_file})."
|
|
@@ -63,7 +63,7 @@ module BabyBro
|
|
|
63
63
|
sleep 0.1
|
|
64
64
|
sleep_time -= 0.1
|
|
65
65
|
if sleep_time == 0
|
|
66
|
-
Process.kill( "SIGKILL", pid )
|
|
66
|
+
Process.kill( "SIGKILL", pid )
|
|
67
67
|
puts "Baby Bro monitor process #{pid} not responding to SIGINT."
|
|
68
68
|
puts "Sending SIGKILL to Baby Bro monitor process #{pid}."
|
|
69
69
|
end
|
|
@@ -81,7 +81,7 @@ module BabyBro
|
|
|
81
81
|
Process.kill( 0, pid ) # check if the process is still alive, raises Errno::ESRCH if not
|
|
82
82
|
puts "Baby Bro monitor process is running with PID #{pid}."
|
|
83
83
|
rescue Errno::ESRCH
|
|
84
|
-
puts "PID file #{
|
|
84
|
+
puts "PID file #{pid_file} found, but no Baby Bro monitor process is running with PID #{pid}."
|
|
85
85
|
remove_pid_file
|
|
86
86
|
puts "PID file removed."
|
|
87
87
|
end
|
|
@@ -89,7 +89,7 @@ module BabyBro
|
|
|
89
89
|
puts "Baby Bro monitor process is not running."
|
|
90
90
|
end
|
|
91
91
|
end
|
|
92
|
-
|
|
92
|
+
|
|
93
93
|
private
|
|
94
94
|
def main
|
|
95
95
|
while( @continue )
|
|
@@ -103,25 +103,25 @@ module BabyBro
|
|
|
103
103
|
remove_pid_file
|
|
104
104
|
puts "complete."
|
|
105
105
|
end
|
|
106
|
-
|
|
106
|
+
|
|
107
107
|
def active_pid
|
|
108
108
|
File.exist?( pid_file ) && File.read(pid_file).to_i
|
|
109
109
|
end
|
|
110
|
-
|
|
110
|
+
|
|
111
111
|
def pid_file
|
|
112
112
|
self.config.data.pid_file
|
|
113
113
|
end
|
|
114
|
-
|
|
114
|
+
|
|
115
115
|
def remove_pid_file
|
|
116
116
|
File.delete( pid_file )
|
|
117
117
|
end
|
|
118
|
-
|
|
118
|
+
|
|
119
119
|
def create_pid_file( pid )
|
|
120
120
|
File.open( pid_file, 'w' ) do |f|
|
|
121
121
|
f.write( pid.to_s )
|
|
122
122
|
end
|
|
123
123
|
end
|
|
124
|
-
|
|
124
|
+
|
|
125
125
|
def load_config( options )
|
|
126
126
|
@config = HashObject.new( process_base_config( options ), true )
|
|
127
127
|
process_monitor_config( @config )
|
|
@@ -131,10 +131,10 @@ module BabyBro
|
|
|
131
131
|
def tron string
|
|
132
132
|
$stdout.puts if @config && @config.tron
|
|
133
133
|
end
|
|
134
|
-
|
|
134
|
+
|
|
135
135
|
def interruptable_sleep sleep_time, guard_interval=1
|
|
136
136
|
if block_given?
|
|
137
|
-
while( yield && sleep_time > 0 )
|
|
137
|
+
while( yield && sleep_time > 0 )
|
|
138
138
|
sleep guard_interval
|
|
139
139
|
sleep_time -= guard_interval
|
|
140
140
|
end
|
|
@@ -142,6 +142,6 @@ module BabyBro
|
|
|
142
142
|
sleep sleep_time
|
|
143
143
|
end
|
|
144
144
|
end
|
|
145
|
-
|
|
145
|
+
|
|
146
146
|
end
|
|
147
147
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: baby-bro
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
5
|
-
prerelease:
|
|
4
|
+
hash: 63
|
|
5
|
+
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 16
|
|
10
|
+
version: 0.0.16
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Bill Doughty
|
|
@@ -15,13 +15,26 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-
|
|
18
|
+
date: 2011-11-29 00:00:00 -06:00
|
|
19
19
|
default_executable: bro
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|
|
22
|
-
|
|
23
|
-
prerelease: false
|
|
22
|
+
type: :runtime
|
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
|
24
|
+
none: false
|
|
25
|
+
requirements:
|
|
26
|
+
- - ">="
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
hash: 3
|
|
29
|
+
segments:
|
|
30
|
+
- 0
|
|
31
|
+
version: "0"
|
|
32
|
+
name: baby-bro
|
|
33
|
+
version_requirements: *id001
|
|
34
|
+
prerelease: false
|
|
35
|
+
- !ruby/object:Gem::Dependency
|
|
36
|
+
type: :development
|
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
|
25
38
|
none: false
|
|
26
39
|
requirements:
|
|
27
40
|
- - ">="
|
|
@@ -32,8 +45,9 @@ dependencies:
|
|
|
32
45
|
- 3
|
|
33
46
|
- 1
|
|
34
47
|
version: 1.3.1
|
|
35
|
-
|
|
36
|
-
version_requirements: *
|
|
48
|
+
name: rspec
|
|
49
|
+
version_requirements: *id002
|
|
50
|
+
prerelease: false
|
|
37
51
|
description: Baby Bro monitors timestamp changes of files and and estimates time spent actively working in project directories.
|
|
38
52
|
email: billdoughty@capitalthought.com
|
|
39
53
|
executables:
|
|
@@ -44,8 +58,9 @@ extra_rdoc_files:
|
|
|
44
58
|
- LICENSE
|
|
45
59
|
- README.rdoc
|
|
46
60
|
files:
|
|
47
|
-
- .gitignore
|
|
48
61
|
- .rvmrc
|
|
62
|
+
- Gemfile
|
|
63
|
+
- Gemfile.lock
|
|
49
64
|
- History.txt
|
|
50
65
|
- LICENSE
|
|
51
66
|
- Manifest.txt
|
|
@@ -53,6 +68,7 @@ files:
|
|
|
53
68
|
- README.rdoc
|
|
54
69
|
- Rakefile
|
|
55
70
|
- VERSION
|
|
71
|
+
- baby-bro-0.0.15.gem
|
|
56
72
|
- baby-bro.gemspec
|
|
57
73
|
- bin/bro
|
|
58
74
|
- config/babybrorc.example
|
|
@@ -79,8 +95,8 @@ homepage: http://github.com/capitalthought/baby-bro
|
|
|
79
95
|
licenses: []
|
|
80
96
|
|
|
81
97
|
post_install_message:
|
|
82
|
-
rdoc_options:
|
|
83
|
-
|
|
98
|
+
rdoc_options: []
|
|
99
|
+
|
|
84
100
|
require_paths:
|
|
85
101
|
- lib
|
|
86
102
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
@@ -104,10 +120,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
104
120
|
requirements: []
|
|
105
121
|
|
|
106
122
|
rubyforge_project:
|
|
107
|
-
rubygems_version: 1.
|
|
123
|
+
rubygems_version: 1.6.2
|
|
108
124
|
signing_key:
|
|
109
125
|
specification_version: 3
|
|
110
126
|
summary: File activity monitor for time tracking.
|
|
111
|
-
test_files:
|
|
112
|
-
|
|
113
|
-
- spec/spec_helper.rb
|
|
127
|
+
test_files: []
|
|
128
|
+
|
data/.gitignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
pkg
|