Sha256: 78fc2aeb6b6d4e42f50d5b50d26bd98325936da391c5e47bb200685bea9b0ed1

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

require 'monkey_butler/targets/base'

module MonkeyButler
  module Targets
    class CocoapodsTarget < MonkeyButler::Targets::Base
      def init
        unless project.config['cocoapods.repo']
          project.config['cocoapods.repo'] = ask("What is the name of your Cocoapods specs repo? ")
        end
        if options['bundler']
          append_to_file 'Gemfile', "gem 'cocoapods'\n"
        end
      end

      def generate
        invoke :validate
        template('podspec.erb', podspec_name)
      end

      def validate
        fail Error, "Invalid configuration: cocoapods.repo is not configured." unless cocoapods_repo
      end

      def push
        invoke :validate
        run "pod repo push #{options['quiet'] && '--silent '}--allow-warnings #{cocoapods_repo} #{podspec_name}"
      end

      private
      def cocoapods_repo
        project.config['cocoapods.repo']
      end

      def podspec_name
        "#{project.name}.podspec"
      end

      def pod_version
        unique_tag_for_version(migrations.latest_version)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
monkey_butler-1.2.2 lib/monkey_butler/targets/cocoapods/cocoapods_target.rb