[Groonga-commit] groonga/groonga at 431bfbb [master] mrb: add Context#with_command_version

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jul 6 22:55:54 JST 2015


Kouhei Sutou	2015-07-06 22:55:54 +0900 (Mon, 06 Jul 2015)

  New Revision: 431bfbb390d9bac90726c01c158e52c1511d6c31
  https://github.com/groonga/groonga/commit/431bfbb390d9bac90726c01c158e52c1511d6c31

  Message:
    mrb: add Context#with_command_version

  Modified files:
    lib/mrb/scripts/context.rb

  Modified: lib/mrb/scripts/context.rb (+10 -0)
===================================================================
--- lib/mrb/scripts/context.rb    2015-07-06 22:39:26 +0900 (e65d665)
+++ lib/mrb/scripts/context.rb    2015-07-06 22:55:54 +0900 (4d8419f)
@@ -34,6 +34,16 @@ module Groonga
       logger.log_error(error)
     end
 
+    def with_command_version(version)
+      old_version = command_version
+      begin
+        self.command_version = version
+        yield
+      ensure
+        self.command_version = old_version
+      end
+    end
+
     private
     def set_error_raw(rc, error_level, message, backtrace)
       self.rc = rc.to_i
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index