muby 0.7.13 → 0.7.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ require 'ncurses'
4
4
  module Muby
5
5
 
6
6
 
7
- VERSION = "0.7.13" unless defined?(Muby::VERSION)
7
+ VERSION = "0.7.14" unless defined?(Muby::VERSION)
8
8
 
9
9
  #
10
10
  # The class that encapsulates all configuration.
@@ -102,6 +102,8 @@ module Muby
102
102
 
103
103
  @gags = []
104
104
 
105
+ @colors = {}
106
+
105
107
  @anti_gags = []
106
108
 
107
109
  @remote_substitutions = {}
@@ -405,11 +405,21 @@ class Muby::Connection
405
405
  return_value
406
406
  end
407
407
 
408
+ def colorize(s)
409
+ conf.colors.each do |reg, colors|
410
+ return colors if s.match(reg)
411
+ end
412
+ return ["", ""]
413
+ end
414
+
408
415
  def display_buffer
409
416
  unless @showBuffer.empty?
410
417
  if !gag(@matchBuffer) || nongag(@matchBuffer)
411
418
  @showBuffer = substitute(@showBuffer, conf.remote_substitutions)
412
419
  Muby::Completer.get_instance.store(@matchBuffer) if conf.feed_completer_with_input
420
+ pre, post = colorize(@matchBuffer)
421
+ @showBuffer.unshift pre
422
+ @showBuffer.push post
413
423
  @outputWindow.print(*@showBuffer)
414
424
  end
415
425
  @showBuffer = []
@@ -3,6 +3,7 @@ module Muby
3
3
  module Help
4
4
  def self.configuration
5
5
  {
6
+ :colors => "A Hash where the keys are regular expressions that the output is matched against, and the values are two-element-Arrays where the first element is what will be prepended to the output line and the second element what will be appended to the output line matching.",
6
7
  :connect_timeout => "The number of seconds we will try to connect before giving up.",
7
8
  :single_shot_gags => "The gags that will only be used once and then discarded. Usually created by triggers.",
8
9
  :feed_completer_with_history => "If true, the completion command will use history to calculate possible completions.",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.13
4
+ version: 0.7.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Kihlgren, Sy Ali
@@ -9,11 +9,12 @@ autorequire: muby
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-30 00:00:00 +02:00
12
+ date: 2008-11-11 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ncurses
17
+ type: :runtime
17
18
  version_requirement:
18
19
  version_requirements: !ruby/object:Gem::Requirement
19
20
  requirements:
@@ -34,15 +35,15 @@ files:
34
35
  - lib/muby/logger.rb
35
36
  - lib/muby/style.rb
36
37
  - lib/muby/user_methods.rb
37
- - lib/muby/helper_methods.rb
38
38
  - lib/muby/application.rb
39
- - lib/muby/user_window.rb
40
39
  - lib/muby/configuration.rb
41
40
  - lib/muby/inputwindow.rb
42
41
  - lib/muby/help.rb
43
42
  - lib/muby/outputwindow.rb
44
43
  - lib/muby/completer.rb
45
44
  - lib/muby/displayer.rb
45
+ - lib/muby/helper_methods.rb
46
+ - lib/muby/user_window.rb
46
47
  - lib/muby/trigger.rb
47
48
  - lib/muby.rb
48
49
  - contrib/aardmud.org_4000/aliases/aard-aliases.rb
@@ -91,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
92
  requirements: []
92
93
 
93
94
  rubyforge_project:
94
- rubygems_version: 1.1.1
95
+ rubygems_version: 1.2.0
95
96
  signing_key:
96
97
  specification_version: 2
97
98
  summary: A simple but powerful mud client.