padrino-gen 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/padrino-gen/generators/actions.rb +1 -3
- data/lib/padrino-gen/generators/components/orms/activerecord.rb +1 -2
- data/lib/padrino-gen/generators/components/orms/couchrest.rb +1 -2
- data/lib/padrino-gen/generators/components/orms/datamapper.rb +1 -2
- data/lib/padrino-gen/generators/components/orms/mongoid.rb +1 -2
- data/lib/padrino-gen/generators/components/orms/mongomapper.rb +0 -1
- data/lib/padrino-gen/generators/components/orms/mongomatic.rb +0 -1
- data/lib/padrino-gen/generators/components/orms/ohm.rb +1 -2
- data/lib/padrino-gen/generators/components/orms/ripple.rb +0 -1
- data/lib/padrino-gen/generators/components/orms/sequel.rb +1 -2
- data/lib/padrino-gen/generators/components/renderers/slim.rb +1 -1
- data/lib/padrino-gen/generators/project.rb +9 -24
- data/lib/padrino-gen/generators/templates/Gemfile.tt +0 -1
- data/lib/padrino-gen/generators/templates/static/ujs/mootools.js +61 -62
- data/lib/padrino-gen/padrino-tasks/activerecord.rb +2 -2
- data/lib/padrino-gen/padrino-tasks/datamapper.rb +3 -3
- data/lib/padrino-gen/padrino-tasks/mongoid.rb +1 -1
- data/lib/padrino-gen/padrino-tasks/mongomapper.rb +2 -2
- data/padrino-gen.gemspec +1 -1
- data/test/test_app_generator.rb +1 -4
- data/test/test_project_generator.rb +2 -12
- metadata +4 -4
@@ -206,8 +206,6 @@ module Padrino
|
|
206
206
|
template "templates/helper.rb.tt", destination_root(app, "helpers.rb")
|
207
207
|
@short_name = 'notifier'
|
208
208
|
template "templates/mailer.rb.tt", destination_root(app, "mailers.rb")
|
209
|
-
empty_directory destination_root(app, "views", "layouts")
|
210
|
-
empty_directory destination_root(app, "views", "mailers")
|
211
209
|
else # generate standard folders
|
212
210
|
empty_directory destination_root(app, 'controllers')
|
213
211
|
empty_directory destination_root(app, 'helpers')
|
@@ -258,4 +256,4 @@ module Padrino
|
|
258
256
|
end
|
259
257
|
end # Actions
|
260
258
|
end # Generators
|
261
|
-
end # Padrino
|
259
|
+
end # Padrino
|
@@ -112,7 +112,6 @@ def setup_orm
|
|
112
112
|
end
|
113
113
|
require_dependencies 'activerecord', :require => 'active_record'
|
114
114
|
create_file("config/database.rb", ar)
|
115
|
-
empty_directory('app/models')
|
116
115
|
end
|
117
116
|
|
118
117
|
AR_MODEL = (<<-MODEL) unless defined?(AR_MODEL)
|
@@ -169,4 +168,4 @@ def create_migration_file(migration_name, name, columns)
|
|
169
168
|
:add => Proc.new { |field, kind| "t.#{kind.underscore.gsub(/_/, '')} :#{field}" },
|
170
169
|
:remove => Proc.new { |field, kind| "t.remove :#{field}" }
|
171
170
|
)
|
172
|
-
end
|
171
|
+
end
|
@@ -26,7 +26,6 @@ def setup_orm
|
|
26
26
|
require_dependencies 'couchrest_model', :version => '~>1.1.0'
|
27
27
|
require_dependencies 'json_pure'
|
28
28
|
create_file("config/database.rb", COUCHREST.gsub(/!NAME!/, @app_name.underscore))
|
29
|
-
empty_directory('app/models')
|
30
29
|
end
|
31
30
|
|
32
31
|
CR_MODEL = (<<-MODEL) unless defined?(CR_MODEL)
|
@@ -53,4 +52,4 @@ end
|
|
53
52
|
|
54
53
|
def create_migration_file(migration_name, name, columns)
|
55
54
|
# NO MIGRATION NEEDED
|
56
|
-
end
|
55
|
+
end
|
@@ -50,7 +50,6 @@ def setup_orm
|
|
50
50
|
end
|
51
51
|
|
52
52
|
create_file("config/database.rb", dm)
|
53
|
-
empty_directory('app/models')
|
54
53
|
insert_hook("DataMapper.finalize", :after_load)
|
55
54
|
end
|
56
55
|
|
@@ -116,4 +115,4 @@ def create_migration_file(migration_name, name, columns)
|
|
116
115
|
:add => Proc.new { |field, kind| "add_column :#{field}, #{kind.classify}" },
|
117
116
|
:remove => Proc.new { |field, kind| "drop_column :#{field}" }
|
118
117
|
)
|
119
|
-
end
|
118
|
+
end
|
@@ -31,7 +31,6 @@ def setup_orm
|
|
31
31
|
require_dependencies 'mongoid'
|
32
32
|
require_dependencies('SystemTimer', :require => 'system_timer') if RUBY_VERSION =~ /1\.8/
|
33
33
|
create_file("config/database.rb", MONGOID.gsub(/!NAME!/, @app_name.underscore))
|
34
|
-
empty_directory('app/models')
|
35
34
|
end
|
36
35
|
|
37
36
|
MONGOID_MODEL = (<<-MODEL) unless defined?(MONGOID_MODEL)
|
@@ -66,4 +65,4 @@ end
|
|
66
65
|
|
67
66
|
def create_migration_file(migration_name, name, columns)
|
68
67
|
# NO MIGRATION NEEDED
|
69
|
-
end
|
68
|
+
end
|
@@ -13,7 +13,6 @@ def setup_orm
|
|
13
13
|
require_dependencies 'mongo_mapper'
|
14
14
|
require_dependencies('SystemTimer', :require => 'system_timer') if RUBY_VERSION =~ /1\.8/
|
15
15
|
create_file("config/database.rb", MONGO.gsub(/!NAME!/, @app_name.underscore))
|
16
|
-
empty_directory('app/models')
|
17
16
|
end
|
18
17
|
|
19
18
|
MM_MODEL = (<<-MODEL) unless defined?(MM_MODEL)
|
@@ -12,7 +12,6 @@ def setup_orm
|
|
12
12
|
require_dependencies 'bson_ext', :require => 'mongo'
|
13
13
|
require_dependencies 'mongomatic'
|
14
14
|
create_file("config/database.rb", MONGOMATIC.gsub(/!NAME!/, @app_name.underscore))
|
15
|
-
empty_directory('app/models')
|
16
15
|
end
|
17
16
|
|
18
17
|
MONGOMATIC_MODEL = (<<-MODEL) unless defined?(MONGOMATIC_MODEL)
|
@@ -28,7 +28,6 @@ def setup_orm
|
|
28
28
|
require_dependencies 'ohm', :require => 'ohm'
|
29
29
|
require_dependencies 'ohm-contrib', :require => 'ohm/contrib'
|
30
30
|
create_file("config/database.rb", ohm)
|
31
|
-
empty_directory('app/models')
|
32
31
|
end
|
33
32
|
|
34
33
|
OHM_MODEL = (<<-MODEL) unless defined?(OHM_MODEL)
|
@@ -69,4 +68,4 @@ end
|
|
69
68
|
|
70
69
|
def create_migration_file(migration_name, name, columns)
|
71
70
|
# NO MIGRATION NEEDED
|
72
|
-
end
|
71
|
+
end
|
@@ -37,7 +37,6 @@ def setup_orm
|
|
37
37
|
require_dependencies 'ripple'
|
38
38
|
create_file("config/riak.yml", RIPPLE_DB.gsub(/!NAME!/, @app_name.underscore))
|
39
39
|
create_file("config/database.rb", RIPPLE_CFG)
|
40
|
-
empty_directory('app/models')
|
41
40
|
end
|
42
41
|
|
43
42
|
RIPPLE_MODEL = (<<-MODEL) unless defined?(RIPPLE_MODEL)
|
@@ -30,7 +30,6 @@ def setup_orm
|
|
30
30
|
'sqlite3'
|
31
31
|
end
|
32
32
|
create_file("config/database.rb", sequel)
|
33
|
-
empty_directory('app/models')
|
34
33
|
empty_directory('db/migrate')
|
35
34
|
end
|
36
35
|
|
@@ -88,4 +87,4 @@ def create_migration_file(migration_name, name, columns)
|
|
88
87
|
:add => Proc.new { |field, kind| "add_column :#{field}, #{kind.camelize}" },
|
89
88
|
:remove => Proc.new { |field, kind| "drop_column :#{field}" }
|
90
89
|
)
|
91
|
-
end
|
90
|
+
end
|
@@ -80,30 +80,15 @@ module Padrino
|
|
80
80
|
|
81
81
|
# Finish message
|
82
82
|
def finish_message
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
TEXT
|
93
|
-
else
|
94
|
-
text = (<<-TEXT).gsub(/ {10}/,'')
|
95
|
-
|
96
|
-
=================================================================
|
97
|
-
#{name} is ready for development! Next, follow these steps:
|
98
|
-
=================================================================
|
99
|
-
1) cd #{options[:root]}/#{name}
|
100
|
-
2) bundle install
|
101
|
-
=================================================================
|
102
|
-
|
103
|
-
TEXT
|
104
|
-
end
|
105
|
-
say(text)
|
83
|
+
say
|
84
|
+
say "="*65, :green
|
85
|
+
say "#{name} is ready for development!", :green
|
86
|
+
say "="*65, :green
|
87
|
+
say "$ cd #{options[:root]}/#{name}", :bold
|
88
|
+
say "$ bundle install", :bold unless options[:bundle]
|
89
|
+
say "="*65, :green
|
90
|
+
say
|
106
91
|
end
|
107
92
|
end # Project
|
108
93
|
end # Generators
|
109
|
-
end # Padrino
|
94
|
+
end # Padrino
|
@@ -28,7 +28,6 @@ gem 'padrino', '<%= Padrino.version %>'
|
|
28
28
|
# gem 'padrino-core', '<%= Padrino.version %>'
|
29
29
|
# gem 'padrino-admin', '<%= Padrino.version %>'
|
30
30
|
# gem 'padrino-cache', '<%= Padrino.version %>'
|
31
|
-
# gem 'padrino-core', '<%= Padrino.version %>'
|
32
31
|
# gem 'padrino-gen', '<%= Padrino.version %>'
|
33
32
|
# gem 'padrino-helpers', '<%= Padrino.version %>'
|
34
33
|
# gem 'padrino-mailer', '<%= Padrino.version %>'
|
@@ -6,67 +6,6 @@
|
|
6
6
|
// Halt Definition
|
7
7
|
Event.implement({ halt: function() { this.stop(); this.stopped = true; }});
|
8
8
|
|
9
|
-
window.addEvent('domready', function() {
|
10
|
-
|
11
|
-
/* Remote Form Support
|
12
|
-
* form_for @user, '/user', :remote => true
|
13
|
-
**/
|
14
|
-
|
15
|
-
document.body.delegateEvent('submit', { "form[data-remote=true]" :
|
16
|
-
function(e) {
|
17
|
-
e.halt();
|
18
|
-
var element = e.target;
|
19
|
-
var message = element.get('data-confirm');
|
20
|
-
if (message && !confirm(message)) { return false; }
|
21
|
-
JSAdapter.sendRequest(element, {
|
22
|
-
verb: element.get('data-method') || element.get('method') || 'post',
|
23
|
-
url: element.get('action'),
|
24
|
-
params: element.toQueryString()
|
25
|
-
});
|
26
|
-
}
|
27
|
-
});
|
28
|
-
|
29
|
-
/* Confirmation Support
|
30
|
-
* link_to 'sign out', '/logout', :confirm => "Log out?"
|
31
|
-
**/
|
32
|
-
|
33
|
-
document.body.delegateEvent('click', { "a[data-confirm]" :
|
34
|
-
function(e) {
|
35
|
-
var message = e.target.get('data-confirm');
|
36
|
-
if (message && !confirm(message)) { e.halt(); }
|
37
|
-
}
|
38
|
-
});
|
39
|
-
|
40
|
-
/*
|
41
|
-
* Link Remote Support
|
42
|
-
* link_to 'add item', '/create', :remote => true
|
43
|
-
**/
|
44
|
-
|
45
|
-
document.body.delegateEvent('click', { "a[data-remote]" :
|
46
|
-
function(e) {
|
47
|
-
if (e.stopped) return; e.halt();
|
48
|
-
var element = e.target;
|
49
|
-
JSAdapter.sendRequest(element, {
|
50
|
-
verb: element.get('data-method') || 'get',
|
51
|
-
url: element.get('href')
|
52
|
-
});
|
53
|
-
}
|
54
|
-
});
|
55
|
-
|
56
|
-
/*
|
57
|
-
* Link Method Support
|
58
|
-
* link_to 'delete item', '/destroy', :method => :delete
|
59
|
-
**/
|
60
|
-
|
61
|
-
document.body.delegateEvent('click', { "a[data-method]:not([data-remote])" :
|
62
|
-
function(e) {
|
63
|
-
if (e.stopped) return;
|
64
|
-
console.log(e.target);
|
65
|
-
JSAdapter.sendMethod(e.target);
|
66
|
-
e.halt();
|
67
|
-
}});
|
68
|
-
});
|
69
|
-
|
70
9
|
/* JSAdapter */
|
71
10
|
var JSAdapter = {
|
72
11
|
// Sends an xhr request to the specified url with given verb and params
|
@@ -101,4 +40,64 @@ var JSAdapter = {
|
|
101
40
|
}
|
102
41
|
form.submit();
|
103
42
|
}
|
104
|
-
};
|
43
|
+
};
|
44
|
+
window.addEvent('domready', function() {
|
45
|
+
|
46
|
+
/* Remote Form Support
|
47
|
+
* form_for @user, '/user', :remote => true
|
48
|
+
**/
|
49
|
+
|
50
|
+
$$("form[data-remote=true]").addEvent('click', function(e) {
|
51
|
+
e.halt();
|
52
|
+
var element = e.target;
|
53
|
+
var message = element.get('data-confirm');
|
54
|
+
if (message && !confirm(message)) {
|
55
|
+
return false;
|
56
|
+
}
|
57
|
+
JSAdapter.sendRequest(element, {
|
58
|
+
verb: element.get('data-method') || element.get('method') || 'post',
|
59
|
+
url: element.get('action'),
|
60
|
+
params: element.toQueryString()
|
61
|
+
});
|
62
|
+
});
|
63
|
+
|
64
|
+
/* Confirmation Support
|
65
|
+
* link_to 'sign out', '/logout', :confirm => "Log out?"
|
66
|
+
**/
|
67
|
+
|
68
|
+
$$('a[data-confirm').addEvent('click', function(e) {
|
69
|
+
var message = e.target.get('data-confirm');
|
70
|
+
if (message && !confirm(message)) {
|
71
|
+
e.halt();
|
72
|
+
}
|
73
|
+
});
|
74
|
+
|
75
|
+
/*
|
76
|
+
* Link Remote Support
|
77
|
+
* link_to 'add item', '/create', :remote => true
|
78
|
+
**/
|
79
|
+
|
80
|
+
$$("a[data-remote]").addEvent('click', function(e) {
|
81
|
+
if (e.stopped) return; e.halt();
|
82
|
+
var element = e.target;
|
83
|
+
JSAdapter.sendRequest(element, {
|
84
|
+
verb: element.get('data-method') || 'get',
|
85
|
+
url: element.get('href')
|
86
|
+
});
|
87
|
+
})
|
88
|
+
|
89
|
+
/*
|
90
|
+
* Link Method Support
|
91
|
+
* link_to 'delete item', '/destroy', :method => :delete
|
92
|
+
**/
|
93
|
+
|
94
|
+
|
95
|
+
$$("a[data-method]:not([data-remote])").addEvent('click', function(e) {
|
96
|
+
if (e.stopped) {
|
97
|
+
return;
|
98
|
+
}
|
99
|
+
JSAdapter.sendMethod(e.target);
|
100
|
+
e.halt();
|
101
|
+
});
|
102
|
+
|
103
|
+
});
|
@@ -315,7 +315,7 @@ if defined?(ActiveRecord)
|
|
315
315
|
if defined?(I18n)
|
316
316
|
desc "Generates .yml files for I18n translations"
|
317
317
|
task :translate => :environment do
|
318
|
-
models = Dir["#{Padrino.root}/app/models/**/*.rb"].map { |m| File.basename(m, ".rb") }
|
318
|
+
models = Dir["#{Padrino.root}/{app,}/models/**/*.rb"].map { |m| File.basename(m, ".rb") }
|
319
319
|
|
320
320
|
models.each do |m|
|
321
321
|
# Get the model class
|
@@ -567,4 +567,4 @@ if defined?(ActiveRecord)
|
|
567
567
|
end
|
568
568
|
|
569
569
|
ActiveRecord::Migration.send :include, AutoMigrations
|
570
|
-
end
|
570
|
+
end
|
@@ -50,7 +50,7 @@ if defined?(DataMapper)
|
|
50
50
|
puts "=> Creating database '#{database}'"
|
51
51
|
case config[:adapter]
|
52
52
|
when 'postgres'
|
53
|
-
system("createdb", "-E", charset, "-U", user, database)
|
53
|
+
system("createdb", "-E", charset, "-h", host, "-U", user, database)
|
54
54
|
puts "<= dm:create executed"
|
55
55
|
when 'mysql'
|
56
56
|
query = [
|
@@ -74,7 +74,7 @@ if defined?(DataMapper)
|
|
74
74
|
puts "=> Dropping database '#{database}'"
|
75
75
|
case config[:adapter]
|
76
76
|
when 'postgres'
|
77
|
-
system("dropdb", "-U", user, database)
|
77
|
+
system("dropdb", "-h", host, "-U", user, database)
|
78
78
|
puts "<= dm:drop executed"
|
79
79
|
when 'mysql'
|
80
80
|
query = [
|
@@ -96,4 +96,4 @@ if defined?(DataMapper)
|
|
96
96
|
desc "Create the database migrate and initialize with the seed data"
|
97
97
|
task :setup => [:create, :migrate, :seed]
|
98
98
|
end
|
99
|
-
end
|
99
|
+
end
|
@@ -9,7 +9,7 @@ if defined?(Mongoid)
|
|
9
9
|
# Helper to retrieve a list of models.
|
10
10
|
def get_mongoid_models
|
11
11
|
documents = []
|
12
|
-
Dir
|
12
|
+
Dir['{app,}/models/*.rb'].sort.each do |file|
|
13
13
|
model_path = file[0..-4].split('/')[2..-1]
|
14
14
|
|
15
15
|
begin
|
@@ -8,7 +8,7 @@ if defined?(MongoMapper)
|
|
8
8
|
if defined?(I18n)
|
9
9
|
desc "Generates .yml files for I18n translations"
|
10
10
|
task :translate => :environment do
|
11
|
-
models = Dir["#{Padrino.root}/app/models/**/*.rb"].map { |m| File.basename(m, ".rb") }
|
11
|
+
models = Dir["#{Padrino.root}/{app,}/models/**/*.rb"].map { |m| File.basename(m, ".rb") }
|
12
12
|
|
13
13
|
models.each do |m|
|
14
14
|
# Get the model class
|
@@ -47,4 +47,4 @@ if defined?(MongoMapper)
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
50
|
-
end
|
50
|
+
end
|
data/padrino-gen.gemspec
CHANGED
data/test/test_app_generator.rb
CHANGED
@@ -42,7 +42,6 @@ class TestAppGenerator < Test::Unit::TestCase
|
|
42
42
|
assert_file_exists("#{@apptmp}/sample_project/demo/helpers.rb")
|
43
43
|
assert_file_exists("#{@apptmp}/sample_project/demo/controllers.rb")
|
44
44
|
assert_file_exists("#{@apptmp}/sample_project/demo/mailers.rb")
|
45
|
-
assert_dir_exists("#{@apptmp}/sample_project/demo/views/mailers")
|
46
45
|
assert_dir_exists("#{@apptmp}/sample_project/public/demo")
|
47
46
|
assert_match_in_file(/:notifier/,"#{@apptmp}/sample_project/demo/mailers.rb")
|
48
47
|
assert_no_file_exists("#{@apptmp}/sample_project/demo/helpers")
|
@@ -62,8 +61,6 @@ class TestAppGenerator < Test::Unit::TestCase
|
|
62
61
|
silence_logger { generate(:project, 'sample_project', "--root=#{@apptmp}", '--script=none', '-t=bacon') }
|
63
62
|
silence_logger { generate(:app, 'demo_app', "--root=#{@apptmp}/sample_project") }
|
64
63
|
silence_logger { generate(:mailer, 'demo', "-r=#{@apptmp}/sample_project", '-a=demoapp') }
|
65
|
-
assert_match_in_file(/DemoApp.mailer :demo/m, "#{@apptmp}/sample_project/demoapp/mailers/demo.rb")
|
66
|
-
assert_dir_exists("#{@apptmp}/sample_project/demoapp/views/mailers/demo")
|
67
64
|
end
|
68
65
|
|
69
66
|
# only destroys what it generated.
|
@@ -81,4 +78,4 @@ class TestAppGenerator < Test::Unit::TestCase
|
|
81
78
|
assert_no_match_in_file(/Padrino\.mount\("Demo"\).to\("\/demo"\)/,"#{@apptmp}/sample_project/config/apps.rb")
|
82
79
|
end
|
83
80
|
end
|
84
|
-
end
|
81
|
+
end
|
@@ -67,8 +67,7 @@ class TestProjectGenerator < Test::Unit::TestCase
|
|
67
67
|
assert_dir_exists("#{@apptmp}/sample_project/public/images")
|
68
68
|
assert_dir_exists("#{@apptmp}/sample_project/public/javascripts")
|
69
69
|
assert_dir_exists("#{@apptmp}/sample_project/public/stylesheets")
|
70
|
-
assert_dir_exists("#{@apptmp}/sample_project/app/views/
|
71
|
-
assert_dir_exists("#{@apptmp}/sample_project/app/views/layouts")
|
70
|
+
# assert_dir_exists("#{@apptmp}/sample_project/app/views/layouts")
|
72
71
|
assert_match_in_file(/:notifier/,"#{@apptmp}/sample_project/app/mailers.rb")
|
73
72
|
assert_no_file_exists("#{@apptmp}/sample_project/demo/helpers")
|
74
73
|
assert_no_file_exists("#{@apptmp}/sample_project/demo/controllers")
|
@@ -76,7 +75,7 @@ class TestProjectGenerator < Test::Unit::TestCase
|
|
76
75
|
|
77
76
|
should "not create models folder if no orm is chosen" do
|
78
77
|
silence_logger { generate(:project, 'sample_project', "--root=#{@apptmp}", '--script=none', '--orm=none') }
|
79
|
-
assert_no_dir_exists("#{@apptmp}/sample_project/
|
78
|
+
assert_no_dir_exists("#{@apptmp}/sample_project/models")
|
80
79
|
end
|
81
80
|
|
82
81
|
should "not create tests folder if no test framework is chosen" do
|
@@ -177,7 +176,6 @@ class TestProjectGenerator < Test::Unit::TestCase
|
|
177
176
|
assert_match_in_file(/Sequel.connect/, "#{@apptmp}/project.com/config/database.rb")
|
178
177
|
assert_match_in_file(%r{sqlite://}, "#{@apptmp}/project.com/config/database.rb")
|
179
178
|
assert_match_in_file(%r{project_com}, "#{@apptmp}/project.com/config/database.rb")
|
180
|
-
assert_dir_exists("#{@apptmp}/project.com/app/models")
|
181
179
|
end
|
182
180
|
|
183
181
|
should "properly generate mysql" do
|
@@ -210,7 +208,6 @@ class TestProjectGenerator < Test::Unit::TestCase
|
|
210
208
|
assert_match_in_file(/gem 'sqlite3'/, "#{@apptmp}/project.com/Gemfile")
|
211
209
|
assert_match_in_file(/ActiveRecord::Base.establish_connection/, "#{@apptmp}/project.com/config/database.rb")
|
212
210
|
assert_match_in_file(/project_com/, "#{@apptmp}/project.com/config/database.rb")
|
213
|
-
assert_dir_exists("#{@apptmp}/project.com/app/models")
|
214
211
|
end
|
215
212
|
|
216
213
|
should "properly generate mysql" do
|
@@ -250,7 +247,6 @@ class TestProjectGenerator < Test::Unit::TestCase
|
|
250
247
|
assert_match_in_file(/gem 'dm-sqlite-adapter'/, "#{@apptmp}/project.com/Gemfile")
|
251
248
|
assert_match_in_file(/DataMapper.setup/, "#{@apptmp}/project.com/config/database.rb")
|
252
249
|
assert_match_in_file(/project_com/, "#{@apptmp}/project.com/config/database.rb")
|
253
|
-
assert_dir_exists("#{@apptmp}/project.com/app/models")
|
254
250
|
end
|
255
251
|
|
256
252
|
should "properly generate for mysql" do
|
@@ -281,7 +277,6 @@ class TestProjectGenerator < Test::Unit::TestCase
|
|
281
277
|
assert_match_in_file(/gem 'bson_ext'/, "#{@apptmp}/project.com/Gemfile")
|
282
278
|
assert_match_in_file(/MongoMapper.database/, "#{@apptmp}/project.com/config/database.rb")
|
283
279
|
assert_match_in_file(/project_com/, "#{@apptmp}/project.com/config/database.rb")
|
284
|
-
assert_dir_exists("#{@apptmp}/project.com/app/models")
|
285
280
|
end
|
286
281
|
|
287
282
|
should "properly generate for mongoid" do
|
@@ -291,7 +286,6 @@ class TestProjectGenerator < Test::Unit::TestCase
|
|
291
286
|
assert_match_in_file(/gem 'bson_ext'/, "#{@apptmp}/project.com/Gemfile")
|
292
287
|
assert_match_in_file(/Mongoid.database/, "#{@apptmp}/project.com/config/database.rb")
|
293
288
|
assert_match_in_file(/project_com/, "#{@apptmp}/project.com/config/database.rb")
|
294
|
-
assert_dir_exists("#{@apptmp}/project.com/app/models")
|
295
289
|
end
|
296
290
|
|
297
291
|
|
@@ -301,7 +295,6 @@ class TestProjectGenerator < Test::Unit::TestCase
|
|
301
295
|
assert_match_in_file(/gem 'couchrest_model'/, "#{@apptmp}/project.com/Gemfile")
|
302
296
|
assert_match_in_file(/CouchRest.database!/, "#{@apptmp}/project.com/config/database.rb")
|
303
297
|
assert_match_in_file(/project_com/, "#{@apptmp}/project.com/config/database.rb")
|
304
|
-
assert_dir_exists("#{@apptmp}/project.com/app/models")
|
305
298
|
end
|
306
299
|
|
307
300
|
should "properly generate for ohm" do
|
@@ -311,7 +304,6 @@ class TestProjectGenerator < Test::Unit::TestCase
|
|
311
304
|
assert_match_in_file(/gem 'ohm'/, "#{@apptmp}/sample_project/Gemfile")
|
312
305
|
assert_match_in_file(/gem 'ohm-contrib', :require => "ohm\/contrib"/, "#{@apptmp}/sample_project/Gemfile")
|
313
306
|
assert_match_in_file(/Ohm.connect/, "#{@apptmp}/sample_project/config/database.rb")
|
314
|
-
assert_dir_exists("#{@apptmp}/sample_project/app/models")
|
315
307
|
end
|
316
308
|
|
317
309
|
should "properly generate for mongomatic" do
|
@@ -320,7 +312,6 @@ class TestProjectGenerator < Test::Unit::TestCase
|
|
320
312
|
assert_match_in_file(/gem 'bson_ext'/, "#{@apptmp}/sample_project/Gemfile")
|
321
313
|
assert_match_in_file(/gem 'mongomatic'/, "#{@apptmp}/sample_project/Gemfile")
|
322
314
|
assert_match_in_file(/Mongomatic.db = Mongo::Connection.new.db/, "#{@apptmp}/sample_project/config/database.rb")
|
323
|
-
assert_dir_exists("#{@apptmp}/sample_project/app/models")
|
324
315
|
end
|
325
316
|
|
326
317
|
should "properly generate for ripple" do
|
@@ -329,7 +320,6 @@ class TestProjectGenerator < Test::Unit::TestCase
|
|
329
320
|
assert_match_in_file(/gem 'ripple'/, "#{@apptmp}/sample_project/Gemfile")
|
330
321
|
assert_match_in_file(/Ripple.load_configuration/, "#{@apptmp}/sample_project/config/database.rb")
|
331
322
|
assert_match_in_file(/http_port: 8098/, "#{@apptmp}/sample_project/config/riak.yml")
|
332
|
-
assert_dir_exists("#{@apptmp}/sample_project/app/models")
|
333
323
|
end
|
334
324
|
end
|
335
325
|
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: padrino-gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.10.
|
5
|
+
version: 0.10.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Padrino Team
|
@@ -13,7 +13,7 @@ autorequire:
|
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
15
|
|
16
|
-
date: 2011-
|
16
|
+
date: 2011-08-01 00:00:00 -07:00
|
17
17
|
default_executable:
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
requirements:
|
25
25
|
- - "="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.10.
|
27
|
+
version: 0.10.1
|
28
28
|
type: :runtime
|
29
29
|
version_requirements: *id001
|
30
30
|
- !ruby/object:Gem::Dependency
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
requirements:
|
36
36
|
- - ~>
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version: 1.0
|
38
|
+
version: "1.0"
|
39
39
|
type: :runtime
|
40
40
|
version_requirements: *id002
|
41
41
|
- !ruby/object:Gem::Dependency
|