pave 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/pave +36 -0
- data/lib/pave.rb +1 -0
- data/lib/pave/concrete.rb +26 -7
- data/lib/pave/database.rb +9 -0
- data/lib/pave/version.rb +1 -1
- data/lib/pave/virtual_host.rb +1 -19
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56cbfc6029f618ea0e737c96ed8f695ff6026182
|
4
|
+
data.tar.gz: 5d60bdbdc93f9f019c2515fb46934879578534c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73069297bb4d399f98d7cad1d88ab3d98e224e2abc758aa5ca3b4d39118fa2a7a01914a3f2c5c2c904336b9246dda12e6ae22b0989dfe40abb4995881f4b8eff
|
7
|
+
data.tar.gz: 2841c0c99a163690e01e2564260476f53a1e948f0daaba51dae8d2bc57356bab60ebafde1395d018a3a98d8c4f77844cea7cd7329c310d66565eb18432092d07
|
data/bin/pave
CHANGED
@@ -25,6 +25,41 @@ command :update do |c|
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
command :setup do |c|
|
29
|
+
c.syntax = "pave setup"
|
30
|
+
c.description = "Setup app folder for project."
|
31
|
+
c.action do
|
32
|
+
Pave::Concrete.set_up_app_folder
|
33
|
+
end
|
34
|
+
end
|
35
|
+
alias_command :"setup:app", :setup
|
36
|
+
|
37
|
+
command :"setup:symlinks" do |c|
|
38
|
+
c.syntax = "pave setup:symlinks"
|
39
|
+
c.description = "Setup app folder symlinks for project."
|
40
|
+
c.action do
|
41
|
+
Pave::Concrete.symlink_folders
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
command :"setup:permissions" do |c|
|
46
|
+
c.syntax = "pave setup:permissions"
|
47
|
+
c.description = "Setup folder permissions for project."
|
48
|
+
c.action do
|
49
|
+
Pave::Concrete.modify_folder_permissions
|
50
|
+
end
|
51
|
+
end
|
52
|
+
alias_command :"setup:chmod", :"setup:permissions"
|
53
|
+
|
54
|
+
command :"setup:clean" do |c|
|
55
|
+
c.syntax = "pave setup:cleanup"
|
56
|
+
c.description = "Remove unused folders from project."
|
57
|
+
c.action do
|
58
|
+
Pave::Concrete.remove_extra_folders
|
59
|
+
end
|
60
|
+
end
|
61
|
+
alias_command :"setup:cleanup", :"setup:clean"
|
62
|
+
|
28
63
|
command :"virtualhost:create" do |c|
|
29
64
|
c.syntax = "pave virtualhost:create VHOST"
|
30
65
|
c.description = "Setup virtual host for Concrete5 project."
|
@@ -70,6 +105,7 @@ command :"virtualhost:restart" do |c|
|
|
70
105
|
Pave::VirtualHost.new.restart_apache
|
71
106
|
end
|
72
107
|
end
|
108
|
+
alias_command :"vh:restart", :"virtualhost:restart"
|
73
109
|
|
74
110
|
command :"db:create" do |c|
|
75
111
|
c.syntax = "pave db:create"
|
data/lib/pave.rb
CHANGED
data/lib/pave/concrete.rb
CHANGED
@@ -6,6 +6,7 @@ module Pave
|
|
6
6
|
|
7
7
|
def self.create(name, options)
|
8
8
|
say ""
|
9
|
+
return say "Options should be given after the application name. For details run: `pave help`" unless name.size > 0
|
9
10
|
say "Setting up Concrete5 in folder #{name}."
|
10
11
|
new(name).setup
|
11
12
|
end
|
@@ -39,6 +40,7 @@ module Pave
|
|
39
40
|
|
40
41
|
symlink_folders
|
41
42
|
remove_extra_folders
|
43
|
+
modify_folder_permissions
|
42
44
|
end
|
43
45
|
|
44
46
|
def initialize_git
|
@@ -48,18 +50,35 @@ module Pave
|
|
48
50
|
sh "cd #{name} && git init && git add -A && git commit -m 'Initial'"
|
49
51
|
end
|
50
52
|
|
53
|
+
def sudo?
|
54
|
+
`whoami` == "root"
|
55
|
+
end
|
56
|
+
|
51
57
|
def create_virtual_host
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
58
|
+
if sudo?
|
59
|
+
Pave::VirtualHost.new("#{name}.site").create_vhost
|
60
|
+
else
|
61
|
+
say "Virtual host not set up. Run `sudo pave vh:create #{name}.site` to create it."
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def modify_folder_permissions
|
66
|
+
world_writable_folders.each do |folder|
|
67
|
+
sh "chmod -R 777 #{folder}"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def world_writable_folders
|
72
|
+
[
|
73
|
+
:config,
|
74
|
+
:packages,
|
75
|
+
:files
|
76
|
+
]
|
57
77
|
end
|
58
78
|
|
59
79
|
def symlink_folders
|
60
80
|
symlinked_folders.each do |folder|
|
61
|
-
sh "
|
62
|
-
sh "ln -s app/#{folder} #{name}/#{folder}"
|
81
|
+
sh "ln -s #{name}/#{folder} app/#{folder}"
|
63
82
|
end
|
64
83
|
end
|
65
84
|
|
data/lib/pave/version.rb
CHANGED
data/lib/pave/virtual_host.rb
CHANGED
@@ -13,6 +13,7 @@ module Pave
|
|
13
13
|
|
14
14
|
def create_vhost
|
15
15
|
return say "No virtual host backup found. Run `pave vh:backup` before adding a virtual host." unless check_backup
|
16
|
+
return say "No host name provided. Run `pave help` for more details." unless hostname.size > 0
|
16
17
|
|
17
18
|
add_vhost_to_conf && add_hosts_entry && restart_apache && say("Created virtual host for #{hostname}.")
|
18
19
|
end
|
@@ -149,22 +150,3 @@ module Pave
|
|
149
150
|
|
150
151
|
end
|
151
152
|
end
|
152
|
-
|
153
|
-
|
154
|
-
# /etc/apache2/extra/httpd-vhosts.conf
|
155
|
-
# <Directory "/Users/jh/Code/Web/fishalaskamagazine.dev/">
|
156
|
-
# Allow From All
|
157
|
-
# AllowOverride All
|
158
|
-
# Options +Indexes
|
159
|
-
# </Directory>
|
160
|
-
# <VirtualHost *:80>
|
161
|
-
# ServerName "fishalaskamag.site"
|
162
|
-
# DocumentRoot "/Users/jh/Code/Web/fishalaskamagazine.dev"
|
163
|
-
# </VirtualHost>
|
164
|
-
|
165
|
-
# Update hosts file with IP
|
166
|
-
# sudo apachectl restart
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pave
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamon Holmgren
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- bin/pave
|
101
101
|
- lib/pave.rb
|
102
102
|
- lib/pave/concrete.rb
|
103
|
+
- lib/pave/database.rb
|
103
104
|
- lib/pave/shell.rb
|
104
105
|
- lib/pave/version.rb
|
105
106
|
- lib/pave/virtual_host.rb
|