Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* 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
Christian Meier authored July 29, 2010
8  History.txt
... ...
@@ -1,3 +1,11 @@
  1
+=== 0.5.1 / 2010-29-07
  2
+
  3
+* switch over to use pom.xml as primary project configuration
  4
+
  5
+* made basic rake tasks work with both ruby and jruby
  6
+
  7
+* rake tasks are compatible to the maven setup
  8
+
1 9
 === 0.5.0 / 2010-29-06
2 10
 
3 11
 * switch to DM version 1.0.0
43  Rakefile
... ...
@@ -1,26 +1,43 @@
1 1
 # -*- ruby -*-
2 2
 
3 3
 require 'rubygems'
4  
-require 'hoe'
5 4
 
6 5
 require 'spec'
7 6
 require 'spec/rake/spectask'
8  
-require 'pathname'
9 7
 
10 8
 require './lib/datamapper4rails/version.rb'
11 9
 
12  
-Hoe.spec('datamapper4rails') do |p|
13  
-  p.rubyforge_name = 'datamapper4rail'
14  
-  p.developer('mkristian', 'm.kristian@web.de')
15  
-  p.extra_deps = [['rack-datamapper', '~>0.3']]
16  
-  p.remote_rdoc_dir = '' # Release to root
17  
-  p.rspec_options << '--options' << 'spec/spec.opts'
  10
+build_dir = 'target'
  11
+
  12
+desc 'clean up'
  13
+task :clean do
  14
+  FileUtils.rm_rf(build_dir)
  15
+end
  16
+
  17
+desc 'Package as a gem.'
  18
+task :package do
  19
+  require 'fileutils'
  20
+  gemspec = Dir['*.gemspec'].first
  21
+  Kernel.system("#{RUBY} -S gem build #{gemspec}")
  22
+  FileUtils.mkdir_p(build_dir)
  23
+  gem = Dir['*.gem'].first
  24
+  FileUtils.mv(gem, File.join(build_dir,"#{gem}"))
  25
+  puts File.join(build_dir,"#{gem}")
18 26
 end
19 27
 
20 28
 desc 'Install the package as a gem.'
21  
-task :install => [:clean, :package] do
22  
-  gem = Dir['pkg/*.gem'].first
23  
-  sh "gem install --local #{gem} --no-ri --no-rdoc"
  29
+task :install => [:package] do
  30
+  gem = Dir[File.join(build_dir, '*.gem')].first
  31
+  extra = ENV['GEM_HOME'].nil? && ENV['GEM_PATH'].nil? ? "--user-install" : ""
  32
+  Kernel.system("#{RUBY} -S gem install --local #{gem} --no-ri --no-rdoc #{extra}")
  33
+end
  34
+
  35
+desc 'Run specifications'
  36
+Spec::Rake::SpecTask.new(:spec) do |t|
  37
+  if File.exists?(File.join('spec','spec.opts'))
  38
+    t.spec_opts << '--options' << File.join('spec','spec.opts')
  39
+  end
  40
+  t.spec_files = Dir.glob(File.join('spec','**','*_spec.rb'))
24 41
 end
25 42
 
26 43
 desc 'generate rails using all generators and run the specs'
@@ -34,8 +51,8 @@ task :integration_tests => [:spec, :install] do
34 51
   end
35 52
 end
36 53
 
37  
-require 'yard'
  54
+#require 'yard'
38 55
 
39  
-YARD::Rake::YardocTask.new
  56
+#YARD::Rake::YardocTask.new
40 57
 
41 58
 # vim: syntax=Ruby
6  datamapper4rails.gemspec
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
5 5
 
6 6
   s.summary = 'collection of datamapper related extensions'
7 7
   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.'
8  
-  s.homepage = 'http://datamapper4rail.rubyforge.org'
  8
+  s.homepage = 'http://github.com/mkristian/datamapper4rails'
9 9
 
10 10
   s.authors = ['mkristian']
11 11
   s.email = ['m.kristian@web.de']
@@ -16,11 +16,13 @@ Gem::Specification.new do |s|
16 16
   s.extra_rdoc_files = ['History.txt','README.txt']
17 17
   s.rdoc_options = ['--main','README.txt']
18 18
   s.require_paths = ['lib']
  19
+  s.licenses << 'MIT-LICENSE'
19 20
   s.files = Dir['lib/**/*']
  21
+  s.files += ["MIT-LICENSE"]
20 22
   s.files += Dir['generators/**/*']
21 23
   s.files += Dir['spec/**/*']
22 24
   s.test_files += Dir['spec/**/*_spec.rb']
23 25
   s.add_dependency 'rack-datamapper', '~> 0.3.0'
24 26
   s.add_development_dependency 'rspec', '~> 1.3.0'
25 27
   s.add_development_dependency 'rake', '0.8.7'
26  
-end
  28
+end
1  lib/datamapper4rails/.gitignore
... ...
@@ -0,0 +1 @@
  1
