lhj-tools 0.1.37 → 0.1.38

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: 00bcfbfc57ef29c17ccb992fe52decd1dc169a2f4595c6c291edc99e8d5516b4
4
- data.tar.gz: 48ea09b1938d81b27293719247d9382d1b92627ccb4e9544a312d0c00029a942
3
+ metadata.gz: b4b7a07edf3348968838d40729cca25f41ba64ce15e201923d13d931590e7e97
4
+ data.tar.gz: 5c5ec0c49a7653d41c07dab04c2838f8b10e94bb986eb645e2eeb3c664a61536
5
5
  SHA512:
6
- metadata.gz: 19fa3572c6c8cf794f74299710c5b2a0a0e24d4ac25abec6a7d0e5bce4ef339d039aa86418a228c039b999fb63b2e00423674c584e9e1ee8cc476597da5cb180
7
- data.tar.gz: d65ecfea427f73d635670475c9b811e4f998358de57ac1a27e9091489bf877d998008c9454e2e207e6661e74a8201192701c3e1c9d97998e61a665b84e38d90d
6
+ metadata.gz: 672eee52600ff602c54aa7ae0a98e2dd418b33efac5b0ccbe3dc61ca47008a6af9eb7a124087437265b77663a5f0b92a87a4efef80d852fc38d93717afa66437
7
+ data.tar.gz: eac0a1544282d3e4826419fb5e7e8648c067d3664717630d89da95632eae0a69f3eee1931e9cee65d218bc7a33ac0da7dbb53615b1f8adbe06d0dd491a275a08
@@ -0,0 +1,38 @@
1
+
2
+ # frozen_string_literal: true
3
+ require 'lhj/helper/oss_helper'
4
+ require 'highline'
5
+
6
+ module Lhj
7
+ class Command
8
+ class OSS < Command
9
+ class Download < OSS
10
+ self.summary = '下载OSS'
11
+
12
+ def initialize(argv)
13
+ @current_path = argv.shift_argument || Dir.pwd
14
+ @cli = HighLine.new
15
+ super
16
+ end
17
+
18
+ def handle
19
+ objects = Lhj::OSS::Helper.instance.list
20
+ obj_keys = []
21
+ objects.each_with_index do |o, i|
22
+ obj_keys << o.key
23
+ puts "#{i}.#{o.key}".yellow
24
+ end
25
+ idx = @cli.ask('请选择下载的序号: '.green).strip.to_i
26
+ oss_key = obj_keys[idx]
27
+ puts "下载的key为:#{oss_key}".yellow
28
+
29
+ file_key = oss_key.split('/').last
30
+ file = File.join(@current_path, file_key)
31
+ Lhj::OSS::Helper.instance.down_load(oss_key, file)
32
+ puts "下载文件到目录: #{file}\n".yellow
33
+ end
34
+
35
+ end
36
+ end
37
+ end
38
+ end
@@ -8,7 +8,7 @@ module Lhj
8
8
  class OSS < Command
9
9
  # OSS file upload
10
10
  class Upload < OSS
11
- self.summary = '上传文件'
11
+ self.summary = '上传文件(添加标签 --tag=XX)'
12
12
 
13
13
  self.arguments = [
14
14
  CLAide::Argument.new('tag', false)
data/lib/lhj/command.rb CHANGED
@@ -17,6 +17,7 @@ module Lhj
17
17
  require 'lhj/command/oss/del'
18
18
  require 'lhj/command/oss/upload'
19
19
  require 'lhj/command/oss/list'
20
+ require 'lhj/command/oss/download'
20
21
  require 'lhj/command/code/view'
21
22
  require 'lhj/command/code/code_template'
22
23
  require 'lhj/command/rename_image'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lhj
4
4
  module Tools
5
- VERSION = "0.1.37"
5
+ VERSION = "0.1.38"
6
6
  end
7
7
  end
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.1.37
4
+ version: 0.1.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-27 00:00:00.000000000 Z
11
+ date: 2022-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: claide
@@ -312,6 +312,7 @@ files:
312
312
  - lib/lhj/command/local/micro_service.rb
313
313
  - lib/lhj/command/oss.rb
314
314
  - lib/lhj/command/oss/del.rb
315
+ - lib/lhj/command/oss/download.rb
315
316
  - lib/lhj/command/oss/list.rb
316
317
  - lib/lhj/command/oss/upload.rb
317
318
  - lib/lhj/command/pgyer_upload.rb