repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
lewagon/foot_traffic | https://github.com/lewagon/foot_traffic/blob/a3e577c2f1d3222f2b8d279465823061584d4a60/examples/single_threaded.rb | examples/single_threaded.rb | require "foot_traffic"
using FootTraffic
FootTraffic::Session.start do |window|
window.new_tab.goto "https://www.lewagon.com"
window.new_tab.goto "https://www.lewagon.com/berlin"
paris = window.new_tab
paris.goto "https://www.lewagon.com/paris"
paris.at_css('[href="/paris/apply"]').click
paris.at_css("#ap... | ruby | MIT | a3e577c2f1d3222f2b8d279465823061584d4a60 | 2026-01-04T17:48:16.406321Z | false |
lewagon/foot_traffic | https://github.com/lewagon/foot_traffic/blob/a3e577c2f1d3222f2b8d279465823061584d4a60/examples/clones.rb | examples/clones.rb | require "foot_traffic"
using FootTraffic
opts = {
headless: true,
process_timeout: 10,
timeout: 100,
slowmo: 0.1,
window_size: [1024, 768]
}
begin
FootTraffic::Session.start(options: opts, quit: true, clones: 100) do |window, pool|
pool << window.tab_thread { |tab| tab.goto "https://www.lewagon.com" }... | ruby | MIT | a3e577c2f1d3222f2b8d279465823061584d4a60 | 2026-01-04T17:48:16.406321Z | false |
lewagon/foot_traffic | https://github.com/lewagon/foot_traffic/blob/a3e577c2f1d3222f2b8d279465823061584d4a60/examples/simple.rb | examples/simple.rb | require "foot_traffic"
using FootTraffic
FootTraffic::Session.start do |window|
window.tab_thread { |tab| tab.goto "https://www.lewagon.com" }
window.tab_thread { |tab| tab.goto "https://www.lewagon.com/berlin" }
window.tab_thread { |tab| tab.goto "https://www.lewagon.com/paris" }
end
| ruby | MIT | a3e577c2f1d3222f2b8d279465823061584d4a60 | 2026-01-04T17:48:16.406321Z | false |
lewagon/foot_traffic | https://github.com/lewagon/foot_traffic/blob/a3e577c2f1d3222f2b8d279465823061584d4a60/examples/multi_threaded_pool.rb | examples/multi_threaded_pool.rb | require "foot_traffic"
using FootTraffic
FootTraffic::Session.start(quit: true) do |window, pool|
pool << window.tab_thread { |tab| tab.goto "https://www.lewagon.com" }
pool << window.tab_thread { |tab| tab.goto "https://www.lewagon.com/berlin" }
pool << window.tab_thread { |paris|
paris.goto "https://www.le... | ruby | MIT | a3e577c2f1d3222f2b8d279465823061584d4a60 | 2026-01-04T17:48:16.406321Z | false |
lewagon/foot_traffic | https://github.com/lewagon/foot_traffic/blob/a3e577c2f1d3222f2b8d279465823061584d4a60/lib/foot_traffic.rb | lib/foot_traffic.rb | require "foot_traffic/version"
require "foot_traffic/session"
module FootTraffic
class ResourceOverloadError < StandardError; end
end
| ruby | MIT | a3e577c2f1d3222f2b8d279465823061584d4a60 | 2026-01-04T17:48:16.406321Z | false |
lewagon/foot_traffic | https://github.com/lewagon/foot_traffic/blob/a3e577c2f1d3222f2b8d279465823061584d4a60/lib/foot_traffic/refinements.rb | lib/foot_traffic/refinements.rb | require "ferrum"
module FootTraffic
refine Ferrum::Context do
def new_tab
create_page
end
def in_thread(&block)
Thread.new do
block.call(create_page)
rescue ThreadError, RuntimeError, Errno::EMFILE, Errno::ECONNRESET
raise ResourceOverloadError
end
end
al... | ruby | MIT | a3e577c2f1d3222f2b8d279465823061584d4a60 | 2026-01-04T17:48:16.406321Z | false |
lewagon/foot_traffic | https://github.com/lewagon/foot_traffic/blob/a3e577c2f1d3222f2b8d279465823061584d4a60/lib/foot_traffic/session.rb | lib/foot_traffic/session.rb | require_relative "refinements"
require "ferrum"
module FootTraffic
class ThreadPool
def initialize
@threads = []
end
def <<(thread)
@threads << thread
end
def wait
@threads.map(&:join)
end
end
class Session
def self.start(options: {}, duration: nil, clones: 1, qui... | ruby | MIT | a3e577c2f1d3222f2b8d279465823061584d4a60 | 2026-01-04T17:48:16.406321Z | false |
lewagon/foot_traffic | https://github.com/lewagon/foot_traffic/blob/a3e577c2f1d3222f2b8d279465823061584d4a60/lib/foot_traffic/version.rb | lib/foot_traffic/version.rb | module FootTraffic
VERSION = "0.1.0"
end
| ruby | MIT | a3e577c2f1d3222f2b8d279465823061584d4a60 | 2026-01-04T17:48:16.406321Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/test/test_helper.rb | test/test_helper.rb | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'web3/eth'
require 'minitest/autorun'
| ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/test/web3/eth_test.rb | test/web3/eth_test.rb | require 'test_helper'
class Web3::EthTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::Web3::Eth::VERSION
end
def test_it_does_something_useful
assert false
end
end
| ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth.rb | lib/web3/eth.rb | require "web3/eth/version"
require "web3/eth/abi/abi_coder"
require "web3/eth/utility"
require "web3/eth/block"
require "web3/eth/transaction"
require "web3/eth/contract"
require "web3/eth/call_trace"
require "web3/eth/log"
require "web3/eth/transaction_receipt"
require "web3/eth/eth_module"
require "web3/eth/trace_mod... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/trace_module.rb | lib/web3/eth/trace_module.rb | module Web3
module Eth
class TraceModule
include Web3::Eth::Utility
PREFIX = 'trace_'
def initialize web3_rpc
@web3_rpc = web3_rpc
end
def method_missing m, *args
@web3_rpc.request "#{PREFIX}#{m}", args[0]
end
def internalCallsByHash tx_hash
... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/eth_module.rb | lib/web3/eth/eth_module.rb | module Web3
module Eth
class EthModule
include Web3::Eth::Utility
PREFIX = 'eth_'
def initialize web3_rpc
@web3_rpc = web3_rpc
end
def getBalance address, block = 'latest', convert_to_eth = true
wei = @web3_rpc.request("#{PREFIX}#{__method__}", [address, block]).... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/version.rb | lib/web3/eth/version.rb | module Web3
module Eth
VERSION = "0.2.16"
end
end
| ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/contract.rb | lib/web3/eth/contract.rb | module Web3
module Eth
class Contract
class ContractInstance
def initialize contract, address
@contract = contract
@address = address
end
def method_missing m, *args
@contract.call_contract @address, m.to_s, args
end
def __contract__
... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/rpc.rb | lib/web3/eth/rpc.rb | module Web3
module Eth
class Rpc
require 'json'
require 'net/http'
JSON_RPC_VERSION = '2.0'
DEFAULT_CONNECT_OPTIONS = {
use_ssl: false,
open_timeout: 10,
read_timeout: 70
}
DEFAULT_HOST = 'localhost'
DEFAULT_PORT = 8545
attr_reade... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/utility.rb | lib/web3/eth/utility.rb | module Web3
module Eth
module Utility
def hex num
'0x' + num.to_s(16)
end
def wei_to_ether(wei)
1.0 * wei / 10**18
end
def from_hex h
h.to_i 16
end
def remove_0x_head(s)
s[0,2] == '0x' ? s[2..-1] : s
end
end
end
end | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/log.rb | lib/web3/eth/log.rb | module Web3
module Eth
class Log
attr_reader :raw_data
def initialize log
@raw_data = log
log.each do |k, v|
self.instance_variable_set("@#{k}", v)
self.class.send(:define_method, k, proc {self.instance_variable_get("@#{k}")})
end
end
def has_topics?
!!t... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/transaction.rb | lib/web3/eth/transaction.rb | module Web3
module Eth
class Transaction
include Web3::Eth::Utility
attr_reader :raw_data
def initialize transaction_data
@raw_data = transaction_data
transaction_data.each do |k, v|
self.instance_variable_set("@#{k}", v)
self.class.send(:define_method, k,... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/transaction_receipt.rb | lib/web3/eth/transaction_receipt.rb | module Web3
module Eth
class TransactionReceipt
include Web3::Eth::Utility
attr_reader :raw_data
def initialize transaction_data
@raw_data = transaction_data
transaction_data.each do |k, v|
self.instance_variable_set("@#{k}", v)
self.class.send(:define_me... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/etherscan.rb | lib/web3/eth/etherscan.rb | module Web3
module Eth
class Etherscan
DEFAULT_CONNECT_OPTIONS = {
open_timeout: 10,
read_timeout: 70,
parse_result: true,
url: 'https://api.etherscan.io/api'
}
attr_reader :api_key, :connect_options
def initialize api_key, connect_options: DEFAU... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/call_trace.rb | lib/web3/eth/call_trace.rb | module Web3
module Eth
class CallTrace
include Web3::Eth::Utility
attr_reader :raw_data
def initialize trace_data
@raw_data = trace_data
trace_data.each do |k, v|
self.instance_variable_set("@#{k}", v)
self.class.send(:define_method, k, proc {self.instanc... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/block.rb | lib/web3/eth/block.rb | module Web3
module Eth
class Block
include Web3::Eth::Utility
attr_reader :raw_data
def initialize block_data
@raw_data = block_data
block_data.each do |k, v|
self.instance_variable_set("@#{k}", v)
self.class.send(:define_method, k, proc {self.instance_va... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/abi/exceptions.rb | lib/web3/eth/abi/exceptions.rb | # -*- encoding : ascii-8bit -*-
module Web3::Eth::Abi
class DeprecatedError < StandardError; end
class ChecksumError < StandardError; end
class FormatError < StandardError; end
class ValidationError < StandardError; end
class ValueError < StandardError; end
class AssertError < StandardError; end
class ... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/abi/type.rb | lib/web3/eth/abi/type.rb | # -*- encoding : ascii-8bit -*-
module Web3::Eth::Abi
class Type
class ParseError < StandardError;
end
class <<self
##
# Crazy regexp to seperate out base type component (eg. uint), size (eg.
# 256, 128x128, nil), array component (eg. [], [45], nil)
#
def parse(type)
... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/abi/utils.rb | lib/web3/eth/abi/utils.rb | # -*- encoding : ascii-8bit -*-
require 'digest'
require 'digest/sha3'
require 'openssl'
require 'rlp'
module Web3::Eth::Abi
module Utils
extend self
include Constant
##
# Not the keccak in sha3, although it's underlying lib named SHA3
#
def keccak256(x)
Digest::SHA3.new(256).digest... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/abi/abi_coder.rb | lib/web3/eth/abi/abi_coder.rb | # -*- encoding : ascii-8bit -*-
require 'web3/eth/abi/type'
require 'web3/eth/abi/constant'
require 'web3/eth/abi/exceptions'
require 'web3/eth/abi/utils'
module Web3::Eth::Abi
##
# Contract ABI encoding and decoding.
#
# @see https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI
#
module AbiCoder
... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
izetex/web3-eth | https://github.com/izetex/web3-eth/blob/11f02a0683f30bca5a2e9be90824378394dcdf9a/lib/web3/eth/abi/constant.rb | lib/web3/eth/abi/constant.rb | # -*- encoding : ascii-8bit -*-
module Web3::Eth::Abi
module Constant
BYTE_EMPTY = "".freeze
BYTE_ZERO = "\x00".freeze
BYTE_ONE = "\x01".freeze
TT32 = 2**32
TT40 = 2**40
TT160 = 2**160
TT256 = 2**256
TT64M1 = 2**64 - 1
UINT_MAX = 2**256 - 1
UINT_MIN = 0
INT_MAX... | ruby | MIT | 11f02a0683f30bca5a2e9be90824378394dcdf9a | 2026-01-04T17:48:36.828969Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/spec/rails_helper.rb | spec/rails_helper.rb | # frozen_string_literal: true
ENV["RAILS_ENV"] = "test"
require "bundler/setup"
require "logger"
require "combustion"
Combustion.initialize!
require "spec_helper"
| ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
ENV["RACK_ENV"] = "test"
require "bundler/setup"
require "schked"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
config.expect_with :rspec do |c|
c.syntax = :expect
end
conf... | ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/spec/rails/railtie_spec.rb | spec/rails/railtie_spec.rb | # frozen_string_literal: true
require "rails_helper"
describe Schked::Railtie do
describe "schked.config" do
let(:config) { Schked::Config.new }
before do
allow(Schked).to receive(:config).and_return(config)
end
context "when by default root schedule doesn't exist" do
it { expect(confi... | ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/spec/lib/schked_spec.rb | spec/lib/schked_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Schked do
it { expect(described_class.config).to be_a(Schked::Config) }
it { expect(described_class.worker).to be_a(Schked::Worker) }
end
| ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/spec/lib/schked/worker_spec.rb | spec/lib/schked/worker_spec.rb | # frozen_string_literal: true
require "spec_helper"
require "tempfile"
describe Schked::Worker do
subject(:worker) { described_class.new(config: config) }
let(:config) { Schked::Config.new }
let(:logger) { instance_double(Logger).as_null_object }
before do
@taoe = Thread.abort_on_exception
Thread.ab... | ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/spec/lib/schked/redis_locker_spec.rb | spec/lib/schked/redis_locker_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Schked::RedisLocker do
let(:redis_conf) { {url: ENV["REDIS_URL"]} }
subject { described_class.new(redis_conf) }
describe "#lock" do
it "locks" do
expect(subject.lock).to be true
end
context "when is locked by someone else" do
... | ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/spec/lib/schked/config_spec.rb | spec/lib/schked/config_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe Schked::Config do
subject(:config) { described_class.new }
describe "#paths" do
it "appends files" do
config.paths << "foo"
config.paths << "bar"
expect(config.paths).to eq %w[foo bar]
end
end
it { expect(config.logger).... | ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/lib/schked.rb | lib/schked.rb | # frozen_string_literal: true
require "connection_pool"
require "redlock"
require "schked/version"
require "schked/config"
require "schked/worker"
require "schked/redis_locker"
require "schked/redis_client_factory"
require "schked/railtie" if defined?(Rails)
module Schked
module_function
def config
@config ... | ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/lib/schked/version.rb | lib/schked/version.rb | # frozen_string_literal: true
module Schked
VERSION = "1.3.1"
end
| ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/lib/schked/redis_locker.rb | lib/schked/redis_locker.rb | # frozen_string_literal: true
module Schked
class RedisLocker
attr_reader :lock_manager,
:lock_id,
:lock_ttl,
:logger
LOCK_KEY = "schked:redis_locker"
LOCK_TTL = 60_000 # ms
def initialize(redis_conf, lock_ttl: LOCK_TTL, logger: Logger.new($stdout))
@lock_manager = Redlock::... | ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/lib/schked/railtie.rb | lib/schked/railtie.rb | # frozen_string_literal: true
require "rails/railtie"
module Schked
class Railtie < Rails::Railtie
class PathsConfig
def self.call(app)
return if Schked.config.do_not_load_root_schedule?
root_schedule = app.root.join("config", "schedule.rb")
if root_schedule.exist?
path ... | ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/lib/schked/redis_client_factory.rb | lib/schked/redis_client_factory.rb | # frozen_string_literal: true
require "redis-client"
module Schked
module RedisClientFactory
def self.build(options)
unless options.key?(:reconnect_attempts)
options[:reconnect_attempts] = 3
end
if options.key?(:sentinels)
if (url = options.delete(:url))
uri = URI.pa... | ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/lib/schked/cli.rb | lib/schked/cli.rb | # frozen_string_literal: true
require "thor"
require "shellwords"
module Schked
class CLI < Thor
def self.start(argv)
if File.exist?(".schked")
argv += File
.read(".schked")
.split("\n")
.join(" ")
.strip
.shellsplit
end
super(argv)
... | ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/lib/schked/worker.rb | lib/schked/worker.rb | # frozen_string_literal: true
require "rufus/scheduler"
module Schked
class Worker
def initialize(config:)
@config = config
@locker = RedisLocker.new(config.redis, lock_ttl: 40_000, logger: config.logger) unless config.standalone?
@scheduler = Rufus::Scheduler.new(trigger_lock: locker)
... | ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/lib/schked/config.rb | lib/schked/config.rb | # frozen_string_literal: true
require "logger"
module Schked
class Config
attr_writer :logger,
:do_not_load_root_schedule,
:redis,
:standalone
def paths
@paths ||= []
end
def logger?
!!@logger
end
def logger
@logger ||= Logger.new($stdout).tap { |l| l.l... | ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/.danger/merge_commits.rb | .danger/merge_commits.rb | # frozen_string_literal: true
# Check for merge commits
if git.commits.any? { |c| c.message =~ /^Merge branch 'master'/ }
warn "Please rebase to get rid of the merge commits in this PR"
end
| ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/.danger/missing_tests.rb | .danger/missing_tests.rb | # frozen_string_literal: true
# Check that there are both app and test code changes for the main app
changed_files = CHANGED_FILES.select { |path| path =~ /^(exe|lib)/ }
if changed_files.any?
changed_test_files = CHANGED_FILES.select { |path| path =~ /^spec/ }
if changed_test_files.empty?
warn "Are you sure ... | ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
bibendi/schked | https://github.com/bibendi/schked/blob/860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58/.danger/missing_labels.rb | .danger/missing_labels.rb | # frozen_string_literal: true
# Check for labels presence (ignoring "wip" label)
non_wip_labels = github.pr_labels - %w[wip]
failure "Please add labels to this PR" if non_wip_labels.empty?
| ruby | MIT | 860cd20b61fa5a98eb098d7cd0e95dd4f55c5f58 | 2026-01-04T17:48:41.942530Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/decorators/summary_decorator.rb | app/decorators/summary_decorator.rb | class SummaryDecorator < Draper::Decorator
delegate_all
include DecorateSerializer
attr :id, :title, :description, :path
# rubocop:disable Lint/DuplicateMethods
def id
object._id.to_s
end
# rubocop:enable Lint/DuplicateMethods
def path
h.summary_path(self)
end
def description_html
re... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/decorators/user_decorator.rb | app/decorators/user_decorator.rb | class UserDecorator < Draper::Decorator
delegate_all
include DecorateSerializer
attr :id, :uid, :name, :display_name, :avatar_url, :is_admin, :url
# rubocop:disable Lint/DuplicateMethods
def id
object._id.to_s
end
def display_name
name_or_display_name
end
# rubocop:enable Lint/DuplicateMetho... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/decorators/message_decorator.rb | app/decorators/message_decorator.rb | require 'gemoji'
class MessageDecorator < Draper::Decorator
delegate_all
include DecorateSerializer
attr :id, :username, :channel, :channel_name, :text, :format_text, :avatar_url, :me?, :created_at, :created_time,
:permalink, :attachment_items, :is_bot, :reactions
# rubocop:disable Lint/DuplicateMethod... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/helpers/summaries_helper.rb | app/helpers/summaries_helper.rb | module SummariesHelper
def messages_json(summary)
summary.sorted_messages.to_a.map { |n|
MessageDecorator.new(n)
}.to_json(root: false)
end
def attachment_text_format(text)
MessageDecorator.new(OpenStruct.new(text: text)).format_text
end
end
| ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/controllers/summaries_controller.rb | app/controllers/summaries_controller.rb | class SummariesController < ApplicationController
before_action :do_check_login, only: [:new, :create, :edit, :update, :destroy]
before_action :set_summary, only: [:show, :edit, :update, :destroy]
def index
page = (params[:page] || 1).to_i
source = Summary.newest.page(page)
@summaries = SummaryDecora... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/controllers/users_controller.rb | app/controllers/users_controller.rb | class UsersController < ApplicationController
before_action :set_user
def show
page = (params[:page] || 1).to_i
source = @user.summaries.newest.page(page)
@summaries = SummaryDecorator.decorate_collection(source)
end
private
def set_user
@user = User.find_by(name: params[:name])
rescue St... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/controllers/proxies_controller.rb | app/controllers/proxies_controller.rb | require 'net/http'
require 'digest/md5'
class ProxiesController < ApplicationController
def show
raise 'invalid' unless params[:url]
data = fetch(params[:url])
raise '404' unless data
send_data data[:body], type: data[:content_type], disposition: 'inline'
end
IMAGE_MAX_SIZE = 1024
IMAGE_CON... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/controllers/sessions_controller.rb | app/controllers/sessions_controller.rb | class SessionsController < ApplicationController
skip_before_action :require_login_in_private
# GET /auth/slack/callback
def create
auth = request.env['omniauth.auth']
unless valid_auth?(auth)
redirect_to '/'
return
end
user = create_or_update_user(auth)
session[:user_id] = user.... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/controllers/application_controller.rb | app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_action :do_login, :assign_global_alert, :require_login_in_private
private
def assign_global_alert
@g... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/controllers/api/histories_controller.rb | app/controllers/api/histories_controller.rb | require 'slack'
module API
class HistoriesController < ApplicationController
before_action :do_check_login
# 暫定
# GET /api/histories.json?url=http://〜
def index
client = SlackSupport::Client.create(session[:token])
chs = Services::CacheHistoryService.new(client)
messages = chs.cach... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/models/message.rb | app/models/message.rb | class Message
include Mongoid::Document
include Mongoid::Attributes::Dynamic
field :channel, type: String
field :channel_name, type: String
field :ts, type: String
index({ channel: 1, ts: 1 }, { unique: true })
def username
case self['username']
when nil
owner.try(:name_or_display_name)
... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/models/summary.rb | app/models/summary.rb | class Summary
include Mongoid::Document
paginates_per 5
field :title, type: String
field :description, type: String
belongs_to :user
has_and_belongs_to_many :messages
scope :newest, -> { order(id: :desc) }
validates :title,
length: 1..64
validates :description,
length: 0..10... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/models/user.rb | app/models/user.rb | class User
include Mongoid::Document
field :uid, type: String
field :name, type: String
field :display_name, type: String
field :avatar_url, type: String
field :is_admin, type: Boolean
field :is_bot, type: Boolean
field :last_fetched_at, type: DateTime
has_many :summaries, dependent: :restrict_with_ex... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/models/services/cache_history_service.rb | app/models/services/cache_history_service.rb | module Services
class CacheHistoryService
def initialize(client)
@client = client
@cache_users = {}
@cache_bots = {}
end
def cache(url)
archive_url = SlackSupport::ArchiveURL.new(url)
raise 'invalid url' unless archive_url.valid?
c_id, = detect_channel_id_and_name(arc... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/models/slack_support/poster.rb | app/models/slack_support/poster.rb | require 'erb'
module SlackSupport
class Poster
def initialize(client, channel_name)
@client = client
@channel_name = channel_name
end
def post(user, url, title, description)
@client.chat_postMessage({
channel: channel_id,
username: 'togelack',
text: "<@#{user.ui... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/models/slack_support/emoji.rb | app/models/slack_support/emoji.rb | module SlackSupport
class Emoji
def initialize(client)
@client = client
end
def get(name)
list[name]
end
alias [] get
def list
@list ||= Rails.cache.fetch('slack_support__emoji#list', expires_in: 30.minutes) do
resp = @client.emoji_list
return {} unless res... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/models/slack_support/archive_url.rb | app/models/slack_support/archive_url.rb | module SlackSupport
# SlackのArchiveページのURLを扱う
class ArchiveURL
# init
# @param [String] url
def initialize(url)
@url = url.to_s.strip
extract_from_url
end
attr_reader :url, :team, :channel, :ts, :thread_ts
def valid?
channel
end
private
def extract_from_url
... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/models/slack_support/channel_resolver.rb | app/models/slack_support/channel_resolver.rb | module SlackSupport
class ChannelResolver
def initialize(client)
@client = client
@cache = {}
end
def resolve_by_id(id)
@cache[id] ||=
begin
response = @client.conversations_info({ channel: id })
response['ok'] ? response['channel']['name'] : id
end
... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/models/slack_support/client.rb | app/models/slack_support/client.rb | require 'slack-ruby-client'
module SlackSupport
module Client
def self.create(token = nil)
Slack::Web::Client.new(token: (token || ENV.fetch('SLACK_TOKEN', nil)))
end
end
end
| ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/lib/decorate_serializer.rb | app/lib/decorate_serializer.rb | module DecorateSerializer
def self.included(base)
base.extend ClassMethods
base.class_eval do
def serializable_hash(_options = nil)
self.class.attr_lists.index_with { |n|
public_send(n)
}
end
end
end
module ClassMethods
def attr(*args)
@_args = args
... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/lib/pipeline_filters/replace_emoji_filter.rb | app/lib/pipeline_filters/replace_emoji_filter.rb | require 'gemoji'
module PipelineFilters
class ReplaceEmojiFilter < ::HTML::Pipeline::Filter
def call
doc.search('img').each do |node|
next unless node['class'] == 'emoji'
next if node['src'].starts_with?('https://')
name = node['title'].gsub(':', '')
info = Emoji.find_by_al... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/app/lib/pipeline_filters/add_rel_to_link_filter.rb | app/lib/pipeline_filters/add_rel_to_link_filter.rb | module PipelineFilters
class AddRelToLinkFilter < ::HTML::Pipeline::Filter
def call
doc.search('a').each do |node|
next unless node['href'].starts_with?('http')
next if node['rel']
node['target'] = '_blank'
node['rel'] = 'noopener noreferrer'
end
doc
end
e... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/db/seeds.rb | db/seeds.rb | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/application.rb | config/application.rb | require_relative 'boot'
require 'rails'
# Pick the frameworks you want:
require 'active_model/railtie'
require 'active_job/railtie'
# require "active_record/railtie"
# require "active_storage/engine"
require 'action_controller/railtie'
require 'action_mailer/railtie'
# require "action_mailbox/engine"
# require "action... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/environment.rb | config/environment.rb | # Load the Rails application.
require_relative 'application'
# Initialize the Rails application.
Rails.application.initialize!
| ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/puma.rb | config/puma.rb | max_threads_count = ENV.fetch('RAILS_MAX_THREADS', 5)
min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
threads min_threads_count, max_threads_count
worker_timeout 3600 if ENV.fetch('RAILS_ENV', 'development') == 'development'
port ENV.fetch('PORT', 3000)
environment ENV.fetch('RAILS_ENV', 'de... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/routes.rb | config/routes.rb | Rails.application.routes.draw do
root 'summaries#index'
get '/auth/:provider/callback', to: 'sessions#create'
resource :session, only: [:destroy]
resources :summaries do
collection do
get 'list'
end
end
namespace :api do
resources :histories, only: [:index]
end
get '@:name', to: 'u... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/boot.rb | config/boot.rb | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.
| ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/content_security_policy.rb | config/initializers/content_security_policy.rb | # Be sure to restart your server when you modify this file.
# Define an application-wide content security policy
# For further information see the following documentation
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
# Rails.application.config.content_security_policy do |policy|
... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/filter_parameter_logging.rb | config/initializers/filter_parameter_logging.rb | # Be sure to restart your server when you modify this file.
# Configure sensitive parameters which will be filtered from the log file.
Rails.application.config.filter_parameters += [
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
]
| ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/gemoji.rb | config/initializers/gemoji.rb | [
{ target: 'thinking', aliases: ['thinking_face'] }
].each do |item|
emoji = Emoji.find_by_alias(item[:target])
raise "emoji: #{item[:target]} is not defined" unless emoji
Emoji.edit_emoji(emoji) do |char|
item[:aliases].each do |alias_name|
char.add_alias(alias_name)
end
end
end
| ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/application_controller_renderer.rb | config/initializers/application_controller_renderer.rb | # Be sure to restart your server when you modify this file.
# ActiveSupport::Reloader.to_prepare do
# ApplicationController.renderer.defaults.merge!(
# http_host: 'example.org',
# https: false
# )
# end
| ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/session_store.rb | config/initializers/session_store.rb | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_togelack_session', expire_after: 30.days.to_i
| ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/mongoid.rb | config/initializers/mongoid.rb | require 'mongoid'
# @see https://github.com/mongodb/mongoid/pull/4944
module Mongoid
module Errors
class MongoidError < StandardError
def translate(key, options)
::I18n.t("#{BASE_KEY}.#{key}", **options)
end
end
end
end
| ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/new_framework_defaults_6_0.rb | config/initializers/new_framework_defaults_6_0.rb | # Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 6.0 upgrade.
#
# Once upgraded flip defaults one by one to migrate to the new default.
#
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
# Don't force requests from old ver... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/wrap_parameters.rb | config/initializers/wrap_parameters.rb | # Be sure to restart your server when you modify this file.
# This file contains settings for ActionController::ParamsWrapper which
# is enabled by default.
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
ActiveSupport.on_load(:action_controller) do
wrap_parameters f... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/omniauth.rb | config/initializers/omniauth.rb | Rails.application.config.middleware.use OmniAuth::Builder do
provider(:slack, ENV.fetch('SLACK_CLIENT_ID', nil), ENV.fetch('SLACK_CLIENT_SECRET', nil),
scope: 'identify,read',
team: ENV.fetch('SLACK_TEAM_ID', nil))
end
| ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/inflections.rb | config/initializers/inflections.rb | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflec... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/cookies_serializer.rb | config/initializers/cookies_serializer.rb | # Be sure to restart your server when you modify this file.
# Specify a serializer for the signed and encrypted cookie jars.
# Valid options are :json, :marshal, and :hybrid.
Rails.application.config.action_dispatch.cookies_serializer = :json
| ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/permissions_policy.rb | config/initializers/permissions_policy.rb | # Define an application-wide HTTP permissions policy. For further
# information see https://developers.google.com/web/updates/2018/06/feature-policy
#
# Rails.application.config.permissions_policy do |f|
# f.camera :none
# f.gyroscope :none
# f.microphone :none
# f.usb :none
# f.fullscreen :s... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/backtrace_silencers.rb | config/initializers/backtrace_silencers.rb | # Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| /my_noisy_library/.match?(line) }
# You can also remove all the silencers if you're trying to debug a ... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/mime_types.rb | config/initializers/mime_types.rb | # Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
| ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/new_framework_defaults_6_1.rb | config/initializers/new_framework_defaults_6_1.rb | # Be sure to restart your server when you modify this file.
#
# This file contains migration options to ease your Rails 6.1 upgrade.
#
# Once upgraded flip defaults one by one to migrate to the new default.
#
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
# Support for inversing belongs_to ... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/initializers/draper.rb | config/initializers/draper.rb | Draper::CollectionDecorator.delegate :current_page, :total_pages, :limit_value, :total_count
| ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/environments/test.rb | config/environments/test.rb | require 'active_support/core_ext/integer/time'
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data the... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/environments/development.rb | config/environments/development.rb | require 'active_support/core_ext/integer/time'
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded any time
# it changes. This slows down response time but is perfect for developme... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
rutan/togelack | https://github.com/rutan/togelack/blob/810cc078a805787a13b0b0751ae5bbebafa20405/config/environments/production.rb | config/environments/production.rb | require 'active_support/core_ext/integer/time'
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your applica... | ruby | MIT | 810cc078a805787a13b0b0751ae5bbebafa20405 | 2026-01-04T17:48:38.164574Z | false |
goco-inc/legacy-graphql-activerecord | https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/spec/spec_helper.rb | spec/spec_helper.rb | # frozen_string_literal: true
require 'bundler/setup'
Bundler.setup
require 'pry'
require 'graphql/activerecord'
RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
# assertions if you prefer.
config.... | ruby | MIT | 025be0879466ee2e6d7324f4dd59b6a306e0e211 | 2026-01-04T17:48:42.035378Z | false |
goco-inc/legacy-graphql-activerecord | https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/spec/graphql/models/hash_combiner_spec.rb | spec/graphql/models/hash_combiner_spec.rb | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe GraphQL::Models::HashCombiner do
describe '::combine' do
it "groups items based on the most common value first" do
input = [
{ type: 'hello', id: 1 },
{ type: 'hello', id: 2 },
{ type: 'hello', id: 3 },
{ ty... | ruby | MIT | 025be0879466ee2e6d7324f4dd59b6a306e0e211 | 2026-01-04T17:48:42.035378Z | false |
goco-inc/legacy-graphql-activerecord | https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/activerecord.rb | lib/graphql/activerecord.rb | # frozen_string_literal: true
require 'active_support'
require 'active_record'
require 'graphql'
require 'graphql/batch'
require 'graphql/relay'
require 'graphql/models/monkey_patches/graphql_query_context'
require 'graphql/models/active_record_extension'
require 'graphql/models/instrumentation'
# Helpers
require 'g... | ruby | MIT | 025be0879466ee2e6d7324f4dd59b6a306e0e211 | 2026-01-04T17:48:42.035378Z | false |
goco-inc/legacy-graphql-activerecord | https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/hash_combiner.rb | lib/graphql/models/hash_combiner.rb | # frozen_string_literal: true
module GraphQL::Models::HashCombiner
class << self
# Takes a set of hashes that represent conditions, and combines them into the smallest number of hashes
def combine(hashes)
# Group the hashes by keys. If they are querying different columns, they can't be combined
b... | ruby | MIT | 025be0879466ee2e6d7324f4dd59b6a306e0e211 | 2026-01-04T17:48:42.035378Z | false |
goco-inc/legacy-graphql-activerecord | https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/version.rb | lib/graphql/models/version.rb | # frozen_string_literal: true
module GraphQL
module Models
VERSION = "0.13.0"
end
end
| ruby | MIT | 025be0879466ee2e6d7324f4dd59b6a306e0e211 | 2026-01-04T17:48:42.035378Z | false |
goco-inc/legacy-graphql-activerecord | https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/attribute_loader.rb | lib/graphql/models/attribute_loader.rb | # frozen_string_literal: true
module GraphQL::Models
# Simplified loader that can take a hash of attributes to match, combine them into a single query, and then fulfill
# then individually. It can also ask the database to order them correctly.
class AttributeLoader < GraphQL::Batch::Loader
attr_reader :model... | ruby | MIT | 025be0879466ee2e6d7324f4dd59b6a306e0e211 | 2026-01-04T17:48:42.035378Z | false |
goco-inc/legacy-graphql-activerecord | https://github.com/goco-inc/legacy-graphql-activerecord/blob/025be0879466ee2e6d7324f4dd59b6a306e0e211/lib/graphql/models/mutator.rb | lib/graphql/models/mutator.rb | # frozen_string_literal: true
module GraphQL::Models
class Mutator
attr_accessor :field_map, :root_model, :inputs, :context
def initialize(field_map, root_model, inputs, context)
@field_map = field_map
@root_model = root_model
@inputs = inputs
@context = context
end
def appl... | ruby | MIT | 025be0879466ee2e6d7324f4dd59b6a306e0e211 | 2026-01-04T17:48:42.035378Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.