PROTON-799: Added the UUID mixin for the Ruby reactive APIs.
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/eeef2578 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/eeef2578 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/eeef2578 Branch: refs/heads/ruby-engine-apis Commit: eeef257854ebca6d7f40847a59f4178a162e51fb Parents: 6fd3be8 Author: Darryl L. Pierce <mcpie...@gmail.com> Authored: Thu Feb 26 11:29:07 2015 -0500 Committer: Darryl L. Pierce <mcpie...@gmail.com> Committed: Thu May 14 15:17:31 2015 -0400 ---------------------------------------------------------------------- proton-c/bindings/ruby/lib/qpid_proton.rb | 3 +++ proton-c/bindings/ruby/lib/util/uuid.rb | 32 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/eeef2578/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 bcc7edd..80565dd 100644 --- a/proton-c/bindings/ruby/lib/qpid_proton.rb +++ b/proton-c/bindings/ruby/lib/qpid_proton.rb @@ -22,6 +22,8 @@ require "date" if RUBY_VERSION < "1.9" require "kconv" +else + require "securerandom" end # Exception classes @@ -33,6 +35,7 @@ require "util/error_handler" require "util/constants" require "util/swig_helper" require "util/engine" +require "util/uuid" # Types require "types/strings" http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/eeef2578/proton-c/bindings/ruby/lib/util/uuid.rb ---------------------------------------------------------------------- diff --git a/proton-c/bindings/ruby/lib/util/uuid.rb b/proton-c/bindings/ruby/lib/util/uuid.rb new file mode 100644 index 0000000..882715b --- /dev/null +++ b/proton-c/bindings/ruby/lib/util/uuid.rb @@ -0,0 +1,32 @@ +#-- +# 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::Util + + module UUID + + def generate_uuid + # generate a UUID based on what APIs are available with the current + # version of Ruby + SecureRandom.uuid + end + + end + +end --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org