Skip to content

Commit f6243dd

Browse files
committed
switch to datamapper version 1.0.x
1 parent c2e7a52 commit f6243dd

File tree

10 files changed

+143
-34
lines changed

10 files changed

+143
-34
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/pkg
2-
*~
2+
*~
3+
target

Manifest.txt

-19
This file was deleted.

Rakefile

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
# -*- ruby -*-
22

33
require 'rubygems'
4-
require 'hoe'
5-
require './lib/rack_datamapper/version.rb'
64

75
require 'spec'
86
require 'spec/rake/spectask'
97
require 'pathname'
108
require 'yard'
119

12-
Hoe.spec('rack-datamapper') do |p|
13-
p.developer('mkristian', '[email protected]')
14-
p.extra_deps = [['dm-core', '>0.9.10']]
15-
p.rspec_options << '--options' << 'spec/spec.opts'
16-
end
10+
desc "Run specs"
11+
Spec::Rake::SpecTask.new('spec')
1712

1813
desc 'Install the package as a gem.'
1914
task :install => [:clean, :package] do

gemspec_to_pom.rb

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/ruby
2+
require 'rubygems'
3+
4+
raise "needs rubygems version >=1.3.6" if Gem::VERSION < "1.3.6"
5+
load '../jruby-maven-plugins/gem-proxy/src/main/resources/gem_artifacts.rb'
6+
m = Maven::LocalRepository.new
7+
File.open("pom.xml", "w") do |f|
8+
f << m.to_pomxml('rack_datamapper.gemspec')
9+
end

lib/rack_datamapper/identity_maps.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ def initialize(app, name = :default)
66
end
77

88
def call(env)
9-
status, headers, response = nil, nil, nil
109
DataMapper.repository(@name) do
11-
status, headers, response = @app.call(env)
10+
@app.call(env)
1211
end
13-
[status, headers, response]
1412
end
1513
end
1614
end

lib/rack_datamapper/session/abstract/store.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ def self.default_storage_name
101101

102102
property :session_id, String, :key => true
103103

104-
property :data, Text, :nullable => false, :default => ::Base64.encode64(Marshal.dump({}))
104+
property :data, Text, :required => true, :default => ::Base64.encode64(Marshal.dump({}))
105105

106-
property :updated_at, DateTime, :nullable => true, :index => true
106+
property :updated_at, DateTime, :required => false, :index => true
107107

108108
def data=(data)
109109
attribute_set(:data, ::Base64.encode64(Marshal.dump(data)))

lib/rack_datamapper/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Rack
22
module DataMapper
3-
VERSION = '0.2.5'.freeze
3+
VERSION = '0.3.0'.freeze
44
end
55
end

