This repository has been archived by the owner on May 9, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removed files no longer required after moving from Hoe to Jeweler * Updated tasks * Updated README
- Loading branch information
Showing
20 changed files
with
411 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
README.rdoc | ||
lib/**/*.rb | ||
bin/* | ||
features/**/*.feature | ||
LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
*.log | ||
log/* | ||
doc | ||
cov | ||
pkg | ||
## MAC OS | ||
.DS_Store | ||
coverage.html | ||
coverage/* | ||
*.db | ||
|
||
## TEXTMATE | ||
*.tmproj | ||
tmtags | ||
|
||
## EMACS | ||
*~ | ||
\#* | ||
_Yardoc | ||
.yardoc | ||
tmp/* | ||
.\#* | ||
|
||
## VIM | ||
*.swp | ||
|
||
## PROJECT::GENERAL | ||
coverage | ||
rdoc | ||
pkg | ||
tmp | ||
|
||
## PROJECT::SPECIFIC |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
= dm-ambition | ||
|
||
DataMapper::Ambition is a plugin that provides an Ambition-like API for | ||
accessing DataMapper models. | ||
|
||
== Installation | ||
|
||
With Rubygems: | ||
|
||
$ sudo gem install dm-ambition | ||
$ irb -rubygems | ||
>> require 'dm-core' | ||
>> require 'dm-ambition' | ||
=> true | ||
|
||
With git and local working copy: | ||
|
||
$ git clone git://github.com/dkubb/dm-ambition.git | ||
$ cd dm-ambition | ||
$ rake build && sudo rake install | ||
$ irb -rubygems | ||
>> require 'dm-core' | ||
>> require 'dm-ambition' | ||
=> true | ||
|
||
== Examples | ||
|
||
# with == operator | ||
User.select { |u| u.name == 'Dan Kubb' } | ||
|
||
# with =~ operator | ||
User.select { |u| u.name =~ /Dan Kubb/ } | ||
|
||
# with > operator | ||
User.select { |u| u.id > 1 } | ||
|
||
# with >= operator | ||
User.select { |u| u.id >= 1 } | ||
|
||
# with < operator | ||
User.select { |u| u.id < 1 } | ||
|
||
# with <= operator | ||
User.select { |u| u.id <= 1 } | ||
|
||
# with < operator | ||
User.select { |u| u.id < 1 } | ||
|
||
# with receiver.attribute.nil? | ||
User.select { |u| u.id.nil? } | ||
|
||
# with nil bind value | ||
User.select { |u| u.id == nil } | ||
|
||
# with true bind value | ||
User.select { |u| u.admin == true } | ||
|
||
# with false bind value | ||
User.select { |u| u.admin == false } | ||
|
||
# with AND conditions | ||
User.select { |u| u.id == 1 && u.name == 'Dan Kubb' } | ||
|
||
# with negated conditions | ||
User.select { |u| !(u.id == 1) } | ||
|
||
# with double-negated conditions | ||
User.select { |u| !(!(u.id == 1)) } | ||
|
||
# with receiver matching | ||
User.select { |u| u == user } | ||
|
||
# using send on receiver | ||
User.select { |u| u.send(:name) == 'Dan Kubb' } | ||
|
||
# with Array#include? | ||
User.select { |u| user_ids.include?(u.id) } | ||
|
||
# with Range#include? | ||
User.select { |u| (1..10).include?(u.id) } | ||
|
||
# with Hash#key? | ||
User.select { |u| { 1 => 'Dan Kubb' }.key?(u.id) } | ||
|
||
# with Hash#value? | ||
User.select { |u| { 'Dan Kubb' => 1 }.value?(u.id) } | ||
|
||
# with receiver and Array#include? | ||
User.select { |u| users.include?(u) } | ||
|
||
# with receiver and Hash#key? | ||
User.select { |u| { user => 'Dan Kubb' }.key?(u) } | ||
|
||
# with receiver and Hash#value? | ||
User.select { |u| { 'Dan Kubb' => user }.value?(u) } | ||
|
||
== License | ||
|
||
Copyright (c) 2009 Dan Kubb | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,38 @@ | ||
require 'pathname' | ||
require 'rubygems' | ||
require 'rake' | ||
|
||
ROOT = Pathname(__FILE__).dirname.expand_path | ||
JRUBY = RUBY_PLATFORM =~ /java/ | ||
WINDOWS = Gem.win_platform? | ||
SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS']) | ||
|
||
require ROOT + 'lib/dm-ambition/version' | ||
|
||
AUTHOR = 'Dan Kubb' | ||
EMAIL = 'dan.kubb [a] gmail [d] com' | ||
GEM_NAME = 'dm-ambition' | ||
GEM_VERSION = DataMapper::Ambition::VERSION | ||
GEM_DEPENDENCIES = [ | ||
[ 'dm-core', '~>0.10' ], | ||
[ 'ParseTree', '~>3.0' ], | ||
[ 'ruby2ruby', '~>1.2' ], | ||
] | ||
|
||
GEM_CLEAN = %w[ log pkg coverage ] | ||
GEM_EXTRAS = { :has_rdoc => true, :extra_rdoc_files => %w[ README.txt LICENSE TODO History.txt ] } | ||
|
||
PROJECT_NAME = 'dm-ambition' | ||
PROJECT_URL = "http://github.com/dkubb/#{GEM_NAME}" | ||
PROJECT_DESCRIPTION = PROJECT_SUMMARY = 'DataMapper plugin providing an Ambition-like API' | ||
|
||
#[ ROOT, ROOT.parent ].each do |dir| | ||
[ ROOT ].each do |dir| | ||
Pathname.glob(dir.join('tasks/**/*.rb').to_s).each { |f| require f } | ||
require File.expand_path('../lib/dm-ambition/version', __FILE__) | ||
|
||
begin | ||
gem 'jeweler', '~> 1.4' | ||
require 'jeweler' | ||
|
||
Jeweler::Tasks.new do |gem| | ||
gem.name = 'dm-ambition' | ||
gem.summary = 'DataMapper plugin providing an Ambition-like API' | ||
gem.description = gem.summary | ||
gem.email = 'dan.kubb@gmail.com' | ||
gem.homepage = 'http://github.com/dkubb/%s' % gem.name | ||
gem.authors = [ 'Dan Kubb' ] | ||
|
||
gem.version = DataMapper::Ambition::VERSION | ||
|
||
gem.rubyforge_project = 'dm-ambition' | ||
|
||
gem.add_dependency 'dm-core', '~> 0.10.2' | ||
gem.add_dependency 'ParseTree', '~> 3.0.4' | ||
gem.add_dependency 'ruby2ruby', '~> 1.2.4' | ||
|
||
gem.add_development_dependency 'rspec', '~> 1.2.9' | ||
gem.add_development_dependency 'yard', '~> 0.4.0' | ||
end | ||
|
||
Jeweler::GemcutterTasks.new | ||
Jeweler::RubyforgeTasks.new do |rubyforge| | ||
rubyforge.doc_task = 'yardoc' | ||
end | ||
|
||
FileList['tasks/**/*.rake'].each { |task| import task } | ||
rescue LoadError | ||
puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler' | ||
end |
Oops, something went wrong.