+*.errors
2  lib/datamapper4rails/version.rb
... ...
@@ -1,3 +1,3 @@
1  
-class Datamapper4rails
  1
+module Datamapper4rails
2 2
   VERSION = '0.5.1'.freeze
3 3
 end
56  pom.xml
@@ -6,11 +6,11 @@
6 6
   <modelVersion>4.0.0</modelVersion>
7 7
   <groupId>rubygems</groupId>
8 8
   <artifactId>datamapper4rails</artifactId>
9  
-  <version>0.5.1</version>
  9
+  <version>0.5.1-SNAPSHOT</version>
10 10
   <packaging>gem</packaging>
11 11
   <name><![CDATA[collection of datamapper related extensions]]></name>
12 12
   <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>
13  
-  <url>http://datamapper4rail.rubyforge.org</url>
  13
+  <url>http://github.com/mkristian/datamapper4rails</url>
14 14
   <developers>
15 15
     <developer>
16 16
       <id>m.kristian</id>
@@ -19,6 +19,11 @@
19 19
     </developer>
20 20
   </developers>
21 21
   <licenses>
  22
+    <license>
  23
+      <name>MIT-LICENSE</name>
  24
+      <url>./MIT-LICENSE</url>
  25
+      <distribution>repo</distribution>
  26
+    </license>
22 27
   </licenses>
23 28
   <dependencies>
24 29
     <dependency>
@@ -45,20 +50,13 @@
45 50
   </dependencies>
46 51
   <repositories>
47 52
     <repository>
48  
-      <id>rubygems</id>
  53
+      <id>rubygems-releases</id>
49 54
       <url>http://gems.saumya.de/releases</url>
50 55
     </repository>
51 56
   </repositories>
52  
-  <pluginRepositories>
53  
-    <pluginRepository>
54  
-      <id>sonatype-nexus-snapshots</id>
55  
-      <name>Sonatype Nexus Snapshots</name>
56  
-      <url>http://oss.sonatype.org/content/repositories/snapshots</url>
57  
-    </pluginRepository>
58  
-  </pluginRepositories>
59 57
   <properties>
60 58
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
61  
-    <jruby.plugins.version>0.20.0-SNAPSHOT</jruby.plugins.version>
  59
+    <jruby.plugins.version>0.20.0</jruby.plugins.version>
62 60
   </properties>
63 61
   <build>
64 62
     <plugins>
@@ -67,14 +65,34 @@
67 65
         <artifactId>gem-maven-plugin</artifactId>
68 66
         <version>${jruby.plugins.version}</version>
69 67
         <extensions>true</extensions>
70  
-	<configuration>
71  
-	  <date>2010-06-20</date>
72  
-	  <extraRdocFiles>History.txt,README.txt</extraRdocFiles>
73  
-	  <rdocOptions>--main,README.txt</rdocOptions>
74  
-	  <requirePaths>lib</requirePaths>
75  
-	  <rubyforgeProject>datamapper4rail</rubyforgeProject>
76  
-	  <rubygemsVersion>1.3.5</rubygemsVersion>
77  
-	</configuration>
  68
+        <executions>
  69
+          <execution>
  70
+	    <id>gemspec</id>
  71
+            <goals><goal>package</goal></goals>
  72
+            <configuration>
  73
+              <extraRdocFiles>History.txt,README.txt</extraRdocFiles>
  74
+              <rdocOptions>--main,README.txt</rdocOptions>
  75
+              <rubyforgeProject>datamapper4rail</rubyforgeProject>
  76
+              <overwriteGemspec>true</overwriteGemspec>
  77
+            </configuration>
  78
+          </execution>
  79
+	  <execution>
  80
+	    <id>version</id>
  81
+	    <phase>compile</phase>
  82
+	    <goals>
  83
+	      <goal>exec</goal>
  84
+	    </goals>
  85
+	    <configuration>
  86
+	      <script>
  87
+		version = '${project.version}'.sub(/-SNAPSHOT/, '')
  88
+		puts "module Datamapper4rails"
  89
+		puts "  VERSION = '#{version}'.freeze"
  90
+		puts "end"
  91
+	      </script>
  92
+	      <outputFile>lib/datamapper4rails/version.rb</outputFile>
  93
+	    </configuration>
  94
+	  </execution>
  95
+        </executions>
78 96
       </plugin>
79 97
       <plugin>
80 98
         <groupId>de.saumya.mojo</groupId>
1  spec/spec_helper.rb
... ...
@@ -1,6 +1,7 @@
1 1
 require 'rubygems'
2 2
 require 'dm-core'
3 3
 require 'base64'
  4
+require 'pathname'
4 5
 $LOAD_PATH << Pathname(__FILE__).dirname.parent.expand_path + 'lib'
5 6
 
6 7
 # just define a empty abstract store

0 notes on commit ef60ed6

Please sign in to comment.
Something went wrong with that request. Please try again.