From nobody at rubyforge.org Tue Feb 26 05:07:51 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 26 Feb 2008 05:07:51 -0500 (EST) Subject: [Muby-submits] [261] trunk/lib/muby: fixed config file not being found if muby is called outside $HOME. Message-ID: <20080226100751.E115118585E6@rubyforge.org> Revision: 261 Author: zond Date: 2008-02-26 05:07:51 -0500 (Tue, 26 Feb 2008) Log Message: ----------- fixed config file not being found if muby is called outside $HOME. fixed broken displaying of lines not terminated with newline. Modified Paths: -------------- trunk/lib/muby/configuration.rb trunk/lib/muby/connection.rb Modified: trunk/lib/muby/configuration.rb =================================================================== --- trunk/lib/muby/configuration.rb 2007-11-15 09:49:44 UTC (rev 260) +++ trunk/lib/muby/configuration.rb 2008-02-26 10:07:51 UTC (rev 261) @@ -272,8 +272,10 @@ # def load_user_files! @loaded_rc_file = false - if to_load = [".mubyrc", "mubyrc"].find do |file_name| - File.exists?(File.join(ENV["HOME"], file_name)) + if to_load = [".mubyrc", "mubyrc"].collect do |file_name| + File.join(ENV["HOME"], file_name) + end.find do |file_name| + File.exists?(file_name) end nice_load!(to_load) @loaded_rc_file = to_load Modified: trunk/lib/muby/connection.rb =================================================================== --- trunk/lib/muby/connection.rb 2007-11-15 09:49:44 UTC (rev 260) +++ trunk/lib/muby/connection.rb 2008-02-26 10:07:51 UTC (rev 261) @@ -232,7 +232,7 @@ @showBuffer.push(style) end end - elsif ! conf.broken_keycodes.include?(c) + elsif !conf.broken_keycodes.include?(c) # # This is not telnet command OR ansi, lets treat it as nice MUD text! # @@ -263,9 +263,6 @@ while select([@socket],nil,nil,1) && c = getc handle(c) end - if conf.flush - display_buffer - end end status("Connection closed by remote end") @inputWindow.disconnect @@ -284,12 +281,14 @@ def manage_buffers(c) trigger(@matchBuffer, conf.remote_character_triggers, true) - if c == 10 - trigger(@matchBuffer, conf.remote_triggers, false) + if c == 10 || conf.flush display_buffer - @matchBuffer = "" - @used_triggers = {} @showBuffer = [] + if c == 10 + trigger(@matchBuffer, conf.remote_triggers, false) + @matchBuffer = "" + @used_triggers = {} + end end end From nobody at rubyforge.org Tue Feb 26 05:08:31 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 26 Feb 2008 05:08:31 -0500 (EST) Subject: [Muby-submits] [262] trunk/lib/muby/configuration.rb: bumped version number Message-ID: <20080226100831.B363418585E6@rubyforge.org> Revision: 262 Author: zond Date: 2008-02-26 05:08:31 -0500 (Tue, 26 Feb 2008) Log Message: ----------- bumped version number Modified Paths: -------------- trunk/lib/muby/configuration.rb Modified: trunk/lib/muby/configuration.rb =================================================================== --- trunk/lib/muby/configuration.rb 2008-02-26 10:07:51 UTC (rev 261) +++ trunk/lib/muby/configuration.rb 2008-02-26 10:08:31 UTC (rev 262) @@ -4,7 +4,7 @@ module Muby - VERSION = "0.7.4" unless defined?(Muby::VERSION) + VERSION = "0.7.5" unless defined?(Muby::VERSION) # # The class that encapsulates all configuration. From nobody at rubyforge.org Tue Feb 26 05:09:07 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Tue, 26 Feb 2008 05:09:07 -0500 (EST) Subject: [Muby-submits] [263] tags/release_0_7_5/: made new release Message-ID: <20080226100907.6075E18585E6@rubyforge.org> Revision: 263 Author: zond Date: 2008-02-26 05:09:07 -0500 (Tue, 26 Feb 2008) Log Message: ----------- made new release Added Paths: ----------- tags/release_0_7_5/ Copied: tags/release_0_7_5 (from rev 262, trunk) From nobody at rubyforge.org Wed Feb 27 05:52:08 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 27 Feb 2008 05:52:08 -0500 (EST) Subject: [Muby-submits] [264] trunk/lib/muby: added more support for the telnet protocol to enable certain behaviours ( go ahead command, for example). Message-ID: <20080227105208.8F6E418585F3@rubyforge.org> Revision: 264 Author: zond Date: 2008-02-27 05:52:08 -0500 (Wed, 27 Feb 2008) Log Message: ----------- added more support for the telnet protocol to enable certain behaviours (go ahead command, for example). bumped version number. Modified Paths: -------------- trunk/lib/muby/configuration.rb trunk/lib/muby/connection.rb Modified: trunk/lib/muby/configuration.rb =================================================================== --- trunk/lib/muby/configuration.rb 2008-02-26 10:09:07 UTC (rev 263) +++ trunk/lib/muby/configuration.rb 2008-02-27 10:52:08 UTC (rev 264) @@ -4,7 +4,7 @@ module Muby - VERSION = "0.7.5" unless defined?(Muby::VERSION) + VERSION = "0.7.6" unless defined?(Muby::VERSION) # # The class that encapsulates all configuration. Modified: trunk/lib/muby/connection.rb =================================================================== --- trunk/lib/muby/connection.rb 2008-02-26 10:09:07 UTC (rev 263) +++ trunk/lib/muby/connection.rb 2008-02-27 10:52:08 UTC (rev 264) @@ -150,15 +150,68 @@ c end + TELNET_COMMANDS = { + 240 => :end_of_sub_negotiation, + 241 => :noop, + 242 => :data_mark, + 243 => :break, + 249 => :go_ahead, + 250 => :sub_negotiation, + 251 => :will, + 252 => :wont, + 253 => :do, + 254 => :dont, + 255 => :iac + } + + # + # This is not telnet command OR ansi, lets treat it as nice MUD text! + # + # Debug about it, add it to match buffer, add it to show buffer and show if we want to show. + # Then check it for triggers. + # + def handle_regular_character(c) + @matchBuffer = @matchBuffer + c.chr + append_show_buffer(c.chr) + manage_buffers(c) + end + def handle(c) # # The telnet support (just so we dont explode or something) # - # We are just plain ignoring it atm. + # We are just plain ignoring most of it atm. # - if c == 255 # telnet interpret as command (IAC) - c = getc # get the request (DO|DONT) - c = getc # get the latest part whatever that is + if TELNET_COMMANDS[c] == :iac # this is an "interpret as command" + c = getc + if (next_command = TELNET_COMMANDS[c]) == :iac # if the next one as well is an iac, we actually want to display a 255 + handle_regular_character(c) + else + case next_command + when :do # ignore the option negotiation + c = getc + when :dont # ignore the option negotiation + c = getc + when :will # ignore the option negotiation + c = getc + when :wont # ignore the option negotiation + c = getc + when :noop # waf? + # do nothing + when :data_mark + warn("Got a data_mark (TELNET protocol) which I don't know how to handle. Expect strange behaviour...") + when :break + warn("Got a break (TELNET protocol) which I don't know how to handle. Expect strange behaviour...") + when :go_ahead + display_buffer # on a go ahead the server obviously wants us to display the @displayBuffer regardless of our conf.flush setting + when :sub_negotiation # we just skip ahead to the end of the sub negotiation + while TELNET_COMMANDS[c] != :end_of_sub_negotiation + c = getc + end + else + warn("Got an unknown TELNET command (#{c.chr}) which I don't know how to handle. Expect strange behaviour...") + end + end elsif c == 27 # escape char! this is probably some ANSI color or shite c = getc if c.chr == "[" # this is an ansi-something that is more than one char long @@ -233,15 +286,7 @@ end end elsif !conf.broken_keycodes.include?(c) - # - # This is not telnet command OR ansi, lets treat it as nice MUD text! - # - # Debug about it, add it to match buffer, add it to show buffer and show if we want to show. - # Then check it for triggers. - # - @matchBuffer = @matchBuffer + c.chr - append_show_buffer(c.chr) - manage_buffers(c) + handle_regular_character(c) end end @@ -283,7 +328,6 @@ trigger(@matchBuffer, conf.remote_character_triggers, true) if c == 10 || conf.flush display_buffer - @showBuffer = [] if c == 10 trigger(@matchBuffer, conf.remote_triggers, false) @matchBuffer = "" From nobody at rubyforge.org Wed Feb 27 05:52:44 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Wed, 27 Feb 2008 05:52:44 -0500 (EST) Subject: [Muby-submits] [265] tags/release_0_7_6/: created new release Message-ID: <20080227105245.0643C18585A7@rubyforge.org> Revision: 265 Author: zond Date: 2008-02-27 05:52:44 -0500 (Wed, 27 Feb 2008) Log Message: ----------- created new release Added Paths: ----------- tags/release_0_7_6/ Copied: tags/release_0_7_6 (from rev 264, trunk)