pave 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.ruby-gemset +1 -0
- data/Gemfile +0 -2
- data/Gemfile.lock +6 -8
- data/bin/pave +8 -0
- data/lib/pave.rb +7 -0
- data/lib/pave/database.rb +14 -14
- data/lib/pave/version.rb +1 -1
- data/templates/themes/blank/includes/view_helpers.php +8 -2
- metadata +3 -3
- data/templates/themes/blank/includes/functions.php +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a32c736c3ff194d168d9f2cd6fc05f2e65492bef
|
4
|
+
data.tar.gz: 6e55111b71cb0e533939c1fba03d237d190966c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcebfee711427e2bd3331e8ac1a2a4da96cfc3346841ea4ca9c9214871b22f48fe9f5b13c8a1b255a0471e71134df36e35ff6b37be431d157dd02b7cdfa6554a
|
7
|
+
data.tar.gz: 3586b76889c4ef68da99655b9112345be3f30df4c443feaab76c37a10f54d461351080e7b6212974be9ae5bc7a251863d41d1919ce255b83de29315602ff6698
|
data/.gitignore
CHANGED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pave
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pave (0.
|
5
|
-
commander (~> 4.1
|
4
|
+
pave (0.9.0)
|
5
|
+
commander (~> 4.1)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
@@ -11,10 +11,8 @@ GEM
|
|
11
11
|
highline (~> 1.6.11)
|
12
12
|
diff-lcs (1.2.5)
|
13
13
|
highline (1.6.20)
|
14
|
-
|
15
|
-
|
16
|
-
rdoc (4.0.1)
|
17
|
-
json (~> 1.4)
|
14
|
+
rake (10.1.1)
|
15
|
+
rdoc (4.1.0)
|
18
16
|
rspec (2.14.1)
|
19
17
|
rspec-core (~> 2.14.0)
|
20
18
|
rspec-expectations (~> 2.14.0)
|
@@ -30,6 +28,6 @@ PLATFORMS
|
|
30
28
|
DEPENDENCIES
|
31
29
|
bundler (~> 1.3)
|
32
30
|
pave!
|
33
|
-
rake (~>
|
34
|
-
rdoc
|
31
|
+
rake (~> 10.1)
|
32
|
+
rdoc (~> 4.1)
|
35
33
|
rspec (~> 2)
|
data/bin/pave
CHANGED
@@ -25,6 +25,14 @@ command :update do |c|
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
command :clean do |c|
|
29
|
+
c.syntax = "pave clean"
|
30
|
+
c.description = "Removes cached files."
|
31
|
+
c.action do
|
32
|
+
Pave.clean
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
28
36
|
command :setup do |c|
|
29
37
|
c.syntax = "pave setup APP_PATH"
|
30
38
|
c.description = "Setup folders for project."
|
data/lib/pave.rb
CHANGED
@@ -18,6 +18,13 @@ module Pave
|
|
18
18
|
end
|
19
19
|
module_function :update
|
20
20
|
|
21
|
+
def clean
|
22
|
+
say "Cleaning up cached files..."
|
23
|
+
`rm -rf ~/.pave`
|
24
|
+
($? == 0) ? (say "Done") : (say "Failed")
|
25
|
+
end
|
26
|
+
module_function :clean
|
27
|
+
|
21
28
|
def template_folder
|
22
29
|
script = File.join(File.expand_path("../", File.dirname(__FILE__)), "templates")
|
23
30
|
end
|
data/lib/pave/database.rb
CHANGED
@@ -47,7 +47,7 @@ module Pave
|
|
47
47
|
@dump_file_name[which_db] ||= "#{Time.now.strftime("%Y-%m-%d_%H-%M-%S")}-#{name}-#{which_db}.sql.gz"
|
48
48
|
end
|
49
49
|
|
50
|
-
def
|
50
|
+
def dump_local
|
51
51
|
if !File.directory?('db')
|
52
52
|
sh "mkdir ./db"
|
53
53
|
sh "echo '<?= die(); ?>' > ./db/index.php"
|
@@ -66,12 +66,12 @@ module Pave
|
|
66
66
|
sh "ssh #{server} \"cd #{directory}/db; mysqldump -u#{db['user']} -p#{db['pass']} #{db['name']} | gzip > #{dump_file(:remote)}\""
|
67
67
|
end
|
68
68
|
|
69
|
-
def
|
70
|
-
say "Executing #{dump_file(:
|
71
|
-
sh "gzip -dc ./db/#{dump_file(:
|
69
|
+
def execute_remote_dump_on_local_db
|
70
|
+
say "Executing #{dump_file(:remote)} on #{name}"
|
71
|
+
sh "gzip -dc ./db/#{dump_file(:remote)} | mysql -uroot #{name}"
|
72
72
|
end
|
73
73
|
|
74
|
-
def
|
74
|
+
def execute_local_dump_on_remote_db(remote="live")
|
75
75
|
server = Pave::Remote.server(remote)
|
76
76
|
directory = Pave::Remote.directory(remote)
|
77
77
|
db = remote_db
|
@@ -79,13 +79,13 @@ module Pave
|
|
79
79
|
sh "ssh #{server} \"cd #{directory}/db; gzip -dc #{dump_file(:local)} | mysql -u#{db['user']} -p#{db['pass']} #{db['name']}\""
|
80
80
|
end
|
81
81
|
|
82
|
-
def
|
82
|
+
def upload_local_dump_to_remote(remote="live")
|
83
83
|
# Upload the project's local database dump to remotes db directory.
|
84
84
|
say "Uploading ./db/#{dump_file(:local)} SQL dump to #{remote_url}/db/#{dump_file(:local)}"
|
85
85
|
sh "scp ./db/#{dump_file(:local)} #{remote_url}/db/#{dump_file(:local)}"
|
86
86
|
end
|
87
87
|
|
88
|
-
def
|
88
|
+
def download_remote_to_local(remote="live")
|
89
89
|
# Download the project's live database dump to local db directory.
|
90
90
|
say "Downloading SQL dump from #{remote_url}/db/#{dump_file(:remote)} to ./db/#{dump_file(:remote)}"
|
91
91
|
sh "scp #{remote_url}/db/#{dump_file(:remote)} ./db/#{dump_file(:remote)}"
|
@@ -94,18 +94,18 @@ module Pave
|
|
94
94
|
def push(remote="live")
|
95
95
|
# Upload the project's local database and replace the live database.
|
96
96
|
dump_remote(remote) # for backup purposes
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
97
|
+
download_remote_to_local(remote)
|
98
|
+
dump_local
|
99
|
+
upload_local_dump_to_remote(remote)
|
100
|
+
execute_local_dump_on_remote_db(remote)
|
101
101
|
end
|
102
102
|
|
103
103
|
def pull(remote="live")
|
104
104
|
# Download the project's live database and replace local database.
|
105
|
-
|
105
|
+
dump_local # for backup purposes
|
106
106
|
dump_remote(remote)
|
107
|
-
|
108
|
-
|
107
|
+
download_remote_to_local(remote)
|
108
|
+
execute_remote_dump_on_local_db
|
109
109
|
end
|
110
110
|
end
|
111
111
|
end
|
data/lib/pave/version.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
<?
|
2
|
-
|
2
|
+
|
3
|
+
function is_edit_mode() {
|
3
4
|
global $c;
|
4
5
|
if ($c->isEditMode()) {
|
5
|
-
echo "
|
6
|
+
echo "edit-mode";
|
6
7
|
}
|
7
8
|
}
|
8
9
|
|
@@ -11,4 +12,9 @@
|
|
11
12
|
echo "<img src='" . $imgPath . $img . "' />";
|
12
13
|
}
|
13
14
|
|
15
|
+
function has_blocks($area) {
|
16
|
+
global $c;
|
17
|
+
return $area->getTotalBlocksInArea($c) > 0;
|
18
|
+
}
|
19
|
+
|
14
20
|
?>
|
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.
|
4
|
+
version: 0.10.0
|
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: 2014-01-
|
12
|
+
date: 2014-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -91,6 +91,7 @@ extensions: []
|
|
91
91
|
extra_rdoc_files: []
|
92
92
|
files:
|
93
93
|
- ".gitignore"
|
94
|
+
- ".ruby-gemset"
|
94
95
|
- ".ruby-version"
|
95
96
|
- Gemfile
|
96
97
|
- Gemfile.lock
|
@@ -122,7 +123,6 @@ files:
|
|
122
123
|
- templates/themes/blank/description.txt
|
123
124
|
- templates/themes/blank/elements/footer.php
|
124
125
|
- templates/themes/blank/elements/header.php
|
125
|
-
- templates/themes/blank/includes/functions.php
|
126
126
|
- templates/themes/blank/includes/view_helpers.php
|
127
127
|
- templates/themes/blank/js/scripts.js
|
128
128
|
- templates/themes/blank/thumbnail.png
|