wordmove 5.0.2 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 827af36f1540f218650df064024c9fcd661d3bd87df075e2ba71f15bc8598fcd
4
- data.tar.gz: f744dd778926c98cb5071902b8b410c84f2a8b102f0db4e9890e3cb9b6dc8337
3
+ metadata.gz: 223beeb2dffe00e753186e62859f3e2512935bed78d0de7a01b4370051333b76
4
+ data.tar.gz: d146a0409203df99fe3a94c1cdb69cbb907e33cdbab83adf45dc51bf4a9ed373
5
5
  SHA512:
6
- metadata.gz: a37976a8841050d1e25b158c4fb47c30bbc87f6b7d15bba88d0eecbf40a2b193dd4a4b93b868e44f72689dd1ef074f804429b3f714b7d9b9e9cd753cef467dff
7
- data.tar.gz: 244d0333c938b18cb7c8bcb479c7876c9d9d4626d4eb1d0e6c9d2efe69a09e3274232fdd7819de2ce3e9018ac13fbe1d488fd48acbad8a4428a14eeebb414bac
6
+ metadata.gz: d25af04e6678422ee1bb26d790591d625946af17e04842869468eebdab4634ef32ff795b6a2f3882b9bfc02886511b80674d13bbf90d0d905c5d539b5d7fd543
7
+ data.tar.gz: 48f68062be511a820a21ead03b0f5e3fdbb5beff7caedd97e1b02d860cf00055629ae28f6d47c13c1d29a600d27895d71ae85517a6add0bd11b2f50c30ef7bf7
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: bug
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **Wordmove command**
14
+ Command used on the CLI: (e.g.: `wordmove pull --all --no-db`)
15
+
16
+ **Expected behavior**
17
+ A clear and concise description of what you expected to happen.
18
+
19
+ **movefile.yml**
20
+ Paste (removing personal data) the interesting part, if any, of your `movefile.yml` formatting it inside a code block with `yml` syntax and double checking the indentation.
21
+
22
+ **Exception/trace**
23
+ Paste (removing personal data) the entire trace of error/exception you encountered, if any
24
+
25
+ **Environment (please complete the following information):**
26
+ - OS:
27
+ - Ruby: (`ruby --version`)
28
+ - Wordmove: (`wordmove --version`)
29
+
30
+ **Doctor**
31
+ * [x] `wordmove doctor` is all green
32
+
33
+ (If it is not, report the error you got.)
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: Discussion
3
+ about: Open discussions are welcome :)
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: feature
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,17 @@
1
+ # Number of days of inactivity before an issue becomes stale
2
+ daysUntilStale: 60
3
+ # Number of days of inactivity before a stale issue is closed
4
+ daysUntilClose: 7
5
+ # Issues with these labels will never be considered stale
6
+ exemptLabels:
7
+ - feature
8
+ - bug
9
+ # Label to use when marking an issue as stale
10
+ staleLabel: wontfix
11
+ # Comment to post when marking an issue as stale. Set to `false` to disable
12
+ markComment: >
13
+ This issue has been automatically marked as stale because it has not had
14
+ recent activity. It will be closed if no further activity occurs. Thank you
15
+ for your contributions.
16
+ # Comment to post when closing a stale issue. Set to `false` to disable
17
+ closeComment: false
@@ -6,8 +6,7 @@ rvm:
6
6
  cache: bundler
7
7
 
8
8
  before_install:
9
- - gem update --system
10
- - gem install bundler
9
+ - gem install bundler -v '~> 2.0'
11
10
 
12
11
  install:
13
12
  - bundle install --jobs=3 --retry=3
