neocities 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/mkrf_conf.rb +2 -1
- data/lib/neocities/cli.rb +24 -0
- data/lib/neocities/client.rb +8 -0
- data/lib/neocities/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e868d70dd0564036428471413481d66f764cde75087d25a4aef0ec945d5792b
|
4
|
+
data.tar.gz: 9d180d291b6169253110534aef62a48ec3ee8b43a8f50dc6a4635695d1ce525a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2a884cc70d5ffb3521a472e2f1a582963f44b3e390f171486c6c3d08125041779cf65e562decc6a3aeaafbfa2d7e956efbb22ee77cd7b5cb3e3f096d7d15e11
|
7
|
+
data.tar.gz: aab95d2837cdcdfa49b35cabf4a4b57fae898f2189bcd16f34b16e5729b9f415491fe4c7a024376d0b0e5eb24c98cea2c5743269fa6d21431876bd2b4f58e157
|
data/ext/mkrf_conf.rb
CHANGED
data/lib/neocities/cli.rb
CHANGED
@@ -162,11 +162,13 @@ module Neocities
|
|
162
162
|
@no_gitignore = false
|
163
163
|
@excluded_files = []
|
164
164
|
@dry_run = false
|
165
|
+
@prune = false
|
165
166
|
loop {
|
166
167
|
case @subargs[0]
|
167
168
|
when '--no-gitignore' then @subargs.shift; @no_gitignore = true
|
168
169
|
when '-e' then @subargs.shift; @excluded_files.push(@subargs.shift)
|
169
170
|
when '--dry-run' then @subargs.shift; @dry_run = true
|
171
|
+
when '--prune' then @subargs.shift; @prune = true
|
170
172
|
when /^-/ then puts(@pastel.red.bold("Unknown option: #{@subargs[0].inspect}")); display_push_help_and_exit
|
171
173
|
else break
|
172
174
|
end
|
@@ -188,6 +190,28 @@ module Neocities
|
|
188
190
|
display_push_help_and_exit
|
189
191
|
end
|
190
192
|
|
193
|
+
if @prune
|
194
|
+
pruned_dirs = []
|
195
|
+
resp = @client.list
|
196
|
+
resp[:files].each do |file|
|
197
|
+
path = Pathname(File.join(@subargs[0], file[:path]))
|
198
|
+
|
199
|
+
pruned_dirs << path if !path.exist? && (file[:is_directory])
|
200
|
+
|
201
|
+
if !path.exist? && !pruned_dirs.include?(path.dirname)
|
202
|
+
print @pastel.bold("Deleting #{file[:path]} ... ")
|
203
|
+
resp = @client.delete_wrapper_with_dry_run file[:path], @dry_run
|
204
|
+
|
205
|
+
if resp[:result] == 'success'
|
206
|
+
print @pastel.green.bold("SUCCESS") + "\n"
|
207
|
+
else
|
208
|
+
print "\n"
|
209
|
+
display_response resp
|
210
|
+
end
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
191
215
|
Dir.chdir(root_path) do
|
192
216
|
paths = Dir.glob(File.join('**', '*'))
|
193
217
|
|
data/lib/neocities/client.rb
CHANGED
data/lib/neocities/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neocities
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Drake
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-table
|