gossip 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/History.txt +9 -0
  2. data/LICENSE.txt +34 -0
  3. data/Manifest.txt +62 -0
  4. data/README.txt +6 -0
  5. data/Rakefile +137 -0
  6. data/examples/all-config-file-choices.yml +36 -0
  7. data/lib/gossip.rb +32 -0
  8. data/lib/gossip/command.rb +122 -0
  9. data/lib/gossip/cronies/campfire.rb +72 -0
  10. data/lib/gossip/cronies/jabber.rb +66 -0
  11. data/lib/gossip/cronies/smtp.rb +121 -0
  12. data/lib/gossip/cronies/stdout.rb +24 -0
  13. data/lib/gossip/cronies/trac.rb +82 -0
  14. data/lib/gossip/cronies/twitter.rb +50 -0
  15. data/lib/gossip/crony.rb +102 -0
  16. data/lib/gossip/multi-exceptions.rb +47 -0
  17. data/lib/gossip/preteen.rb +86 -0
  18. data/lib/gossip/site-config.rb +94 -0
  19. data/lib/gossip/social-universe.rb +18 -0
  20. data/lib/gossip/version.rb +8 -0
  21. data/pages/classes.html +58 -0
  22. data/pages/cronies.html +256 -0
  23. data/pages/css/LICENSE.txt +1 -0
  24. data/pages/css/Thumbs.db +0 -0
  25. data/pages/css/bg2.gif +0 -0
  26. data/pages/css/gossip5-header-flip.jpg +0 -0
  27. data/pages/css/left.gif +0 -0
  28. data/pages/css/left_on.gif +0 -0
  29. data/pages/css/main.css +242 -0
  30. data/pages/css/right.gif +0 -0
  31. data/pages/css/right_on.gif +0 -0
  32. data/pages/css/tvline.gif +0 -0
  33. data/pages/images/campfire.png +0 -0
  34. data/pages/images/classes.png +0 -0
  35. data/pages/images/deployment.png +0 -0
  36. data/pages/images/jabber-big.png +0 -0
  37. data/pages/images/jabber.png +0 -0
  38. data/pages/images/trac-bigger.png +0 -0
  39. data/pages/images/trac-detail.png +0 -0
  40. data/pages/images/twitter.png +0 -0
  41. data/pages/index.html +45 -0
  42. data/pages/installation.html +95 -0
  43. data/pages/scripts.html +166 -0
  44. data/pages/src/classes.graffle +0 -0
  45. data/pages/starting-to-use.html +200 -0
  46. data/pages/writing-new-scripts.html +38 -0
  47. data/scripts/fanout +64 -0
  48. data/scripts/svntell +71 -0
  49. data/scripts/watchdog +86 -0
  50. data/setup.rb +1585 -0
  51. data/test/script/fanout-slowtests.rb +40 -0
  52. data/test/script/svntell-slowtests.rb +40 -0
  53. data/test/script/util.rb +22 -0
  54. data/test/script/watchdog-slowtests.rb +56 -0
  55. data/test/unit/command-crony-interaction-tests.rb +116 -0
  56. data/test/unit/command-tests.rb +119 -0
  57. data/test/unit/crony-tests.rb +46 -0
  58. data/test/unit/multi-exception-tests.rb +70 -0
  59. data/test/unit/preteen-tests.rb +81 -0
  60. data/test/util/bff.rb +45 -0
  61. data/test/util/doghouse.rb +42 -0
  62. data/test/util/silly-little-test-program.rb +6 -0
  63. metadata +181 -0
