Sha256: 2137cd8cf9fdee766a30ccf1d56f41b9b71822202071463dde8535afd5eb48ab

Contents?: true

Size: 547 Bytes

Versions: 20

Compression:

Stored size: 547 Bytes

Contents

# frozen_string_literal: true

module LearnTest
  class UsernameParser
    def self.get_username
      parser = LearnTest::NetrcInteractor.new
      username = parser.username
      user_id = parser.user_id

      if !LearnTest::LearnOauthTokenParser.get_learn_oauth_token && (!username || user_id == 'none')
        print 'Enter your github username: '
        username = $stdin.gets.strip
        user_id = LearnTest::GithubInteractor.get_user_id_for(username)
        parser.write(username, user_id)
      end

      username
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
learn-test-3.3.1 lib/learn_test/username_parser.rb
learn-test-3.3.0 lib/learn_test/username_parser.rb
learn-test-3.3.0.pre.6 lib/learn_test/username_parser.rb
learn-test-3.3.0.pre.5 lib/learn_test/username_parser.rb
learn-test-3.3.0.pre.4 lib/learn_test/username_parser.rb
learn-test-3.3.0.pre.3 lib/learn_test/username_parser.rb
learn-test-3.3.0.pre.2 lib/learn_test/username_parser.rb
learn-test-3.3.0.pre.1 lib/learn_test/username_parser.rb
learn-test-3.2.4 lib/learn_test/username_parser.rb
learn-test-3.2.3 lib/learn_test/username_parser.rb
learn-test-3.2.2 lib/learn_test/username_parser.rb
learn-test-3.2.1 lib/learn_test/username_parser.rb
learn-test-3.2.1.pre.7 lib/learn_test/username_parser.rb
learn-test-3.2.1.pre.6 lib/learn_test/username_parser.rb
learn-test-3.2.1.pre.5 lib/learn_test/username_parser.rb
learn-test-3.2.1.pre.4 lib/learn_test/username_parser.rb
learn-test-3.2.1.pre.3 lib/learn_test/username_parser.rb
learn-test-3.2.1.pre.2 lib/learn_test/username_parser.rb
learn-test-3.2.1.pre.1 lib/learn_test/username_parser.rb
learn-test-3.2.0 lib/learn_test/username_parser.rb