autumn 3.1.9 → 3.1.10

Sign up to get free protection for your applications and to get access to all the features.
data/AUTHORS CHANGED
@@ -4,6 +4,7 @@ Following persons have contributed to autumn.
4
4
  113 Tim Morgan <riscfuture@gmail.com>
5
5
  29 TJ Vanderpoel <bougy.man@gmail.com>
6
6
  3 Dale Campbell <dale@save-state.net>
7
+ 3 TJ Vanderpoel <bougyman@zero.(none)>
7
8
  1 bterlson <btthalion@gmail.com>
8
9
  1 comboy <kacper.ciesla@gmail.com>
9
10
  1 Kevin Berry <KevinBerry@nrs.us>
data/CHANGELOG CHANGED
@@ -1,3 +1,15 @@
1
+ [07fcbbb | Mon May 04 18:11:53 UTC 2009] TJ Vanderpoel <bougyman@zero.(none)>
2
+
3
+ * added gitignore ignoring RIDE files
4
+
5
+ [65f3eef | Mon May 04 18:11:06 UTC 2009] TJ Vanderpoel <bougyman@zero.(none)>
6
+
7
+ * forgot to add the important changes for 3.1.10, adding now
8
+
9
+ [09a4209 | Mon May 04 18:05:49 UTC 2009] TJ Vanderpoel <bougyman@zero.(none)>
10
+
11
+ * Version 3.1.10 sets NICK_REGEX back to allowing leading special chars. Also added spec for Stem#receive, which was where the problem showed itself
12
+
1
13
  [6fa0854 | Sun May 03 20:04:59 UTC 2009] TJ Vanderpoel <bougy.man@gmail.com>
2
14
 
3
15
  * Version 3.1.9 Separated skel/ rake tasks, got rake setup to install all deps for running initial app
data/MANIFEST CHANGED
@@ -102,6 +102,7 @@ spec/coder_spec.rb
102
102
  spec/ctcp_spec.rb
103
103
  spec/daemon_spec.rb
104
104
  spec/datamapper_hacks_spec.rb
105
+ spec/stem_spec.rb
105
106
  tasks/authors.rake
106
107
  tasks/changelog.rake
107
108
  tasks/copyright.rake
@@ -2,16 +2,16 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{autumn}
5
- s.version = "3.1.9"
5
+ s.version = "3.1.10"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Tim 'riscfuture' Morgan"]
9
- s.date = %q{2009-05-03}
9
+ s.date = %q{2009-05-04}
10
10
  s.default_executable = %q{autumn}
11
11
  s.description = %q{Autumn is a simple and modular irc framework}
12
12
  s.email = %q{bougy.man@gmail.com}
13
13
  s.executables = ["autumn"]
