right_support 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
| @@ -123,13 +123,19 @@ module RightSupport::Data | |
| 123 123 | 
             
                # === Parameters
         | 
| 124 124 | 
             
                # @param [Hash] original hash to clone
         | 
| 125 125 | 
             
                #
         | 
| 126 | 
            +
                # === Block
         | 
| 127 | 
            +
                # @yieldparam [Object] value of leaf
         | 
| 128 | 
            +
                # @yieldreturn [Object] cloned value of leaf or original value
         | 
| 129 | 
            +
                #
         | 
| 126 130 | 
             
                # === Return
         | 
| 127 131 | 
             
                # @return [Hash] deep cloned hash
         | 
| 128 | 
            -
                def self.deep_clone(original)
         | 
| 132 | 
            +
                def self.deep_clone(original, &leaf_callback)
         | 
| 129 133 | 
             
                  result = original.clone
         | 
| 130 134 | 
             
                  result.each do |k, v|
         | 
| 131 135 | 
             
                    if hashable?(v)
         | 
| 132 136 | 
             
                      result[k] = deep_clone(v)
         | 
| 137 | 
            +
                    elsif leaf_callback
         | 
| 138 | 
            +
                      result[k] = leaf_callback.call(v)
         | 
| 133 139 | 
             
                    elsif v.respond_to?(:duplicable?)
         | 
| 134 140 | 
             
                      result[k] = (v.duplicable? ? v.clone : v)
         | 
| 135 141 | 
             
                    else
         | 
| @@ -1,3 +1,6 @@ | |
| 1 | 
            +
            require 'openssl'
         | 
| 2 | 
            +
            require 'openssl/ssl'
         | 
| 3 | 
            +
             | 
| 1 4 | 
             
            module RightSupport::Net
         | 
| 2 5 | 
             
              module SSL
         | 
| 3 6 | 
             
                # A helper module that provides monkey patch for OpenSSL::SSL.verify_certificate_identity method.
         | 
| @@ -7,13 +10,12 @@ module RightSupport::Net | |
| 7 10 | 
             
                # verify_certificate_identity method, to change the SSL algorythm of hostname verification.
         | 
| 8 11 | 
             
                module OpenSSLPatch
         | 
| 9 12 | 
             
                  class << self
         | 
| 10 | 
            -
                     | 
| 13 | 
            +
                    @enabled = false
         | 
| 11 14 |  | 
| 12 15 | 
             
                    def enable!
         | 
| 13 | 
            -
                      return if  | 
| 14 | 
            -
                       | 
| 16 | 
            +
                      return if @enabled
         | 
| 17 | 
            +
                      @enabled = true
         | 
| 15 18 |  | 
| 16 | 
            -
                      require 'openssl'
         | 
| 17 19 | 
             
                      OpenSSL::SSL.module_exec do
         | 
| 18 20 | 
             
                        def verify_certificate_identity(cert, hostname)
         | 
| 19 21 | 
             
                          if RightSupport::Net::SSL::OpenSSLPatch.enabled?
         | 
| @@ -55,11 +57,11 @@ module RightSupport::Net | |
| 55 57 | 
             
                    end
         | 
| 56 58 |  | 
| 57 59 | 
             
                    def disable!
         | 
| 58 | 
            -
                       | 
| 60 | 
            +
                      @enabled = false
         | 
| 59 61 | 
             
                    end
         | 
| 60 62 |  | 
| 61 63 | 
             
                    def enabled?
         | 
| 62 | 
            -
                       | 
| 64 | 
            +
                      @enabled
         | 
| 63 65 | 
             
                    end
         | 
| 64 66 | 
             
                  end
         | 
| 65 67 | 
             
                end
         | 
| @@ -178,7 +178,7 @@ module RightSupport | |
| 178 178 | 
             
                  all[0..-2].inject("") { |a, (str, sep)| a + str + sep + "\n" } + all[-1][0]
         | 
| 179 179 | 
             
                end
         | 
| 180 180 |  | 
| 181 | 
            -
                # Format  | 
| 181 | 
            +
                # Format time value in local time
         | 
| 182 182 | 
             
                #
         | 
| 183 183 | 
             
                # === Parameters
         | 
| 184 184 | 
             
                # time(Integer):: Time in seconds in Unix-epoch to be formatted
         | 
    
        data/right_support.gemspec
    CHANGED
    
    | @@ -7,8 +7,8 @@ spec = Gem::Specification.new do |s| | |
| 7 7 | 
             
              s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
         | 
| 8 8 |  | 
| 9 9 | 
             
              s.name    = 'right_support'
         | 
| 10 | 
            -
              s.version = '2.3. | 
| 11 | 
            -
              s.date    = '2012- | 
| 10 | 
            +
              s.version = '2.3.1'
         | 
| 11 | 
            +
              s.date    = '2012-07-12'
         | 
| 12 12 |  | 
| 13 13 | 
             
              s.authors = ['Tony Spataro', 'Sergey Sergyenko', 'Ryan Williamson', 'Lee Kirchhoff', 'Sergey Enin']
         | 
| 14 14 | 
             
              s.email   = 'support@rightscale.com'
         | 
    
        metadata
    CHANGED
    
    | @@ -1,13 +1,13 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: right_support
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            -
              hash:  | 
| 4 | 
            +
              hash: 1
         | 
| 5 5 | 
             
              prerelease: false
         | 
| 6 6 | 
             
              segments: 
         | 
| 7 7 | 
             
              - 2
         | 
| 8 8 | 
             
              - 3
         | 
| 9 | 
            -
              -  | 
| 10 | 
            -
              version: 2.3. | 
| 9 | 
            +
              - 1
         | 
| 10 | 
            +
              version: 2.3.1
         | 
| 11 11 | 
             
            platform: ruby
         | 
| 12 12 | 
             
            authors: 
         | 
| 13 13 | 
             
            - Tony Spataro
         | 
| @@ -19,7 +19,7 @@ autorequire: | |
| 19 19 | 
             
            bindir: bin
         | 
| 20 20 | 
             
            cert_chain: []
         | 
| 21 21 |  | 
| 22 | 
            -
            date: 2012- | 
| 22 | 
            +
            date: 2012-07-12 00:00:00 -07:00
         | 
| 23 23 | 
             
            default_executable: 
         | 
| 24 24 | 
             
            dependencies: []
         | 
| 25 25 |  |