You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2017/11/30 21:42:40 UTC

[09/12] qpid-proton git commit: PROTON-1064: [ruby] Move Condition to core

PROTON-1064: [ruby] Move Condition to core


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/15c804c7
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/15c804c7
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/15c804c7

Branch: refs/heads/master
Commit: 15c804c7a7a2206ed94a5557bc95a4913a3261ae
Parents: 0f03d82
Author: Alan Conway <ac...@redhat.com>
Authored: Wed Nov 22 15:04:01 2017 -0500
Committer: Alan Conway <ac...@redhat.com>
Committed: Thu Nov 30 16:36:26 2017 -0500

----------------------------------------------------------------------
 proton-c/bindings/ruby/lib/core/condition.rb | 65 +++++++++++++++++++++++
 proton-c/bindings/ruby/lib/qpid_proton.rb    |  2 +-
 proton-c/bindings/ruby/lib/util/condition.rb | 65 -----------------------
 3 files changed, 66 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/15c804c7/proton-c/bindings/ruby/lib/core/condition.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/core/condition.rb b/proton-c/bindings/ruby/lib/core/condition.rb
new file mode 100644
index 0000000..2b0e1bf
--- /dev/null
+++ b/proton-c/bindings/ruby/lib/core/condition.rb
@@ -0,0 +1,65 @@
+#--
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#++
+
+module Qpid::Proton
+
+  class Condition
+
+    attr_reader :name, :description, :info
+
+    def initialize(name, description = nil, info = nil)
+      @name = name
+      @description = description
+      @info = info
+    end
+
+    def to_s() "#{@name}: #{@description}"; end
+
+    def inspect() "#{self.class.name}(#{@name.inspect}, #{@description.inspect}, #{@info.inspect})"; end
+
+    def ==(other)
+      ((other.is_a? Condition) &&
+       (other.name == self.name) &&
+       (other.description == self.description) &&
+       (other.info == self.info))
+    end
+
+    # Make a condition.
+    # @param obj the object to turn into a condition
+    # @param default_name condition name to use if obj does not imply a name
+    # @return
+    # - when Condition return obj unchanged
+    # - when Exception return Condition(obj.class.name, obj.to_s)
+    # - when nil then nil
+    # - else return Condition(default_name, obj.to_s)
+    def self.make(obj, default_name="proton")
+      case obj
+      when Condition then obj
+      when Exception then Condition.new(obj.class.name, obj.to_s)
+      when nil then nil
+      else Condition.new(default_name, obj.to_s)
+      end
+    end
+
+  end
+
+  module Util                   #TODO aconway 2017-10-28: backwards compat
+    Condition = Qpid::Proton::Condition
+  end
+end

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/15c804c7/proton-c/bindings/ruby/lib/qpid_proton.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/qpid_proton.rb b/proton-c/bindings/ruby/lib/qpid_proton.rb
index cf1a01f..62e308b 100644
--- a/proton-c/bindings/ruby/lib/qpid_proton.rb
+++ b/proton-c/bindings/ruby/lib/qpid_proton.rb
@@ -41,7 +41,6 @@ require "util/version"
 require "util/error_handler"
 require "util/constants"
 require "util/swig_helper"
-require "util/condition"
 require "util/wrapper"
 require "util/class_wrapper"
 require "util/engine"
@@ -65,6 +64,7 @@ require "event/event"
 require "event/collector"
 
 # Main Proton classes
+require "core/condition"
 require "core/uri"
 require "core/message"
 require "core/endpoint"

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/15c804c7/proton-c/bindings/ruby/lib/util/condition.rb
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/lib/util/condition.rb b/proton-c/bindings/ruby/lib/util/condition.rb
deleted file mode 100644
index 1cb307a..0000000
--- a/proton-c/bindings/ruby/lib/util/condition.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-#--
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#++
-
-module Qpid::Proton
-
-  class Condition
-
-    attr_reader :name, :description, :info
-
-    def initialize(name, description = nil, info = nil)
-      @name = name
-      @description = description
-      @info = info
-    end
-
-    def to_s() "#{@name}: #{@description}"; end
-
-    def inspect() "#{self.class.name}(#{@name.inspect}, #{@description.inspect}, #{@info.inspect})"; end
-
-    def ==(other)
-      ((other.is_a? Condition) &&
-       (other.name == self.name) && 
-       (other.description == self.description) &&
-       (other.info == self.info))
-    end
-
-    # Make a condition.
-    # @param obj the object to turn into a condition
-    # @param default_name condition name to use if obj does not imply a name
-    # @return
-    # - when Condition return obj unchanged
-    # - when Exception return Condition(obj.class.name, obj.to_s)
-    # - when nil then nil
-    # - else return Condition(default_name, obj.to_s)
-    def self.make(obj, default_name="proton")
-      case obj
-      when Condition then obj
-      when Exception then Condition.new(obj.class.name, obj.to_s)
-      when nil then nil
-      else Condition.new(default_name, obj.to_s)
-      end
-    end
-
-  end
-
-  module Util                   #TODO aconway 2017-10-28: backwards compat
-    Condition = Qpid::Proton::Condition
-  end
-end


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org