Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 147 lines (129 sloc) 4.153 kb
6c4e37b9 »
2009-10-01 * added datamapper migration to the model
1 # inspired by http://www.rowtheboat.com/archives/32
2 ###################################################
3
38dc646f »
2009-11-28 fixed issue with datamapper edge
4 # this pulls in rails_datamapper and rack_datamapper
5 gem 'datamapper4rails'
6c4e37b9 »
2009-10-01 * added datamapper migration to the model
6
7 # assume sqlite3 to be database
fade29eb »
2009-10-19 some cosmetic changes
8 gem 'do_sqlite3'
6c4e37b9 »
2009-10-01 * added datamapper migration to the model
9
10 # assume you want to have validations and timestamps in your models
11 gem 'dm-validations'
12 gem 'dm-timestamps'
13 gem 'dm-migrations'
475691f6 »
2009-10-07 jruby fixes, add dm-serializer to template, deprecated warning, ...
14 gem 'dm-serializer' # to allow xml interface to work
38dc646f »
2009-11-28 fixed issue with datamapper edge
15 gem 'dm-core'
16
17 # get all datamapper related gems
18 gem 'addressable', :lib => 'addressable/uri'
6c4e37b9 »
2009-10-01 * added datamapper migration to the model
19
20 # assume you prefer rspec over unit tests
fade29eb »
2009-10-19 some cosmetic changes
21 gem 'rspec', :lib => false
22 gem 'rspec-rails', :lib => false
6c4e37b9 »
2009-10-01 * added datamapper migration to the model
23
24 # install all gems
fade29eb »
2009-10-19 some cosmetic changes
25 rake 'gems:install'
6c4e37b9 »
2009-10-01 * added datamapper migration to the model
26
27 # install specs rake tasks
fade29eb »
2009-10-19 some cosmetic changes
28 generate('rspec', '-f')
6c4e37b9 »
2009-10-01 * added datamapper migration to the model
29
30 # install datamapper rake tasks
fade29eb »
2009-10-19 some cosmetic changes
31 generate('datamapper_install')
6c4e37b9 »
2009-10-01 * added datamapper migration to the model
32
33 # fix config files to work with datamapper instead of active_record
fade29eb »
2009-10-19 some cosmetic changes
34 environment ''
35 environment 'config.frameworks -= [ :active_record ]'
36 environment '# deactive active_record'
6c4e37b9 »
2009-10-01 * added datamapper migration to the model
37 gsub_file 'spec/spec_helper.rb', /^\s*config[.]/, ' #\0'
38 gsub_file 'test/test_helper.rb', /^[^#]*fixtures/, ' #\0'
39
4f1e648f »
2009-10-07 * fixed the rack_datamapper naming problem
40 file 'spec/support/datamapper.rb', <<-CODE
41 require 'datamapper4rails/rspec'
42 CODE
43
6c4e37b9 »
2009-10-01 * added datamapper migration to the model
44 # add middleware
45 def middleware(name)
fade29eb »
2009-10-19 some cosmetic changes
46 log 'middleware', name
6c4e37b9 »
2009-10-01 * added datamapper migration to the model
47 environment "config.middleware.use '#{name}'"
48 end
49
fade29eb »
2009-10-19 some cosmetic changes
50 environment ''
51 middleware 'DataMapper::RestfulTransactions'
52 middleware 'DataMapper::IdentityMaps'
53 middleware 'Rack::Deflater'
54 environment '# add middleware'
6c4e37b9 »
2009-10-01 * added datamapper migration to the model
55
56 # init a session store
57 initializer 'datamapper_store.rb', <<-CODE
58 # init a session store which uses a memory cache and a persistent store
59 # cleanup can be a problem. jruby uses soft-references for the cache so
60 # memory cleanup with jruby is not a problem.
0c3625bf »
2009-11-26 removed dep to ixtlan
61 require 'datamapper4rails/datamapper_store'
6c4e37b9 »
2009-10-01 * added datamapper migration to the model
62 ActionController::Base.session_store = :datamapper_store
63 ActionController::Base.session = {
64 :cache => true,
65 }
66 CODE
67
4f1e648f »
2009-10-07 * fixed the rack_datamapper naming problem
68 # gzip fix for jruby
69 initializer 'monkey_patches.rb', <<-CODE
70 if RUBY_PLATFORM =~ /java/
71 require 'zlib'
72 class Zlib::GzipWriter
73 def <<(arg)
74 write(arg)
75 end
76 end
77 end
78 CODE
79
15dc5fa3 »
2009-11-29 added pom.xml and removed prepare-jruby.sh
80 file 'pom.xml', <<-CODE
81 <project xmlns="http://maven.apache.org/POM/4.0.0"
82 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
83 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
84 http://maven.apache.org/xsd/maven-4.0.0.xsd">
85 <modelVersion>4.0.0</modelVersion>
86 <groupId>com.example</groupId>
87 <artifactId>demo</artifactId>
88 <packaging>war</packaging>
89 <version>1.0-SNAPSHOT</version>
90 <name>rails datamapper demo</name>
91 <url>http://github.com/mkristian/rails-templates/blob/master/datamapper.rb</url>
92 <pluginRepositories>
93 <pluginRepository>
94 <id>saumya</id>
95 <name>Saumyas Plugins</name>
96 <url>http://mojo.saumya.de</url>
97 </pluginRepository>
98 </pluginRepositories>
99 <build>
100 <plugins>
101 <plugin>
102 <groupId>de.saumya.mojo</groupId>
103 <artifactId>rails-maven-plugin</artifactId>
525e5abd »
2009-12-03 little changes + new version for maven plugins
104 <version>0.3.1</version>
15dc5fa3 »
2009-11-29 added pom.xml and removed prepare-jruby.sh
105 </plugin>
106 <plugin>
107 <groupId>de.saumya.mojo</groupId>
108 <artifactId>jruby-maven-plugin</artifactId>
525e5abd »
2009-12-03 little changes + new version for maven plugins
109 <version>0.3.1</version>
110 </plugin>
111 <plugin>
112 <groupId>de.saumya.mojo</groupId>
113 <artifactId>gem-maven-plugin</artifactId>
114 <version>0.3.1</version>
15dc5fa3 »
2009-11-29 added pom.xml and removed prepare-jruby.sh
115 </plugin>
116 </plugins>
117 </build>
118 <properties>
119 <jruby.fork>false</jruby.fork>
120 </properties>
121 </project>
4f1e648f »
2009-10-07 * fixed the rack_datamapper naming problem
122 CODE
123
6c4e37b9 »
2009-10-01 * added datamapper migration to the model
124 rake 'db:sessions:create'
4f1e648f »
2009-10-07 * fixed the rack_datamapper naming problem
125
126 logger.info
127 logger.info
128 logger.info "info mavenized rails application"
475691f6 »
2009-10-07 jruby fixes, add dm-serializer to template, deprecated warning, ...
129 logger.info "\thttp://github.org/mkristian/rails-maven-plugin"
4f1e648f »
2009-10-07 * fixed the rack_datamapper naming problem
130 logger.info
15dc5fa3 »
2009-11-29 added pom.xml and removed prepare-jruby.sh
131 logger.info "if you want to run jruby please uninstall"
132 logger.info "the native extension of do_sqlite3 and install the java version"
38dc646f »
2009-11-28 fixed issue with datamapper edge
133 logger.info "\truby -S gem uninstall do_sqlite3"
134 logger.info "\tjruby -S rake gems:install"
15dc5fa3 »
2009-11-29 added pom.xml and removed prepare-jruby.sh
135 logger.info
525e5abd »
2009-12-03 little changes + new version for maven plugins
136 logger.info "rake gems:unpack does NOT work with jruby due to a bug in rails <=2.3.5"
137 logger.info "you can try"
15dc5fa3 »
2009-11-29 added pom.xml and removed prepare-jruby.sh
138 logger.info "\tmvn rails:rails-freeze-gems"
525e5abd »
2009-12-03 little changes + new version for maven plugins
139 logger.info "which patches rails after freezing it"
15dc5fa3 »
2009-11-29 added pom.xml and removed prepare-jruby.sh
140 logger.info
4f1e648f »
2009-10-07 * fixed the rack_datamapper naming problem
141 logger.info
525e5abd »
2009-12-03 little changes + new version for maven plugins
142 logger.info
143 logger.info
144 logger.info "for dm-core version 0.10.2 there are a lot of deprecated warning but everything works as expected"
145 logger.info
146 logger.info
Something went wrong with that request. Please try again.