Skip to content

Commit

Permalink
Explicitly require "uri" for 1.9.2-preview3+
Browse files Browse the repository at this point in the history
* The URI namespace is not automatically loaded in 1.9.2-preview3 and above
* Moved constant declaration to the top of the class
* Froze constant (in general constants should be frozen)
* Reordered require statements for core libs to be alphabetical

[#1304 state:resolved]
  • Loading branch information
dkubb committed Jun 5, 2010
1 parent 53055ee commit f54d775
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/extlib/hash.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
require "time"
require 'bigdecimal'
require 'time'
require 'uri'

require 'extlib/object'
require 'extlib/mash'
require 'extlib/class'
require 'extlib/string'

class Hash
URI_ENCODE_PATTERN = Regexp.new("[^#{URI::PATTERN::UNRESERVED}]").freeze

class << self
# Converts valid XML into a Ruby Hash structure.
#
Expand Down Expand Up @@ -126,7 +129,6 @@ def to_params
# @return [String] This key value pair as a param
#
# @api public
URI_ENCODE_PATTERN = Regexp.new("[^#{URI::PATTERN::UNRESERVED}]")
def normalize_param(key, value)
param = ''
stack = []
Expand Down

0 comments on commit f54d775

Please sign in to comment.