Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

switch to new jruby plugin, adjusted Rakefile to do basic tasks

  • Loading branch information...
commit 99d6a83f995f3b84ef22847871369a507938b396 1 parent 63f16cf
@mkristian authored
View
32 Rakefile
@@ -1,32 +1,40 @@
# -*- ruby -*-
require 'rubygems'
+require './lib/rack_datamapper/version.rb'
require 'spec'
require 'spec/rake/spectask'
-require 'pathname'
-require 'yard'
-desc "Run specs"
-Spec::Rake::SpecTask.new('spec')
+build_dir = 'target'
+desc 'clean up'
task :clean do
- sh "rm -r pkg"
+ FileUtils.rm_rf(build_dir)
end
-desc 'Package as a gem.'
+desc 'package as a gem.'
task :package do
- sh "gem build rack_datamapper.gemspec"
- sh "mkdir -p pkg"
- sh "mv rack-datamapper-*.gem pkg"
+ require 'fileutils'
+ gemspec = Dir['*.gemspec'].first
+ sh "gem build #{gemspec}"
+ FileUtils.mkdir_p(build_dir)
+ gem = Dir['*.gem'].first
+ FileUtils.mv(gem, File.join(build_dir,"#{gem}"))
end
desc 'Install the package as a gem.'
-task :install => [:clean, :package] do
- gem = Dir['pkg/*.gem'].first
+task :install => [:package] do
+ gem = Dir[File.join(build_dir, '*.gem')].first
sh "gem install --local #{gem} --no-ri --no-rdoc"
end
-YARD::Rake::YardocTask.new
+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
# vim: syntax=Ruby
View
13 lib/rack_datamapper.rb
@@ -1,9 +1,8 @@
-require 'pathname'
-require 'extlib/pathname'
require 'dm-core'
-require Pathname(__FILE__).dirname / 'rack_datamapper' / 'version'
-require Pathname(__FILE__).dirname / 'rack_datamapper' / 'identity_maps'
-require Pathname(__FILE__).dirname / 'rack_datamapper' / 'restful_transactions'
-require Pathname(__FILE__).dirname / 'rack_datamapper' / 'transaction_boundaries'
-require Pathname(__FILE__).dirname / 'rack_datamapper' / 'session' / 'datamapper'
+base = File.join(File.dirname(__FILE__),'rack_datamapper')
+require File.join(base, 'version')
+require File.join(base, 'identity_maps')
+require File.join(base, 'restful_transactions')
+require File.join(base, 'transaction_boundaries')
+require File.join(base, 'session', 'datamapper')
View
1  lib/rack_datamapper/.gitignore
@@ -0,0 +1 @@
+*.errors
View
2  lib/rack_datamapper/version.rb
@@ -1,5 +1,5 @@
module Rack
module DataMapper
- VERSION = '0.3.2'.freeze
+ VERSION = '0.3.3'.freeze
end
end
View
48 pom.xml
@@ -6,11 +6,16 @@
<modelVersion>4.0.0</modelVersion>
<groupId>rubygems</groupId>
<artifactId>rack-datamapper</artifactId>
- <version>0.3.2</version>
+ <version>0.3.3-SNAPSHOT</version>
<packaging>gem</packaging>
<name><![CDATA[this collection of plugins helps to add datamapper functionality to Rack]]></name>
<description><![CDATA[this collection of plugins helps to add datamapper functionality to Rack. there is a IdentityMaps plugin which wrappes the request and with it all database actions are using that identity map. the transaction related plugin TransactionBoundaries and RestfulTransactions wrappes the request into a transaction. for using datamapper to store session data there is the DatamapperStore.]]></description>
<url>http://github.com/mkristian/rack_datamapper</url>
+ <scm>
+ <connection>scm:git:git://github.com/mkristian/rack_datamappe.git</connection>
+ <developerConnection>scm:git:git@github.com:mkristian/rack_datamappe.git</developerConnection>
+ <url>http://github.com/mkristian/rack_datamappe</url>
+ </scm>
<developers>
<developer>
<id>m.kristian</id>
@@ -71,20 +76,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>
@@ -93,14 +91,40 @@
<artifactId>gem-maven-plugin</artifactId>
<version>${jruby.plugins.version}</version>
<extensions>true</extensions>
+ <configuration>
+ <gemspecOverwrite>true</gemspecOverwrite>
+ </configuration>
+ <executions>
+ <execution>
+ <id>gemspec</id>
+ <goals><goal>package</goal></goals>
<configuration>
<date>2010-06-13</date>
<extraRdocFiles>History.txt,README.txt</extraRdocFiles>
<rdocOptions>--main,README.txt</rdocOptions>
- <requirePaths>lib</requirePaths>
<rubyforgeProject>rack-datamapper</rubyforgeProject>
- <rubygemsVersion>1.3.5</rubygemsVersion>
+ <extra_files>Rakefile</extra_files>
</configuration>
+ </execution>
+ <execution>
+ <id>version</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ <configuration>
+ <script>
+ version = '${project.version}'.sub(/-SNAPSHOT/, '')
+ puts "module Rack"
+ puts " module DataMapper"
+ puts " VERSION = '#{version}'.freeze"
+ puts " end"
+ puts "end"
+ </script>
+ <outputFile>lib/rack_datamapper/version.rb</outputFile>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
<plugin>
<groupId>de.saumya.mojo</groupId>
View
24 rack-datamapper.gemspec
@@ -0,0 +1,24 @@
+# create by maven - leave it as is
+Gem::Specification.new do |s|
+ s.name = 'rack-datamapper'
+ s.version = '0.3.3'
+
+ s.summary = 'this collection of plugins helps to add datamapper functionality to Rack'
+ s.description = 'this collection of plugins helps to add datamapper functionality to Rack. there is a IdentityMaps plugin which wrappes the request and with it all database actions are using that identity map. the transaction related plugin TransactionBoundaries and RestfulTransactions wrappes the request into a transaction. for using datamapper to store session data there is the DatamapperStore.'
+ s.homepage = 'http://github.com/mkristian/rack_datamapper'
+
+ s.authors = ['mkristian']
+ s.email = ['m.kristian@web.de']
+
+ s.files = Dir['MIT-LICENSE']
+ s.licenses << 'MIT-LICENSE'
+ s.files += Dir['lib/**/*']
+ s.files += Dir['spec/**/*']
+ s.test_files += Dir['spec/**/*_spec.rb']
+ s.add_dependency 'dm-core', '~> 1.0.0'
+ s.add_dependency 'rack', '~> 1.0'
+ s.add_development_dependency 'dm-migrations', '~> 1.0.0'
+ s.add_development_dependency 'dm-transactions', '~> 1.0.0'
+ s.add_development_dependency 'dm-sqlite-adapter', '~> 1.0.0'
+ s.add_development_dependency 'rspec', '~> 1.3.0'
+end
View
33 rack_datamapper.gemspec
@@ -1,33 +0,0 @@
-# -*- encoding: utf-8 -*-
-
-Gem::Specification.new do |s|
- s.name = %q{rack-datamapper}
- s.version = "0.3.2"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["mkristian"]
- s.date = %q{2010-06-13}
- s.description = %q{this collection of plugins helps to add datamapper functionality to Rack. there is a IdentityMaps plugin which wrappes the request and with it all database actions are using that identity map. the transaction related plugin TransactionBoundaries and RestfulTransactions wrappes the request into a transaction. for using datamapper to store session data there is the DatamapperStore.}
- s.email = ["m.kristian@web.de"]
- s.extra_rdoc_files = ["History.txt", "README.txt"]
- s.files = ["History.txt", "MIT-LICENSE", "README.txt", "Rakefile"]
- s.files = s.files +
- Dir.glob("lib/*jar") +
- Dir.glob("lib/**/*rb")
- s.test_files = Dir.glob("spec/**/*.rb")
- s.homepage = %q{http://github.com/mkristian/rack_datamapper}
- s.rdoc_options = ["--main", "README.txt"]
- s.require_paths = ["lib"]
- s.rubyforge_project = %q{rack-datamapper}
- s.rubygems_version = %q{1.3.5}
- s.summary = %q{this collection of plugins helps to add datamapper functionality to Rack}
-
- s.add_runtime_dependency(%q<dm-core>, ["~> 1.0.0"])
- s.add_runtime_dependency(%q<rack>, ["~> 1.0"])
-
- s.add_development_dependency(%q<dm-migrations>, ["~> 1.0.0"])
- s.add_development_dependency(%q<dm-transactions>, ["~> 1.0.0"])
- s.add_development_dependency(%q<dm-sqlite-adapter>, ["~> 1.0.0"])
- s.add_development_dependency(%q<rspec>, ["~> 1.3.0"])
-end
-
View
12 spec/spec_helper.rb
@@ -1,11 +1,11 @@
-require 'pathname'
require 'rubygems'
+require 'pathname'
$LOAD_PATH << Pathname(__FILE__).dirname.parent.expand_path + 'lib'
require 'rack_datamapper'
require 'dm-core/version'
require 'dm-migrations'
require 'dm-transactions'
-p DataMapper::VERSION
+
def load_driver(name, default_uri)
return false if ENV['ADAPTER'] != name.to_s
@@ -22,6 +22,8 @@ def load_driver(name, default_uri)
ENV['ADAPTER'] ||= 'sqlite3'
-HAS_SQLITE3 = load_driver(:sqlite3, 'sqlite3::memory:')
-HAS_MYSQL = load_driver(:mysql, 'mysql://localhost/dm_core_test')
-HAS_POSTGRES = load_driver(:postgres, 'postgres://postgres@localhost/dm_core_test')
+unless defined? HAS_SQLITE3
+ HAS_SQLITE3 = load_driver(:sqlite3, 'sqlite3::memory:')
+ HAS_MYSQL = load_driver(:mysql, 'mysql://localhost/dm_core_test')
+ HAS_POSTGRES = load_driver(:postgres, 'postgres://postgres@localhost/dm_core_test')
+end
Please sign in to comment.
Something went wrong with that request. Please try again.