wordmove 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.mdown ADDED
@@ -0,0 +1,73 @@
1
+ # Wordmove
2
+
3
+ Wordmove is a nice little gem that lets you automatically mirror local Wordpress installations and DB data back and forth from your local development machine to the remote staging server.
4
+
5
+ Think of it like Capistrano for Wordpress, complete with push/pull capabilities.
6
+
7
+ ## Installation
8
+
9
+ That's easy:
10
+
11
+ ```
12
+ gem install wordmove
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```
18
+ > wordmove help
19
+ Tasks:
20
+ wordmove help [TASK] # Describe available tasks or one specific task
21
+ wordmove init # Generates a brand new Movefile
22
+ wordmove pull # Pulls WP data from remote host to the local machine
23
+ wordmove push # Pushes WP data from local machine to remote host
24
+ ```
25
+
26
+ ## Movefile
27
+
28
+ You can configure Wordmove creating a `Movefile`. That's just a YAML file with all the local and remote host infos:
29
+
30
+ ```yaml
31
+ local:
32
+ vhost: "http://vhost.local"
33
+ wordpress_path: "~/dev/sites/your_site"
34
+ database:
35
+ name: "database_name"
36
+ username: "username"
37
+ password: "password"
38
+ host: "host"
39
+ remote:
40
+ vhost: "http://remote.com"
41
+ wordpress_path: "/var/www/your_site"
42
+ exclude:
43
+ - .git
44
+ - .DS_Store
45
+ - .sass-cache
46
+ - Movefile
47
+ database:
48
+ name: "database_name"
49
+ username: "username"
50
+ password: "password"
51
+ host: "host"
52
+ ssh:
53
+ username: "username"
54
+ password: "password"
55
+ host: "host"
56
+ ```
57
+
58
+ ## Known problems and limitations
59
+ * Wordmove requires an SSH connection to the remote host;
60
+ * Wordmove requires `mysqldump` and `mysql` to be present in the remote host and executable by the SSH user;
61
+ * Wordmove requires `rsync` to be present and executable in your machine;
62
+
63
+ ## License
64
+
65
+ (The MIT License)
66
+
67
+ Copyright © 2011 weLaika
68
+
69
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
70
+
71
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
72
+
73
+ THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/lib/wordmove/cli.rb CHANGED
@@ -11,7 +11,7 @@ module Wordmove
11
11
  Wordmove::Generators::Movefile.start
12
12
  end
13
13
 
14
- desc "pull", "Pulls Wordpress data from remote host to the local machine"
14
+ desc "pull", "Pulls WP data from remote host to the local machine"
15
15
  method_option :skip_db, :aliases => "-d", :type => :boolean
16
16
  method_option :skip_uploads, :aliases => "-u", :type => :boolean
17
17
  method_option :skip_themes, :aliases => "-t", :type => :boolean
@@ -23,7 +23,7 @@ module Wordmove
23
23
  deployer.pull
24
24
  end
25
25
 
26
- desc "push", "Push Wordpress data to remote host from local machine"
26
+ desc "push", "Pushes WP data from local machine to remote host"
27
27
  method_option :skip_db, :aliases => "-d", :type => :boolean
28
28
  method_option :skip_uploads, :aliases => "-u", :type => :boolean
29
29
  method_option :skip_themes, :aliases => "-t", :type => :boolean
@@ -18,32 +18,36 @@ module Wordmove
18
18
  end
19
19
 
20
20
  def push
21
- unless options.skip_db
22
- logger.info "Pushing the DB..."
23
- push_db
24
- end
21
+ informative_errors do
22
+ unless options.skip_db
23
+ logger.info "Pushing the DB..."
24
+ push_db
25
+ end
25
26
 
26
- remotely do |host|
27
- %w(uploads themes plugins).each do |step|
28
- unless options.send("skip_#{step}")
29
- logger.info "Pushing wp-content/#{step}..."
30
- host.download_dir local_wpcontent_path(step), remote_wpcontent_path(step)
27
+ remotely do |host|
28
+ %w(uploads themes plugins).each do |step|
29
+ unless options.send("skip_#{step}")
30
+ logger.info "Pushing wp-content/#{step}..."
31
+ host.download_dir local_wpcontent_path(step), remote_wpcontent_path(step)
32
+ end
31
33
  end
32
34
  end
33
35
  end
34
36
  end
35
37
 
36
38
  def pull
37
- unless options.skip_db
38
- logger.info "Pushing the DB..."
39
- pull_db
40
- end
39
+ informative_errors do
40
+ unless options.skip_db
41
+ logger.info "Pulling the DB..."
42
+ pull_db
43
+ end
41
44
 
42
- remotely do |host|
43
- %w(uploads themes plugins).each do |step|
44
- unless options.send("skip_#{step}")
45
- logger.info "Pushing wp-content/#{step}..."
46
- host.upload_dir remote_wpcontent_path(step), local_wpcontent_path(step)
45
+ remotely do |host|
46
+ %w(uploads themes plugins).each do |step|
47
+ unless options.send("skip_#{step}")
48
+ logger.info "Pulling wp-content/#{step}..."
49
+ host.upload_dir remote_wpcontent_path(step), local_wpcontent_path(step)
50
+ end
47
51
  end
48
52
  end
49
53
  end
@@ -128,5 +132,18 @@ module Wordmove
128
132
  host.close
129
133
  end
130
134
 
135
+ def informative_errors
136
+ yield
137
+ rescue Timeout::Error
138
+ logger.error "Connection timed out!"
139
+ puts "Timed out"
140
+ rescue Errno::EHOSTUNREACH
141
+ logger.error "Host unreachable!"
142
+ rescue Errno::ECONNREFUSED
143
+ logger.error "Connection refused!"
144
+ rescue Net::SSH::AuthenticationFailed
145
+ logger.error "SSH authentification failure, please double check the SSH credentials on your Movefile!"
146
+ end
147
+
131
148
  end
132
149
  end
@@ -3,15 +3,16 @@ require 'colored'
3
3
  module Wordmove
4
4
  class Logger
5
5
 
6
- INFO = 0
7
- VERBOSE = 1
6
+ ERROR = 0
7
+ INFO = 1
8
+ VERBOSE = 2
8
9
 
9
10
  attr_accessor :level
10
11
 
11
12
  def log(l, message)
12
- colors = [ :green, :cyan ]
13
+ colors = [ :red, :green, :cyan ]
13
14
  if l <= level
14
- puts " " * l + message.send(colors[l])
15
+ puts " " * [l-1, 0].max + message.send(colors[l])
15
16
  end
16
17
  end
17
18
 
@@ -23,5 +24,9 @@ module Wordmove
23
24
  log VERBOSE, message
24
25
  end
25
26
 
27
+ def error(message)
28
+ log ERROR, message
29
+ end
30
+
26
31
  end
27
32
  end
@@ -1,3 +1,3 @@
1
1
  module Wordmove
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wordmove
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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: 2011-11-30 00:00:00.000000000 Z
12
+ date: 2011-12-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colored
16
- requirement: &70236824991780 !ruby/object:Gem::Requirement
16
+ requirement: &70157314085180 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70236824991780
24
+ version_requirements: *70157314085180
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: escape
27
- requirement: &70236824991120 !ruby/object:Gem::Requirement
27
+ requirement: &70157314084760 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70236824991120
35
+ version_requirements: *70157314084760
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70236824990120 !ruby/object:Gem::Requirement
38
+ requirement: &70157314084340 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70236824990120
46
+ version_requirements: *70157314084340
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: net-ssh
49
- requirement: &70236824989300 !ruby/object:Gem::Requirement
49
+ requirement: &70157314083920 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70236824989300
57
+ version_requirements: *70157314083920
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: net-scp
60
- requirement: &70236824988840 !ruby/object:Gem::Requirement
60
+ requirement: &70157314083500 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70236824988840
68
+ version_requirements: *70157314083500
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: thor
71
- requirement: &70236824988300 !ruby/object:Gem::Requirement
71
+ requirement: &70157314083080 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70236824988300
79
+ version_requirements: *70157314083080
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: activesupport
82
- requirement: &70236824987660 !ruby/object:Gem::Requirement
82
+ requirement: &70157314082580 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 3.0.0
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *70236824987660
90
+ version_requirements: *70157314082580
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: i18n
93
- requirement: &70236824986980 !ruby/object:Gem::Requirement
93
+ requirement: &70157318420180 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *70236824986980
101
+ version_requirements: *70157318420180
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: hashie
104
- requirement: &70236825713180 !ruby/object:Gem::Requirement
104
+ requirement: &70157318418540 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :runtime
111
111
  prerelease: false
112
- version_requirements: *70236825713180
112
+ version_requirements: *70157318418540
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: rspec
115
- requirement: &70236825712460 !ruby/object:Gem::Requirement
115
+ requirement: &70157318416820 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70236825712460
123
+ version_requirements: *70157318416820
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: cucumber
126
- requirement: &70236825711560 !ruby/object:Gem::Requirement
126
+ requirement: &70157318415160 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *70236825711560
134
+ version_requirements: *70157318415160
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: aruba
137
- requirement: &70236825710660 !ruby/object:Gem::Requirement
137
+ requirement: &70157314110500 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,7 +142,7 @@ dependencies:
142
142
  version: '0'
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *70236825710660
145
+ version_requirements: *70157314110500
146
146
  description: Capistrano for Wordpress
147
147
  email:
148
148
  - stefano.verna@welaika.com
@@ -155,6 +155,7 @@ files:
155
155
  - Gemfile
156
156
  - Gemfile.lock
157
157
  - README
158
+ - README.mdown
158
159
  - Rakefile
159
160
  - bin/wordmove
160
161
  - features/generator.feature
@@ -171,6 +172,7 @@ files:
171
172
  - lib/wordmove/hosts/remote_host.rb
172
173
  - lib/wordmove/logger.rb
173
174
  - lib/wordmove/version.rb
175
+ - pkg/wordmove-0.0.1.gem
174
176
  - spec/foodie_spec.rb
175
177
  - wordmove.gemspec
176
178
  homepage: ''