rapid-app 0.1.3 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +14 -2
- data/lib/rapid-app.rb +6 -1
- data/lib/rapid/app/settings.rb +163 -84
- data/lib/rapid/app/skeleton.rb +67 -79
- data/lib/rapid/app/version.rb +1 -1
- data/lib/rapid/app/web.rb +48 -0
- data/public/rapid/app/application.css +10 -0
- data/public/rapid/app/application.js +63 -0
- data/rapid-app.gemspec +1 -11
- data/spec/hello_world/3.2.1/.gitignore +15 -0
- data/spec/hello_world/3.2.1/Gemfile +39 -0
- data/spec/hello_world/3.2.1/README.rdoc +261 -0
- data/spec/hello_world/3.2.1/Rakefile +7 -0
- data/spec/hello_world/3.2.1/app/assets/images/rails.png +0 -0
- data/spec/hello_world/3.2.1/app/assets/javascripts/application.js +15 -0
- data/spec/hello_world/3.2.1/app/assets/stylesheets/application.css +13 -0
- data/spec/hello_world/3.2.1/app/controllers/application_controller.rb +3 -0
- data/spec/hello_world/3.2.1/app/helpers/application_helper.rb +2 -0
- data/spec/hello_world/3.2.1/app/mailers/.gitkeep +0 -0
- data/spec/hello_world/3.2.1/app/models/.gitkeep +0 -0
- data/spec/hello_world/3.2.1/app/views/layouts/application.html.erb +14 -0
- data/spec/hello_world/3.2.1/config.ru +4 -0
- data/spec/hello_world/3.2.1/config/application.rb +59 -0
- data/spec/hello_world/3.2.1/config/boot.rb +6 -0
- data/spec/hello_world/3.2.1/config/database.yml +25 -0
- data/spec/hello_world/3.2.1/config/environment.rb +5 -0
- data/spec/hello_world/3.2.1/config/environments/development.rb +37 -0
- data/spec/hello_world/3.2.1/config/environments/production.rb +67 -0
- data/spec/hello_world/3.2.1/config/environments/test.rb +37 -0
- data/spec/hello_world/3.2.1/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/hello_world/3.2.1/config/initializers/inflections.rb +15 -0
- data/spec/hello_world/3.2.1/config/initializers/mime_types.rb +5 -0
- data/spec/hello_world/3.2.1/config/initializers/secret_token.rb +7 -0
- data/spec/hello_world/3.2.1/config/initializers/session_store.rb +8 -0
- data/spec/hello_world/3.2.1/config/initializers/wrap_parameters.rb +14 -0
- data/spec/hello_world/3.2.1/config/locales/en.yml +5 -0
- data/spec/hello_world/3.2.1/config/routes.rb +58 -0
- data/spec/hello_world/3.2.1/db/seeds.rb +7 -0
- data/spec/hello_world/3.2.1/doc/README_FOR_APP +2 -0
- data/spec/hello_world/3.2.1/lib/assets/.gitkeep +0 -0
- data/spec/hello_world/3.2.1/lib/tasks/.gitkeep +0 -0
- data/spec/hello_world/3.2.1/log/.gitkeep +0 -0
- data/spec/hello_world/3.2.1/public/404.html +26 -0
- data/spec/hello_world/3.2.1/public/422.html +26 -0
- data/spec/hello_world/3.2.1/public/500.html +25 -0
- data/spec/hello_world/3.2.1/public/favicon.ico +0 -0
- data/spec/hello_world/3.2.1/public/index.html +241 -0
- data/spec/hello_world/3.2.1/public/robots.txt +5 -0
- data/spec/hello_world/3.2.1/script/rails +6 -0
- data/spec/hello_world/3.2.1/test/fixtures/.gitkeep +0 -0
- data/spec/hello_world/3.2.1/test/functional/.gitkeep +0 -0
- data/spec/hello_world/3.2.1/test/integration/.gitkeep +0 -0
- data/spec/hello_world/3.2.1/test/performance/browsing_test.rb +12 -0
- data/spec/hello_world/3.2.1/test/test_helper.rb +13 -0
- data/spec/hello_world/3.2.1/test/unit/.gitkeep +0 -0
- data/spec/hello_world/3.2.1/vendor/assets/javascripts/.gitkeep +0 -0
- data/spec/hello_world/3.2.1/vendor/assets/stylesheets/.gitkeep +0 -0
- data/spec/hello_world/3.2.1/vendor/plugins/.gitkeep +0 -0
- data/spec/rapid/app/skeleton_spec.rb +48 -40
- data/spec/support/project.rb +77 -0
- data/spec/templates/app/helpers/analytics/google_helper_spec.rb +22 -0
- data/spec/templates/config/application_spec.rb +23 -23
- data/spec/templates/config/deploy/production_spec.rb +45 -45
- data/spec/templates/config/deploy_spec.rb +32 -32
- data/spec/templates/config/environments/development_spec.rb +14 -0
- data/spec/templates/config/environments/production_spec.rb +15 -1
- data/spec/templates/config/environments/test_spec.rb +14 -0
- data/spec/templates/features/support/env_spec.rb +4 -4
- data/spec/templates/lib/tasks/test.rake_spec.rb +22 -21
- data/spec/templates/spec/spec_helper_spec.rb +4 -4
- data/templates/app/helpers/analytics/google_helper.rb +21 -0
- data/templates/config/application.rb +4 -2
- data/templates/config/deploy.rb +4 -4
- data/templates/config/deploy/production.rb +15 -15
- data/templates/config/environments/development.rb +12 -3
- data/templates/config/environments/production.rb +9 -2
- data/templates/config/environments/test.rb +5 -10
- data/templates/lib/tasks/test.rake +3 -0
- data/views/edit.haml +160 -0
- data/views/error.haml +3 -0
- data/views/layout.haml +7 -0
- metadata +115 -80
data/Rakefile
CHANGED
@@ -1,4 +1,16 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
+
require 'rapid/web/tasks'
|
2
3
|
|
3
|
-
|
4
|
-
|
4
|
+
if defined? Rspec
|
5
|
+
require 'rspec/core/rake_task'
|
6
|
+
RSpec::Core::RakeTask.new('spec')
|
7
|
+
end
|
8
|
+
|
9
|
+
desc "Run the Sinatra server to edit your application with this gem"
|
10
|
+
task :server do
|
11
|
+
path = ENV["APP"]
|
12
|
+
raise "USAGE: rake server APP=/path/to/rails/application" if path.nil?
|
13
|
+
|
14
|
+
require 'rapid-app'
|
15
|
+
Rapid::App::Web.run!
|
16
|
+
end
|
data/lib/rapid-app.rb
CHANGED
data/lib/rapid/app/settings.rb
CHANGED
@@ -11,34 +11,40 @@ module Rapid
|
|
11
11
|
|
12
12
|
setting.code 'controllers.application.body'
|
13
13
|
setting.code 'helpers.application.body'
|
14
|
-
setting.code 'config.
|
14
|
+
setting.code 'app.config.start'
|
15
|
+
setting.code 'app.config.rest'
|
15
16
|
setting.code 'routes.body'
|
16
17
|
|
17
|
-
setting.namespace 'database'
|
18
|
-
setting.namespace 'database.
|
19
|
-
setting.namespace 'database.mysql'
|
20
|
-
setting.namespace 'database.mongoid'
|
18
|
+
setting.namespace 'database'
|
19
|
+
setting.namespace 'database.sqlite3'
|
20
|
+
setting.namespace 'database.mysql'
|
21
|
+
setting.namespace 'database.mongoid'
|
21
22
|
|
22
|
-
setting.namespace 'development'
|
23
|
-
setting.string 'development.
|
23
|
+
setting.namespace 'development'
|
24
|
+
setting.string 'development.protocol', :default => 'http'
|
25
|
+
setting.string 'development.domain'
|
24
26
|
setting.integer 'development.port'
|
27
|
+
setting.string 'development.delivery_method'
|
25
28
|
|
26
|
-
setting.namespace 'test'
|
27
|
-
setting.string 'test.
|
29
|
+
setting.namespace 'test'
|
30
|
+
setting.string 'test.protocol', :default => 'http'
|
31
|
+
setting.string 'test.domain'
|
28
32
|
setting.integer 'test.port'
|
29
33
|
|
30
34
|
setting.integer 'test.coverage.threshold', :default => 90
|
31
|
-
setting.namespace 'test.unit'
|
35
|
+
setting.namespace 'test.unit'
|
32
36
|
|
33
|
-
setting.namespace 'test.
|
37
|
+
setting.namespace 'test.rake.all'
|
38
|
+
|
39
|
+
setting.namespace 'test.rspec'
|
34
40
|
setting.code 'test.rspec.factories.body'
|
35
41
|
|
36
|
-
setting.namespace 'test.cucumber'
|
42
|
+
setting.namespace 'test.cucumber'
|
37
43
|
setting.integer 'test.cucumber.wip.max', :default => 20
|
38
44
|
setting.code 'test.cucumber.selectors.body'
|
39
45
|
setting.code 'test.cucumber.paths.body'
|
40
46
|
|
41
|
-
setting.namespace 'test.roodi'
|
47
|
+
setting.namespace 'test.roodi'
|
42
48
|
setting.integer 'test.roodi.method.complexity', :default => 8
|
43
49
|
setting.integer 'test.roodi.method.lines.max', :default => 40
|
44
50
|
setting.integer 'test.roodi.block.complexity', :default => 4
|
@@ -46,47 +52,49 @@ module Rapid
|
|
46
52
|
setting.integer 'test.roodi.module.lines.max', :default => 300
|
47
53
|
setting.integer 'test.roodi.parameters.max', :default => 5
|
48
54
|
|
49
|
-
setting.namespace 'production'
|
55
|
+
setting.namespace 'production'
|
56
|
+
setting.string 'production.protocol', :default => 'http'
|
50
57
|
setting.string 'production.domain'
|
51
58
|
setting.integer 'production.port'
|
52
59
|
|
53
|
-
setting.namespace 'assets'
|
54
|
-
setting.namespace 'paginate'
|
55
|
-
setting.namespace 'net'
|
56
|
-
setting.namespace 'net.http'
|
60
|
+
setting.namespace 'assets'
|
61
|
+
setting.namespace 'paginate'
|
62
|
+
setting.namespace 'net'
|
63
|
+
setting.namespace 'net.http'
|
57
64
|
|
58
|
-
setting.namespace 'i18n'
|
59
|
-
setting.namespace 'breadcrumbs'
|
60
|
-
setting.namespace '
|
61
|
-
setting.
|
65
|
+
setting.namespace 'i18n'
|
66
|
+
setting.namespace 'breadcrumbs'
|
67
|
+
setting.namespace 'haml'
|
68
|
+
setting.namespace 'upload'
|
69
|
+
setting.boolean 'upload.private'
|
62
70
|
|
63
|
-
setting.namespace 'import'
|
64
|
-
setting.namespace 'import.logs'
|
71
|
+
setting.namespace 'import'
|
72
|
+
setting.namespace 'import.logs'
|
65
73
|
|
66
|
-
setting.namespace 'exceptions'
|
67
|
-
setting.namespace 'exceptions.airbrake'
|
74
|
+
setting.namespace 'exceptions'
|
75
|
+
setting.namespace 'exceptions.airbrake'
|
68
76
|
setting.string 'exceptions.airbrake.api_key'
|
69
77
|
setting.string 'exceptions.airbrake.host'
|
70
78
|
setting.boolean 'exceptions.airbrake.secure'
|
71
79
|
|
72
|
-
setting.namespace 'deploy'
|
73
|
-
setting.string 'deploy.repository.url'
|
80
|
+
setting.namespace 'deploy'
|
74
81
|
|
75
|
-
setting.
|
76
|
-
setting.
|
77
|
-
setting.
|
78
|
-
setting.string 'deploy.production.
|
79
|
-
setting.string 'deploy.production.
|
80
|
-
setting.
|
81
|
-
setting.string 'deploy.production.
|
82
|
-
setting.
|
83
|
-
setting.string 'deploy.production.
|
84
|
-
setting.string 'deploy.production.
|
85
|
-
setting.string 'deploy.production.rvm.
|
82
|
+
setting.string 'deploy.capistrano.repository.url'
|
83
|
+
setting.namespace 'deploy.capistrano.production'
|
84
|
+
setting.namespace 'deploy.capistrano.production'
|
85
|
+
setting.string 'deploy.capistrano.production.domain'
|
86
|
+
setting.string 'deploy.capistrano.production.path'
|
87
|
+
setting.string 'deploy.capistrano.production.branch'
|
88
|
+
setting.string 'deploy.capistrano.production.user'
|
89
|
+
setting.integer 'deploy.capistrano.production.keep', :default => 5
|
90
|
+
setting.string 'deploy.capistrano.production.server', :default => 'passenger'
|
91
|
+
setting.string 'deploy.capistrano.production.bin'
|
92
|
+
setting.string 'deploy.capistrano.production.rvm.type'
|
93
|
+
setting.string 'deploy.capistrano.production.rvm.ruby'
|
94
|
+
setting.string 'deploy.capistrano.production.rvm.gemset'
|
86
95
|
|
87
96
|
|
88
|
-
setting.namespace 'email'
|
89
|
-
setting.string 'email.smtp.provider'
|
97
|
+
setting.namespace 'email'
|
90
98
|
setting.string 'email.smtp.address'
|
91
99
|
setting.string 'email.smtp.domain'
|
92
100
|
setting.string 'email.smtp.username'
|
@@ -98,21 +106,35 @@ module Rapid
|
|
98
106
|
setting.string 'email.test.subject', :default => "Test Email"
|
99
107
|
setting.string 'email.test.message', :default => "Emails are configured correctly!"
|
100
108
|
|
101
|
-
setting.namespace 'scheduler'
|
109
|
+
setting.namespace 'scheduler'
|
102
110
|
setting.code 'scheduler.body'
|
103
111
|
|
104
|
-
setting.namespace 'async'
|
105
|
-
setting.namespace 'async.delayed_job'
|
112
|
+
setting.namespace 'async'
|
113
|
+
setting.namespace 'async.delayed_job'
|
114
|
+
|
115
|
+
setting.namespace 'analytics'
|
116
|
+
setting.string 'analytics.google.uid'
|
117
|
+
|
118
|
+
class << self
|
119
|
+
|
120
|
+
def databases
|
121
|
+
%w(sqlite3 mysql mongoid)
|
122
|
+
end
|
123
|
+
|
124
|
+
def timezones
|
125
|
+
ActiveSupport::TimeZone.all.collect {|z| z.name}
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
106
129
|
|
107
130
|
validates_presence_of 'name'
|
108
131
|
validates_presence_of 'upload', :if => :import?
|
109
132
|
validates_presence_of 'async', :if => :import?
|
110
133
|
validates_presence_of 'net.http', :if => 'root.exceptions.airbrake?'
|
111
134
|
|
112
|
-
validates_inclusion_of 'timezone', :in =>
|
113
|
-
validates_inclusion_of 'deploy.production.server', :in => %w(passenger heroku), :allow_nil => true
|
114
|
-
validates_inclusion_of '
|
115
|
-
validates_inclusion_of 'deploy.production.rvm.type', :in => %w(system user), :allow_nil => true
|
135
|
+
validates_inclusion_of 'timezone', :in => timezones, :allow_nil => true
|
136
|
+
validates_inclusion_of 'deploy.capistrano.production.server', :in => %w(passenger heroku), :allow_nil => true
|
137
|
+
validates_inclusion_of 'deploy.capistrano.production.rvm.type', :in => %w(system user), :allow_nil => true
|
116
138
|
|
117
139
|
def module_name
|
118
140
|
name.camelize if name
|
@@ -120,6 +142,7 @@ module Rapid
|
|
120
142
|
|
121
143
|
def module_name= name
|
122
144
|
self.name = name ? name.underscore : nil
|
145
|
+
name
|
123
146
|
end
|
124
147
|
|
125
148
|
def rails_all?
|
@@ -128,9 +151,9 @@ module Rapid
|
|
128
151
|
|
129
152
|
def rails_all= bool
|
130
153
|
if bool
|
131
|
-
database.active_record = true
|
132
|
-
assets = true
|
133
|
-
test.unit = true
|
154
|
+
self.database.active_record = true
|
155
|
+
self.assets = true
|
156
|
+
self.test.unit = true
|
134
157
|
end
|
135
158
|
|
136
159
|
bool
|
@@ -138,12 +161,60 @@ module Rapid
|
|
138
161
|
|
139
162
|
setting.class_eval 'database' do
|
140
163
|
|
164
|
+
def type
|
165
|
+
if sqlite3?
|
166
|
+
'sqlite3'
|
167
|
+
elsif mysql?
|
168
|
+
'mysql'
|
169
|
+
elsif mongoid?
|
170
|
+
'mongoid'
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
def type= type
|
175
|
+
case type
|
176
|
+
when 'sqlite3'
|
177
|
+
self.sqlite3 = true
|
178
|
+
self.mysql = false
|
179
|
+
self.mongoid = false
|
180
|
+
when 'mysql'
|
181
|
+
self.sqlite3 = false
|
182
|
+
self.mysql = true
|
183
|
+
self.mongoid = false
|
184
|
+
when 'mongoid'
|
185
|
+
self.sqlite3 = false
|
186
|
+
self.mysql = false
|
187
|
+
self.mongoid = true
|
188
|
+
else
|
189
|
+
if type == '' || type == nil
|
190
|
+
self.sqlite3 = false
|
191
|
+
self.mysql = false
|
192
|
+
self.mongoid = false
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
type
|
197
|
+
end
|
198
|
+
|
141
199
|
def active_record?
|
142
200
|
sqlite? || mysql?
|
143
201
|
end
|
144
202
|
|
145
|
-
def
|
146
|
-
|
203
|
+
def active_record= value
|
204
|
+
unless value
|
205
|
+
self.sqlite = false
|
206
|
+
self.mysql = false
|
207
|
+
end
|
208
|
+
|
209
|
+
value
|
210
|
+
end
|
211
|
+
|
212
|
+
def sqlite?
|
213
|
+
sqlite3?
|
214
|
+
end
|
215
|
+
|
216
|
+
def sqlite= sql
|
217
|
+
# TODO
|
147
218
|
end
|
148
219
|
|
149
220
|
end
|
@@ -162,7 +233,7 @@ module Rapid
|
|
162
233
|
%(%w(#{tasks.join(' ')}))
|
163
234
|
end
|
164
235
|
|
165
|
-
def tasks=
|
236
|
+
def tasks= value
|
166
237
|
# TODO infer the roodi, spec, cucumber settings
|
167
238
|
end
|
168
239
|
|
@@ -188,7 +259,43 @@ module Rapid
|
|
188
259
|
|
189
260
|
end
|
190
261
|
|
191
|
-
setting.class_eval '
|
262
|
+
setting.class_eval 'email.smtp' do
|
263
|
+
|
264
|
+
def provider
|
265
|
+
case address
|
266
|
+
when 'smtp.gmail.com'
|
267
|
+
'google'
|
268
|
+
when 'smtp.sendgrid.net'
|
269
|
+
'sendgrid'
|
270
|
+
else
|
271
|
+
'other'
|
272
|
+
end
|
273
|
+
end
|
274
|
+
|
275
|
+
def provider= provider
|
276
|
+
case provider
|
277
|
+
when 'google'
|
278
|
+
self.address = 'smtp.gmail.com'
|
279
|
+
self.port = 587
|
280
|
+
self.authentication = "plain"
|
281
|
+
self.tls = true
|
282
|
+
|
283
|
+
when 'sendgrid'
|
284
|
+
self.address = 'smtp.sendgrid.com'
|
285
|
+
self.port = 587
|
286
|
+
self.authentication = "plain"
|
287
|
+
self.tls = true
|
288
|
+
|
289
|
+
else
|
290
|
+
# other, no setup
|
291
|
+
end
|
292
|
+
|
293
|
+
@provider = provider
|
294
|
+
end
|
295
|
+
|
296
|
+
end
|
297
|
+
|
298
|
+
setting.class_eval 'deploy.capistrano' do
|
192
299
|
|
193
300
|
def rvm?
|
194
301
|
production.rvm?
|
@@ -217,7 +324,7 @@ module Rapid
|
|
217
324
|
|
218
325
|
end
|
219
326
|
|
220
|
-
setting.class_eval 'deploy.production' do
|
327
|
+
setting.class_eval 'deploy.capistrano.production' do
|
221
328
|
|
222
329
|
def scheduler?
|
223
330
|
bin? && root.scheduler?
|
@@ -229,34 +336,6 @@ module Rapid
|
|
229
336
|
|
230
337
|
end
|
231
338
|
|
232
|
-
setting.class_eval 'email.smtp' do
|
233
|
-
|
234
|
-
def address
|
235
|
-
case provider
|
236
|
-
when 'google'
|
237
|
-
"smtp.gmail.com"
|
238
|
-
when 'sendgrid'
|
239
|
-
"smtp.sendgrid.net"
|
240
|
-
else
|
241
|
-
self[:address]
|
242
|
-
end
|
243
|
-
end
|
244
|
-
|
245
|
-
def address= address
|
246
|
-
self.provider = case address
|
247
|
-
when 'smtp.gmail.com'
|
248
|
-
'google'
|
249
|
-
when 'smtp.sendgrid.net'
|
250
|
-
'sendgrid'
|
251
|
-
else
|
252
|
-
nil
|
253
|
-
end
|
254
|
-
|
255
|
-
self[:address] = address
|
256
|
-
end
|
257
|
-
|
258
|
-
end
|
259
|
-
|
260
339
|
end
|
261
340
|
|
262
341
|
end
|
data/lib/rapid/app/skeleton.rb
CHANGED
@@ -55,30 +55,27 @@ module Rapid
|
|
55
55
|
def assets
|
56
56
|
gem 'sass-rails', :group => :assets, :if => 'assets'
|
57
57
|
|
58
|
-
if
|
59
|
-
|
60
|
-
gem 'uglifier', :group => :assets
|
61
|
-
end
|
58
|
+
gem 'coffee-rails', :group => :assets, :if => 'assets'
|
59
|
+
gem 'uglifier', :group => :assets, :if => 'assets'
|
62
60
|
end
|
63
61
|
|
64
62
|
def email
|
65
|
-
template 'config/initializers/email.rb', :if => 'email'
|
63
|
+
template 'config/initializers/email.rb', :if => 'email.smtp'
|
66
64
|
|
67
65
|
template 'app/mailers/test_mailer.rb', :if => 'email.test'
|
68
|
-
if
|
69
|
-
|
70
|
-
view 'test_mailer/test_email.text.erb'
|
71
|
-
end
|
66
|
+
template 'lib/tasks/test_mailer.rake', :if => 'email.test'
|
67
|
+
view 'test_mailer/test_email.text.erb', :if => 'email.test'
|
72
68
|
end
|
73
69
|
|
74
70
|
def database
|
75
71
|
directory 'db/migrate', :if => 'database.active_record'
|
76
72
|
|
73
|
+
gem 'sqlite3', :if => 'database.sqlite3'
|
74
|
+
gem 'mysql', :if => 'database.mysql'
|
75
|
+
|
77
76
|
gem 'mongoid', :if => 'database.mongoid'
|
78
|
-
if
|
79
|
-
|
80
|
-
gem 'SystemTimer'
|
81
|
-
end
|
77
|
+
gem 'bson_ext', :if => 'database.mongoid'
|
78
|
+
gem 'SystemTimer', :if => 'database.mongoid'
|
82
79
|
end
|
83
80
|
|
84
81
|
def development
|
@@ -87,68 +84,60 @@ module Rapid
|
|
87
84
|
|
88
85
|
def test
|
89
86
|
template 'config/environments/test.rb', :if => 'test'
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
template 'lib/tasks/test.rake'
|
100
|
-
gem 'fakeweb', :group => :test, :if => 'settings.net.http'
|
101
|
-
end
|
87
|
+
|
88
|
+
section :test_unit
|
89
|
+
section :rspec
|
90
|
+
section :cucumber
|
91
|
+
section :roodi
|
92
|
+
section :coverage
|
93
|
+
|
94
|
+
template 'lib/tasks/test.rake', :if => 'test.rake.all'
|
102
95
|
end
|
103
96
|
|
104
97
|
def test_unit
|
98
|
+
directory 'test', :if => 'test.unit'
|
105
99
|
template 'test/test_helper.rb', :if => 'test.unit'
|
106
100
|
end
|
107
101
|
|
108
102
|
def rspec
|
109
103
|
gem "rspec-rails", :group => :test, :if => 'test.rspec'
|
110
104
|
|
111
|
-
if
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
end
|
105
|
+
gem 'database_cleaner', :group => :test, :if => ['test.rspec', 'database']
|
106
|
+
gem 'factory_girl_rails', :group => :test, :if => ['test.rspec', 'database']
|
107
|
+
|
108
|
+
template 'rspec', :to => '.rspec', :if => 'test.rspec'
|
109
|
+
template 'spec/factories.rb', :if => ['test.rspec', 'database']
|
110
|
+
template 'spec/spec_helper.rb', :if => 'test.rspec'
|
111
|
+
directory 'spec/support', :if => 'test.rspec'
|
112
|
+
directory 'spec', :if => 'test.rspec'
|
120
113
|
end
|
121
114
|
|
122
115
|
def cucumber
|
123
116
|
gem 'cucumber-rails', :group => :test, :if => 'test.cucumber'
|
117
|
+
gem 'capybara', :group => :test, :if => 'test.cucumber'
|
118
|
+
gem 'launchy', :group => :test, :if => 'test.cucumber'
|
119
|
+
|
120
|
+
template 'config/cucumber.yml', :if => 'test.cucumber'
|
121
|
+
|
122
|
+
directory 'features', :if => 'test.cucumber'
|
123
|
+
template 'features/step_definitions/email_steps.rb', :if => ['test.cucumber', 'email']
|
124
|
+
template 'features/step_definitions/web_steps/browsing_steps.rb', :if => 'test.cucumber'
|
125
|
+
template 'features/step_definitions/web_steps/debug_steps.rb', :if => 'test.cucumber'
|
126
|
+
template 'features/step_definitions/web_steps/form_steps.rb', :if => 'test.cucumber'
|
127
|
+
template 'features/step_definitions/web_steps/step_scoper.rb', :if => 'test.cucumber'
|
124
128
|
|
125
|
-
if
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
template 'features/step_definitions/web_steps/debug_steps.rb'
|
133
|
-
template 'features/step_definitions/web_steps/form_steps.rb'
|
134
|
-
template 'features/step_definitions/web_steps/step_scoper.rb'
|
135
|
-
|
136
|
-
template 'features/support/email.rb' if settings.email?
|
137
|
-
template 'features/support/env.rb'
|
138
|
-
template 'features/support/paths.rb'
|
139
|
-
template 'features/support/selectors.rb'
|
140
|
-
template 'features/support/with_scope.rb'
|
141
|
-
|
142
|
-
template 'lib/tasks/cucumber.rake'
|
143
|
-
end
|
129
|
+
template 'features/support/email.rb', :if => ['test.cucumber', 'email']
|
130
|
+
template 'features/support/env.rb', :if => 'test.cucumber'
|
131
|
+
template 'features/support/paths.rb', :if => 'test.cucumber'
|
132
|
+
template 'features/support/selectors.rb', :if => 'test.cucumber'
|
133
|
+
template 'features/support/with_scope.rb', :if => 'test.cucumber'
|
134
|
+
|
135
|
+
template 'lib/tasks/cucumber.rake', :if => 'test.cucumber'
|
144
136
|
end
|
145
137
|
|
146
138
|
def roodi
|
147
|
-
template 'config/roodi.yml',
|
148
|
-
|
149
|
-
if settings.test.roodi?
|
150
|
-
gem 'roodi', :group => :test
|
151
|
-
end
|
139
|
+
template 'config/roodi.yml', :if => 'test.roodi'
|
140
|
+
gem 'roodi', :group => :test, :if => 'test.roodi'
|
152
141
|
end
|
153
142
|
|
154
143
|
def coverage
|
@@ -162,40 +151,31 @@ module Rapid
|
|
162
151
|
def exceptions
|
163
152
|
gem 'airbrake', :if => 'exceptions.airbrake'
|
164
153
|
|
165
|
-
if
|
166
|
-
template 'config/initializers/airbrake.rb'
|
167
|
-
end
|
154
|
+
template 'config/initializers/airbrake.rb', :if => 'exceptions.airbrake'
|
168
155
|
end
|
169
156
|
|
170
157
|
def deploy
|
171
|
-
gem 'capistrano',
|
158
|
+
gem 'capistrano', :group => :development, :if => 'deploy.capistrano'
|
159
|
+
gem 'capistrano-ext', :group => :development, :if => 'deploy.capistrano'
|
160
|
+
|
161
|
+
template 'config/deploy.rb', :if => 'deploy.capistrano'
|
162
|
+
template 'config/deploy/production.rb', :if => ['deploy', 'deploy.capistrano.production']
|
172
163
|
|
173
|
-
if
|
174
|
-
gem 'capistrano-ext', :group => :development
|
175
|
-
|
176
|
-
template 'config/deploy.rb'
|
177
|
-
template 'config/deploy/production.rb' if settings.deploy.production?
|
178
|
-
end
|
164
|
+
directory 'config/deploy', :if => 'deploy.capistrano'
|
179
165
|
end
|
180
166
|
|
181
167
|
def scheduler
|
182
168
|
gem 'whenever', :if => 'scheduler'
|
183
|
-
if
|
184
|
-
template 'config/schedule.rb'
|
185
|
-
end
|
169
|
+
template 'config/schedule.rb', :if => 'scheduler'
|
186
170
|
end
|
187
171
|
|
188
172
|
def async
|
189
173
|
gem 'delayed_job', :if => 'async.delayed_job'
|
190
174
|
|
191
|
-
if
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
migration 'create_jobs'
|
196
|
-
gem 'delayed_job_active_record'
|
197
|
-
end
|
198
|
-
end
|
175
|
+
script 'script/delayed_job', :if => 'async.delayed_job'
|
176
|
+
# migration 'create_jobs', :if => 'async.delayed_job'
|
177
|
+
|
178
|
+
gem 'delayed_job_active_record', :if => ['async.delayed_job', 'database.active_record']
|
199
179
|
|
200
180
|
# TODO resque
|
201
181
|
end
|
@@ -203,8 +183,16 @@ module Rapid
|
|
203
183
|
def other
|
204
184
|
gem 'kaminari', :if => 'paginate'
|
205
185
|
gem 'net_http_exception_fix', :if => 'net.http'
|
186
|
+
gem 'fakeweb', :group => :test, :if => ['net.http', 'test']
|
206
187
|
gem 'crummy', :if => 'breadcrumbs'
|
207
188
|
gem 'carrierwave', :if => 'upload'
|
189
|
+
gem 'haml', :if => 'haml'
|
190
|
+
analytics
|
191
|
+
end
|
192
|
+
|
193
|
+
def analytics
|
194
|
+
directory 'app/helpers/analytics', :if => 'analytics'
|
195
|
+
template 'app/helpers/analytics/google_helper.rb', :if => 'analytics.google'
|
208
196
|
end
|
209
197
|
|
210
198
|
end
|