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
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/jobs/download_gem_job_spec.rb
spec/jobs/download_gem_job_spec.rb
require 'rails_helper' RSpec.describe DownloadGemJob, type: :job do let(:library_version) do double('LibraryVersion', disallowed?: false, ready?: false, to_s: 'rails-7.0.0', platform: nil, source_path: '/tmp/gems/rails/7.0.0', source: :remote_gem, name: 'rails' ) e...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/jobs/delete_docs_job_spec.rb
spec/jobs/delete_docs_job_spec.rb
require 'rails_helper' RSpec.describe DeleteDocsJob, type: :job do let(:library_version) do double('LibraryVersion', source_path: '/tmp/gems/rails/7.0.0', source: :remote_gem, name: 'rails', version: '7.0.0', to_s: 'rails-7.0.0' ) end let(:library) do create(:gem, name:...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/jobs/github_checkout_job_spec.rb
spec/jobs/github_checkout_job_spec.rb
require 'rails_helper' RSpec.describe GithubCheckoutJob, type: :job do let(:owner) { 'rails' } let(:project) { 'rails' } let(:commit) { 'main' } subject { described_class.new } before do allow(subject).to receive(:sh).and_return(true) end describe '#perform' do let(:library_version) { double('...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/jobs/cache_clear_job_spec.rb
spec/jobs/cache_clear_job_spec.rb
require 'rails_helper' RSpec.describe CacheClearJob, type: :job do describe '#perform' do let(:paths) { [ '/docs/rails/7.0.0', '/docs/rspec/3.12.0' ] } context 'when Cloudflare token is configured' do with_rubydoc_config(integrations: { cloudflare_token: 'test_token', cloudflare_zones: [ 'zone123' ] }...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/system/github_spec.rb
spec/system/github_spec.rb
require 'rails_helper' RSpec.describe "Github", type: :system do with_rubydoc_config({}) do context "GET /" do before do Library.gem.delete_all create_list(:github, 10) create(:gem, name: "yard", versions: [ "1.0.0", "2.0.0", "3.0.0", "4.0.0", "5.0.0" ]) create(:github, name...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/system/gem_spec.rb
spec/system/gem_spec.rb
require 'rails_helper' RSpec.describe "Github", type: :system do with_rubydoc_config({}) do context "GET /" do before do Library.gem.delete_all end context "when no gems are available" do it do visit gems_path expect(page).to have_selector("h2", text: "RubyG...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/helpers/shell_helper_spec.rb
spec/helpers/shell_helper_spec.rb
require 'rails_helper' RSpec.describe ShellHelper, type: :helper do describe '#sh' do context 'with successful command' do it 'executes the command and returns result' do result = helper.sh('echo "test"', raise_error: true) expect(result).to be_success end it 'logs the command ...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/helpers/application_helper_spec.rb
spec/helpers/application_helper_spec.rb
require 'rails_helper' RSpec.describe ApplicationHelper, type: :helper do describe 'constants' do it 'defines LIBRARY_TYPES' do expect(ApplicationHelper::LIBRARY_TYPES).to be_a(Hash) expect(ApplicationHelper::LIBRARY_TYPES[:featured]).to eq("Gem") expect(ApplicationHelper::LIBRARY_TYPES[:stdlib...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/factories/libraries.rb
spec/factories/libraries.rb
FactoryBot.define do factory :library do name { Faker::Internet.unique.username } versions { Faker::Number.between(from: 1, to: 10).to_i.times.map { Faker::Number.number(digits: 3).to_s.split("").join(".") } } factory :gem do source { :remote_gem } end factory :github do source { :gi...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/controllers/github_controller_spec.rb
spec/controllers/github_controller_spec.rb
require 'rails_helper' RSpec.describe GithubController, type: :controller do describe "GET #index" do before do create(:github, name: 'rails', owner: 'rails', versions: [ 'main' ]) create(:github, name: 'ruby', owner: 'ruby', versions: [ 'master' ]) end it "returns a successful response" do ...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/controllers/stdlib_controller_spec.rb
spec/controllers/stdlib_controller_spec.rb
require 'rails_helper' RSpec.describe StdlibController, type: :controller do describe "GET #index" do before do create(:stdlib, name: 'json', versions: [ '2.6.0' ]) create(:stdlib, name: 'csv', versions: [ '3.2.0' ]) end it "returns a successful response" do get :index expect(res...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/controllers/gems_controller_spec.rb
spec/controllers/gems_controller_spec.rb
require 'rails_helper' RSpec.describe GemsController, type: :controller do describe "GET #index" do before do create(:gem, name: 'activerecord', versions: [ '7.0.0' ]) create(:gem, name: 'actionpack', versions: [ '3.12.0' ]) end it "returns a successful response" do get :index ex...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/models/library_spec.rb
spec/models/library_spec.rb
require 'rails_helper' RSpec.describe Library, type: :model do describe 'enums' do it 'defines source enum' do expect(Library.sources).to eq('remote_gem' => 'remote_gem', 'github' => 'github', 'stdlib' => 'stdlib', 'featured' => 'featured') end end describe 'scopes' do before do @gem1 = ...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/spec/models/github_project_spec.rb
spec/models/github_project_spec.rb
require 'rails_helper' RSpec.describe GithubProject, type: :model do describe 'validations' do it 'validates url format' do project = GithubProject.new(url: 'https://github.com/rails/rails') expect(project).to be_valid project.url = 'https://example.com/rails/rails' expect(project).not_t...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/lib/yard/templates/default/method/setup.rb
lib/yard/templates/default/method/setup.rb
def init super return unless defined? Rubydoc.config.disqus sections.push :disqus end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/lib/yard/templates/default/layout/html/setup.rb
lib/yard/templates/default/layout/html/setup.rb
def javascripts super + %w[js/rubydoc_custom.js] end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/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
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/config/environment.rb
config/environment.rb
# Load the Rails application. require_relative "application" # Initialize the Rails application. Rails.application.initialize!
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/config/puma.rb
config/puma.rb
# This configuration file will be evaluated by Puma. The top-level methods that # are invoked here are part of Puma's configuration DSL. For more information # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html. # # Puma starts a configurable number of processes (workers) and each process # serve...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/config/routes.rb
config/routes.rb
Rails.application.routes.draw do # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. # Can be used by load balancers and uptime monitors to verify that the app is live. get...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/config/importmap.rb
config/importmap.rb
# Pin npm packages by running ./bin/importmap pin "application" pin "yard" pin "@hotwired/turbo-rails", to: "turbo.min.js" pin "@hotwired/stimulus", to: "stimulus.min.js" pin "@hotwired/stimulus-loading", to: "stimulus-loading.js" pin_all_from "app/javascript/controllers", under: "controllers"
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/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
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/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. # See the Securing Rails Applications Guide for more information: # https://guides.rubyonrails.org/security.html#content-security-policy-header # Rails.application.configure do # config.content_security...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/config/initializers/filter_parameter_logging.rb
config/initializers/filter_parameter_logging.rb
# Be sure to restart your server when you modify this file. # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. # Use this to limit dissemination of sensitive information. # See the ActiveSupport::ParameterFilter documentation for supported notations and behavio...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/config/initializers/rubydoc.rb
config/initializers/rubydoc.rb
# Configuration module Rubydoc def self.config; @config; end def self.config=(config) @config = JSON.parse({ name: "RubyDoc.info", description: "Documenting RubyGems, Stdlib, and GitHub Projects", integrations: { rubygems: Rails.application.credentials.rubydoc&.rubygems_api_key, ...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/config/initializers/skylight.rb
config/initializers/skylight.rb
require "skylight" if Rails.application.credentials.rubydoc&.skylight_token Rails.application.config.skylight.logger = ActiveSupport::Logger.new(STDOUT) Rails.application.config.skylight.environments << "development" Rails.application.config.skylight.probes << "active_job" view_paths = Rails.application.confi...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/config/initializers/mini_profiler.rb
config/initializers/mini_profiler.rb
if defined? Rack::MiniProfiler Rack::MiniProfiler.config.position = "bottom-right" end
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/config/initializers/queue_jobs.rb
config/initializers/queue_jobs.rb
SolidQueue.on_start do UpdateRemoteGemsListJob.clear_lock_file # Queue a few jobs on start [ UpdateRemoteGemsListJob, RegisterLibrariesJob, ReapGenerateDocsJob ].each do |job_class| if SolidQueue::Job.where(class_name: job_class.name, finished_at: nil).none? Rails.logger.info "[initializer/queue_jobs] ...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/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
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/config/initializers/assets.rb
config/initializers/assets.rb
# Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = "1.0" # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/config/environments/test.rb
config/environments/test.rb
# 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 there! Rails.application.configure do # Settings...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/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. # Make code changes take effect immediately without server restart. config.enable_reloading = true # Do not eager load code on boot. config.eager...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
docmeta/rubydoc.info
https://github.com/docmeta/rubydoc.info/blob/05379203c0f7e84c6f5df9bbbd384db5ff7ac532/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.enable_reloading = false # Eager load code on boot for better performance and memory savings (ignor...
ruby
MIT
05379203c0f7e84c6f5df9bbbd384db5ff7ac532
2026-01-04T17:46:46.862481Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/app/app.rb
app/app.rb
class Fikus < Padrino::Application register Padrino::Mailer register Padrino::Helpers ## # Application configuration options # # set :raise_errors, true # Show exceptions (default for development) # set :public, "foo/bar" # Location for static assets (default root/public) # set :reload, false ...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/app/helpers/fikus_helpers.rb
app/helpers/fikus_helpers.rb
Fikus.helpers do include FikusPageHelpers end
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/app/controllers/main.rb
app/controllers/main.rb
Fikus.controller do get :index do render_page('') end get :index, :with => :page_name do requested_page = (params[:page_name] == nil) ? '' : params[:page_name] render_page(requested_page) end end
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/app/models/account.rb
app/models/account.rb
require 'digest/sha1' class Account include MongoMapper::Document attr_accessor :password # Keys key :name, String key :surname, String key :email, String key :crypted_password, String key :salt, String key :role, String # Validations vali...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/app/models/page.rb
app/models/page.rb
class Page include MongoMapper::Document key :title, String, :required => true key :path, String key :body, String, :required => true key :layout, String, :default => 'application.haml' key :weight, Integer, :numeric => true, :default => 0 timestamps! belongs_to :site validates_uniquen...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/app/models/site.rb
app/models/site.rb
class Site include MongoMapper::Document key :name, String key :domain, String key :tagline, String timestamps! has_many :pages def self.get_site(domain) match = nil Site.all.each do |site| match = site if domain && domain.match(site.domain) end match end end
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/deploy/after_symlink.rb
deploy/after_symlink.rb
# Deploy hook helper methods for shared config files on the Engine Yard AppCloud # NOTE: You need to have these customized files put in place with Chef # Along with any other customized files you need. ['database.rb', 'fikus.yml'].each do |cfg_file| cfg_file_path = "#{shared_path}/config/#{cfg_file}" if File.exist?...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/db/seeds.rb
db/seeds.rb
# Seed add you the ability to populate your db. # We provide you a basic shell for interaction with the end user. # So try some code like below: # # name = shell.ask("What's your name?") # shell.say name # #email = shell.ask "Which email do you want use for loggin into admin?" #password = shell.ask "Tell me th...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/admin/app.rb
admin/app.rb
class Admin < Padrino::Application register Padrino::Mailer register Padrino::Helpers register Padrino::Admin::AccessControl ## # Application configuration options # # set :raise_errors, true # Show exceptions (default for development) # set :public, "foo/bar" # Location for static assets (def...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/admin/helpers/admin_helpers.rb
admin/helpers/admin_helpers.rb
Admin.helpers do include FikusPageHelpers end
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/admin/controllers/sessions.rb
admin/controllers/sessions.rb
Admin.controllers :sessions do get :new do render "/sessions/new", nil, :layout => false end post :create do if account = Account.authenticate(params[:email], params[:password]) set_current_account(account) redirect url(:base, :index) else flash[:warning] = "Login or password wrong...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/admin/controllers/accounts.rb
admin/controllers/accounts.rb
Admin.controllers :accounts do get :index do @accounts = Account.all render 'accounts/index' end get :new do @account = Account.new render 'accounts/new' end post :create do @account = Account.new(params[:account]) if @account.save flash[:notice] = 'Account was successfully cr...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/admin/controllers/sites.rb
admin/controllers/sites.rb
Admin.controllers :sites do get :index do @sites = Site.all render 'sites/index' end get :new do @site = Site.new render 'sites/new' end post :create do @site = Site.new(params[:site]) if @site.save flash[:notice] = 'Site was successfully created.' redirect url(:sites, :...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/admin/controllers/base.rb
admin/controllers/base.rb
Admin.controllers :base do get :index, :map => "/" do render "base/index" end end
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/admin/controllers/pages.rb
admin/controllers/pages.rb
Admin.controllers :pages do get :index do @pages = Page.all render 'pages/index' end get :new do @page = Page.new render 'pages/new' end post :create do @page = Page.new(params[:page]) if @page.save flash[:notice] = 'Page was successfully created.' redirect url(:pages, :...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/chef/fikus/recipes/default.rb
chef/fikus/recipes/default.rb
# # Cookbook Name:: fikus # Recipe:: default # # Copy customized config files into place # for your fikus website if ['solo', 'app', 'app_master'].include?(node[:instance_role]) node[:applications].each do |app_name,data| mongodb_master = 'localhost' node[:utility_instances].each do |util_instance| i...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/config/fikus.rb
config/fikus.rb
# This loads the site config file for your Fikus installation # Customize fikus.yml to your tastes, and enjoy the power of a # stupid simple content management system powered by love! config = YAML.load_file(File.join(Padrino.root, "config", "fikus.yml")) ::FikusConfig = OpenStruct.new(config[Padrino.env]) case Fiku...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/config/apps.rb
config/apps.rb
## # This file mounts each app in the Padrino project to a specified sub-uri. # You can mount additional applications using any of these commands below: # # Padrino.mount("blog").to('/blog') # Padrino.mount("blog", :app_class => "BlogApp").to('/blog') # Padrino.mount("blog", :app_file => "path/to/blog/app.rb").t...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/config/boot.rb
config/boot.rb
# Defines our constants PADRINO_ENV = ENV["PADRINO_ENV"] ||= ENV["RACK_ENV"] ||= "development" unless defined?(PADRINO_ENV) PADRINO_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) unless defined?(PADRINO_ROOT) begin # Require the preresolved locked set of gems. require File.expand_path('../../.b...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/config/database.rb
config/database.rb
if ENV['MONGOHQ_URL'] uri = URI.parse(ENV['MONGOHQ_URL']) MongoMapper.connection = Mongo::Connection.from_uri(ENV['MONGOHQ_URL'], :logger => logger) MongoMapper.database = uri.path.gsub(/^\//, '') else MongoMapper.connection = Mongo::Connection.new('localhost', nil, :logger => logger) MongoMapper.database = "...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/shared/lib/page_helpers.rb
shared/lib/page_helpers.rb
module FikusPageHelpers def current_site site = Site.get_site(request.host) end def all_layouts Dir.entries(File.join(Padrino.root, "app", "views", "layouts")).select {|x| x =~ /\.haml$/} end def get_valid_layout(layout_to_use) full_layout_path = File.join(Padrino.root, "app", "views", "l...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
bratta/fikus
https://github.com/bratta/fikus/blob/8d6b0789eb932eb0b7a37ceea56d892d14810405/shared/lib/cacher.rb
shared/lib/cacher.rb
module FikusCacher # By default, don't perform any caching. class FikusCacher def cache(page) return true end def sweep(options={}) return true end # Return false if no caching was performed, else return cached contents def retrieve(page) yield end def get...
ruby
MIT
8d6b0789eb932eb0b7a37ceea56d892d14810405
2026-01-04T17:46:47.220136Z
false
seamusabshere/lock_and_cache
https://github.com/seamusabshere/lock_and_cache/blob/8626eaa73be1904705de89ad916ed782053f8294/benchmarks/allowed_in_keys.rb
benchmarks/allowed_in_keys.rb
require 'set' require 'date' require 'benchmark/ips' ALLOWED_IN_KEYS = [ ::String, ::Symbol, ::Numeric, ::TrueClass, ::FalseClass, ::NilClass, ::Integer, ::Float, ::Date, ::DateTime, ::Time, ].to_set parts = RUBY_VERSION.split('.').map(&:to_i) unless parts[0] >= 2 and parts[1] >= 4 ALLOWED_IN_K...
ruby
MIT
8626eaa73be1904705de89ad916ed782053f8294
2026-01-04T17:46:54.372075Z
false
seamusabshere/lock_and_cache
https://github.com/seamusabshere/lock_and_cache/blob/8626eaa73be1904705de89ad916ed782053f8294/spec/lock_and_cache_spec.rb
spec/lock_and_cache_spec.rb
require 'spec_helper' class Foo include LockAndCache def initialize(id) @id = id @count = 0 @count_exp = 0 @click_single_hash_arg_as_options = 0 @click_last_hash_as_options = 0 end def click lock_and_cache do @count += 1 end end def cached_rand lock_and_cache do ...
ruby
MIT
8626eaa73be1904705de89ad916ed782053f8294
2026-01-04T17:46:54.372075Z
false
seamusabshere/lock_and_cache
https://github.com/seamusabshere/lock_and_cache/blob/8626eaa73be1904705de89ad916ed782053f8294/spec/spec_helper.rb
spec/spec_helper.rb
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'lock_and_cache' require 'timeout' require 'redis' LockAndCache.lock_storage = Redis.new db: 3 LockAndCache.cache_storage = Redis.new db: 4 require 'thread/pool' require 'pry'
ruby
MIT
8626eaa73be1904705de89ad916ed782053f8294
2026-01-04T17:46:54.372075Z
false
seamusabshere/lock_and_cache
https://github.com/seamusabshere/lock_and_cache/blob/8626eaa73be1904705de89ad916ed782053f8294/spec/lock_and_cache/key_spec.rb
spec/lock_and_cache/key_spec.rb
require 'spec_helper' class KeyTestId def id 'id' end end class KeyTestLockAndCacheKey def lock_and_cache_key 'lock_and_cache_key' end end class KeyTest1 def lock_and_cache_key KeyTestLockAndCacheKey.new end end describe LockAndCache::Key do describe 'parts' do it "has a known issue diffe...
ruby
MIT
8626eaa73be1904705de89ad916ed782053f8294
2026-01-04T17:46:54.372075Z
false
seamusabshere/lock_and_cache
https://github.com/seamusabshere/lock_and_cache/blob/8626eaa73be1904705de89ad916ed782053f8294/lib/lock_and_cache.rb
lib/lock_and_cache.rb
require 'logger' require 'timeout' require 'digest/sha1' require 'base64' require 'redis' require 'active_support' require 'active_support/core_ext' require_relative 'lock_and_cache/version' require_relative 'lock_and_cache/action' require_relative 'lock_and_cache/key' # Lock and cache using redis! # # Most caching l...
ruby
MIT
8626eaa73be1904705de89ad916ed782053f8294
2026-01-04T17:46:54.372075Z
false
seamusabshere/lock_and_cache
https://github.com/seamusabshere/lock_and_cache/blob/8626eaa73be1904705de89ad916ed782053f8294/lib/lock_and_cache/version.rb
lib/lock_and_cache/version.rb
module LockAndCache VERSION = '6.0.1' end
ruby
MIT
8626eaa73be1904705de89ad916ed782053f8294
2026-01-04T17:46:54.372075Z
false
seamusabshere/lock_and_cache
https://github.com/seamusabshere/lock_and_cache/blob/8626eaa73be1904705de89ad916ed782053f8294/lib/lock_and_cache/key.rb
lib/lock_and_cache/key.rb
require 'date' module LockAndCache # @private class Key class << self # @private # # Extract the method id from a method's caller array. def extract_method_id_from_caller(kaller) kaller[0] =~ METHOD_NAME_IN_CALLER raise "couldn't get method_id from #{kaller[0]}" unless $...
ruby
MIT
8626eaa73be1904705de89ad916ed782053f8294
2026-01-04T17:46:54.372075Z
false
seamusabshere/lock_and_cache
https://github.com/seamusabshere/lock_and_cache/blob/8626eaa73be1904705de89ad916ed782053f8294/lib/lock_and_cache/action.rb
lib/lock_and_cache/action.rb
module LockAndCache # @private class Action ERROR_MAGIC_KEY = :lock_and_cache_error attr_reader :key attr_reader :options attr_reader :blk def initialize(key, options, blk) raise "need a block" unless blk @key = key @options = options.stringify_keys @blk = blk end ...
ruby
MIT
8626eaa73be1904705de89ad916ed782053f8294
2026-01-04T17:46:54.372075Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/helpers/slack_helper.rb
app/helpers/slack_helper.rb
module SlackHelper end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/helpers/escalation_series_helper.rb
app/helpers/escalation_series_helper.rb
module EscalationSeriesHelper end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/helpers/sessions_helper.rb
app/helpers/sessions_helper.rb
module SessionsHelper end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/helpers/comments_helper.rb
app/helpers/comments_helper.rb
module CommentsHelper end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/helpers/incidents_helper.rb
app/helpers/incidents_helper.rb
module IncidentsHelper end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/helpers/users_helper.rb
app/helpers/users_helper.rb
module UsersHelper end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/helpers/maintenances_helper.rb
app/helpers/maintenances_helper.rb
module MaintenancesHelper end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/helpers/notifier_providers_helper.rb
app/helpers/notifier_providers_helper.rb
module NotifierProvidersHelper end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/helpers/application_helper.rb
app/helpers/application_helper.rb
module ApplicationHelper end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/helpers/incident_events_helper.rb
app/helpers/incident_events_helper.rb
module IncidentEventsHelper end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/helpers/notifiers_helper.rb
app/helpers/notifiers_helper.rb
module NotifiersHelper end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/helpers/escalations_helper.rb
app/helpers/escalations_helper.rb
module EscalationsHelper end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/helpers/topics_helper.rb
app/helpers/topics_helper.rb
module TopicsHelper end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/helpers/home_helper.rb
app/helpers/home_helper.rb
module HomeHelper end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/controllers/topics_controller.rb
app/controllers/topics_controller.rb
class TopicsController < ApplicationController before_action :set_topic, only: [:show, :edit, :update, :destroy, :mailgun, :mackerel, :alertmanager, :slack] skip_before_action :login_required, only: [:mailgun, :mackerel, :alertmanager, :slack], raise: false # GET /topics # GET /topics.json def index @top...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/controllers/home_controller.rb
app/controllers/home_controller.rb
class HomeController < ApplicationController def index redirect_to incidents_path end end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/controllers/incidents_controller.rb
app/controllers/incidents_controller.rb
class IncidentsController < ApplicationController before_action :set_incidents, only: [:index, :bulk_acknowledge, :bulk_resolve] before_action :set_incident, only: [:show, :edit, :update, :destroy, :acknowledge, :resolve] before_action :ensure_hash, only: [:acknowledge, :resolve] skip_before_action :login_requi...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/controllers/users_controller.rb
app/controllers/users_controller.rb
class UsersController < ApplicationController before_action :set_user, only: [:show, :edit, :update, :destroy, :activation, :deactivation] # GET /users # GET /users.json def index @users = User.all end # GET /users/1 # GET /users/1.json def show end # GET /users/new def new @user = User...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/controllers/slack_controller.rb
app/controllers/slack_controller.rb
class SlackController < ApplicationController skip_before_action :login_required, only: [:interactive], raise: false def interactive verify! message = payload['original_message'] message['attachments'][0].delete('actions') user = payload['user']['name'] text = '' payload['actions'].each ...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/controllers/comments_controller.rb
app/controllers/comments_controller.rb
class CommentsController < ApplicationController before_action :set_comment, only: [:show, :edit, :update, :destroy] before_action :set_incident # GET /comments # GET /comments.json def index @comments = Comment.where(incident: @incident) end # GET /comments/1 # GET /comments/1.json def show e...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/controllers/maintenances_controller.rb
app/controllers/maintenances_controller.rb
class MaintenancesController < ApplicationController before_action :set_maintenance, only: [:show, :edit, :update, :destroy] # GET /maintenances # GET /maintenances.json def index @maintenances = Maintenance.not_expired end # GET /maintenances/1 # GET /maintenances/1.json def show end # GET /...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/controllers/escalation_series_controller.rb
app/controllers/escalation_series_controller.rb
class EscalationSeriesController < ApplicationController before_action :set_escalation_series, only: [:show, :edit, :update, :destroy, :update_escalations] # GET /escalation_series # GET /escalation_series.json def index @escalation_series = EscalationSeries.all end # GET /escalation_series/1 # GET ...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/controllers/notifiers_controller.rb
app/controllers/notifiers_controller.rb
class NotifiersController < ApplicationController before_action :set_notifier, only: [:show, :edit, :update, :destroy] # GET /notifiers # GET /notifiers.json def index @notifiers = Notifier.all end # GET /notifiers/1 # GET /notifiers/1.json def show end # GET /notifiers/new def new @not...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/controllers/escalations_controller.rb
app/controllers/escalations_controller.rb
class EscalationsController < ApplicationController before_action :set_escalation, only: [:show, :edit, :update, :destroy] # GET /escalations # GET /escalations.json def index @escalations = Escalation.all.order('escalate_after_sec') end # GET /escalations/1 # GET /escalations/1.json def show en...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/controllers/incident_events_controller.rb
app/controllers/incident_events_controller.rb
require 'securerandom' class IncidentEventsController < ApplicationController skip_before_action :login_required, only: [:twilio], raise: false def twilio @event = IncidentEvent.find(params[:id]) language = ENV['TWILIO_LANGUAGE'] || 'en-US' resp = nil if params[:Digits] case params[:Digits]...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/controllers/notifier_providers_controller.rb
app/controllers/notifier_providers_controller.rb
class NotifierProvidersController < ApplicationController before_action :set_notifier_provider, only: [:show, :edit, :update, :destroy] # GET /notifier_providers # GET /notifier_providers.json def index @notifier_providers = NotifierProvider.all end # GET /notifier_providers/1 # GET /notifier_provid...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
class SessionsController < ApplicationController skip_before_action :login_required, only: [:create] def create @user = User.find_or_create_from_auth_hash(auth_hash) @user.update_credentials_from_auth_hash(auth_hash) self.current_user = @user redirect_to '/' end private def auth_hash re...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/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: :null_session helper_method :current_user if ENV["GOOGLE_CLIENT_ID"] before_action :login_required end def login_requ...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/models/maintenance.rb
app/models/maintenance.rb
class Maintenance < ApplicationRecord scope :active, -> { t = Time.now; where('start_time <= ? AND ? <= end_time', t, t) } scope :not_expired, -> { where('? <= end_time', Time.now) } scope :expired, -> { where('end_time < ?', Time.now) } belongs_to :topic def filter_regexp Regexp.new(filter) end e...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/models/topic.rb
app/models/topic.rb
class Topic < ApplicationRecord enum kind: [:api] belongs_to :escalation_series has_many :incidents validates :name, presence: true validates :kind, presence: true validates :escalation_series, presence: true def in_maintenance?(*bodies) maints = Maintenance.active.where(topic: self) maints.any?...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/models/incident_event.rb
app/models/incident_event.rb
class IncidentEvent < ApplicationRecord belongs_to :incident enum kind: [:opened, :acknowledged, :resolved, :escalated, :commented, :notified] validates :incident, presence: true validates :kind, presence: true serialize :info, JSON after_create :notify after_initialize :set_defaults def set_default...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/models/comment.rb
app/models/comment.rb
class Comment < ApplicationRecord belongs_to :incident belongs_to :user validates :incident, presence: true validates :user, presence: true validates :comment, presence: true end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/models/notification_worker.rb
app/models/notification_worker.rb
class NotificationWorker include Sidekiq::Worker def self.enqueue(event:, notifier:) Rails.logger.info "Enqueue NotificationWorker job" self.perform_in(notifier.notify_after_sec, event.id, notifier.id) end def perform(event_id, notifier_id) event = IncidentEvent.find(event_id) notifier = Noti...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/models/escalation_update_worker.rb
app/models/escalation_update_worker.rb
class EscalationUpdateWorker include Sidekiq::Worker def perform EscalationSeries.all.each do |series| handle_series(series) end rescue => err Rails.logger.error "#{err.class}: #{err}\n#{err.backtrace.join("\n")}" end private def handle_series(series) series.update_escalations! en...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/models/application_record.rb
app/models/application_record.rb
# Base ApplicationRecord Class class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/models/escalation_worker.rb
app/models/escalation_worker.rb
class EscalationWorker include Sidekiq::Worker def self.enqueue(incident, escalation) Rails.logger.info "Enqueue EscalaionWorker job" self.perform_in(escalation.escalate_after_sec, incident.id, escalation.id) end def perform(incident_id, escalation_id) incident = Incident.find(incident_id) esc...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false
ryotarai/waker
https://github.com/ryotarai/waker/blob/24b15020a03659b61257cc33b905e962bcbe4637/app/models/notifier_provider.rb
app/models/notifier_provider.rb
class NotifierProvider < ApplicationRecord serialize :settings, JSON enum kind: [:mailgun, :file, :rails_logger, :hipchat, :twilio, :slack, :datadog, :sns] validates :name, presence: true after_initialize :set_defaults def set_defaults self.settings ||= {} end def concrete_class self.class.con...
ruby
MIT
24b15020a03659b61257cc33b905e962bcbe4637
2026-01-04T17:46:55.259411Z
false