14
- s.files = ["AUTHORS", "CHANGELOG", "MANIFEST", "README", "README.textile", "Rakefile", "autumn.gemspec", "bin/autumn", "lib/autumn.rb", "lib/autumn/authentication.rb", "lib/autumn/channel_leaf.rb", "lib/autumn/coder.rb", "lib/autumn/console_boot.rb", "lib/autumn/ctcp.rb", "lib/autumn/daemon.rb", "lib/autumn/datamapper_hacks.rb", "lib/autumn/foliater.rb", "lib/autumn/formatting.rb", "lib/autumn/generator.rb", "lib/autumn/genesis.rb", "lib/autumn/inheritable_attributes.rb", "lib/autumn/leaf.rb", "lib/autumn/log_facade.rb", "lib/autumn/misc.rb", "lib/autumn/resources/daemons/Anothernet.yml", "lib/autumn/resources/daemons/AustHex.yml", "lib/autumn/resources/daemons/Bahamut.yml", "lib/autumn/resources/daemons/Dancer.yml", "lib/autumn/resources/daemons/GameSurge.yml", "lib/autumn/resources/daemons/IRCnet.yml", "lib/autumn/resources/daemons/Ithildin.yml", "lib/autumn/resources/daemons/KineIRCd.yml", "lib/autumn/resources/daemons/PTlink.yml", "lib/autumn/resources/daemons/QuakeNet.yml", "lib/autumn/resources/daemons/RFC1459.yml", "lib/autumn/resources/daemons/RFC2811.yml", "lib/autumn/resources/daemons/RFC2812.yml", "lib/autumn/resources/daemons/RatBox.yml", "lib/autumn/resources/daemons/Ultimate.yml", "lib/autumn/resources/daemons/Undernet.yml", "lib/autumn/resources/daemons/Unreal.yml", "lib/autumn/resources/daemons/_Other.yml", "lib/autumn/resources/daemons/aircd.yml", "lib/autumn/resources/daemons/bdq-ircd.yml", "lib/autumn/resources/daemons/hybrid.yml", "lib/autumn/resources/daemons/ircu.yml", "lib/autumn/resources/daemons/tr-ircd.yml", "lib/autumn/script.rb", "lib/autumn/speciator.rb", "lib/autumn/stem.rb", "lib/autumn/stem_facade.rb", "lib/autumn/tool/bin.rb", "lib/autumn/tool/create.rb", "lib/autumn/tool/project_creator.rb", "lib/autumn/version.rb", "lib/skel/Rakefile", "lib/skel/config/global.yml", "lib/skel/config/seasons/testing/database.yml", "lib/skel/config/seasons/testing/leaves.yml", "lib/skel/config/seasons/testing/season.yml", "lib/skel/config/seasons/testing/stems.yml", "lib/skel/leaves/administrator/README", "lib/skel/leaves/administrator/controller.rb", "lib/skel/leaves/administrator/views/autumn.txt.erb", "lib/skel/leaves/administrator/views/reload.txt.erb", "lib/skel/leaves/insulter/README", "lib/skel/leaves/insulter/controller.rb", "lib/skel/leaves/insulter/views/about.txt.erb", "lib/skel/leaves/insulter/views/help.txt.erb", "lib/skel/leaves/insulter/views/insult.txt.erb", "lib/skel/leaves/scorekeeper/README", "lib/skel/leaves/scorekeeper/config.yml", "lib/skel/leaves/scorekeeper/controller.rb", "lib/skel/leaves/scorekeeper/helpers/general.rb", "lib/skel/leaves/scorekeeper/models/channel.rb", "lib/skel/leaves/scorekeeper/models/person.rb", "lib/skel/leaves/scorekeeper/models/pseudonym.rb", "lib/skel/leaves/scorekeeper/models/score.rb", "lib/skel/leaves/scorekeeper/tasks/stats.rake", "lib/skel/leaves/scorekeeper/views/about.txt.erb", "lib/skel/leaves/scorekeeper/views/change.txt.erb", "lib/skel/leaves/scorekeeper/views/history.txt.erb", "lib/skel/leaves/scorekeeper/views/points.txt.erb", "lib/skel/leaves/scorekeeper/views/usage.txt.erb", "lib/skel/log/README", "lib/skel/log/testing.log", "lib/skel/script/console", "lib/skel/script/destroy", "lib/skel/script/generate", "lib/skel/shared/README", "lib/skel/tasks/app.rake", "lib/skel/tasks/db.rake", "lib/skel/tasks/doc.rake", "lib/skel/tasks/gem_installer.rake", "lib/skel/tasks/log.rake", "lib/skel/tasks/setup.rake", "lib/skel/tasks/spec.rake", "lib/skel/tmp/README", "spec/authentication_spec.rb", "spec/channel_leaf_spec.rb", "spec/coder_spec.rb", "spec/ctcp_spec.rb", "spec/daemon_spec.rb", "spec/datamapper_hacks_spec.rb", "tasks/authors.rake", "tasks/changelog.rake", "tasks/copyright.rake", "tasks/doc.rake", "tasks/gem.rake", "tasks/gem_installer.rake", "tasks/install_dependencies.rake", "tasks/manifest.rake", "tasks/rcov.rake", "tasks/release.rake", "tasks/reversion.rake", "tasks/setup.rake", "tasks/spec.rake"]
14
+ s.files = ["AUTHORS", "CHANGELOG", "MANIFEST", "README", "README.textile", "Rakefile", "autumn.gemspec", "bin/autumn", "lib/autumn.rb", "lib/autumn/authentication.rb", "lib/autumn/channel_leaf.rb", "lib/autumn/coder.rb", "lib/autumn/console_boot.rb", "lib/autumn/ctcp.rb", "lib/autumn/daemon.rb", "lib/autumn/datamapper_hacks.rb", "lib/autumn/foliater.rb", "lib/autumn/formatting.rb", "lib/autumn/generator.rb", "lib/autumn/genesis.rb", "lib/autumn/inheritable_attributes.rb", "lib/autumn/leaf.rb", "lib/autumn/log_facade.rb", "lib/autumn/misc.rb", "lib/autumn/resources/daemons/Anothernet.yml", "lib/autumn/resources/daemons/AustHex.yml", "lib/autumn/resources/daemons/Bahamut.yml", "lib/autumn/resources/daemons/Dancer.yml", "lib/autumn/resources/daemons/GameSurge.yml", "lib/autumn/resources/daemons/IRCnet.yml", "lib/autumn/resources/daemons/Ithildin.yml", "lib/autumn/resources/daemons/KineIRCd.yml", "lib/autumn/resources/daemons/PTlink.yml", "lib/autumn/resources/daemons/QuakeNet.yml", "lib/autumn/resources/daemons/RFC1459.yml", "lib/autumn/resources/daemons/RFC2811.yml", "lib/autumn/resources/daemons/RFC2812.yml", "lib/autumn/resources/daemons/RatBox.yml", "lib/autumn/resources/daemons/Ultimate.yml", "lib/autumn/resources/daemons/Undernet.yml", "lib/autumn/resources/daemons/Unreal.yml", "lib/autumn/resources/daemons/_Other.yml", "lib/autumn/resources/daemons/aircd.yml", "lib/autumn/resources/daemons/bdq-ircd.yml", "lib/autumn/resources/daemons/hybrid.yml", "lib/autumn/resources/daemons/ircu.yml", "lib/autumn/resources/daemons/tr-ircd.yml", "lib/autumn/script.rb", "lib/autumn/speciator.rb", "lib/autumn/stem.rb", "lib/autumn/stem_facade.rb", "lib/autumn/tool/bin.rb", "lib/autumn/tool/create.rb", "lib/autumn/tool/project_creator.rb", "lib/autumn/version.rb", "lib/skel/Rakefile", "lib/skel/config/global.yml", "lib/skel/config/seasons/testing/database.yml", "lib/skel/config/seasons/testing/leaves.yml", "lib/skel/config/seasons/testing/season.yml", "lib/skel/config/seasons/testing/stems.yml", "lib/skel/leaves/administrator/README", "lib/skel/leaves/administrator/controller.rb", "lib/skel/leaves/administrator/views/autumn.txt.erb", "lib/skel/leaves/administrator/views/reload.txt.erb", "lib/skel/leaves/insulter/README", "lib/skel/leaves/insulter/controller.rb", "lib/skel/leaves/insulter/views/about.txt.erb", "lib/skel/leaves/insulter/views/help.txt.erb", "lib/skel/leaves/insulter/views/insult.txt.erb", "lib/skel/leaves/scorekeeper/README", "lib/skel/leaves/scorekeeper/config.yml", "lib/skel/leaves/scorekeeper/controller.rb", "lib/skel/leaves/scorekeeper/helpers/general.rb", "lib/skel/leaves/scorekeeper/models/channel.rb", "lib/skel/leaves/scorekeeper/models/person.rb", "lib/skel/leaves/scorekeeper/models/pseudonym.rb", "lib/skel/leaves/scorekeeper/models/score.rb", "lib/skel/leaves/scorekeeper/tasks/stats.rake", "lib/skel/leaves/scorekeeper/views/about.txt.erb", "lib/skel/leaves/scorekeeper/views/change.txt.erb", "lib/skel/leaves/scorekeeper/views/history.txt.erb", "lib/skel/leaves/scorekeeper/views/points.txt.erb", "lib/skel/leaves/scorekeeper/views/usage.txt.erb", "lib/skel/log/README", "lib/skel/log/testing.log", "lib/skel/script/console", "lib/skel/script/destroy", "lib/skel/script/generate", "lib/skel/shared/README", "lib/skel/tasks/app.rake", "lib/skel/tasks/db.rake", "lib/skel/tasks/doc.rake", "lib/skel/tasks/gem_installer.rake", "lib/skel/tasks/log.rake", "lib/skel/tasks/setup.rake", "lib/skel/tasks/spec.rake", "lib/skel/tmp/README", "spec/authentication_spec.rb", "spec/channel_leaf_spec.rb", "spec/coder_spec.rb", "spec/ctcp_spec.rb", "spec/daemon_spec.rb", "spec/datamapper_hacks_spec.rb", "spec/stem_spec.rb", "tasks/authors.rake", "tasks/changelog.rake", "tasks/copyright.rake", "tasks/doc.rake", "tasks/gem.rake", "tasks/gem_installer.rake", "tasks/install_dependencies.rake", "tasks/manifest.rake", "tasks/rcov.rake", "tasks/release.rake", "tasks/reversion.rake", "tasks/setup.rake", "tasks/spec.rake"]
15
15
  s.has_rdoc = true
