Sha256: 2ba8b4aa5316c5fb4f3a192d16b878a42e149a3ea25e0b1a9533c1f35879b7de

Contents?: true

Size: 1.92 KB

Versions: 55

Compression:

Stored size: 1.92 KB

Contents

require 'claide'
require "tty-spinner"

module Lhj
  # command plugin
  class Command < CLAide::Command
    require 'lhj/command/init'
    require 'lhj/command/config'
    require 'lhj/command/head_import'
    require 'lhj/command/refactor_rename'
    require 'lhj/command/local/fetch'
    require 'lhj/command/local/filter'
    require 'lhj/command/local/local'
    require 'lhj/command/local/micro_service'
    require 'lhj/command/local/local_upload'
    require 'lhj/command/oss'
    require 'lhj/command/oss/del'
    require 'lhj/command/oss/upload'
    require 'lhj/command/oss/list'
    require 'lhj/command/oss/info'
    require 'lhj/command/oss/list_bucket'
    require 'lhj/command/oss/update_bucket'
    require 'lhj/command/oss/download'
    require 'lhj/command/code/view'
    require 'lhj/command/code/code_template'
    require 'lhj/command/rename_image'
    require 'lhj/command/trans'
    require 'lhj/command/yapi/yapi_init'
    require 'lhj/command/yapi'
    require 'lhj/command/file_path'
    require 'lhj/command/http'
    require 'lhj/command/sync_pod_repo'
    require 'lhj/command/sync_pod_version'
    require 'lhj/command/sync_pod_code'
    require 'lhj/command/pgyer_upload'
    require 'lhj/command/duplicate_imageset'
    require 'lhj/command/jenkins/jenkins_build'
    require 'lhj/command/sync_dingding_user'

    self.abstract_command = true
    self.command = 'lhj'
    self.version = VERSION

    def begin_title
      '开始处理...'
    end

    def auto_spin
      puts begin_title.green
      # @spinner.auto_spin
    end

    def stop
      puts '处理完成'.green
      # @spinner.success('Done!')
    end

    def initialize(argv)
      super(argv)
      @spinner = TTY::Spinner.new('[:spinner]...', output: $stdout, format: :dots, clear: true)
    end

    def run
      auto_spin
      handle
      stop
    end

    def handle
      raise 'A subclass should override the `Lhj::Command#run` method'
    end

  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
lhj-tools-0.2.83 lib/lhj/command.rb
lhj-tools-0.2.82 lib/lhj/command.rb
lhj-tools-0.2.81 lib/lhj/command.rb
lhj-tools-0.2.80 lib/lhj/command.rb
lhj-tools-0.2.79 lib/lhj/command.rb
lhj-tools-0.2.78 lib/lhj/command.rb
lhj-tools-0.2.77 lib/lhj/command.rb
lhj-tools-0.2.76 lib/lhj/command.rb
lhj-tools-0.2.75 lib/lhj/command.rb
lhj-tools-0.2.74 lib/lhj/command.rb
lhj-tools-0.2.73 lib/lhj/command.rb
lhj-tools-0.2.72 lib/lhj/command.rb
lhj-tools-0.2.71 lib/lhj/command.rb
lhj-tools-0.2.70 lib/lhj/command.rb
lhj-tools-0.2.69 lib/lhj/command.rb
lhj-tools-0.2.68 lib/lhj/command.rb
lhj-tools-0.2.67 lib/lhj/command.rb
lhj-tools-0.2.66 lib/lhj/command.rb
lhj-tools-0.2.65 lib/lhj/command.rb
lhj-tools-0.2.64 lib/lhj/command.rb