<commit_before>module Steam
  class Session
    autoload :Rails, 'steam/session/rails'

    # cattr_accessor :host

    attr_accessor :id, :browser
    #, :request, :response, :session, :cookies
    # delegate :headers, :to => :response

    def initialize(browser = nil)
      @browser = browser
      # @id = start
    end

    def start
      # response = post('/test/sessions')
      # raise unless response.code == '200'
      # response.body
    end

    def stop
      # delete("/test/sessions/#{id}")
    end

    def respond_to?(method)
      return true if browser.respond_to?(method)
      super
    end

    def method_missing(method, *args, &block)
      return browser.send(method, *args, &block) # if browser.respond_to?(method)
      super
    end

    # def redirect?
    #   response.status/100 == 3
    # end
    #
    # def follow_redirect!
    #   # raise "not a redirect! #{@status} #{@status_message}" unless redirect?
    #   get(headers['location'])
    #   status
    # end
  end
end<commit_msg>explicitly delegate #select to browser so we avoid calling Kernel#select<commit_after>module Steam
  class Session
    autoload :Rails, 'steam/session/rails'

    # cattr_accessor :host

    attr_accessor :id, :browser
    #, :request, :response, :session, :cookies
    # delegate :headers, :to => :response

    def initialize(browser = nil)
      @browser = browser
      # @id = start
    end

    def start
      # response = post('/test/sessions')
      # raise unless response.code == '200'
      # response.body
    end

    def stop
      # delete("/test/sessions/#{id}")
    end

    def respond_to?(method)
      return true if browser.respond_to?(method)
      super
    end

    # FIXME - there has to be a better way to enforce this - how does webrat handle it?
    def select(*args, &block)
      browser.select(*args, &block)
    end

    def method_missing(method, *args, &block)
      return browser.send(method, *args, &block) # if browser.respond_to?(method)
      super
    end

    # def redirect?
    #   response.status/100 == 3
    # end
    #
    # def follow_redirect!
    #   # raise "not a redirect! #{@status} #{@status_message}" unless redirect?
    #   get(headers['location'])
    #   status
    # end
  end
end
{'fraction_non_alphanumeric': 0.11704946996466431, 'fraction_numerical': 0.006183745583038869, 'mean_word_length': 2.47926267281106, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7446115', 'n_tokens_mistral': 725, 'n_tokens_neox': 702, 'n_words': 194}