require 'learn_web/client/request'
require 'learn_web/client/connection'
require 'learn_web/client/user'
require 'learn_web/client/pull_request'
require 'learn_web/client/lesson'
require 'learn_web/client/validate_repo'
require 'learn_web/client/fork'
require 'learn_web/client/environment'
require 'learn_web/client/event'

module LearnWeb
  class Client
    attr_reader :token, :conn, :silent_output

    #LEARN_URL = 'https://learn.co'
    #API_ROOT  = '/api/v1'
    LEARN_URL = 'http://localhost:3000'
    API_ROOT  = '/api/v1'

    include LearnWeb::Client::Request
    include LearnWeb::Client::Connection
    include LearnWeb::Client::PullRequest
    include LearnWeb::Client::Lesson
    include LearnWeb::Client::ValidateRepo
    include LearnWeb::Client::Fork
    include LearnWeb::Client::User
    include LearnWeb::Client::Environment
    include LearnWeb::Client::Event

    def initialize(token:, silent_output: false)
      @token = token
      @silent_output = silent_output
      @conn = Faraday.new(url: LEARN_URL) do |faraday|
        faraday.adapter Faraday.default_adapter
      end
    end

    def valid_token?
      !!me.data
    end
  end
end

require 'learn_web/client/request'
require 'learn_web/client/connection'
require 'learn_web/client/user'
require 'learn_web/client/pull_request'
require 'learn_web/client/lesson'
require 'learn_web/client/validate_repo'
require 'learn_web/client/fork'
require 'learn_web/client/environment'
require 'learn_web/client/event'

module LearnWeb
  class Client
    attr_reader :token, :conn, :silent_output

    LEARN_URL = 'https://learn.co'
    API_ROOT  = '/api/v1'

    include LearnWeb::Client::Request
    include LearnWeb::Client::Connection
    include LearnWeb::Client::PullRequest
    include LearnWeb::Client::Lesson
    include LearnWeb::Client::ValidateRepo
    include LearnWeb::Client::Fork
    include LearnWeb::Client::User
    include LearnWeb::Client::Environment
    include LearnWeb::Client::Event

    def initialize(token:, silent_output: false)
      @token = token
      @silent_output = silent_output
      @conn = Faraday.new(url: LEARN_URL) do |faraday|
        faraday.adapter Faraday.default_adapter
      end
    end

    def valid_token?
      !!me.data
    end
  end
end

Revert to prod learn url
Revert to prod learn url
