Skip to content
This repository has been archived by the owner on May 9, 2018. It is now read-only.

Commit

Permalink
Updated to work with Jeweler
Browse files Browse the repository at this point in the history
* Removed files no longer required after moving from Hoe to Jeweler
* Updated tasks
* Updated README
  • Loading branch information
dkubb committed Dec 15, 2009
1 parent 0a82f9d commit 6961805
Show file tree
Hide file tree
Showing 20 changed files with 411 additions and 261 deletions.
5 changes: 5 additions & 0 deletions .document
@@ -0,0 +1,5 @@
README.rdoc
lib/**/*.rb
bin/*
features/**/*.feature
LICENSE
31 changes: 20 additions & 11 deletions .gitignore
@@ -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
3 changes: 0 additions & 3 deletions History.txt

This file was deleted.

118 changes: 118 additions & 0 deletions README.rdoc
@@ -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.
114 changes: 0 additions & 114 deletions README.txt

This file was deleted.

63 changes: 35 additions & 28 deletions Rakefile
@@ -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

0 comments on commit 6961805

Please sign in to comment.