Skip to content

Commit

Permalink
* switch over to use pom.xml as primary project configuration
Browse files Browse the repository at this point in the history
* made basic rake tasks work with both ruby and jruby

* rake tasks are compatible to the maven setup
  • Loading branch information
mkristian committed Jul 29, 2010
1 parent d77f8a7 commit ef60ed6
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 35 deletions.
8 changes: 8 additions & 0 deletions History.txt
Original file line number Original file line Diff line number Diff line change
@@ -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 === 0.5.0 / 2010-29-06


* switch to DM version 1.0.0 * switch to DM version 1.0.0
Expand Down
43 changes: 30 additions & 13 deletions Rakefile
Original file line number Original file line Diff line number Diff line change
@@ -1,26 +1,43 @@
# -*- ruby -*- # -*- ruby -*-


require 'rubygems' require 'rubygems'
require 'hoe'


require 'spec' require 'spec'
require 'spec/rake/spectask' require 'spec/rake/spectask'
require 'pathname'


require './lib/datamapper4rails/version.rb' require './lib/datamapper4rails/version.rb'


Hoe.spec('datamapper4rails') do |p| build_dir = 'target'
p.rubyforge_name = 'datamapper4rail'
p.developer('mkristian', 'm.kristian@web.de') desc 'clean up'
p.extra_deps = [['rack-datamapper', '~>0.3']] task :clean do
p.remote_rdoc_dir = '' # Release to root FileUtils.rm_rf(build_dir)
p.rspec_options << '--options' << 'spec/spec.opts' 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 end


desc 'Install the package as a gem.' desc 'Install the package as a gem.'
task :install => [:clean, :package] do task :install => [:package] do
gem = Dir['pkg/*.gem'].first gem = Dir[File.join(build_dir, '*.gem')].first
sh "gem install --local #{gem} --no-ri --no-rdoc" 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 end


desc 'generate rails using all generators and run the specs' desc 'generate rails using all generators and run the specs'
Expand All @@ -34,8 +51,8 @@ task :integration_tests => [:spec, :install] do
end end
end end


require 'yard' #require 'yard'


YARD::Rake::YardocTask.new #YARD::Rake::YardocTask.new


# vim: syntax=Ruby # vim: syntax=Ruby
6 changes: 4 additions & 2 deletions datamapper4rails.gemspec
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Gem::Specification.new do |s|


s.summary = 'collection of datamapper related extensions' 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.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.authors = ['mkristian']
s.email = ['m.kristian@web.de'] s.email = ['m.kristian@web.de']
Expand All @@ -16,11 +16,13 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = ['History.txt','README.txt'] s.extra_rdoc_files = ['History.txt','README.txt']
s.rdoc_options = ['--main','README.txt'] s.rdoc_options = ['--main','README.txt']
s.require_paths = ['lib'] s.require_paths = ['lib']
s.licenses << 'MIT-LICENSE'
s.files = Dir['lib/**/*'] s.files = Dir['lib/**/*']
s.files += ["MIT-LICENSE"]
s.files += Dir['generators/**/*'] s.files += Dir['generators/**/*']
s.files += Dir['spec/**/*'] s.files += Dir['spec/**/*']
s.test_files += Dir['spec/**/*_spec.rb'] s.test_files += Dir['spec/**/*_spec.rb']
s.add_dependency 'rack-datamapper', '~> 0.3.0' s.add_dependency 'rack-datamapper', '~> 0.3.0'
s.add_development_dependency 'rspec', '~> 1.3.0' s.add_development_dependency 'rspec', '~> 1.3.0'
s.add_development_dependency 'rake', '0.8.7' s.add_development_dependency 'rake', '0.8.7'
end end
1 change: 1 addition & 0 deletions lib/datamapper4rails/.gitignore
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
*.errors
2 changes: 1 addition & 1 deletion lib/datamapper4rails/version.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,3 @@
class Datamapper4rails module Datamapper4rails
VERSION = '0.5.1'.freeze VERSION = '0.5.1'.freeze
end end
56 changes: 37 additions & 19 deletions pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>rubygems</groupId> <groupId>rubygems</groupId>
<artifactId>datamapper4rails</artifactId> <artifactId>datamapper4rails</artifactId>
<version>0.5.1</version> <version>0.5.1-SNAPSHOT</version>
<packaging>gem</packaging> <packaging>gem</packaging>
<name><![CDATA[collection of datamapper related extensions]]></name> <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> <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> <developers>
<developer> <developer>
<id>m.kristian</id> <id>m.kristian</id>
Expand All @@ -19,6 +19,11 @@
</developer> </developer>
</developers> </developers>
<licenses> <licenses>
<license>
<name>MIT-LICENSE</name>
<url>./MIT-LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses> </licenses>
<dependencies> <dependencies>
<dependency> <dependency>
Expand All @@ -45,20 +50,13 @@
</dependencies> </dependencies>
<repositories> <repositories>
<repository> <repository>
<id>rubygems</id> <id>rubygems-releases</id>
<url>http://gems.saumya.de/releases</url> <url>http://gems.saumya.de/releases</url>
</repository> </repository>
</repositories> </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> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <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> </properties>
<build> <build>
<plugins> <plugins>
Expand All @@ -67,14 +65,34 @@
<artifactId>gem-maven-plugin</artifactId> <artifactId>gem-maven-plugin</artifactId>
<version>${jruby.plugins.version}</version> <version>${jruby.plugins.version}</version>
<extensions>true</extensions> <extensions>true</extensions>
<configuration> <executions>
<date>2010-06-20</date> <execution>
<extraRdocFiles>History.txt,README.txt</extraRdocFiles> <id>gemspec</id>
<rdocOptions>--main,README.txt</rdocOptions> <goals><goal>package</goal></goals>
<requirePaths>lib</requirePaths> <configuration>
<rubyforgeProject>datamapper4rail</rubyforgeProject> <extraRdocFiles>History.txt,README.txt</extraRdocFiles>
<rubygemsVersion>1.3.5</rubygemsVersion> <rdocOptions>--main,README.txt</rdocOptions>
</configuration> <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>
<plugin> <plugin>
<groupId>de.saumya.mojo</groupId> <groupId>de.saumya.mojo</groupId>
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'rubygems' require 'rubygems'
require 'dm-core' require 'dm-core'
require 'base64' require 'base64'
require 'pathname'
$LOAD_PATH << Pathname(__FILE__).dirname.parent.expand_path + 'lib' $LOAD_PATH << Pathname(__FILE__).dirname.parent.expand_path + 'lib'


# just define a empty abstract store # just define a empty abstract store
Expand Down

0 comments on commit ef60ed6

Please sign in to comment.