Sha256: 71acba35ee107da56f3b4154384a5f890f190065a0aa51481f15639c2187a228

Contents?: true

Size: 969 Bytes

Versions: 14

Compression:

Stored size: 969 Bytes

Contents

require 'ostruct'

class Utils
  def self.credentials(options)

    credentials = OpenStruct.new

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

    if ENV['SLOWLANE_PORTAL_PASSWORD']
      credentials.password=ENV['SLOWLANE_PORTAL_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_PORTAL_TEAM']
      team=ENV['SLOWLANE_PORTAL_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

14 entries across 14 versions & 1 rubygems

Version Path
slowlane-1.2.5 lib/slowlane/portal/util.rb
slowlane-1.2.4 lib/slowlane/portal/util.rb
slowlane-1.2.3 lib/slowlane/portal/util.rb
slowlane-1.2.2 lib/slowlane/portal/util.rb
slowlane-1.2.1 lib/slowlane/portal/util.rb
slowlane-1.2.0 lib/slowlane/portal/util.rb
slowlane-1.1.1 lib/slowlane/portal/util.rb
slowlane-1.1.0 lib/slowlane/portal/util.rb
slowlane-1.0.1 lib/slowlane/portal/util.rb
slowlane-1.0.0 lib/slowlane/portal/util.rb
slowlane-0.0.9 lib/slowlane/portal/util.rb
slowlane-0.0.8 lib/slowlane/portal/util.rb
slowlane-0.0.6 lib/slowlane/portal/util.rb
slowlane-0.0.5 lib/slowlane/portal/util.rb