thrush 0.0.3 → 0.0.4

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.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/thrush.rb +13 -9
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODIyMjFmYmU5MDYxNDI3N2M3MDMxNTdhYWI1MDllNDVmMTIxZDc2Yw==
4
+ NTA5ZDMxOWQxODI2ZmQ0YTViMGFmN2M0N2FjYzdkMTk0ODAxZWU2ZQ==
5
5
  data.tar.gz: !binary |-
6
- NjU0OTQxNGQ4NjM1Zjk4NWRhNmYzZjIyZmZmMjMwYmY1MWE2OTJmYw==
6
+ ZDNkYmI3Y2NjYTA1ZjlhODllMWRmNTViOWFiODEyZDcwMGY2ZmY0ZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZGRhNTE4YzA2ZDlmYWVhNjdhYzJlOWU1NjM5YzQ5OGFlYjU0MGM3OTljNWQ4
10
- ODQzMjlkYzhhMjU1MDNjZmY0MDJiZjdjOGQyMzU4ZmU4ZDVjNTUzNDM2NDE2
11
- ZWM5YzZkODAxMjcxNTM1OGE5NjQ1YzEwZGIwZmE0ZjNmMTQ1ZmM=
9
+ ZTEwZGI1ZDBhOTJlZGZhN2ZlYjcxZTZkN2JkZGQ3NDIzMDc4MmViZGQxOWEy
10
+ MTQ4YmQwNTU1MGM1MDdlNjA1NzZlNTI3OGRiMGEzMDMxNGFjMzAzZjg2NDBm
11
+ MzIwY2Q1NTkxZmQ4YmFkMjVhZTc5ZWFjYzllMjYzM2E3YTIxOWE=
12
12
  data.tar.gz: !binary |-
13
- YTk2ZTNiNzBlOGYwNGM4YWIxZjVhZWFjOTk3MzQ1OGQ5NTEzZDY2YWYzNGQx
14
- Zjg5MzZlZmQzNGRkMzA2ODY1MzAyYzdiOGEwMDEyODk5ODczZGY1N2I3Yzdi
15
- YjA0NDdiZGJlYzY4NzUyODE4M2Y5MWJhMzg0ZDlhMDI5NWY4Y2Y=
13
+ NGE0MzViNTBmNmE5NTcyZTgwNGYyM2U2ZDdiN2JkMWEwNzBjYWRiNDY4ZThj
14
+ YTk3NmY5Nzk3MjU1OWY5YTcwODA0YjU3NTQzNTAzZWRiNTdjNzIwYjc4OThj
15
+ MzNmM2I1ZGQ0OTAwN2M4NjA0NjhkZTZlMjM0NmU0ZGUwZDk5MjA=
@@ -113,13 +113,14 @@ def header(h)
113
113
  end
114
114
 
115
115
  def run!
116
+ client = env(:client).nil? ? 'Thrush' : env(:client)
116
117
  if @flags.has_key?(:help)
117
- puts header("Thrush client help for (ENV = #{ @current_env.upcase })").blue.bold
118
+ puts header("#{ client } client help for (ENV = #{ @current_env.upcase })").blue.bold
118
119
  puts "#{ env(:help) }\n"
119
120
  exit
120
121
  end
121
122
 
122
- puts header("Thrush client for (ENV = #{ @current_env.upcase })").blue.bold
123
+ puts header("#{ client } client for (ENV = #{ @current_env.upcase })").blue.bold
123
124
  puts "** DEBUG MODE **".yellow if debug?
124
125
  i = 1
125
126
 
@@ -152,21 +153,24 @@ def run!
152
153
  end
153
154
  when :rsync
154
155
  debug = debug? ? 'n' : ''
155
- # TODO: The default rsync values I've hardcoded including --no-o, --no-g and other defaults should be flags that someone can pass in.
156
- cmd = ["rsync -#{ debug }vazcO --no-o --no-g"]
156
+ rsh = cmd_vals(:rsh, cmd_values)
157
157
 
158
- rsh = cmd_vals(:rsh, cmd_values)
158
+ # TODO: The default rsync values I've hardcoded including --no-o, --no-g and other defaults should be flags that someone can pass in.
159
+ cmd = []
160
+ cmd << 'sudo' if rsh.nil? && sudo
161
+ cmd << "rsync -#{ debug }vazcO --no-o --no-g"
159
162
  cmd << "--rsh=#{ rsh }" unless rsh.nil?
160
-
161
163
  cmd << "--exclude '.git' --exclude '.idea' --exclude '.DS_Store'"
162
164
 
163
165
  ignore = cmd_vals(:ignore, cmd_values)
164
166
  ignore.each { |exclude| cmd << "--exclude '#{ exclude }'" } unless ignore.nil? || ignore.empty?
165
167
 
166
- cmd << "--rsync-path='sudo rsync'" if sudo
168
+ if rsh == 'sync'
169
+ cmd << "--rsync-path='sudo rsync'" if sudo
167
170
 
168
- path = cmd_vals(:path, cmd_values)
169
- cmd << "--rsync-path='#{ path }'" unless path.nil? || path.empty?
171
+ path = cmd_vals(:path, cmd_values)
172
+ cmd << "--rsync-path='#{ path }'" unless path.nil? || path.empty?
173
+ end
170
174
 
171
175
  cmd << cmd_vals(:src, cmd_values)
172
176
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thrush
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Z.d. Peacock