pom.xml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0"?>
2+
<project
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
4+
xmlns="http://maven.apache.org/POM/4.0.0"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
6+
<modelVersion>4.0.0</modelVersion>
7+
<groupId>rubygems</groupId>
8+
<artifactId>rack-datamapper</artifactId>
9+
<version>0.3.0</version>
10+
<packaging>gem</packaging>
11+
<name><![CDATA[this collection of plugins helps to add datamapper functionality to Rack]]></name>
12+
<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>
13+
<url>http://github.com/mkristian/rack_datamapper</url>
14+
<dependencies>
15+
<dependency>
16+
<groupId>rubygems</groupId>
17+
<artifactId>dm-core</artifactId>
18+
<version>[1.0.0,1.0.99999.99999)</version>
19+
<type>gem</type>
20+
<scope>compile</scope>
21+
</dependency>
22+
<dependency>
23+
<groupId>rubygems</groupId>
24+
<artifactId>rack</artifactId>
25+
<version>[1.0.0,1.99999.99999)</version>
26+
<type>gem</type>
27+
<scope>compile</scope>
28+
</dependency>
29+
<dependency>
30+
<groupId>rubygems</groupId>
31+
<artifactId>dm-migrations</artifactId>
32+
<version>[1.0.0,1.0.99999.99999)</version>
33+
<type>gem</type>
34+
<scope>test</scope>
35+
</dependency>
36+
<dependency>
37+
<groupId>rubygems</groupId>
38+
<artifactId>dm-transactions</artifactId>
39+
<version>[1.0.0,1.0.99999.99999)</version>
40+
<type>gem</type>
41+
<scope>test</scope>
42+
</dependency>
43+
<dependency>
44+
<groupId>rubygems</groupId>
45+
<artifactId>dm-sqlite-adapter</artifactId>
46+
<version>[1.0.0,1.0.99999.99999)</version>
47+
<type>gem</type>
48+
<scope>test</scope>
49+
</dependency>
50+
<dependency>
51+
<groupId>rubygems</groupId>
52+
<artifactId>rspec</artifactId>
53+
<version>[1.3.0,1.3.99999.99999)</version>
54+
<type>gem</type>
55+
<scope>test</scope>
56+
</dependency>
57+
</dependencies>
58+
<repositories>
59+
<repository>
60+
<id>rubygems</id>
61+
<url>http://gems.saumya.de/releases</url>
62+
</repository>
63+
</repositories>
64+
<properties>
65+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
66+
<jruby.plugins.version>0.12.1-SNAPSHOT</jruby.plugins.version>
67+
</properties>
68+
<build>
69+
<plugins>
70+
<plugin>
71+
<groupId>de.saumya.mojo</groupId>
72+
<artifactId>rspec-maven-plugin</artifactId>
73+
<version>${jruby.plugins.version}</version>
74+
</plugin>
75+
<plugin>
76+
<groupId>de.saumya.mojo</groupId>
77+
<artifactId>gem-maven-plugin</artifactId>
78+
<version>${jruby.plugins.version}</version>
79+
<extensions>true</extensions>
80+
</plugin>
81+
<plugin>
82+
<artifactId>maven-compiler-plugin</artifactId>
83+
<version>2.0.2</version>
84+
<configuration>
85+
<source>1.5</source>
86+
<target>1.5</target>
87+
</configuration>
88+
</plugin>
89+
</plugins>
90+
</build>
91+
</project>

rack_datamapper.gemspec

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# -*- encoding: utf-8 -*-
2+
3+
Gem::Specification.new do |s|
4+
s.name = %q{rack-datamapper}
5+
s.version = "0.3.0"
6+
7+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8+
s.authors = ["mkristian"]
9+
s.date = %q{2010-06-13}
10+
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.}
11+
s.email = ["[email protected]"]
12+
s.extra_rdoc_files = ["History.txt", "README.txt"]
13+
s.files = ["History.txt", "MIT-LICENSE", "README.txt", "Rakefile"]
14+
s.files = s.files +
15+
Dir.glob("lib/*jar") +
16+
Dir.glob("lib/**/*rb")
17+
s.test_files = Dir.glob("spec/**/*.rb")
18+
s.homepage = %q{http://github.com/mkristian/rack_datamapper}
19+
s.rdoc_options = ["--main", "README.txt"]
20+
s.require_paths = ["lib"]
21+
s.rubyforge_project = %q{rack-datamapper}
22+
s.rubygems_version = %q{1.3.5}
23+
s.summary = %q{this collection of plugins helps to add datamapper functionality to Rack}
24+
25+
s.add_runtime_dependency(%q<dm-core>, ["~> 1.0.0"])
26+
s.add_runtime_dependency(%q<rack>, ["~> 1.0"])
27+
28+
s.add_development_dependency(%q<dm-migrations>, ["~> 1.0.0"])
29+
s.add_development_dependency(%q<dm-transactions>, ["~> 1.0.0"])
30+
s.add_development_dependency(%q<dm-sqlite-adapter>, ["~> 1.0.0"])
31+
s.add_development_dependency(%q<rspec>, ["~> 1.3.0"])
32+
end
33+

spec/spec_helper.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
require 'pathname'
22
require 'rubygems'
3-
#gem 'dm-core', '0.9.10'
43
$LOAD_PATH << Pathname(__FILE__).dirname.parent.expand_path + 'lib'
54
require 'rack_datamapper'
65
require 'dm-core/version'
6+
require 'dm-migrations'
7+
require 'dm-transactions'
78
p DataMapper::VERSION
89
def load_driver(name, default_uri)
910
return false if ENV['ADAPTER'] != name.to_s

0 commit comments

Comments
 (0)