watcher 1.1.0 → 1.2.0

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.
@@ -37,7 +37,7 @@
37
37
  </div>
38
38
  <%= body %>
39
39
  <p class="coda">
40
- <a href="karrick@karrick.net">FIXME full name</a>, <%= modified.pretty %><br>
40
+ <a href="karrick@karrick.org">Karrick McDermott</a>, <%= modified.pretty %><br>
41
41
  Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
42
42
  </p>
43
43
  </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karrick McDermott
@@ -30,7 +30,7 @@ cert_chain:
30
30
  ZrfWyO4dIH4=
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2008-07-22 00:00:00 -04:00
33
+ date: 2008-07-30 00:00:00 -04:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
@@ -45,7 +45,7 @@ dependencies:
45
45
  version:
46
46
  description: Watcher provides advanced integrated exception handling and logging functionality to your Ruby programs.
47
47
  email:
48
- - karrick@karrick.net
48
+ - karrick@karrick.org
49
49
  executables: []
50
50
 
51
51
  extensions: []
@@ -56,6 +56,7 @@ extra_rdoc_files:
56
56
  - Manifest.txt
57
57
  - PostInstall.txt
58
58
  - README.txt
59
+ - TODO.txt
59
60
  - website/index.txt
60
61
  files:
61
62
  - History.txt
@@ -64,9 +65,10 @@ files:
64
65
  - PostInstall.txt
65
66
  - README.txt
66
67
  - Rakefile
67
- - TODO
68
+ - TODO.txt
68
69
  - config/hoe.rb
69
70
  - config/requirements.rb
71
+ - lib/event.rb
70
72
  - lib/watcher.rb
71
73
  - lib/watcher/version.rb
72
74
  - script/console
@@ -77,7 +79,10 @@ files:
77
79
  - tasks/deployment.rake
78
80
  - tasks/environment.rake
79
81
  - tasks/website.rake
80
- - test/watcher-example.rb
82
+ - test/tc_event.rb
83
+ - test/test_helper.rb
84
+ - test/test_watcher.rb
85
+ - test/ts_package.rb
81
86
  - website/index.html
82
87
  - website/index.txt
83
88
  - website/javascripts/rounded_corners_lite.inc.js
metadata.gz.sig CHANGED
Binary file
data/TODO DELETED
@@ -1,23 +0,0 @@
1
- CRITICAL
2
-
3
- * none
4
-
5
- MINOR
6
-
7
- * Write unit tests. This goes without saying.
8
-
9
- * Write some non-trivial example code. I have developed and ported several non-trivial utilities from Logger to Watcher, and am extremely happy with the results. Now let me get something ready to package with this gem.
10
-
11
- * Consolidation/refactoring of warnings and errors. (Principle of least surprise should be applied.) The :log fail action would now imply a warning, while a :raise implies an error. (This is not immediately intuitive.)
12
-
13
- * Trap signals to clean up properly.
14
-
15
- * Log rotation.
16
-
17
- LOW
18
-
19
- * Figure out how to get ri documentation working.
20
-
21
- * Provide a Watcher.destroy method which closes the Watcher instance and changes the @@watcher class attribute back to nil.
22
-
23
- * Validate data when attributes accessors invoked, for instance @current_indent.
@@ -1,50 +0,0 @@
1
- #!/usr/bin/ruby -w
2
- # -*- Ruby -*-
3
- # watcher-example.rb
4
- #
5
- # Summary:: Provide a quick test and demonstration of how to use the Watcher
6
- # class.
7
- # Author:: Karrick McDermott (karrick@karrick.org)
8
- # Date:: 2008-07-04
9
- # Copyright:: Copyright (c) 2008 by Karrick McDermott. All rights reserved.
10
- # License:: Simplified BSD License.
11
- ######################################################################
12
-
13
- require 'rubygems'
14
- require 'watcher'
15
-
16
- ######################################################################
17
- if $0 == __FILE__
18
- begin
19
- watcher=Watcher.create(:verbosity=>:debug, :indent=>5, :time_formatter=>lambda { Time.now.to_s })
20
-
21
- watcher.info("testing watcher",:log) do
22
- normal_directory='/'
23
- watcher.debug("inspecting normal directory [#{normal_directory}]",:log) do
24
- raise RuntimeError.new('missing root directory') unless File.directory?(normal_directory)
25
- end
26
-
27
- watcher.info("The next event will cause an exception, but it will only be logged.")
28
- bogus_filename='/bogus_file_1'
29
- watcher.debug("read bogus file [#{bogus_filename}]",[:log]) do
30
- File.open(bogus_filename,'r') { |f| puts f.readlines }
31
- end
32
-
33
- watcher.info("The next event will cause an exception, but it will be logged *and* re-raised.")
34
- bogus_filename='/bogus_file_2'
35
- watcher.debug("read bogus file [#{bogus_filename}]",[:log,:raise]) do
36
- File.open(bogus_filename,'r') { |f| puts f.readlines }
37
- end
38
-
39
- watcher.info("We won't get back to here, because the above exception was raised.")
40
- normal_directory='/'
41
- watcher.debug("inspecting normal directory [#{normal_directory}]",[:log]) do
42
- raise RuntimeError.new('missing root') unless File.directory?(normal_directory)
43
- end
44
-
45
- end
46
- rescue
47
- STDERR.puts "Received an unhandled exception: #{$!.message}"
48
- ensure
49
- end
50
- end