pave 0.6.6 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f225d50e675e7ea78f411af643399c0468c30991
4
- data.tar.gz: 428edf61a64ccefb496684387d749e531248ad9e
3
+ metadata.gz: 7354b39224a85126b4cd03f209d204818e12f032
4
+ data.tar.gz: 997767c284e18070281dd72d852a0a4a94ab9d93
5
5
  SHA512:
6
- metadata.gz: 9bbc1ba1a61a438409679c40e68e14da7009ffe5f934363a5d13e7959bde2e9e84e62ad9aa1e662078b6c0b88cefdcffdfd18cd82b0006b34f0430123858e878
7
- data.tar.gz: 548a55a640eee5f9ffe30ab3407e0fbec88cfbd064664464a1a8d2902157758487b474670a82422659a7302e5590cda4b5bf265899ac7ebed86c7fcd5d2ca4ec
6
+ metadata.gz: 5160781b40875dbb819892172762631b3b62d4b08415af1c478519584541a090d992019db291999665c8ded5f56f2416d14299a294ae5732682fd049dd0baf01
7
+ data.tar.gz: 273e6788ccd1aea9ca961d8b8766fdf568596287a91f5cb39a01f5fad13ac0b12a8d8914d0011c3d38b35b898effb87dbd45a4a92d313e7b10f3a7a210008425
data/bin/pave CHANGED
@@ -205,6 +205,24 @@ command :"db:push" do |c|
205
205
  end
206
206
  end
207
207
 
208
+ command :"files:pull" do |c|
209
+ c.syntax = "pave files:pull"
210
+ c.description = "Download the project's live files directory."
211
+ c.action do |args|
212
+ remote = args.first || "live"
213
+ Pave::Files.pull(remote)
214
+ end
215
+ end
216
+
217
+ command :"files:push" do |c|
218
+ c.syntax = "pave files:push"
219
+ c.description = "Upload the project's local files directory."
220
+ c.action do |args|
221
+ remote = args.first || "live"
222
+ Pave::Files.push(remote)
223
+ end
224
+ end
225
+
208
226
  command :"generate:theme" do |c|
209
227
  c.syntax = "pave generate:theme THEME_NAME"
210
228
  c.description = "Set up a blank theme with sass."
data/lib/pave/concrete.rb CHANGED
@@ -48,20 +48,17 @@ module Pave
48
48
  def set_up_git
49
49
  say "* Setting up git..."
50
50
  sh "touch #{name}/.gitignore"
51
- gitignored_folders.each{ |folder| sh "echo '#{folder}' >> #{name}/.gitignore" }
52
- gitkeep_folders.each{ |folder| sh "touch #{name}/#{folder}/.keep" }
51
+ gitignored.each{ |ignored| sh "echo '#{ignored}' >> #{name}/.gitignore" }
52
+ gitkept_folders.each{ |folder| sh "touch #{name}/#{folder}/.keep" }
53
53
  sh "touch #{name}/files/.keep"
54
54
  sh "touch #{name}/updates/.keep"
55
55
  end
56
56
 
57
- def gitignored_folders
57
+ def gitignored
58
58
  [
59
- "files/avatars/*",
60
- "files/cache/*",
61
- "files/incoming/*",
62
- "files/thumbnails/*",
63
- "files/tmp/*",
64
- "files/trash/*",
59
+ "files/*",
60
+ "!files/.keep",
61
+ ".DS_Store",
65
62
  ".sass-cache",
66
63
  "stylesheets"
67
64
  ]
@@ -69,7 +66,7 @@ module Pave
69
66
 
70
67
  def create_virtual_host
71
68
  say "* Setting up virtual host..."
72
- if Pave::VirtualHost.new("#{name}.site").create_vhost
69
+ if sh("sudo pave vh:create #{name}.site") == 0
73
70
  say "Successfully setup virtual host #{name}.site."
74
71
  else
75
72
  say "Virtual host not set up. Run `pave vh:create #{name}.site` to create it."
@@ -98,7 +95,7 @@ module Pave
98
95
  %w{ blocks config packages files }
99
96
  end
100
97
 
101
- def gitkeep_folders
98
+ def gitkept_folders
102
99
  [
103
100
  :blocks,
104
101
  :elements,
data/lib/pave/database.rb CHANGED
@@ -75,8 +75,8 @@ module Pave
75
75
  server = Pave::Remote.server(remote)
76
76
  directory = Pave::Remote.directory(remote)
77
77
  db = remote_db
78
- say "Remotely executing #{dump_file(:remote)} on live #{db['name']}"
79
- sh "ssh #{server} \"cd #{directory}/db; gzip -dc #{dump_file(:remote)} | mysql -u#{db['user']} -p#{db['pass']} #{db['name']}\""
78
+ say "Remotely executing #{dump_file(:local)} on live #{db['name']}"
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
82
  def upload(remote="live")
data/lib/pave/files.rb ADDED
@@ -0,0 +1,22 @@
1
+ module Pave
2
+ class Files
3
+ include Pave::Shell
4
+
5
+ def self.push(remote="live")
6
+ server = Pave::Remote.server(remote)
7
+ directory = Pave::Remote.directory(remote)
8
+ sh "scp -r ./files #{server}:#{directory}/local_files;"
9
+ sh "ssh #{server} 'cd #{directory};
10
+ mv ./files ./old_files;
11
+ mv ./local_files ./files && rm -rf ./old_files;'"
12
+ end
13
+
14
+ def self.pull(remote="live")
15
+ server = Pave::Remote.server(remote)
16
+ directory = Pave::Remote.directory(remote)
17
+ sh "scp -r #{server}:#{directory}/files ./remote_files;
18
+ mv ./files ./old_files;
19
+ mv ./remote_files ./files && rm -rf ./old_files;"
20
+ end
21
+ end
22
+ end
data/lib/pave/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pave
2
- VERSION = "0.6.6"
2
+ VERSION = "0.7.0"
3
3
  end
data/lib/pave.rb CHANGED
@@ -3,6 +3,7 @@ require "pave/version"
3
3
  require "pave/shell"
4
4
  require "pave/concrete"
5
5
  require "pave/database"
6
+ require "pave/files"
6
7
  require "pave/virtual_host"
7
8
  require "pave/remote"
8
9
  require "pave/theme"
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.6.6
4
+ version: 0.7.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: 2013-12-20 00:00:00.000000000 Z
12
+ date: 2013-12-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -101,6 +101,7 @@ files:
101
101
  - lib/pave.rb
102
102
  - lib/pave/concrete.rb
103
103
  - lib/pave/database.rb
104
+ - lib/pave/files.rb
104
105
  - lib/pave/remote.rb
105
106
  - lib/pave/shell.rb
106
107
  - lib/pave/theme.rb
@@ -145,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
146
  version: '0'
146
147
  requirements: []
147
148
  rubyforge_project:
148
- rubygems_version: 2.0.14
149
+ rubygems_version: 2.0.3
149
150
  signing_key:
150
151
  specification_version: 4
151
152
  summary: Provides a set of command line tools for Concrete5.