@@ -0,0 +1,86 @@
1
+ Welcome to the contributor guide. If you can't find important information you're welcome
2
+ to edit this page or open a discussion issue to talk with maintainers.
3
+
4
+ In this guide you'll find informations about:
5
+ * [Bug reporting](#bug-reporting)
6
+ * [Development](#development)
7
+ * [Maintainer tasks](#maintainer-tasks)
8
+
9
+ ### Bug reporting
10
+
11
+ Wordmove is an hard piece of software to debug and it is used by many users with many
12
+ different environments - Windows also, even if it isn't officially supported by the dev team.
13
+
14
+ So *please*, help the community adding some crucial informations and posting well
15
+ formatted code. Inspirational details:
16
+
17
+ * OS
18
+ * Ruby version
19
+ * Wordmove version
20
+ * Are you using system Ruby, rbenv or RVM?
21
+ * Describe at your best the action you required to Wordmove: push/pull, ftp/ssh
22
+ * Paste (safely) your full or partial `movefile.yml`
23
+ * Paste (safely) the entire trace of error/exception you encountered, if any
24
+ * If you paste code or the STDOUT log/trace **format them**. If it sound as a joke I swear I'm serious:
25
+ use GitHub's Markdown syntax to keep things readable if you'd like to discuss your problem with the community.
26
+ * Label the issue if you can
27
+
28
+ As a general advise: we tend to not support Wordmove's versions older than the latest stable.
29
+ We'd appreciate your help opening an in depth report if you'd find that an older version is working
30
+ better for you.
31
+
32
+ Thank you all for your support and for the love <3
33
+
34
+ ### Development
35
+
36
+ #### Get Wordmove
37
+
38
+ * fork wordmove
39
+ * clone your own repo
40
+ * be sure to check-out the right branch, usually `master`
41
+
42
+ ##### Installing Ruby
43
+
44
+ To install ruby, please, use [rbenv](https://github.com/rbenv/rbenv) or [RVM](https://rvm.io).
45
+
46
+ ##### Contribute
47
+
48
+ * run `bundle install` to install gem dependencies
49
+ * `git checkout -b my_feature_or_fix_name`
50
+ * code, commit, push and send a pull request on GitHub
51
+
52
+ > Version bump is considered to be a maintainer's task, so please leave the version
53
+ alone while working on your branch.
54
+
55
+
56
+ ##### Test Wordmove
57
+
58
+ Wordmove has a decent test coverage. We _require_ that pull requests does not break tests launched by the CI.
59
+ In order to launch tests on you dev machine
60
+
61
+ ```fish
62
+ rake
63
+ ```
64
+
65
+ The command will launch the test suite - written with RSpec - and rubocop.
66
+
67
+ In order to use the gem locally you can install it
68
+
69
+ ```fish
70
+ rake install
71
+ wordmove --version
72
+ ```
73
+
74
+ or run the executable directly
75
+
76
+ ```fish
77
+ bin/wordmove --version
78
+ ```
79
+
80
+ ### Maintainer tasks
81
+
82
+ ToDo:
83
+
84
+ * [ ] versioning and version dumping
85
+ * [ ] changelog/release
86
+ * [ ] publishing the gem
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2013-2019 weLaika Soc. Coop.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -2,16 +2,15 @@
2
2
 
3
3
  ![logo](https://raw.githubusercontent.com/welaika/wordmove/master/assets/images/wordmove.png)
4
4
 
5
- Wordmove is a gem that lets you automatically mirror local WordPress
5
+ Wordmove is a command line tool that lets you automatically mirror local WordPress
6
6
  installations and DB data back and forth from your local development machine to
7
- the remote server.
7
+ one or more remote servers.
8
8
 
9
- Wordmove has also a neat hook system which enables you to run arbitrary commands
10
- before and after push/pull actions. Local and remote commands are both supported, but remote
11
- ones will be run only if using SSH protocol. Read the [dedicated wiki page](https://github.com/welaika/wordmove/wiki/Hooks) for more info.
9
+ Wordmove has also a neat [hook](https://github.com/welaika/wordmove/wiki/Hooks) system which enables you to run arbitrary commands
10
+ before and after push/pull actions. Local and remote commands are both supported (remote
11
+ ones only on SSH protocol).
12
12
 
13
- [FTP support has been discontinued](https://github.com/welaika/wordmove/wiki/FTP-support-disclaimer), thus most recent features won't work,
14
- while base functionalities are granted.
13
+ [FTP support development has been discontinued](https://github.com/welaika/wordmove/wiki/FTP-support-disclaimer), thus not all features are granted when using this protocol.
15
14
 
16
15
  [![Build Status](https://travis-ci.org/welaika/wordmove.svg?branch=master)](https://travis-ci.org/welaika/wordmove)
17
16
  [![Slack channel](https://img.shields.io/badge/Slack-WP--Hub-blue.svg)](https://wphub-auto-invitation.herokuapp.com/)
@@ -21,7 +20,9 @@ while base functionalities are granted.
21
20
 
22
21
  ## Installation
23
22
 
24
- That's easy:
23
+ Wordmove is developed in ruby and packaged and distributed as a gem.
24
+
25
+ To install:
25
26
 
26
27
  gem install wordmove
27
28
 
@@ -29,17 +30,21 @@ And to update:
29
30
 
30
31
  gem update wordmove
31
32
 
33
+ You can read more about ruby gems ecosystem on the official site https://rubygems.org/.
34
+
32
35
  ## Peer dependencies
33
36
 
34
- Wordmove just acts as automation glue between tools you already have and love. These are its peer dependencies which you need to have installed and in your $PATH:
37
+ Wordmove acts as automation glue between tools you already have and love. These are its peer dependencies which **you need to have installed** and executable through your system $PATH:
38
+
39
+ | Program | Mandatory? |
40
+ | --------- | -------------------------------- |
41
+ | rsync | Yes for SSH protocol |
42
+ | mysql | Yes |
43
+ | mysqldump | Yes |
44
+ | wp-cli | Yes by default, but configurable |
45
+ | lftp | Yes, for FTP protocol |
35
46
 
36
- | Program | Actions | Mandatory? |
37
- | ------- | ---------------------------- | ------------------------------- |
38
- | rsync | Mirror files and dirs | Yes for SSH connections |
39
- | mysql | Import database | Yes |
40
- | mysqldump | Dump database | Yes |
41
- | wp-cli | Adapt database | Yes by default, but configurable|
42
- | lftp | all | Yes, for FTP connections |
47
+ Wordmove also expect that the remote server will have the following commands: `gzip`, `nice`, `mysql`, `rsync`. All of these should be always present by default on any WordPress hosting.
43
48
 
44
49
  ## Usage
45
50
 
@@ -59,11 +64,17 @@ Move inside the WordPress folder and use `wordmove init` to generate a new `move
59
64
 
60
65
  **See the wiki article: [Usage and flags explained](https://github.com/welaika/wordmove/wiki/Usage-and-flags-explained) for more info.**
61
66
 
62
- ### Screencasts
63
67
 
64
- * Push all WordPress, including database and uploads: http://vimeo.com/74648079
65
- * Pull database and uploads, adapting paths and urls: http://vimeo.com/74646861
66
- * Push only theme, transfer only modified files: http://vimeo.com/74647529
68
+
69
+ ### Multistage
70
+
71
+ You can define multiple remote environments in your `movefile.yml`, such as production, staging, etc. Every first level key in the YAML other than the defaults and mandatory `global` and `local` will be interpreted as a remote environment.
72
+
73
+ Use `-e` with `pull` or `push` to run the command on the specified environment.
74
+
75
+ For example: `wordmove push -e staging -d` will push your local database to the staging environment.
76
+
77
+ We warmly **recommend to read the wiki article**: [Multiple environments explained](https://github.com/welaika/wordmove/wiki/Multiple-environments-explained)
67
78
 
68
79
  ## movefile.yml
69
80
 
@@ -141,24 +152,12 @@ production:
141
152
  # where: remote
142
153
  ```
143
154
 
144
- **We warmly recommend to read the wiki article [Multiple environments explained
145
- ](https://github.com/welaika/wordmove/wiki/Multiple-environments-explained) if you need multi-stage support,
146
- and the wiki article [Movefile configurations explained](https://github.com/welaika/wordmove/wiki/movefile.yml-configurations-explained)
147
- to understand about the supported configurations.**
155
+ We warmly **recommend to read the wiki articles**
148
156
 
149
- ## Multistage
157
+ * [Multiple environments explained](https://github.com/welaika/wordmove/wiki/Multiple-environments-explained)
158
+ * [Movefile configurations explained](https://github.com/welaika/wordmove/wiki/movefile.yml-configurations-explained)
150
159
 
151
- You can define multiple environments in your `movefile.yml`, such as production, staging, etc.
152
- Use `-e` with `pull` or `push` to run the command on the specified environment.
153
-
154
- For example:
155
-
156
- wordmove push -e staging -d
157
-
158
- will push your local database to the staging environment only.
159
-
160
- We warmly **recommend** to read the wiki article: [Multiple environments explained
161
- ](https://github.com/welaika/wordmove/wiki/Multiple-environments-explained)
160
+ to understand more about supported configurations.
162
161
 
163
162
  ## Environment Variables
164
163
 
@@ -171,6 +170,7 @@ Environment variables are written using the **ERB tags** syntax:
171
170
  ```
172
171
 
173
172
  ### Variables set up
173
+
174
174
  Environment variables can be set up using two methods:
175
175
 
176
176
  #### Using the shell:
@@ -281,38 +281,10 @@ Visit [Wordpress Tools](https://www.wptools.it).
281
281
 
282
282
  ## Contribute
283
283
 
284
- In order to promote a simpler contribution workflow we have decided to fork and PR the `master` branch.
285
- We will accordingly tag and release or pre-release versions to the rubygems.org repository.
286
- Do not consider the `dev` branch for your forks and PR.
287
- We will never more use version-named branches as in the past, but we'll tag release on `master` and pre-release on `dev`.
288
-
289
- ### Please, **read the full [contributor guide](https://github.com/welaika/wordmove/wiki/Contributor-Guide)**.
284
+ Please, read the [contributor guide](https://github.com/welaika/wordmove/blob/master/CONTRIBUTING.md).
290
285
 
291
- Feel free to open an issue about contribution if more you need more info
286
+ Feel free to open a discussion issue about contribution if you need more info.
292
287
 
293
288
  ## Author
294
289
 
295
290
  made with ❤️ and ☕️ by [weLaika](https://dev.welaika.com)
296
-
297
- ## License
298
-
299
- (The MIT License)
300
-
301
- Copyright © 2013-2019 weLaika
302
-
303
- Permission is hereby granted, free of charge, to any person obtaining a copy of
304
- this software and associated documentation files (the ‘Software’), to deal in
305
- the Software without restriction, including without limitation the rights to
306
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
307
- the Software, and to permit persons to whom the Software is furnished to do so,
308
- subject to the following conditions:
309
-
310
- The above copyright notice and this permission notice shall be included in all
311
- copies or substantial portions of the Software.
312
-
313
- THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
314
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
315
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
316
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
317
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
318
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -100,11 +100,9 @@ module Wordmove
100
100
 
101
101
  return true if simulate?
102
102
 
103
- # rubocop:todo Security/Open
104
- open(local_path, 'w') do |file|
105
- file << open(url).read
103
+ File.open(local_path, 'w') do |file|
104
+ file << URI.open(url).read
106
105
  end
107
- # rubocop:enable Security/Open
108
106
  end
109
107
 
110
108
  def simulate?
@@ -47,11 +47,20 @@ module Wordmove
47
47
  available_enviroments = extract_available_envs(options)
48
48
  options.merge!(cli_options).deep_symbolize_keys!
49
49
 
50
- if available_enviroments.size > 1 && options[:environment].nil?
51
- raise(
52
- UndefinedEnvironment,
53
- "You need to specify an environment with --environment parameter"
54
- )
50
+ if options[:environment] != 'local'
51
+ if available_enviroments.size > 1 && options[:environment].nil?
52
+ raise(
53
+ UndefinedEnvironment,
54
+ "You need to specify an environment with --environment parameter"
55
+ )
56
+ end
57
+
58
+ if options[:environment].present?
59
+ unless available_enviroments.include?(options[:environment].to_sym)
60
+ raise UndefinedEnvironment, "No environment found for \"#{options[:environment]}\". "\
61
+ "Available Environments: #{available_enviroments.join(' ')}"
62
+ end
63
+ end
55
64
  end
56
65
 
57
66
  (options[:environment] || available_enviroments.first).to_sym
@@ -15,8 +15,17 @@ module Wordmove
15
15
  raise UnmetPeerDependencyError, "WP-CLI is not installed or not in your $PATH"
16
16
  end
17
17
 
18
- "wp search-replace --path=#{local_path} #{from} #{to} --quiet "\
19
- "--skip-columns=guid --all-tables --allow-root"
18
+ opts = [
19
+ "--path=#{cli_config_path}",
20
+ from,
21
+ to,
22
+ "--quiet",
23
+ "--skip-columns=guid",
24
+ "--all-tables",
25
+ "--allow-root"
26
+ ]
27
+
28
+ "wp search-replace #{opts.join(' ')}"
20
29
  end
21
30
 
22
31
  private
@@ -24,6 +33,22 @@ module Wordmove
24
33
  def wp_in_path?
25
34
  system('which wp > /dev/null 2>&1')
26
35
  end
36
+
37
+ def cli_config_path
38
+ load_from_yml || load_from_cli || local_path
39
+ end
40
+
41
+ def load_from_yml
42
+ cli_config_path = File.join(local_path, "wp-cli.yml")
43
+ return unless File.exist?(cli_config_path)
44
+
45
+ YAML.load_file(cli_config_path).with_indifferent_access["path"]
46
+ end
47
+
48
+ def load_from_cli
49
+ cli_config = JSON.parse(`wp cli param-dump --with-values`, symbolize_names: true)
50
+ cli_config.dig(:path, :current)
51
+ end
27
52
  end
28
53
  end
29
54
  end
@@ -1,3 +1,3 @@
1
1
  module Wordmove
2
- VERSION = "5.0.2".freeze
2
+ VERSION = "5.1.0".freeze
3
3
  end
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: 5.0.2
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: exe
14
14
  cert_chain: []
15
- date: 2019-12-13 00:00:00.000000000 Z
15
+ date: 2020-05-16 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport
@@ -220,6 +220,10 @@ executables:
220
220
  extensions: []
221
221
  extra_rdoc_files: []
222
222
  files:
223
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
224
+ - ".github/ISSUE_TEMPLATE/discussion.md"
225
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
226
+ - ".github/stale.yml"
223
227
  - ".gitignore"
224
228
  - ".rspec"
225
229
  - ".rubocop.yml"
@@ -228,7 +232,9 @@ files:
228
232
  - ".travis.yml"
229
233
  - ".vscode/launch.json"
230
234
  - CHANGELOG.md
235
+ - CONTRIBUTING.md
231
236
  - Gemfile
237
+ - LICENSE
232
238
  - README.mdown
233
239
  - Rakefile
234
240
  - assets/images/wordmove.png