[Groonga-commit] groonga/groonga-command at 1cecab3 [master] Follow command name change of thread_limit

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Aug 18 23:39:09 JST 2015


Kouhei Sutou	2015-08-18 23:39:09 +0900 (Tue, 18 Aug 2015)

  New Revision: 1cecab359022ad66c8b95f5b69407278c855ebff
  https://github.com/groonga/groonga-command/commit/1cecab359022ad66c8b95f5b69407278c855ebff

  Message:
    Follow command name change of thread_limit

  Modified files:
    lib/groonga/command.rb
  Renamed files:
    lib/groonga/command/thread-limit.rb
      (from lib/groonga/command/thread-count.rb)
    test/command/test-thread-limit.rb
      (from test/command/test-thread-count.rb)

  Modified: lib/groonga/command.rb (+1 -1)
===================================================================
--- lib/groonga/command.rb    2015-08-14 16:42:39 +0900 (7a53e15)
+++ lib/groonga/command.rb    2015-08-18 23:39:09 +0900 (a853d60)
@@ -54,6 +54,6 @@ require "groonga/command/table-list"
 require "groonga/command/table-remove"
 require "groonga/command/table-rename"
 require "groonga/command/table-tokenize"
-require "groonga/command/thread-count"
+require "groonga/command/thread-limit"
 require "groonga/command/tokenize"
 require "groonga/command/truncate"

  Renamed: lib/groonga/command/thread-limit.rb (+7 -12) 74%
===================================================================
--- lib/groonga/command/thread-count.rb    2015-08-14 16:42:39 +0900 (4b53385)
+++ lib/groonga/command/thread-limit.rb    2015-08-18 23:39:09 +0900 (3444420)
@@ -18,30 +18,25 @@ require "groonga/command/base"
 
 module Groonga
   module Command
-    # A command class that represents `thread_count` command.
+    # A command class that represents `thread_limit` command.
     #
     # @since 1.1.3
-    class ThreadCount < Base
-      Command.register("thread_count", self)
+    class ThreadLimit < Base
+      Command.register("thread_limit", self)
 
       class << self
         def parameter_names
           [
-            :new_count,
+            :max,
           ]
         end
       end
 
-      # @return [Integer] `new_count` parameter value.
+      # @return [Integer] `max` parameter value.
       #
       # @since 1.1.3
-      def new_count
-        count = self[:new_count]
-        if count
-          Integer(count)
-        else
-          nil
-        end
+      def max
+        integer_value(:max)
       end
     end
   end

  Renamed: test/command/test-thread-limit.rb (+9 -9) 72%
===================================================================
--- test/command/test-thread-count.rb    2015-08-14 16:42:39 +0900 (90ce9b8)
+++ test/command/test-thread-limit.rb    2015-08-18 23:39:09 +0900 (06afcbf)
@@ -14,30 +14,30 @@
 # License along with this library; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
-class ThreadCountCommandTest < Test::Unit::TestCase
+class ThreadLimitCommandTest < Test::Unit::TestCase
   private
-  def thread_count_command(pair_arguments={}, ordered_arguments=[])
-    Groonga::Command::ThreadCount.new("thread_count",
+  def thread_limit_command(pair_arguments={}, ordered_arguments=[])
+    Groonga::Command::ThreadLimit.new("thread_limit",
                                       pair_arguments,
                                       ordered_arguments)
   end
 
   class ConstructorTest < self
     def test_ordered_arguments
-      new_count = "1"
+      max = "1"
 
-      command = thread_count_command({}, [new_count])
+      command = thread_limit_command({}, [max])
       assert_equal({
-                     :new_count => new_count,
+                     :max => max,
                    },
                    command.arguments)
     end
   end
 
-  class NewCountTest < self
+  class MaxTest < self
     def test_reader
-      command = thread_count_command(:new_count => "1")
-      assert_equal(1, command.new_count)
+      command = thread_limit_command(:max => "1")
+      assert_equal(1, command.max)
     end
   end
 end
-------------- next part --------------
HTML����������������������������...
Télécharger 



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