* riece-ruby.el: Moved add-on stuff to riece-eval-ruby.el.
authorueno <ueno>
Thu, 11 Aug 2005 08:18:07 +0000 (08:18 +0000)
committerueno <ueno>
Thu, 11 Aug 2005 08:18:07 +0000 (08:18 +0000)
* riece-eval-ruby.el: New add-on.
* COMPILE (riece-modules): Add riece-eval-ruby.
* Makefile.am (EXTRA_DIST): Add riece-eval-ruby.el.

lisp/COMPILE
lisp/ChangeLog
lisp/Makefile.am
lisp/riece-eval-ruby.el [new file with mode: 0644]
lisp/riece-ruby.el

index 0215da6..ba93344 100644 (file)
@@ -77,7 +77,8 @@
                riece-toolbar
                riece-eval
                riece-google
-               riece-keepalive))))
+               riece-keepalive
+               riece-eval-ruby))))
 
 (defvar riece-icons
   '("riece-command-quit.xpm"
index 9723310..eac74b6 100644 (file)
@@ -1,5 +1,13 @@
 2005-08-11  Daiki Ueno  <ueno@unixuser.org>
 
+       * riece-ruby.el: Moved add-on stuff to riece-eval-ruby.el.
+
+       * riece-eval-ruby.el: New add-on.
+       * COMPILE (riece-modules): Add riece-eval-ruby.
+       * Makefile.am (EXTRA_DIST): Add riece-eval-ruby.el.
+
+2005-08-11  Daiki Ueno  <ueno@unixuser.org>
+
        * server.rb (Server::unescape): Fixed.
 
        * riece-ruby.el: Implement add-on API.
index bacc2da..c185dda 100644 (file)
@@ -16,7 +16,7 @@ EXTRA_DIST = COMPILE ChangeLog ChangeLog.Liece \
        riece-lsdb.el riece-xface.el riece-ctlseq.el riece-ignore.el \
        riece-hangman.el riece-biff.el riece-kakasi.el riece-foolproof.el \
        riece-yank.el riece-toolbar.el riece-eval.el riece-google.el \
-       riece-keepalive.el url-riece.el \
+       riece-keepalive.el riece-eval-ruby.el url-riece.el \
        riece-command-previous-channel.xpm riece-command-next-channel.xpm \
        riece-submit-bug-report.xpm \
        server.rb
diff --git a/lisp/riece-eval-ruby.el b/lisp/riece-eval-ruby.el
new file mode 100644 (file)
index 0000000..21ff25d
--- /dev/null
@@ -0,0 +1,52 @@
+(require 'riece-ruby)
+(require 'riece-message)
+
+(defvar riece-eval-ruby-enabled nil)
+
+(defconst riece-eval-ruby-description
+  "Evaluate an input string as Ruby program.")
+
+(defun riece-eval-ruby-exit-handler (name)
+  (riece-ruby-inspect name)
+  (let* ((data (copy-sequence riece-ruby-data))
+        (length (length data))
+        (index 0))
+    (while (< index length)
+      (if (eq (aref data index) ?\n)
+         (aset data index ? ))
+      (setq index (1+ index)))
+    (riece-send-string
+     (format "NOTICE %s :%s\r\n"
+            (riece-identity-prefix
+             (riece-ruby-property name 'riece-eval-ruby-target))
+            data))
+    (riece-display-message
+     (riece-make-message (riece-current-nickname)
+                        (riece-ruby-property name 'riece-eval-ruby-target)
+                        data
+                        'notice))))
+
+(defun riece-eval-ruby-display-message-function (message)
+  (if (and riece-eval-ruby-enabled
+          (riece-message-own-p message)
+          (string-match "^,ruby\\s-+" (riece-message-text message)))
+      (let ((name (riece-ruby-execute
+                  (substring (riece-message-text message)
+                             (match-end 0)))))
+       (riece-ruby-set-property name
+                                'riece-eval-ruby-target
+                                (riece-message-target message))
+       (riece-ruby-set-exit-handler name
+                                    #'riece-eval-ruby-exit-handler))))
+
+(defun riece-eval-ruby-insinuate ()
+  (add-hook 'riece-after-display-message-functions
+           'riece-eval-ruby-display-message-function))
+
+(defun riece-eval-ruby-enable ()
+  (setq riece-eval-ruby-enabled t))
+
+(defun riece-eval-ruby-disable ()
+  (setq riece-eval-ruby-enabled nil))
+
+(provide 'riece-eval-ruby)
\ No newline at end of file
index fe5c6f1..d56bc62 100644 (file)
@@ -93,11 +93,6 @@ Use `riece-ruby-set-exit-handler' to set this variable.")
   "An alist mapping from program name to the property list.
 Use `riece-ruby-set-property' to set this variable.")
 
-(defvar riece-ruby-enabled nil)
-
-(defconst riece-ruby-description
-  "Evaluate an input string as Ruby program.")
-
 (defun riece-ruby-substitute-variables (program alist)
   (setq program (copy-sequence program))
   (while alist
@@ -321,49 +316,6 @@ Use `riece-ruby-set-property' to set this variable.")
 (defun riece-ruby-property (name property)
   (cdr (assoc property (cdr (assoc name riece-ruby-property-alist)))))
 
-(defun riece-ruby-exit-handler (name)
-  (riece-ruby-inspect name)
-  (let* ((data (copy-sequence riece-ruby-data))
-        (length (length data))
-        (index 0))
-    (while (< index length)
-      (if (eq (aref data index) ?\n)
-         (aset data index ? ))
-      (setq index (1+ index)))
-    (riece-send-string
-     (format "NOTICE %s :%s\r\n"
-            (riece-identity-prefix
-             (riece-ruby-property name 'riece-ruby-target))
-            data))
-    (riece-display-message
-     (riece-make-message (riece-current-nickname)
-                        (riece-ruby-property name 'riece-ruby-target)
-                        data
-                        'notice))))
-
-(defun riece-ruby-display-message-function (message)
-  (if (and riece-ruby-enabled
-          (riece-message-own-p message)
-          (string-match "^,ruby\\s-+" (riece-message-text message)))
-      (let ((name (riece-ruby-execute
-                  (substring (riece-message-text message)
-                             (match-end 0)))))
-       (riece-ruby-set-property name
-                                'riece-ruby-target
-                                (riece-message-target message))
-       (riece-ruby-set-exit-handler name
-                                    #'riece-ruby-exit-handler))))
-
-(defun riece-ruby-insinuate ()
-  (add-hook 'riece-after-display-message-functions
-           'riece-ruby-display-message-function))
-
-(defun riece-ruby-enable ()
-  (setq riece-ruby-enabled t))
-
-(defun riece-ruby-disable ()
-  (setq riece-ruby-enabled nil))
-
 (provide 'riece-ruby)
 
 ;;; riece-ruby.el ends here