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
@@ -0,0 +1,77 @@
|
|
1
|
+
module Rapid
|
2
|
+
module Spec
|
3
|
+
|
4
|
+
module Project
|
5
|
+
|
6
|
+
def self.included base
|
7
|
+
base.extend ClassMethods
|
8
|
+
end
|
9
|
+
|
10
|
+
def mock_skeleton_io skeleton
|
11
|
+
@skeleton = skeleton
|
12
|
+
|
13
|
+
# skeleton.stub!(:read_template_file)
|
14
|
+
skeleton.stub!(:project_file_exists?) do |file_path|
|
15
|
+
@project_files_content.key?(file_path) || File.exists?(File.join(skeleton.project_path, file_path))
|
16
|
+
end
|
17
|
+
|
18
|
+
@project_directories = {}
|
19
|
+
skeleton.stub!(:make_project_directory) do |file_path|
|
20
|
+
@project_directories[file_path] = true
|
21
|
+
end
|
22
|
+
|
23
|
+
skeleton.stub!(:delete_project_directory) do |file_path|
|
24
|
+
@project_directories[file_path] = false
|
25
|
+
end
|
26
|
+
|
27
|
+
skeleton.stub!(:read_project_file) do |file_path|
|
28
|
+
@project_files_content[file_path] || actual_project_file(file_path)
|
29
|
+
end
|
30
|
+
|
31
|
+
@project_files_content = {}
|
32
|
+
skeleton.stub!(:write_project_file) do |file_path, file_content|
|
33
|
+
@project_files_content[file_path] = file_content
|
34
|
+
end
|
35
|
+
|
36
|
+
skeleton.stub!(:delete_project_file) do |file_path|
|
37
|
+
@project_files_content[file_path] = false
|
38
|
+
end
|
39
|
+
|
40
|
+
skeleton.stub!(:chmod_project_file)
|
41
|
+
end
|
42
|
+
|
43
|
+
def project_file file_path
|
44
|
+
@project_files_content[file_path]
|
45
|
+
end
|
46
|
+
|
47
|
+
def project_file? file_path
|
48
|
+
if @project_files_content.key? file_path
|
49
|
+
@project_files_content[file_path] != false
|
50
|
+
else
|
51
|
+
full_path = File.join @skeleton.project_path, file_path
|
52
|
+
File.exists? full_path
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def actual_project_file file_path
|
57
|
+
full_path = File.join @skeleton.project_path, file_path
|
58
|
+
File.open(full_path) { |f| f.read }
|
59
|
+
end
|
60
|
+
|
61
|
+
def has_directory? file_path
|
62
|
+
if @project_directories.key?(file_path)
|
63
|
+
@project_directories[file_path]
|
64
|
+
else
|
65
|
+
full_path = File.join @skeleton.project_path, file_path
|
66
|
+
File.directory?(full_path)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
module ClassMethods
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../../spec_helper')
|
2
|
+
|
3
|
+
describe "templates/app/helpers/analytics/google_helper.rb" do
|
4
|
+
|
5
|
+
include Rapid::Spec::Template
|
6
|
+
template_spec __FILE__
|
7
|
+
|
8
|
+
describe "analytics.google.uid" do
|
9
|
+
|
10
|
+
it "should push" do
|
11
|
+
push 'analytics.google.uid' => %(foobar)
|
12
|
+
@result.should include %(def google_analytics uid = "foobar")
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should pull" do
|
16
|
+
pull 'analytics.google.uid' => %(foobar)
|
17
|
+
@result['analytics.google.uid'].should == 'foobar'
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -8,24 +8,24 @@ describe "templates/config/application.rb" do
|
|
8
8
|
describe "rails_all" do
|
9
9
|
|
10
10
|
it "should push true" do
|
11
|
-
push
|
11
|
+
push 'database.sqlite3' => true, 'test.unit' => true, 'assets' => true
|
12
12
|
@result.should include %(require 'rails/all')
|
13
13
|
@result.should_not include %(require "action_controller/railtie")
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should push false" do
|
17
|
-
push "database.
|
17
|
+
push "database.sqlite3" => false
|
18
18
|
@result.should_not include %(require 'rails/all')
|
19
19
|
@result.should include %(require "action_controller/railtie")
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should pull true" do
|
23
|
-
pull
|
23
|
+
pull 'database.sqlite3' => true, 'test.unit' => true, 'assets' => true
|
24
24
|
@result['rails_all'].should == true
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should pull false" do
|
28
|
-
pull 'database.
|
28
|
+
pull 'database.sqlite3' => false
|
29
29
|
@result['rails_all'].should == false
|
30
30
|
end
|
31
31
|
|
@@ -34,22 +34,22 @@ describe "templates/config/application.rb" do
|
|
34
34
|
describe "database.active_record" do
|
35
35
|
|
36
36
|
it "should push true" do
|
37
|
-
push 'test.unit' =>
|
37
|
+
push 'database.sqlite3' => true, 'test.unit' => false
|
38
38
|
@result.should include %(\nrequire "active_record/railtie")
|
39
39
|
end
|
40
40
|
|
41
41
|
it "should push false" do
|
42
|
-
push 'database.
|
42
|
+
push 'database.sqlite3' => false
|
43
43
|
@result.should include %(\n# require "active_record/railtie")
|
44
44
|
end
|
45
45
|
|
46
46
|
it "should pull true" do
|
47
|
-
pull 'test.unit' =>
|
47
|
+
pull 'database.sqlite3' => true, 'test.unit' => false
|
48
48
|
@result['database.active_record'].should == true
|
49
49
|
end
|
50
50
|
|
51
51
|
it "should pull false" do
|
52
|
-
pull 'database.
|
52
|
+
pull 'database.sqlite3' => false
|
53
53
|
@result['database.active_record'].should == false
|
54
54
|
end
|
55
55
|
|
@@ -58,22 +58,22 @@ describe "templates/config/application.rb" do
|
|
58
58
|
describe "assets" do
|
59
59
|
|
60
60
|
it "should push true" do
|
61
|
-
push 'test.unit' =>
|
61
|
+
push 'assets' => true, 'test.unit' => false
|
62
62
|
@result.should include %(\nrequire "sprockets/railtie")
|
63
63
|
end
|
64
64
|
|
65
65
|
it "should push false" do
|
66
|
-
push 'assets' =>
|
66
|
+
push 'assets' => false
|
67
67
|
@result.should include %(\n# require "sprockets/railtie")
|
68
68
|
end
|
69
69
|
|
70
70
|
it "should pull true" do
|
71
|
-
pull 'test.unit' =>
|
71
|
+
pull 'assets' => true, 'test.unit' => false
|
72
72
|
@result['assets'].should == true
|
73
73
|
end
|
74
74
|
|
75
75
|
it "should pull false" do
|
76
|
-
pull 'assets' =>
|
76
|
+
pull 'assets' => false
|
77
77
|
@result['assets'].should == false
|
78
78
|
end
|
79
79
|
|
@@ -82,22 +82,22 @@ describe "templates/config/application.rb" do
|
|
82
82
|
describe "test.unit" do
|
83
83
|
|
84
84
|
it "should push true" do
|
85
|
-
push 'assets' =>
|
85
|
+
push 'assets' => false, 'test.unit' => true
|
86
86
|
@result.should include %(\nrequire "rails/test_unit/railtie")
|
87
87
|
end
|
88
88
|
|
89
89
|
it "should push false" do
|
90
|
-
push 'test.unit' =>
|
90
|
+
push 'test.unit' => false
|
91
91
|
@result.should include %(\n# require "rails/test_unit/railtie")
|
92
92
|
end
|
93
93
|
|
94
94
|
it "should pull true" do
|
95
|
-
pull 'assets' =>
|
95
|
+
pull 'assets' => false, 'test.unit' => true
|
96
96
|
@result['test.unit'].should == true
|
97
97
|
end
|
98
98
|
|
99
99
|
it "should pull false" do
|
100
|
-
pull 'test.unit' =>
|
100
|
+
pull 'test.unit' => false
|
101
101
|
@result['test.unit'].should == false
|
102
102
|
end
|
103
103
|
|
@@ -130,7 +130,7 @@ describe "templates/config/application.rb" do
|
|
130
130
|
end
|
131
131
|
|
132
132
|
it "should pull default" do
|
133
|
-
pull 'timezone' =>
|
133
|
+
pull 'timezone' => false
|
134
134
|
@result['timezone'].should == false
|
135
135
|
end
|
136
136
|
|
@@ -141,26 +141,26 @@ describe "templates/config/application.rb" do
|
|
141
141
|
|
142
142
|
end
|
143
143
|
|
144
|
-
describe "config.
|
144
|
+
describe "app.config.start" do
|
145
145
|
|
146
146
|
it "should push code" do
|
147
|
-
push 'config.
|
147
|
+
push 'app.config.start' => "config.something = 'foo'"
|
148
148
|
@result.should include %(config.something = 'foo')
|
149
149
|
end
|
150
150
|
|
151
151
|
it "should push blank" do
|
152
152
|
push
|
153
|
-
@result.should include "US & Canada)'
|
153
|
+
@result.should include "US & Canada)'"
|
154
154
|
end
|
155
155
|
|
156
156
|
it "should pull code" do
|
157
|
-
pull 'config.
|
158
|
-
@result['config.
|
157
|
+
pull 'app.config.start' => "config.something = 'foo'"
|
158
|
+
@result['app.config.start'].should == %(config.something = 'foo')
|
159
159
|
end
|
160
160
|
|
161
161
|
it "should pull blank" do
|
162
162
|
pull
|
163
|
-
@result['config.
|
163
|
+
@result['app.config.start'].should == ""
|
164
164
|
end
|
165
165
|
|
166
166
|
end
|
@@ -5,149 +5,149 @@ describe "templates/config/deploy/production.rb" do
|
|
5
5
|
include Rapid::Spec::Template
|
6
6
|
template_spec __FILE__
|
7
7
|
|
8
|
-
describe "deploy.production.user" do
|
8
|
+
describe "deploy.capistrano.production.user" do
|
9
9
|
|
10
10
|
it "should push" do
|
11
|
-
push 'deploy.production.user' => 'deploy'
|
11
|
+
push 'deploy.capistrano.production.user' => 'deploy'
|
12
12
|
@result.should include %(set :user, "deploy"\n)
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should pull" do
|
16
|
-
pull 'deploy.production.user' => 'deploy'
|
17
|
-
@result['deploy.production.user'].should == %(deploy)
|
16
|
+
pull 'deploy.capistrano.production.user' => 'deploy'
|
17
|
+
@result['deploy.capistrano.production.user'].should == %(deploy)
|
18
18
|
end
|
19
19
|
|
20
20
|
end
|
21
21
|
|
22
|
-
describe "deploy.production.path" do
|
22
|
+
describe "deploy.capistrano.production.path" do
|
23
23
|
|
24
24
|
it "should push" do
|
25
|
-
push 'deploy.production.path' => '/bin'
|
25
|
+
push 'deploy.capistrano.production.path' => '/bin'
|
26
26
|
@result.should include %(set :deploy_to, "/bin")
|
27
27
|
end
|
28
28
|
|
29
29
|
it "should pull" do
|
30
|
-
pull 'deploy.production.path' => '/bin'
|
31
|
-
@result['deploy.production.path'].should == %(/bin)
|
30
|
+
pull 'deploy.capistrano.production.path' => '/bin'
|
31
|
+
@result['deploy.capistrano.production.path'].should == %(/bin)
|
32
32
|
end
|
33
33
|
|
34
34
|
end
|
35
35
|
|
36
|
-
describe "deploy.production.branch" do
|
36
|
+
describe "deploy.capistrano.production.branch" do
|
37
37
|
|
38
38
|
it "should push" do
|
39
|
-
push 'deploy.production.branch' => 'master'
|
39
|
+
push 'deploy.capistrano.production.branch' => 'master'
|
40
40
|
@result.should include %(set :branch, "master"\n)
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should pull" do
|
44
|
-
pull 'deploy.production.branch' => 'master'
|
45
|
-
@result['deploy.production.branch'].should == 'master'
|
44
|
+
pull 'deploy.capistrano.production.branch' => 'master'
|
45
|
+
@result['deploy.capistrano.production.branch'].should == 'master'
|
46
46
|
end
|
47
47
|
|
48
48
|
end
|
49
49
|
|
50
|
-
describe "deploy.production.keep" do
|
50
|
+
describe "deploy.capistrano.production.keep" do
|
51
51
|
|
52
52
|
it "should push" do
|
53
|
-
push 'deploy.production.keep' => 5
|
53
|
+
push 'deploy.capistrano.production.keep' => 5
|
54
54
|
@result.should include %(set :keep_releases, 5\n)
|
55
55
|
end
|
56
56
|
|
57
57
|
it "should pull" do
|
58
|
-
pull 'deploy.production.keep' => 5
|
59
|
-
@result['deploy.production.keep'].should == "5"
|
58
|
+
pull 'deploy.capistrano.production.keep' => 5
|
59
|
+
@result['deploy.capistrano.production.keep'].should == "5"
|
60
60
|
end
|
61
61
|
|
62
62
|
end
|
63
63
|
|
64
|
-
describe "deploy.production.domain" do
|
64
|
+
describe "deploy.capistrano.production.domain" do
|
65
65
|
|
66
66
|
it "should push" do
|
67
|
-
push 'deploy.production.domain' => 'myapp.com'
|
67
|
+
push 'deploy.capistrano.production.domain' => 'myapp.com'
|
68
68
|
@result.should include %(role :web, "myapp.com")
|
69
69
|
@result.should include %(role :app, "myapp.com")
|
70
70
|
@result.should include %(role :db, "myapp.com", :primary => true)
|
71
71
|
end
|
72
72
|
|
73
73
|
it "should pull" do
|
74
|
-
pull 'deploy.production.domain' => 'myapp.com'
|
75
|
-
@result['deploy.production.domain'].should == 'myapp.com'
|
74
|
+
pull 'deploy.capistrano.production.domain' => 'myapp.com'
|
75
|
+
@result['deploy.capistrano.production.domain'].should == 'myapp.com'
|
76
76
|
end
|
77
77
|
|
78
78
|
end
|
79
79
|
|
80
|
-
describe "deploy.production.server" do
|
80
|
+
describe "deploy.capistrano.production.server" do
|
81
81
|
|
82
82
|
it "should push" do
|
83
|
-
push 'deploy.production.server' => 'passenger'
|
83
|
+
push 'deploy.capistrano.production.server' => 'passenger'
|
84
84
|
@result.should include 'run "touch #{deploy_to}/current/tmp/restart.txt"'
|
85
85
|
end
|
86
86
|
|
87
87
|
it "should pull" do
|
88
|
-
pull 'deploy.production.server' => 'passenger'
|
89
|
-
@result['deploy.production.server'].should == %(passenger)
|
88
|
+
pull 'deploy.capistrano.production.server' => 'passenger'
|
89
|
+
@result['deploy.capistrano.production.server'].should == %(passenger)
|
90
90
|
end
|
91
91
|
|
92
92
|
end
|
93
93
|
|
94
|
-
describe "deploy.production.bin" do
|
94
|
+
describe "deploy.capistrano.production.bin" do
|
95
95
|
|
96
96
|
it "should push" do
|
97
|
-
push 'deploy.production.bin' => '/opt/local/bin'
|
97
|
+
push 'deploy.capistrano.production.bin' => '/opt/local/bin'
|
98
98
|
@result.should include %(set :bundle_cmd, "/opt/local/bin/bundle")
|
99
99
|
end
|
100
100
|
|
101
101
|
it "should pull" do
|
102
|
-
pull 'deploy.production.bin' => '/opt/local/bin'
|
103
|
-
@result['deploy.production.bin'].should == %(/opt/local/bin)
|
102
|
+
pull 'deploy.capistrano.production.bin' => '/opt/local/bin'
|
103
|
+
@result['deploy.capistrano.production.bin'].should == %(/opt/local/bin)
|
104
104
|
end
|
105
105
|
|
106
106
|
end
|
107
107
|
|
108
|
-
describe "deploy.production.rvm" do
|
108
|
+
describe "deploy.capistrano.production.rvm" do
|
109
109
|
|
110
110
|
it "should push" do
|
111
|
-
push 'deploy.production.rvm.type' => 'user',
|
112
|
-
'deploy.production.rvm.ruby' => 'ree',
|
113
|
-
'deploy.production.rvm.gemset' => 'rapid'
|
111
|
+
push 'deploy.capistrano.production.rvm.type' => 'user',
|
112
|
+
'deploy.capistrano.production.rvm.ruby' => 'ree',
|
113
|
+
'deploy.capistrano.production.rvm.gemset' => 'rapid'
|
114
114
|
|
115
115
|
@result.should include %(set :rvm_type, :user)
|
116
116
|
@result.should include %(set :rvm_ruby_string, 'ree@rapid')
|
117
117
|
end
|
118
118
|
|
119
119
|
it "should pull" do
|
120
|
-
pull 'deploy.production.rvm.type' => 'user',
|
121
|
-
'deploy.production.rvm.ruby' => 'ree',
|
122
|
-
'deploy.production.rvm.gemset' => 'rapid'
|
120
|
+
pull 'deploy.capistrano.production.rvm.type' => 'user',
|
121
|
+
'deploy.capistrano.production.rvm.ruby' => 'ree',
|
122
|
+
'deploy.capistrano.production.rvm.gemset' => 'rapid'
|
123
123
|
|
124
|
-
@result['deploy.production.rvm.type'].should == 'user'
|
125
|
-
@result['deploy.production.rvm.ruby'].should == 'ree'
|
126
|
-
@result['deploy.production.rvm.gemset'].should == 'rapid'
|
124
|
+
@result['deploy.capistrano.production.rvm.type'].should == 'user'
|
125
|
+
@result['deploy.capistrano.production.rvm.ruby'].should == 'ree'
|
126
|
+
@result['deploy.capistrano.production.rvm.gemset'].should == 'rapid'
|
127
127
|
end
|
128
128
|
|
129
129
|
end
|
130
130
|
|
131
|
-
describe "deploy.production.scheduler" do
|
131
|
+
describe "deploy.capistrano.production.scheduler" do
|
132
132
|
|
133
133
|
it "should push true" do
|
134
|
-
push 'deploy.production.bin' => '/foo', 'scheduler' => true
|
134
|
+
push 'deploy.capistrano.production.bin' => '/foo', 'scheduler' => true
|
135
135
|
@result.should include %(set :whenever_command, "/foo/bundle exec whenever")
|
136
136
|
end
|
137
137
|
|
138
138
|
it "should push false" do
|
139
|
-
push 'deploy.production.bin' => '/foo', 'scheduler' => false
|
139
|
+
push 'deploy.capistrano.production.bin' => '/foo', 'scheduler' => false
|
140
140
|
@result.should_not include %(set :whenever_command, "/foo/bundle exec whenever")
|
141
141
|
end
|
142
142
|
|
143
143
|
it "should pull true" do
|
144
|
-
pull 'deploy.production.bin' => '/foo', 'scheduler' => true
|
145
|
-
@result['deploy.production.scheduler'].should == true
|
144
|
+
pull 'deploy.capistrano.production.bin' => '/foo', 'scheduler' => true
|
145
|
+
@result['deploy.capistrano.production.scheduler'].should == true
|
146
146
|
end
|
147
147
|
|
148
148
|
it "should pull false" do
|
149
|
-
pull 'deploy.production.bin' => '/foo', 'scheduler' => false
|
150
|
-
@result['deploy.production.scheduler'].should == false
|
149
|
+
pull 'deploy.capistrano.production.bin' => '/foo', 'scheduler' => false
|
150
|
+
@result['deploy.capistrano.production.scheduler'].should == false
|
151
151
|
end
|
152
152
|
|
153
153
|
end
|
@@ -5,26 +5,26 @@ describe "templates/config/deploy.rb" do
|
|
5
5
|
include Rapid::Spec::Template
|
6
6
|
template_spec __FILE__
|
7
7
|
|
8
|
-
describe "deploy.rvm" do
|
8
|
+
describe "deploy.capistrano.production.rvm" do
|
9
9
|
|
10
10
|
it "should push true" do
|
11
|
-
push 'deploy.production.rvm' => true
|
11
|
+
push 'deploy.capistrano.production.rvm' => true
|
12
12
|
@result.should include %(require "rvm/capistrano")
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should push false" do
|
16
|
-
push 'deploy.production.rvm' => false
|
16
|
+
push 'deploy.capistrano.production.rvm' => false
|
17
17
|
@result.should_not include %(require "rvm/capistrano")
|
18
18
|
end
|
19
19
|
|
20
20
|
it "should pull true" do
|
21
|
-
pull 'deploy.production.rvm' => true
|
22
|
-
@result['deploy.rvm'].should == true
|
21
|
+
pull 'deploy.capistrano.production.rvm' => true
|
22
|
+
@result['deploy.capistrano.production.rvm'].should == true
|
23
23
|
end
|
24
24
|
|
25
25
|
it "should pull false" do
|
26
|
-
pull 'deploy.production.rvm' => false
|
27
|
-
@result['deploy.rvm'].should == false
|
26
|
+
pull 'deploy.capistrano.production.rvm' => false
|
27
|
+
@result['deploy.capistrano.production.rvm'].should == false
|
28
28
|
end
|
29
29
|
|
30
30
|
end
|
@@ -43,40 +43,40 @@ describe "templates/config/deploy.rb" do
|
|
43
43
|
|
44
44
|
end
|
45
45
|
|
46
|
-
describe "deploy.repository.url" do
|
46
|
+
describe "deploy.capistrano.repository.url" do
|
47
47
|
|
48
48
|
it "should push" do
|
49
|
-
push 'deploy.repository.url' => 'git://foo.git'
|
49
|
+
push 'deploy.capistrano.repository.url' => 'git://foo.git'
|
50
50
|
@result.should include %(set :repository, "git://foo.git"\n)
|
51
51
|
end
|
52
52
|
|
53
53
|
it "should pull" do
|
54
|
-
pull 'deploy.repository.url' => 'git://foo.git'
|
55
|
-
@result['deploy.repository.url'].should == 'git://foo.git'
|
54
|
+
pull 'deploy.capistrano.repository.url' => 'git://foo.git'
|
55
|
+
@result['deploy.capistrano.repository.url'].should == 'git://foo.git'
|
56
56
|
end
|
57
57
|
|
58
58
|
end
|
59
59
|
|
60
|
-
describe "deploy.symlink?" do
|
60
|
+
describe "deploy.capistrano.symlink?" do
|
61
61
|
|
62
62
|
it "should push true" do
|
63
|
-
push 'database.
|
63
|
+
push 'database.sqlite3' => true
|
64
64
|
@result.should include %(task :symlink_shared)
|
65
65
|
end
|
66
66
|
|
67
67
|
it "should push false" do
|
68
|
-
push 'database.
|
68
|
+
push 'database.sqlite3' => false
|
69
69
|
@result.should_not include %(task :symlink_shared)
|
70
70
|
end
|
71
71
|
|
72
72
|
it "should pull true" do
|
73
|
-
pull 'database.
|
74
|
-
@result['deploy.symlink'].should == true
|
73
|
+
pull 'database.sqlite3' => true
|
74
|
+
@result['deploy.capistrano.symlink'].should == true
|
75
75
|
end
|
76
76
|
|
77
77
|
it "should pull false" do
|
78
|
-
pull 'database.
|
79
|
-
@result['deploy.symlink'].should == false
|
78
|
+
pull 'database.sqlite3' => false
|
79
|
+
@result['deploy.capistrano.symlink'].should == false
|
80
80
|
end
|
81
81
|
|
82
82
|
end
|
@@ -84,22 +84,22 @@ describe "templates/config/deploy.rb" do
|
|
84
84
|
describe "database.active_record" do
|
85
85
|
|
86
86
|
it "should push true" do
|
87
|
-
push 'database.
|
87
|
+
push 'database.sqlite3' => true
|
88
88
|
@result.should include %(/database.yml)
|
89
89
|
end
|
90
90
|
|
91
91
|
it "should push false" do
|
92
|
-
push 'database.
|
92
|
+
push 'database.sqlite3' => false
|
93
93
|
@result.should_not include %(/database.yml)
|
94
94
|
end
|
95
95
|
|
96
96
|
it "should pull true" do
|
97
|
-
pull 'database.
|
97
|
+
pull 'database.sqlite3' => true
|
98
98
|
@result['database.active_record'].should == true
|
99
99
|
end
|
100
100
|
|
101
101
|
it "should pull false" do
|
102
|
-
pull 'database.
|
102
|
+
pull 'database.sqlite3' => false, 'upload.private' => true
|
103
103
|
@result['database.active_record'].should == false
|
104
104
|
end
|
105
105
|
|
@@ -108,22 +108,22 @@ describe "templates/config/deploy.rb" do
|
|
108
108
|
describe "database.sqlite3" do
|
109
109
|
|
110
110
|
it "should push true" do
|
111
|
-
push 'database.
|
111
|
+
push 'database.sqlite3' => true
|
112
112
|
@result.should include %(/system/production.sqlite3)
|
113
113
|
end
|
114
114
|
|
115
115
|
it "should push false" do
|
116
|
-
push 'database.
|
116
|
+
push 'database.sqlite3' => false
|
117
117
|
@result.should_not include %(/system/production.sqlite3)
|
118
118
|
end
|
119
119
|
|
120
120
|
it "should pull true" do
|
121
|
-
pull 'database.
|
121
|
+
pull 'database.sqlite3' => true
|
122
122
|
@result['database.sqlite3'].should == true
|
123
123
|
end
|
124
124
|
|
125
125
|
it "should pull false" do
|
126
|
-
pull 'database.
|
126
|
+
pull 'database.sqlite3' => false, 'upload.private' => true
|
127
127
|
@result['database.sqlite3'].should == false
|
128
128
|
end
|
129
129
|
|
@@ -132,23 +132,23 @@ describe "templates/config/deploy.rb" do
|
|
132
132
|
describe "database.mongoid" do
|
133
133
|
|
134
134
|
it "should push true" do
|
135
|
-
push 'database.
|
135
|
+
push 'database.sqlite3' => false, 'database.mongoid' => true
|
136
136
|
@result.should include %(/mongoid.yml)
|
137
137
|
end
|
138
138
|
|
139
139
|
it "should push false" do
|
140
|
-
push 'database.
|
140
|
+
push 'database.sqlite3' => false, 'database.mongoid' => false
|
141
141
|
@result.should_not include %(/mongoid.yml)
|
142
142
|
end
|
143
143
|
|
144
144
|
it "should pull true" do
|
145
|
-
pull 'database.
|
145
|
+
pull 'database.sqlite3' => false, 'database.mongoid' => true
|
146
146
|
@result['database.mongoid'].should == true
|
147
147
|
end
|
148
148
|
|
149
149
|
it "should pull false" do
|
150
|
-
pull 'database.
|
151
|
-
@result['deploy.symlink'].should == false
|
150
|
+
pull 'database.sqlite3' => false, 'database.mongoid' => false
|
151
|
+
@result['deploy.capistrano.symlink'].should == false
|
152
152
|
end
|
153
153
|
|
154
154
|
end
|
@@ -171,7 +171,7 @@ describe "templates/config/deploy.rb" do
|
|
171
171
|
end
|
172
172
|
|
173
173
|
it "should pull false" do
|
174
|
-
pull 'upload.private' => false
|
174
|
+
pull 'database.sqlite3' => true, 'upload.private' => false
|
175
175
|
@result['upload.private'].should == false
|
176
176
|
end
|
177
177
|
|