lhj-tools 0.2.65 → 0.2.66
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lhj/command/oss/list.rb +5 -3
- data/lib/lhj/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: b76b134d11c853bb88b3c9e3de8b5fd6d43b2f740299403bca0d0509bd25a8ef
|
4
|
+
data.tar.gz: 36149c214675272e19a908b12567cd136babcc63ede1585385434984402b3767
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6e5ea95f2549966fbb171d19ec366b14dc69a5f5ed69104b1e953d1ffec86e9a45a6f9f381656698d206591d92a600a240a3852b834b080046d4d0b93d93d53
|
7
|
+
data.tar.gz: 7c2b0fd4686e0881cdb94005cbf5fbeca0661767e61592b9ac1e848ad61f0987f8c82de370b5118b2cf31bd380f41796557f34eb7be5e0a50933245ce229979d
|
data/lib/lhj/command/oss/list.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'lhj/helper/oss_helper'
|
2
2
|
require 'terminal-table'
|
3
3
|
|
4
|
+
# 添加oss后缀,参考此例子
|
5
|
+
# ?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,size_360,text_6YGl6YGl6aKG5YWI,image_bG9nbzEucG5nP3gtb3NzLXByb2Nlc3M9aW1hZ2UvcmVzaXplLFBfMzA,t_90,g_se,x_100,y_20,interval_100,align_1
|
4
6
|
module Lhj
|
5
7
|
class Command
|
6
8
|
class OSS < Command
|
@@ -15,7 +17,7 @@ module Lhj
|
|
15
17
|
查看OSS对象列表 \n
|
16
18
|
--save 保存文件oss_key.yml与oss_url.yml到当前目录 \n
|
17
19
|
--clear 清空控制台输出,当oss数量较多时使用,配合save使用 \n
|
18
|
-
--output_suffix
|
20
|
+
--output_suffix 添加后缀输出控制台,如:x-oss-process=image/watermark,image_YXBwbGUucG5n \n
|
19
21
|
--all_folder 则会添加 delimiter='/',只用于查看oss的目录结构 \n
|
20
22
|
--prefix 添加oss的前缀过滤 \n
|
21
23
|
--marker 参数可以指定从该位置开始list
|
@@ -57,7 +59,7 @@ module Lhj
|
|
57
59
|
|
58
60
|
def save(obj_keys)
|
59
61
|
obj_urls = obj_keys.sort { |a, b| a.slice(/\..*/) <=> b.slice(/\..*/) }.map { |k| "#{Lhj::OSS::Helper.instance.url_path}/#{k}" }
|
60
|
-
obj_urls = obj_urls.map { |k| "#{k}
|
62
|
+
obj_urls = obj_urls.map { |k| "#{k}?#{@output_suffix}" } if @output_suffix
|
61
63
|
FileUtils.chdir(@current_path) do
|
62
64
|
File.write('oss_key.yml', obj_keys.to_yaml)
|
63
65
|
File.write('oss_url.yml', obj_urls.to_yaml) unless @all_folder
|
@@ -71,7 +73,7 @@ module Lhj
|
|
71
73
|
path = k
|
72
74
|
else
|
73
75
|
path = "#{i}.#{Lhj::OSS::Helper.instance.url_path}/#{k}"
|
74
|
-
path = "#{path}
|
76
|
+
path = "#{path}?#{@output_suffix}" if @output_suffix
|
75
77
|
end
|
76
78
|
rows << [path]
|
77
79
|
end
|
data/lib/lhj/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lhj-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.66
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- lihaijian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xcodeproj
|