Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* switch over to use pom.xml as primary project configuration

* made basic rake tasks work with both ruby and jruby

* rake tasks are compatible to the maven setup
  • Loading branch information...
commit ef60ed6f38336c9358dc6601499db250b46f48d5 1 parent d77f8a7
@mkristian authored
View
8 History.txt
@@ -1,3 +1,11 @@
+=== 0.5.1 / 2010-29-07
+
+* switch over to use pom.xml as primary project configuration
+
+* made basic rake tasks work with both ruby and jruby
+
+* rake tasks are compatible to the maven setup
+
=== 0.5.0 / 2010-29-06
* switch to DM version 1.0.0
View
43 Rakefile
@@ -1,26 +1,43 @@
# -*- ruby -*-
require 'rubygems'
-require 'hoe'
require 'spec'
require 'spec/rake/spectask'
-require 'pathname'
require './lib/datamapper4rails/version.rb'
-Hoe.spec('datamapper4rails') do |p|
- p.rubyforge_name = 'datamapper4rail'
- p.developer('mkristian', 'm.kristian@web.de')
- p.extra_deps = [['rack-datamapper', '~>0.3']]
- p.remote_rdoc_dir = '' # Release to root
- p.rspec_options << '--options' << 'spec/spec.opts'
+build_dir = 'target'
+
+desc 'clean up'
+task :clean do
+ FileUtils.rm_rf(build_dir)
+end
+
+desc 'Package as a gem.'
+task :package do
+ require 'fileutils'
+ gemspec = Dir['*.gemspec'].first
+ Kernel.system("#{RUBY} -S gem build #{gemspec}")
+ FileUtils.mkdir_p(build_dir)
+ gem = Dir['*.gem'].first
+ FileUtils.mv(gem, File.join(build_dir,"#{gem}"))
+ puts File.join(build_dir,"#{gem}")
end
desc 'Install the package as a gem.'
-task :install => [:clean, :package] do
- gem = Dir['pkg/*.gem'].first
- sh "gem install --local #{gem} --no-ri --no-rdoc"
+task :install => [:package] do
+ gem = Dir[File.join(build_dir, '*.gem')].first
+ extra = ENV['GEM_HOME'].nil? && ENV['GEM_PATH'].nil? ? "--user-install" : ""
+ Kernel.system("#{RUBY} -S gem install --local #{gem} --no-ri --no-rdoc #{extra}")
+end
+
+desc 'Run specifications'
+Spec::Rake::SpecTask.new(:spec) do |t|
+ if File.exists?(File.join('spec','spec.opts'))
+ t.spec_opts << '--options' << File.join('spec','spec.opts')
+ end
+ t.spec_files = Dir.glob(File.join('spec','**','*_spec.rb'))
end
desc 'generate rails using all generators and run the specs'
@@ -34,8 +51,8 @@ task :integration_tests => [:spec, :install] do
end
end
-require 'yard'
+#require 'yard'
-YARD::Rake::YardocTask.new
+#YARD::Rake::YardocTask.new
# vim: syntax=Ruby
View
6 datamapper4rails.gemspec
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
s.summary = 'collection of datamapper related extensions'
s.description = 'collection of datamapper related extensions. mostly needed to run within rails. the restful transactions is around filter for rails actions if needed to control such transaction on per action base otherwise use the rack extension from rack-datamapper. datamapper store is a session store for rails which uses datamapper as persistent layer and is just a wrapper around the datamapper session store from rack-datamapper. the generators produces datamapper models for your rails application.'
- s.homepage = 'http://datamapper4rail.rubyforge.org'
+ s.homepage = 'http://github.com/mkristian/datamapper4rails'
s.authors = ['mkristian']
s.email = ['m.kristian@web.de']
@@ -16,11 +16,13 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = ['History.txt','README.txt']
s.rdoc_options = ['--main','README.txt']
s.require_paths = ['lib']
+ s.licenses << 'MIT-LICENSE'
s.files = Dir['lib/**/*']
+ s.files += ["MIT-LICENSE"]
s.files += Dir['generators/**/*']
s.files += Dir['spec/**/*']
s.test_files += Dir['spec/**/*_spec.rb']
s.add_dependency 'rack-datamapper', '~> 0.3.0'
s.add_development_dependency 'rspec', '~> 1.3.0'
s.add_development_dependency 'rake', '0.8.7'
-end
+end
View
1  lib/datamapper4rails/.gitignore
@@ -0,0 +1 @@
+*.errors
View
2  lib/datamapper4rails/version.rb
@@ -1,3 +1,3 @@
-class Datamapper4rails
+module Datamapper4rails
VERSION = '0.5.1'.freeze
end
View
56 pom.xml
@@ -6,11 +6,11 @@
<modelVersion>4.0.0</modelVersion>
<groupId>rubygems</groupId>
<artifactId>datamapper4rails</artifactId>
- <version>0.5.1</version>
+ <version>0.5.1-SNAPSHOT</version>
<packaging>gem</packaging>
<name><![CDATA[collection of datamapper related extensions]]></name>
<description><![CDATA[collection of datamapper related extensions. mostly needed to run within rails. the restful transactions is around filter for rails actions if needed to control such transaction on per action base otherwise use the rack extension from rack-datamapper. datamapper store is a session store for rails which uses datamapper as persistent layer and is just a wrapper around the datamapper session store from rack-datamapper. the generators produces datamapper models for your rails application.]]></description>
- <url>http://datamapper4rail.rubyforge.org</url>
+ <url>http://github.com/mkristian/datamapper4rails</url>
<developers>
<developer>
<id>m.kristian</id>
@@ -19,6 +19,11 @@
</developer>
</developers>
<licenses>
+ <license>
+ <name>MIT-LICENSE</name>
+ <url>./MIT-LICENSE</url>
+ <distribution>repo</distribution>
+ </license>
</licenses>
<dependencies>
<dependency>
@@ -45,20 +50,13 @@
</dependencies>
<repositories>
<repository>
- <id>rubygems</id>
+ <id>rubygems-releases</id>
<url>http://gems.saumya.de/releases</url>
</repository>
</repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>sonatype-nexus-snapshots</id>
- <name>Sonatype Nexus Snapshots</name>
- <url>http://oss.sonatype.org/content/repositories/snapshots</url>
- </pluginRepository>
- </pluginRepositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <jruby.plugins.version>0.20.0-SNAPSHOT</jruby.plugins.version>
+ <jruby.plugins.version>0.20.0</jruby.plugins.version>
</properties>
<build>
<plugins>
@@ -67,14 +65,34 @@
<artifactId>gem-maven-plugin</artifactId>
<version>${jruby.plugins.version}</version>
<extensions>true</extensions>
- <configuration>
- <date>2010-06-20</date>
- <extraRdocFiles>History.txt,README.txt</extraRdocFiles>
- <rdocOptions>--main,README.txt</rdocOptions>
- <requirePaths>lib</requirePaths>
- <rubyforgeProject>datamapper4rail</rubyforgeProject>
- <rubygemsVersion>1.3.5</rubygemsVersion>
- </configuration>
+ <executions>
+ <execution>
+ <id>gemspec</id>
+ <goals><goal>package</goal></goals>
+ <configuration>
+ <extraRdocFiles>History.txt,README.txt</extraRdocFiles>
+ <rdocOptions>--main,README.txt</rdocOptions>
+ <rubyforgeProject>datamapper4rail</rubyforgeProject>
+ <overwriteGemspec>true</overwriteGemspec>
+ </configuration>
+ </execution>
+ <execution>
+ <id>version</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ <configuration>
+ <script>
+ version = '${project.version}'.sub(/-SNAPSHOT/, '')
+ puts "module Datamapper4rails"
+ puts " VERSION = '#{version}'.freeze"
+ puts "end"
+ </script>
+ <outputFile>lib/datamapper4rails/version.rb</outputFile>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
<plugin>
<groupId>de.saumya.mojo</groupId>
View
1  spec/spec_helper.rb
@@ -1,6 +1,7 @@
require 'rubygems'
require 'dm-core'
require 'base64'
+require 'pathname'
$LOAD_PATH << Pathname(__FILE__).dirname.parent.expand_path + 'lib'
# just define a empty abstract store
Please sign in to comment.
Something went wrong with that request. Please try again.