Skip to content

Commit

Permalink
Words
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwhite committed Oct 6, 2010
1 parent c2abd32 commit 03d1d05
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
2 changes: 1 addition & 1 deletion LICENSE
@@ -1,4 +1,4 @@
Copyright (c) 2009 Ian White
Copyright (c) 2010 Ian White and José Valim

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
34 changes: 20 additions & 14 deletions README.rdoc
@@ -1,24 +1,30 @@
= orm_adapter

Extraction from pickle's orm adapter
Provides a single point of entry for popular ruby ORMs. It's target audience is gem authors who want to support more than one ORM.

== Example
Currently supported ORMs are ActiveRecord, DataMapper and MongoId.


== Example of use

require 'orm_adapter'

OrmAdapter.for(User).find_first(:name => "fred")
User.to_adapter.find_first(:name => "fred")
User # is it an ActiveRecord, DM Resource, or MongoId Document?

User.to_adapter.find_first :name => 'Fred' # we don't care!

user_model = User.to_adapter
user_model.get!(1) # find a record by id
user_model.find_first(:name => 'fred') # find first fred
user_model.find_all(:name => 'fred') # find all freds
user_model.create!(:name => 'fred') # create a fred

== Note on Patches/Pull Requests

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

== History

orm_adapter is an extraction from {pickle}[http://github.com/ianwhite/pickle] by {Ian White}[http://github.com/ianwhite]. Pickle's orm adapter included work by {Daniel Neighman}[http://github.com/hassox] and {Josh Bassett}[http://github.com/nullobject]. {José Valim}[http://github.com/josevalim] suggested the extraction, and worked on the first release.


== Copyright

Copyright (c) 2010 Ian White. See LICENSE for details.
Copyright (c) 2010 Ian White and José Valim. See LICENSE for details.
8 changes: 7 additions & 1 deletion Rakefile
Expand Up @@ -24,10 +24,16 @@ begin
gem.authors = ["Ian White", "Jose Valim"]
end
Jeweler::GemcutterTasks.new

namespace :release do
desc "release to github and gemcutter"
task :all => ['release', 'gemcutter:release']
end

rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end

YARD::Rake::YardocTask.new(:doc) do |t|
t.files = ['lib/**/*.rb', 'README.rdoc', 'LICENSE']
t.files = ['lib/**/*.rb', 'README.rdoc']
end

0 comments on commit 03d1d05

Please sign in to comment.