Sha256: c217f1a0fbaec3d5ef99eb2ef14421261121ecc5076cf4eee08566d0db571f2e

Contents?: true

Size: 969 Bytes

Versions: 8

Compression:

Stored size: 969 Bytes

Contents

require 'ostruct'

class Utils
  def self.credentials(options)

    credentials = OpenStruct.new

    if ENV['SLOWLANE_FABRIC_USERNAME']
      credentials.username=ENV['SLOWLANE_FABRIC_USERNAME']
    else
      if options[:username] == '<username>'
        puts "username is required"
        exit(-1)
      else
        credentials.username=options[:username]
      end
    end

    if ENV['SLOWLANE_FABRIC_PASSWORD']
      credentials.password=ENV['SLOWLANE_FABRIC_PASSWORD']
    else
      if options[:password] == '<password>'
        puts "password is required"
        exit(-1)
      else
        credentials.password=options[:username]
      end
    end
    return credentials
  end

  def self.team(options)

    if ENV['SLOWLANE_FABRIC_TEAM']
      team=ENV['SLOWLANE_FABRIC_TEAM']
    else
      if options[:team] == '<team>'
        puts "team is required"
        exit(-1)
      else
        team=options[:team]
      end
    end
    return team
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
slowlane-1.2.5 lib/slowlane/fabric/util.rb
slowlane-1.2.4 lib/slowlane/fabric/util.rb
slowlane-1.2.3 lib/slowlane/fabric/util.rb
slowlane-1.2.2 lib/slowlane/fabric/util.rb
slowlane-1.2.1 lib/slowlane/fabric/util.rb
slowlane-1.2.0 lib/slowlane/fabric/util.rb
slowlane-1.1.1 lib/slowlane/fabric/util.rb
slowlane-1.1.0 lib/slowlane/fabric/util.rb