foundry_wordpress_tool 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -8,7 +8,7 @@ Wordpress is a fast tool for building a certain kind of website, but boy oh boy
8
8
 
9
9
  Introducing Foundry Wordpress Tool: standardizing deployments of Wordpress over a variety of hosts & environments. First, install the gem:
10
10
 
11
- ```sh
11
+ ```
12
12
  $ gem install 'fwt'
13
13
  ```
14
14
 
@@ -25,10 +25,21 @@ production:
25
25
  username: deploy
26
26
  ```
27
27
 
28
- Finally, you should be able to run the following command to get a list of available tasks & usage:
28
+ Finally, you should be able to run `fwt` to get a list of available tasks & usage:
29
29
 
30
- ```sh
30
+ ```
31
31
  $ fwt
32
+ ** Welcome to Foundry Wordpress Tool! **
33
+
34
+ Tasks:
35
+ fwt db_pull # Dump the remote database & import it locally
36
+ fwt db_push # Dump the local database & import it remotely
37
+ fwt help [TASK] # Describe available tasks or one specific task
38
+ fwt uploads_pull # Pull wp-content/uploads from the remote
39
+ fwt uploads_push # Push wp-content/uploads to the remote host
40
+
41
+ Options:
42
+ -e, [--env=ENV] # Name of the remote environment (as found in .fwt.yml).
32
43
  ```
33
44
 
34
45
  ## Some assumptions ##
@@ -13,7 +13,7 @@ module FoundryWordpressTool
13
13
  :aliases => '-e'
14
14
 
15
15
  def initialize(*args)
16
- say "** Welcome to Foundry Wordpress Tool! **\n", Thor::Shell::Color::CYAN
16
+ say "** Welcome to Foundry Wordpress Tool v#{VERSION}! **\n", Thor::Shell::Color::CYAN
17
17
  super(*args)
18
18
  end
19
19
 
@@ -3,17 +3,25 @@ module FoundryWordpressTool
3
3
  def self.included(thor)
4
4
  thor.class_eval do
5
5
 
6
+ method_option :delete,
7
+ :type => :boolean,
8
+ :lazy_default => false,
9
+ :desc => 'Delete files locally that do not exist the remotely'
6
10
  desc "uploads_pull", "Pull wp-content/uploads from the remote"
7
- def uploads
11
+ def uploads_pull
8
12
  load_environment_config()
9
- rsync_command = "rsync -avz --delete #{@config['username']}@#{@config['host']}:#{@config['deploy_to']}/wp-content/uploads/ wp-content/uploads/"
13
+ rsync_command = "rsync -avz #{'--delete' if options.delete} #{@config['username']}@#{@config['host']}:#{@config['deploy_to']}/wp-content/uploads/ wp-content/uploads/"
10
14
  run(rsync_command)
11
15
  end
12
16
 
17
+ method_option :delete,
18
+ :type => :boolean,
19
+ :lazy_default => false,
20
+ :desc => 'Delete files remotely that do not exist the locally'
13
21
  desc "uploads_push", "Push wp-content/uploads to the remote host"
14
22
  def uploads_push
15
23
  load_environment_config()
16
- rsync_command = "rsync -avz --delete wp-content/uploads/ #{@config['username']}@#{@config['host']}:#{@config['deploy_to']}/wp-content/uploads/"
24
+ rsync_command = "rsync -avz #{'--delete' if options.delete} wp-content/uploads/ #{@config['username']}@#{@config['host']}:#{@config['deploy_to']}/wp-content/uploads/"
17
25
  run(rsync_command)
18
26
  end
19
27
 
@@ -1,3 +1,3 @@
1
1
  module FoundryWordpressTool
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foundry_wordpress_tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-21 00:00:00.000000000 Z
12
+ date: 2012-02-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &70169921932700 !ruby/object:Gem::Requirement
16
+ requirement: &70144085408240 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70169921932700
24
+ version_requirements: *70144085408240
25
25
  description: Helps manage Wordpress environments
26
26
  email:
27
27
  - jon@foundryinteractive.com