wordmove 3.1.2.pre2 → 3.1.2.pre3

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: 0a0a8d2ce4e3dd407a40e10716d18d305c578c89
4
- data.tar.gz: 066a4e4c3789e5ae60a101701ddf8e384b01999b
3
+ metadata.gz: 01c26cc26687f56e5dd676977452542b1273dbe9
4
+ data.tar.gz: 60c4de34715f35926e8a77f5819ed4032c01a59a
5
5
  SHA512:
6
- metadata.gz: 444a62cee062aa8fabd462e8f2586c93b29604670747be3f9460dc8e7c81fd543ea4a445e6c6ac165a69dd60895604ac09443a4e8f359f65366a3eb94862d4ef
7
- data.tar.gz: cac0b9a65b2f0691efc766642067c8e2fdd16fb7313340dfb3668394ca1ebc97d73b0ea8bc7b53de8a810d978c82912cd7e6d70ca246b4562c1e219293caaf79
6
+ metadata.gz: 99362150137d9a19d0eaeb5c03bf1979e352a64ef5dda1e112353e313dfa4655e307a4d83b03e78a10f5c495736ef9e49a853bcf8c63f776a7a773a3b178ce05
7
+ data.tar.gz: 52c51c6aef8a0cedcfac263f07caffb804e77071a531a174fdf28eecba3adf5150d9f1f449f7f059b821073f518aabd102b3d89e2bb7e2260302fdb9a0c9df0a
data/lib/wordmove/cli.rb CHANGED
@@ -89,7 +89,7 @@ module Wordmove
89
89
  def push
90
90
  ensure_wordpress_options_presence!(options)
91
91
  begin
92
- deployer = Wordmove::Deployer::Base.deployer_for(options)
92
+ deployer = Wordmove::Deployer::Base.deployer_for(options.deep_symbolize_keys)
93
93
  rescue MovefileNotFound => e
94
94
  logger.error(e.message)
95
95
  exit 1
@@ -101,7 +101,7 @@ module Wordmove
101
101
  remote_path = remote_options[:wordpress_path]
102
102
 
103
103
  remote_put_directory(local_path, remote_path,
104
- push_exclude_paths, push_inlcude_paths(task))
104
+ push_exclude_paths(task), push_inlcude_paths(task))
105
105
  end
106
106
 
107
107
  define_method "pull_#{task}" do
@@ -109,7 +109,7 @@ module Wordmove
109
109
  local_path = local_options[:wordpress_path]
110
110
  remote_path = remote_options[:wordpress_path]
111
111
  remote_get_directory(remote_path, local_path,
112
- pull_exclude_paths, pull_include_paths(task))
112
+ pull_exclude_paths(task), pull_include_paths(task))
113
113
  end
114
114
  end
115
115
 
@@ -124,22 +124,45 @@ module Wordmove
124
124
  end
125
125
  end
126
126
 
127
- def push_exclude_paths
128
- paths_to_exclude + [
129
- "/*",
130
- "/#{local_wp_content_dir.relative_path}/*"
131
- ]
127
+ def push_exclude_paths(task)
128
+ Pathname.new(send(:"local_#{task}_dir").relative_path)
129
+ .dirname
130
+ .ascend
131
+ .each_with_object([]) do |directory, array|
132
+ path = directory.to_path
133
+ path.prepend('/') unless path.match? %r{^/}
134
+ path.concat('/') unless path.match? %r{/$}
135
+ path.concat('*')
136
+ array << path
137
+ end
138
+ .concat(paths_to_exclude)
139
+ .concat(['/*'])
132
140
  end
133
141
 
134
142
  def pull_include_paths(task)
135
- push_inlcude_paths(task)
143
+ Pathname.new(send(:"remote_#{task}_dir").relative_path)
144
+ .ascend
145
+ .each_with_object([]) do |directory, array|
146
+ path = directory.to_path
147
+ path.prepend('/') unless path.match? %r{^/}
148
+ path.concat('/') unless path.match? %r{/$}
149
+ array << path
150
+ end
136
151
  end
137
152
 
138
- def pull_exclude_paths
139
- paths_to_exclude + [
140
- "/*",
141
- "/#{remote_wp_content_dir.relative_path}/*"
142
- ]
153
+ def pull_exclude_paths(task)
154
+ Pathname.new(send(:"remote_#{task}_dir").relative_path)
155
+ .dirname
156
+ .ascend
157
+ .each_with_object([]) do |directory, array|
158
+ path = directory.to_path
159
+ path.prepend('/') unless path.match? %r{^/}
160
+ path.concat('/') unless path.match? %r{/$}
161
+ path.concat('*')
162
+ array << path
163
+ end
164
+ .concat(paths_to_exclude)
165
+ .concat(['/*'])
143
166
  end
144
167
  end
145
168
  end
@@ -1,3 +1,3 @@
1
1
  module Wordmove
2
- VERSION = "3.1.2.pre2".freeze
2
+ VERSION = "3.1.2.pre3".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: 3.1.2.pre2
4
+ version: 3.1.2.pre3
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: 2018-06-05 00:00:00.000000000 Z
15
+ date: 2018-06-06 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activesupport