Sha256: 1fa235ff4bcf7a9c78e79f9156b97455538ff74c9fcdf4fba676a85968240150

Contents?: true

Size: 1.48 KB

Versions: 5

Compression:

Stored size: 1.48 KB

Contents

require 'cocoapods'

require_relative '../source/core/run_helper'

module OrmDev
  class Command
    class Publish < Command
      self.summary = '发布插件'
      self.description = <<-DESC
          发布插件.
          指定'插件名.podspec'的路径`PATH`。
      DESC

      self.arguments = [
          CLAide::Argument.new('PATH', false)
      ]

      def self.options
        [
        ].concat(super)
      end

      def initialize(argv)
        @podspec_file = argv.shift_argument
        @podspec_files = Pathname.pwd.children.select { |pn| pn.extname == '.podspec' }
        super
      end

      def validate!
        super
        # raise Pod::Informative, "No `Cimfile' found in the project directory." unless @cipfile_path.exist?
        if @podspec_file
          help! "podspec file at #{@podspec_file} does not exist" unless File.exist? @podspec_file
          @podspec_path = @podspec_file
        else
          raise Pod::Informative, 'No podspec file found, please specify one' unless @podspec_files.length > 0
          raise Pod::Informative, 'Multiple podspec file found, please specify one' unless @podspec_files.length == 1
          @podspec_path = @podspec_files.first
        end
      end

      def run
        super
        OrmDev::LogUtil.info '[插件发布] '.green
        installer = OrmDev::RunHelper.new(@podspec_path)
        installer.setup()
        OrmDev::LogUtil.info "Success!!! Please run command:\n orm ipa \#{platform}"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ormdev-0.0.7 lib/ormdev/command/publish.rb
ormdev-0.0.6 lib/ormdev/command/publish.rb
ormdev-0.0.5 lib/ormdev/command/publish.rb
ormdev-0.0.4 lib/ormdev/command/publish.rb
ormdev-0.0.3 lib/ormdev/command/publish.rb