Sha256: 548cdb042635003332811d60d15dd070d5ce4cc585f5639944a7491ec59bfaf3

Contents?: true

Size: 911 Bytes

Versions: 14

Compression:

Stored size: 911 Bytes

Contents

require 'fileutils'

module Bozo::Publishers

  # Publisher that pushes package to nuget
  class Nuget

    def server(server)
      @server = server
    end

    def api_key(api_key)
      @api_key = api_key
    end

    def execute
      raise Bozo::ConfigurationError.new 'You must specify a nuget server address' if @server.empty?
      raise Bozo::ConfigurationError.new 'You must specify a nuget api key' if @api_key.empty?

      Dir[File.join('dist', 'nuget', '**', '*')].each do |source_file|
        push File.expand_path(source_file)
      end
    end

    private

    def push(source_file)
      args = []
      args << File.expand_path(File.join('build', 'tools', 'nuget', 'NuGet.exe'))
      args << "push"
      args << "\"#{source_file}\""
      args << "\"#{@api_key}\""
      args << "-s #{@server}"
      execute_command :nuget, args
    end

  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
bozo-scripts-0.9.1 lib/bozo/publishers/nuget.rb
bozo-scripts-0.9.0 lib/bozo/publishers/nuget.rb
bozo-scripts-0.8.0 lib/bozo/publishers/nuget.rb
bozo-scripts-0.7.0 lib/bozo/publishers/nuget.rb
bozo-scripts-0.6.0 lib/bozo/publishers/nuget.rb
bozo-scripts-0.5.1 lib/bozo/publishers/nuget.rb
bozo-scripts-0.5.0 lib/bozo/publishers/nuget.rb
bozo-scripts-0.4.4 lib/bozo/publishers/nuget.rb
bozo-scripts-0.4.3 lib/bozo/publishers/nuget.rb
bozo-scripts-0.4.2 lib/bozo/publishers/nuget.rb
bozo-scripts-0.4.1 lib/bozo/publishers/nuget.rb
bozo-scripts-0.4.0 lib/bozo/publishers/nuget.rb
bozo-scripts-0.3.3 lib/bozo/publishers/nuget.rb
bozo-scripts-0.3.2 lib/bozo/publishers/nuget.rb