16
16
  s.homepage = %q{http://github.com/bougyman/autumn}
17
17
  s.post_install_message = %q{============================================================
@@ -160,7 +160,7 @@ module Autumn
160
160
  # can vary from server to server. (See channel?)
161
161
  CHANNEL_REGEX = "[^\\s\\x7,:]+"
162
162
  # The default regular expression for IRC nicknames.
163
- NICK_REGEX = "[a-zA-Z][a-zA-Z0-9\\-_\\[\\]\\{\\}\\\\|`\\^]+"
163
+ NICK_REGEX = "[a-zA-Z0-9\\-_\\[\\]\\{\\}\\\\|`\\^]+"
164
164
 
165
165
  # A parameter in an IRC command.
166
166
 
@@ -317,7 +317,7 @@ module Autumn
317
317
  @throttle_threshold = opts[:throttle_threshold]
318
318
  @throttle_threshold ||= 5
319
319
 
320
- @nick_regex = (opts[:nick_regex] ? opts[:nick_regex].to_re : NICK_REGEX)
320
+ @nick_regex = (opts[:nick_regex] ? opts[:nick_regex] : NICK_REGEX)
321
321
 
322
322
  @channels = Set.new
323
323
  @channels.merge opts[:channels] if opts[:channels]
@@ -725,6 +725,7 @@ module Autumn
725
725
  ann :irc_nick_event, :stem_sync => true # So methods that synchronize can be guaranteed the channel variables are up to date
726
726
 
727
727
  def irc_quit_event(stem, sender, arguments) # :nodoc:
728
+ puts sender.inspect
728
729
  @chan_mutex.synchronize do
729
730
  @channel_members.each { |chan, members| members.delete sender[:nick] }
730
731
  #TODO what should we do if we are in the middle of receiving NAMES replies?
@@ -1,3 +1,3 @@
1
1
  module Autumn
2
- VERSION = "3.1.9"
2
+ VERSION = "3.1.10"
3
3
  end
@@ -0,0 +1,109 @@
1
+ require 'logger'
2
+ require 'set'
3
+
4
+ require 'autumn'
5
+ require 'autumn/genesis'
6
+
7
+ gen = Autumn::Genesis.new
8
+ gen.load_libraries
9
+ gen.load_daemon_info
10
+
11
+ describe Autumn::Stem do
12
+ before :all do
13
+ #TODO how do we stub these methods?
14
+ Autumn::Leaf.class_eval do
15
+ def irc_privmsg_event(*args); true; end
16
+ def irc_join_event(*args); true; end
17
+ def irc_part_event(*args); true; end
18
+ def irc_mode_event(*args); true; end
19
+ def irc_topic_event(*args); true; end
20
+ def irc_invite_event(*args); true; end
21
+ def irc_kick_event(*args); true; end
22
+ def irc_notice_event(*args); true; end
23
+ end
24
+ end
25
+
26
+
27
+
28
+ describe "when an irc message is received" do
29
+
30
+ before :all do
31
+ class Autumn::Stem;public :receive;end
32
+ @logger = Autumn::LogFacade.new Logger.new(STDOUT), 'Stem', 'Stem Spec'
33
+ @stem = Autumn::Stem.new('irc.mockserver.com', 'MockStem', { :logger => @logger, :channels => [ '#listening', '#notlistening' ]})
34
+ Autumn::Foliater.instance.stems['Mock'] = @stem
35
+ @sender_hash = { :nick => 'nick', :host => 'ca.us.host.com', :user => 'user' }
36
+ end
37
+
38
+ describe "And it is a quit event" do
39
+ describe "With a valid quit message" do
40
+
41
+ before :all do
42
+ @resp = @stem.receive(":Towzzer!bowzer@bowzzer.com QUIT :Remote host closed the connection")
43
+ end
44
+
45
+ it "should be a Hash" do
46
+ @resp.should be_an_instance_of(Hash)
47
+ end
48
+
49
+ it "should populate :irc_quit_event" do
50
+ @resp.should have_key(:irc_quit_event)
51
+ @resp[:irc_quit_event].should be_an_instance_of(Array)
52
+ end
53
+
54
+ it "should have 3 arguments to :irc_quit_event" do
55
+ @resp[:irc_quit_event].should have(3).items
56
+ end
57
+
58
+ it "should have an Autumn::Stem as :irc_quit_event's first item" do
59
+ @resp[:irc_quit_event].first.should be_an_instance_of(Autumn::Stem)
60
+ end
61
+
62
+ it "should have a sender hash as :irc_quit_event's second item" do
63
+ @resp[:irc_quit_event][1].should be_an_instance_of(Hash)
64
+ @resp[:irc_quit_event][1].keys.should include(:nick, :user, :host)
65
+ end
66
+
67
+ it "should have a message hash as :irc_quit_event's second item" do
68
+ @resp[:irc_quit_event][2].should be_an_instance_of(Hash)
69
+ @resp[:irc_quit_event][2].keys.should include(:message)
70
+ end
71
+ end
72
+
73
+ describe "With no quit message" do
74
+
75
+ before :all do
76
+ @resp = @stem.receive(":_anm!n=_anm@69.85.248.2 QUIT :Read error: 110 (Connection timed out)")
77
+ end
78
+
79
+ it "should be a Hash" do
80
+ @resp.should be_an_instance_of(Hash)
81
+ end
82
+
83
+ it "should populate :irc_quit_event" do
84
+ @resp.should have_key(:irc_quit_event)
85
+ @resp[:irc_quit_event].should be_an_instance_of(Array)
86
+ end
87
+
88
+ it "should have 3 arguments to :irc_quit_event" do
89
+ @resp[:irc_quit_event].should have(3).items
90
+ end
91
+
92
+ it "should have an Autumn::Stem as :irc_quit_event's first item" do
93
+ @resp[:irc_quit_event].first.should be_an_instance_of(Autumn::Stem)
94
+ end
95
+
96
+ it "should have a sender hash as :irc_quit_event's second item" do
97
+ @resp[:irc_quit_event][1].should be_an_instance_of(Hash)
98
+ @resp[:irc_quit_event][1].keys.should include(:nick, :user, :host)
99
+ end
100
+
101
+ it "should have a message hash as :irc_quit_event's second item" do
102
+ @resp[:irc_quit_event][2].should be_an_instance_of(Hash)
103
+ @resp[:irc_quit_event][2].keys.should include(:message)
104
+ end
105
+ end
106
+
107
+ end
108
+ end
109
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autumn
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.9
4
+ version: 3.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim 'riscfuture' Morgan
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-03 00:00:00 -05:00
12
+ date: 2009-05-04 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -165,6 +165,7 @@ files:
165
165
  - spec/ctcp_spec.rb
166
166
  - spec/daemon_spec.rb
167
167
  - spec/datamapper_hacks_spec.rb
168
+ - spec/stem_spec.rb
168
169
  - tasks/authors.rake
169
170
  - tasks/changelog.rake
170
171
  - tasks/copyright.rake