@@ -0,0 +1,81 @@
1
+ require 'test/unit'
2
+ require 's4t-utils'
3
+ include S4tUtils
4
+ set_test_paths(__FILE__)
5
+
6
+ require 'gossip'
7
+
8
+
9
+ class PreteenTests < Test::Unit::TestCase
10
+ include Gossip
11
+
12
+ class SilentCrony < Crony
13
+ attr_reader :scandal, :details
14
+
15
+ def name; "silent"; end
16
+ def symbol; :silent; end
17
+
18
+ def hear(scandal, details)
19
+ @scandal = scandal
20
+ @details = details
21
+ end
22
+ end
23
+
24
+ class WhiningCrony < Crony
25
+ def name; "whiner"; end
26
+ def symbol; :whiner; end
27
+
28
+ def hear(scandal, details)
29
+ raise StandardError.new("whine: #{scandal}")
30
+ end
31
+ end
32
+
33
+ def make(crony_class, init)
34
+ prog1(crony_class.new) do | crony |
35
+ crony.user_choices = init
36
+ end
37
+ end
38
+
39
+ def test_preteen_fails_nicely_when_given_bad_cronies
40
+ assert_raises_with_matching_message(StandardError, /:wrong_crony is not a known crony/) {
41
+ Preteen.new({}, [:wrong_crony], [])
42
+ }
43
+ assert_raises_with_matching_message(StandardError, /:wrong_crony is not a known crony/) {
44
+ Preteen.new({}, [], [:wrong_crony])
45
+ }
46
+ end
47
+
48
+
49
+ def test_preteen_tells_bffs
50
+ silent = make(SilentCrony, :silent => true)
51
+ whiner = make(WhiningCrony, :whiner => false)
52
+
53
+ preteen = Preteen.new
54
+ preteen.accept(silent, whiner)
55
+ preteen.tell_bffs('scandal', 'details')
56
+
57
+ assert_equal('scandal', silent.scandal)
58
+ assert_equal('details', silent.details)
59
+ end
60
+
61
+ def test_preteen_gathers_failures
62
+ preteen = Preteen.new
63
+ silent = make(SilentCrony, :silent => true)
64
+ preteen.accept(make(WhiningCrony, :whiner => true),
65
+ silent,
66
+ make(WhiningCrony, :whiner => true),
67
+ make(WhiningCrony, :whiner => true))
68
+ preteen.tell_bffs('fact', 'embellishments')
69
+ rescue MultiException => ex
70
+ messages = ex.message.split("\n")
71
+ # Three whining messages
72
+ assert_equal(3, messages.grep(/Complaint from whiner: whine: fact \(StandardError\)/).length)
73
+ # But failures don't interfere with success.
74
+ assert_equal('fact', silent.scandal)
75
+ assert_equal('embellishments', silent.details)
76
+ else
77
+ fail("No exception thrown.")
78
+ end
79
+
80
+
81
+ end
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Created by Brian Marick on 2007-09-17.
4
+ # Copyright (c) 2007. All rights reserved.
5
+
6
+ #!/usr/bin/env ruby
7
+ #
8
+ # Created by Brian Marick on 2007-09-15.
9
+ # Copyright (c) 2007. All rights reserved.
10
+
11
+ require 'gossip/crony'
12
+
13
+ module Gossip
14
+ class OneTestCrony < Crony
15
+
16
+ def initialize(*args)
17
+ super
18
+ @value = nil # silence warnings
19
+ end
20
+
21
+ def name; "bff"; end
22
+ def symbol; :bff; end
23
+
24
+ def command_line_description
25
+ ['-b', "--bff", "Defaults to #{is_bff_by_default?}."]
26
+ end
27
+
28
+ def add_configuration_choices(builder)
29
+ builder.add_choice(:bff_format_string,
30
+ :default => checked(:default_format_string)) { | command_line |
31
+ command_line.uses_option("--bff-format STRING",
32
+ df(:default_format_string)
33
+ )
34
+ }
35
+ end
36
+
37
+ def hear(scandal, details)
38
+ @value = format(@user_choices[:bff_format_string], scandal, details)
39
+ end
40
+
41
+ def value
42
+ @value || "#{name} was not told!"
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Created by Brian Marick on 2007-09-17.
4
+ # Copyright (c) 2007. All rights reserved.
5
+
6
+
7
+ require 'gossip/crony'
8
+
9
+ module Gossip
10
+ class AnotherTestCrony < Crony
11
+
12
+ def initialize(*args)
13
+ super
14
+ @value = nil # silence warnings
15
+ end
16
+
17
+ def name; "doghouse crony"; end
18
+ def symbol; :doghouse; end
19
+
20
+ def command_line_description
21
+ ['-d', "--doghouse", "Defaults to #{is_bff_by_default?}."]
22
+ end
23
+
24
+ def add_configuration_choices(builder)
25
+ builder.add_choice(:doghouse_format_string,
26
+ :default => checked(:default_format_string)) { | command_line |
27
+ command_line.uses_option("--doghouse-format STRING",
28
+ df(:default_format_string)
29
+ )
30
+ }
31
+ end
32
+
33
+ def hear(scandal, details)
34
+ @value = format(@user_choices[:doghouse_format_string], scandal, details)
35
+ end
36
+
37
+ def value
38
+ @value || "#{name} was not told!"
39
+ end
40
+
41
+ end
42
+ end
@@ -0,0 +1,6 @@
1
+ puts 'I am a silly little program.'
2
+ puts 'Here are my arguments:'
3
+ puts " #{ARGV.join(' ')}"
4
+ puts "I mostly write to standard output."
5
+ $stdout.flush
6
+ $stderr.puts "I also write to standard error."
metadata ADDED
@@ -0,0 +1,181 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.0
3
+ specification_version: 1
4
+ name: gossip
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.3.0
7
+ date: 2007-09-28 00:00:00 -05:00
8
+ summary: Library to broadcast messages to multiple destinations + scripts that use it
9
+ require_paths:
10
+ - lib
11
+ email: marick@exampler.com
12
+ homepage: http://gossip.rubyforge.org
13
+ rubyforge_project: gossip
14
+ description: Library to broadcast messages to multiple destinations + scripts that use it
15
+ autorequire:
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ post_install_message:
29
+ authors:
30
+ - Brian Marick
31
+ files:
32
+ - History.txt
33
+ - LICENSE.txt
34
+ - Manifest.txt
35
+ - README.txt
36
+ - Rakefile
37
+ - examples/all-config-file-choices.yml
38
+ - lib/gossip.rb
39
+ - lib/gossip/command.rb
40
+ - lib/gossip/cronies/campfire.rb
41
+ - lib/gossip/cronies/jabber.rb
42
+ - lib/gossip/cronies/smtp.rb
43
+ - lib/gossip/cronies/stdout.rb
44
+ - lib/gossip/cronies/trac.rb
45
+ - lib/gossip/cronies/twitter.rb
46
+ - lib/gossip/crony.rb
47
+ - lib/gossip/multi-exceptions.rb
48
+ - lib/gossip/preteen.rb
49
+ - lib/gossip/site-config.rb
50
+ - lib/gossip/social-universe.rb
51
+ - lib/gossip/version.rb
52
+ - pages/classes.html
53
+ - pages/cronies.html
54
+ - pages/css/LICENSE.txt
55
+ - pages/css/Thumbs.db
56
+ - pages/css/bg2.gif
57
+ - pages/css/gossip5-header-flip.jpg
58
+ - pages/css/left.gif
59
+ - pages/css/left_on.gif
60
+ - pages/css/main.css
61
+ - pages/css/right.gif
62
+ - pages/css/right_on.gif
63
+ - pages/css/tvline.gif
64
+ - pages/images/campfire.png
65
+ - pages/images/classes.png
66
+ - pages/images/deployment.png
67
+ - pages/images/jabber-big.png
68
+ - pages/images/jabber.png
69
+ - pages/images/trac-bigger.png
70
+ - pages/images/trac-detail.png
71
+ - pages/images/twitter.png
72
+ - pages/index.html
73
+ - pages/installation.html
74
+ - pages/scripts.html
75
+ - pages/src/classes.graffle
76
+ - pages/starting-to-use.html
77
+ - pages/writing-new-scripts.html
78
+ - scripts/fanout
79
+ - scripts/svntell
80
+ - scripts/watchdog
81
+ - setup.rb
82
+ - test/script/fanout-slowtests.rb
83
+ - test/script/svntell-slowtests.rb
84
+ - test/script/util.rb
85
+ - test/script/watchdog-slowtests.rb
86
+ - test/unit/command-crony-interaction-tests.rb
87
+ - test/unit/command-tests.rb
88
+ - test/unit/crony-tests.rb
89
+ - test/unit/multi-exception-tests.rb
90
+ - test/unit/preteen-tests.rb
91
+ - test/util/bff.rb
92
+ - test/util/doghouse.rb
93
+ - test/util/silly-little-test-program.rb
94
+ test_files:
95
+ - test/script/fanout-slowtests.rb
96
+ - test/script/svntell-slowtests.rb
97
+ - test/script/watchdog-slowtests.rb
98
+ - test/unit/command-crony-interaction-tests.rb
99
+ - test/unit/command-tests.rb
100
+ - test/unit/crony-tests.rb
101
+ - test/unit/multi-exception-tests.rb
102
+ - test/unit/preteen-tests.rb
103
+ rdoc_options:
104
+ - --main
105
+ - README.txt
106
+ extra_rdoc_files:
107
+ - History.txt
108
+ - LICENSE.txt
109
+ - Manifest.txt
110
+ - README.txt
111
+ - pages/css/LICENSE.txt
112
+ executables: []
113
+
114
+ extensions: []
115
+
116
+ requirements: []
117
+
118
+ dependencies:
119
+ - !ruby/object:Gem::Dependency
120
+ name: s4t-utils
121
+ version_requirement:
122
+ version_requirements: !ruby/object:Gem::Version::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: 1.0.3
127
+ version:
128
+ - !ruby/object:Gem::Dependency
129
+ name: xmpp4r
130
+ version_requirement:
131
+ version_requirements: !ruby/object:Gem::Version::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ version: 0.3.1
136
+ version:
137
+ - !ruby/object:Gem::Dependency
138
+ name: tinder
139
+ version_requirement:
140
+ version_requirements: !ruby/object:Gem::Version::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: 0.1.4
145
+ version:
146
+ - !ruby/object:Gem::Dependency
147
+ name: snitch
148
+ version_requirement:
149
+ version_requirements: !ruby/object:Gem::Version::Requirement
150
+ requirements:
151
+ - - ">="
152
+ - !ruby/object:Gem::Version
153
+ version: 0.1.1
154
+ version:
155
+ - !ruby/object:Gem::Dependency
156
+ name: twitter
157
+ version_requirement:
158
+ version_requirements: !ruby/object:Gem::Version::Requirement
159
+ requirements:
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: 0.2.0
163
+ version:
164
+ - !ruby/object:Gem::Dependency
165
+ name: user-choices
166
+ version_requirement:
167
+ version_requirements: !ruby/object:Gem::Version::Requirement
168
+ requirements:
169
+ - - ">="
170
+ - !ruby/object:Gem::Version
171
+ version: 1.1.4
172
+ version:
173
+ - !ruby/object:Gem::Dependency
174
+ name: hoe
175
+ version_requirement:
176
+ version_requirements: !ruby/object:Gem::Version::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: 1.3.0
181
+ version: