lib/dionysus/configuration.rb in dionysus-1.0.1 vs lib/dionysus/configuration.rb in dionysus-1.0.2

- old
+ new

@@ -1,6 +1,7 @@ require 'dionysus' +require 'dionysus/version_string' ## # = Configuration # # require 'dionysus/configuration' @@ -115,10 +116,14 @@ ## # +true+ if the key is valid. def valid_key?( key ) return false if key.blank? key = _normalize_key(key).to_s - key =~ /^#{VALID_KEY}$/ and !self.methods.include?(key.to_sym) + if RUBY_VERSION.satisfies?('>= 1.9.2') + key =~ /^#{VALID_KEY}$/ and !self.methods.include?(key.to_sym) + else + key =~ /^#{VALID_KEY}$/ and !self.methods.include?(key) + end end ## # +true+ if the key is allowed. def allowed_key?( key )