This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allow spec to be run by the owner specified in the CODEOWNERS file. The @joinswoop/ prefix is assumed | |
# | |
# eg. bin/rspec --tag codeowner:squad-network-be | |
# | |
RSpec.configure do |config| | |
# NOTE: Attempted to only apply these if a codeowner tag was supplied in the configuration | |
# However, it appears that this gets evaluated before the command line options are parsed and | |
# could not find a way to optimize this. | |
File.readlines('CODEOWNERS').each do |line| | |
next unless line.start_with?('/spec/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RingBuffer | |
attr_accessor :head, :tail, :items, :size, :count | |
def initialize(size:) | |
@size = size | |
@head = @tail = @count = 0 | |
@items = [] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'json' | |
require 'uri' | |
@token = '' | |
def list_files | |
ts_to = (Time.now - 60 * 24 * 60 * 60).to_i # 60 days ago | |
uri = URI.parse("https://slack.com/api/files.list?token=#{@token}&ts_to=#{ts_to}&count=1000") |