Permalink
Browse files

Fixed spelling mistake, now normalize_uri, was normilize_uri

* Updated normalize_uri to be protected
  • Loading branch information...
1 parent b9daabc commit b5656eafd85e90f5ce352688e6530b39cac3cac1 Dan Kubb committed Apr 14, 2008
@@ -49,16 +49,17 @@ def delete_set(repository, query)
# raise NotImplementedError
# raise ArgumentError unless block_given?
# end
-
-
- def normilize_uri(uri_or_options)
- uri_or_options
- end
def batch_insertable?
false
end
+ protected
+
+ def normalize_uri(uri_or_options)
+ uri_or_options
+ end
+
private
# Instantiate an Adapter by passing it a DataMapper::Repository
@@ -68,7 +69,7 @@ def initialize(name, uri_or_options)
raise ArgumentError, "+uri_or_options+ should be a Hash, a URI or a String but was #{uri_or_options.class}", caller unless [ Hash, URI, String ].any? { |k| k === uri_or_options }
@name = name
- @uri = normilize_uri(uri_or_options)
+ @uri = normalize_uri(uri_or_options)
@resource_naming_convention = NamingConventions::UnderscoredAndPluralized
@field_naming_convention = NamingConventions::Underscored
@@ -386,7 +386,9 @@ def property_to_column_name(model_name, property, qualify)
include SQL
- def normilize_uri(uri_or_options)
+ protected
+
+ def normalize_uri(uri_or_options)
uri_or_options = URI.parse(uri_or_options) if String === uri_or_options
return uri_or_options if URI === uri_or_options
@@ -20,12 +20,14 @@ def create_connection
return connnection
end
- def normilize_uri(uri_or_options)
- uri = super(uri_or_options)
- uri.path = File.join(Dir.pwd, File.dirname(uri.path), File.basename(uri.path)) unless File.exists?(uri.path)
- uri
+ protected
+
+ def normalize_uri(uri_or_options)
+ uri = super(uri_or_options)
+ uri.path = File.join(Dir.pwd, File.dirname(uri.path), File.basename(uri.path)) unless File.exists?(uri.path)
+ uri
end
end # class Sqlite3Adapter
-
+
end # module Adapters
end # module DataMapper
@@ -272,8 +272,8 @@ class LittleBox
:socket => 'nosock'
}
- adapter = DataMapper::Adapters::DataObjectsAdapter.allocate
- adapter.normilize_uri(options).should ==
+ adapter = DataMapper::Adapters::DataObjectsAdapter.new(:spec, options)
+ adapter.uri.should ==
URI.parse("mysql://me:mypass@davidleal.com:5000/you_can_call_me_al?socket=nosock")
end
@@ -283,12 +283,12 @@ class LittleBox
:database => 'you_can_call_me_al'
}
- adapter = DataMapper::Adapters::DataObjectsAdapter.allocate
- adapter.normilize_uri(options).should == URI.parse("mysql:///you_can_call_me_al")
+ adapter = DataMapper::Adapters::DataObjectsAdapter.new(:spec, options)
+ adapter.uri.should == URI.parse("mysql:///you_can_call_me_al")
end
it 'should accept the uri when no overrides exist' do
uri = URI.parse("protocol:///")
- DataMapper::Adapters::DataObjectsAdapter.allocate.normilize_uri(uri).should == uri
+ DataMapper::Adapters::DataObjectsAdapter.new(:spec, uri).uri.should == uri
end
end

0 comments on commit b5656ea

Please sign in to comment.