hexsha stringlengths 40 40 | size int64 2 1.01M | content stringlengths 2 1.01M | avg_line_length float64 1.5 100 | max_line_length int64 2 1k | alphanum_fraction float64 0.25 1 |
|---|---|---|---|---|---|
abf5186aff83683c63001ea406ad6379e1e4ffb0 | 1,222 | require 'test_helper'
class ExternsControllerTest < ActionController::TestCase
setup do
@person = people(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:people)
end
test "should get new" do
get :new
assert_response :success
end
... | 24.938776 | 182 | 0.700491 |
6a4288bc8229643ef9806cc43a3b5ed91be64a13 | 1,054 | # typed: false
require 'datadog/tracing/contrib/integration'
require 'datadog/tracing/contrib/delayed_job/configuration/settings'
require 'datadog/tracing/contrib/delayed_job/patcher'
module Datadog
module Tracing
module Contrib
module DelayedJob
# Description of DelayedJob integration
cla... | 23.954545 | 103 | 0.620493 |
7a8a04b3bd1f725a6b68360553a0c17a9498d91a | 1,197 | class CmarkGfm < Formula
desc "C implementation of GitHub Flavored Markdown"
homepage "https://github.com/github/cmark"
url "https://github.com/github/cmark/archive/0.28.3.gfm.15.tar.gz"
version "0.28.3.gfm.15"
sha256 "9e43c0b5dbd6678059fb7eeb5f57520b480812083b91567034c9e2890cc32f21"
bottle do
cellar :... | 34.2 | 93 | 0.726817 |
ed2e15a155eea1350f2ef4cdd90fa3a6dc3338fd | 1,614 | module Drivenow
class Agent
require 'open-uri'
require 'json'
attr_reader :cars
# Creates a new instance of the Drivenow::Agent.
# options:
# :city => The city you want to get all for. e.g. :berlin
# :api_key => API-Key for access (optional)
def initialize(options = {})
citie... | 26.9 | 80 | 0.549566 |
28b93c393480c483115de61496650cfad7c7862d | 5,012 | 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 application in memory, allowing both threaded web serve... | 44.353982 | 114 | 0.76237 |
4a74e8ba8e8a68514e88534a7f4459f5b720c0a4 | 27,876 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# dat... | 36.678947 | 121 | 0.708925 |
1c9d1b0d781542b0c2b41a6b34ffdd0d1886df34 | 12,224 | # Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache License Version 2.0.
# This product includes software developed at Datadog (https:#www.datadoghq.com/).
# Copyright 2016-present Datadog, Inc.
# This software definition doesn"t build anything, it"s the place where we cre... | 53.379913 | 185 | 0.613956 |
872eef72227e46a7e58049c54c5efcbc7ab9598e | 2,691 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Post
include Msf::Post::File
include Msf::Post::Windows::Registry
def initialize(info = {})
super(
update_info(
info,
... | 26.126214 | 104 | 0.592345 |
d5896fa238ca06e4cc2805e8b8677ff8cad4b175 | 10,434 | # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... | 40.599222 | 245 | 0.693981 |
91a0f0b9251c866544d0d74567a5196d7228f20b | 560 | class FriendshipsController < ApplicationController
def create
friend = User.find(params[:friend])
current_user.friendships.build(friend_id: friend.id)
if current_user.save
flash[:notice] = 'Following friend'
else
flash[:alert] = 'There was something wrong with the tracking request'
en... | 26.666667 | 77 | 0.726786 |
ed8394ed314d6f8c86ffcd86487131a2a2f515e1 | 1,824 | require 'formula'
class IrcdHybrid < Formula
homepage 'http://www.ircd-hybrid.org/'
url 'http://downloads.sourceforge.net/project/ircd-hybrid/ircd-hybrid/ircd-hybrid-8.1.13/ircd-hybrid-8.1.13.tgz'
sha1 '5874cf6972333b4944cc218cd21918a2120e0304'
# ircd-hybrid needs the .la files
skip_clean :la
# system op... | 28.952381 | 114 | 0.601974 |
01cf60c08300d0595ae037785cb7be09f6df3b43 | 636 | require 'spec_helper'
describe "/admin/tags/new.html.haml" do
include Admin::TagsHelper
before(:each) do
power_user = stub_model(User, :has_role? => true)
allow(view).to receive(:current_visitor).and_return(power_user)
assign(:admin_tag, FactoryBot.build(:admin_tag,
:scope => "value for scope",
... | 27.652174 | 72 | 0.676101 |
e8a789ce414234e1e9d6c3aedc98a9477d019b60 | 123 | class AddTelegramToPerson < ActiveRecord::Migration[5.2]
def change
add_column :people, :telegram, :string
end
end
| 20.5 | 56 | 0.747967 |
abe563dddea164c8e6bb535faf675dc8b7d3203a | 76 | class Application < Rails::Application
config.upload_url = '/uploads'
end
| 19 | 38 | 0.763158 |
ed3066fb022c02f6a88e225ddab9d0446eb88868 | 3,157 | # frozen_string_literal: true
module Asciidoctor
module PDF
class IndexCatalog
include ::Asciidoctor::PDF::TextTransformer
LeadingAlphaRx = /^\p{Alpha}/
attr_accessor :start_page_number
def initialize
@categories = {}
@start_page_number = 1
@dests = {}
@... | 23.559701 | 126 | 0.592018 |
1ccb5566e67e8b37a7f99d44be64526ce931c0ca | 1,175 | class Dwarf < Formula
desc "Object file manipulation tool"
homepage "https://github.com/elboza/dwarf-ng/"
url "https://github.com/elboza/dwarf-ng/archive/dwarf-0.4.0.tar.gz"
sha256 "a64656f53ded5166041ae25cc4b1ad9ab5046a5c4d4c05b727447e73c0d83da0"
bottle do
sha256 "47af5ca1f6349c0d8c49f1ef72cbed7fbaa6e91... | 30.921053 | 93 | 0.69617 |
7ab04d4f225405ddb62703aabbdd0bf8a249e162 | 815 | module ZimbraRestApi
class ZimbraBase
include ZimbraRestApi::ZimbraObject
attr_accessor :zmobject
def initialize(zmobject)
@zmobject = zmobject
@zmobject.acls if zmobject.is_a?(ZimbraRestApi::Domain) # Force loading
instance_variables = get_instance_values(zmobject)
set_instance_... | 23.970588 | 77 | 0.684663 |
1d3377d8f163e5a7991cd5140a8b8cd7e9066d4d | 1,241 | # frozen_string_literal: true
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "bagit/version"
Gem::Specification.new do |spec|
spec.name = "bagit"
spec.version = BagIt::VERSION
spec.summary = "BagIt package generation and validation"
spec.description ... | 35.457143 | 72 | 0.730862 |
b98558ea55f9c62edb54d575d430b78d3e986f0f | 522 | class Ocd::Alert
def initialize(app, message)
@app = app
@message = message
@display_size_cache = Ocd::ValueCache.new
end
def add_char(char)
@app.pop_state # Just get out of this!
end
def update(app, s)
end
def draw(display)
@display_size_cache.update([display.width, display.height]... | 20.88 | 78 | 0.678161 |
6223e20f8b218c755cfb838f8bd3095d22c01e32 | 262 | cask 'noobproof' do
version '1.5'
sha256 '6e74a5aec8e9cf9102c160019990e90ae46486358959fa0d22517b4171f8209a'
url "http://www.hanynet.com/noobproof-#{version}.zip"
name 'NoobProof'
homepage 'http://www.hanynet.com/noobproof/'
app 'NoobProof.app'
end
| 23.818182 | 75 | 0.755725 |
ed0f2551983d183990be06d3d8b73f01c1f202cf | 488 | module Commandable
class << self
# Resets the class to default values clearing any commands
# and setting the colors back to their default values.
def reset_all
clear_commands
reset_colors
reset_screen_clearing
@app_info = nil
@app_exe = nil
@verbose_parame... | 20.333333 | 63 | 0.647541 |
62ea1dba1ccf06058536fced3e708d37ec14c430 | 13,197 | =begin
PureCloud Platform API
With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.
OpenAPI spec version: v2
Contact: DeveloperEvangelists@genesys.com
Generated by: https://github.com/swagger-ap... | 20.492236 | 256 | 0.52762 |
d5abb13b13839d58af37b357c5b772e4d8832825 | 20,922 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::RecoveryServicesSiteRecovery::Mgmt::V2016_08_10
module Models
#
# InMageAzureV2 provider specific settings
#
class InMageAzu... | 33.315287 | 86 | 0.486808 |
036f3dc12f1f806380b7e979a4f7d796d931d3d7 | 490 | class MixesController < ApplicationController
before_filter :find_mix, only: [:show]
def show
set_meta_tags open_graph: {
site_name: 'Mixture.fm - Mixes for the Masses',
title: @mix.title,
type: 'mix',
url: @mix.short_url,
image: 'http://mixture.fm/assets/fbicon.png'
}
render 'mixture/b... | 21.304348 | 64 | 0.693878 |
7952a5d2e03723d728bebadb6a77f417e932a308 | 826 | require 'test_helper'
class MicropostsControllerTest < ActionDispatch::IntegrationTest
def setup
@micropost = microposts(:orange)
end
test "should redirect create when not logged in" do
assert_no_difference 'Micropost.count' do
post microposts_path, params: { micropost: { content: "Lorem ipsum"... | 25.030303 | 77 | 0.734867 |
03a7efbba08ab6f4af0ebab81fb51f5ca08a651d | 1,126 | require 'test_helper'
class EventsControllerTest < ActionController::TestCase
setup do
@event = events(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:events)
end
test "should get new" do
get :new
assert_response :success
end
tes... | 22.52 | 119 | 0.692718 |
abd38536d4be32c0dc67deb0f8fdf0e228d99474 | 2,140 | # *****************************************************************************
# * Copyright (c) 2019 Matěj Outlý
# *****************************************************************************
# *
# * Common delivery service
# *
# * Author: Matěj Outlý
# * Date : 19. 4. 2017
# *
# ***********************************... | 33.968254 | 160 | 0.553271 |
e87c40bea358934a7525892faeae5759008de013 | 296 | class CreateEvents < ActiveRecord::Migration
def change
create_table :events do |t|
t.date :event_date
t.boolean :full_day
t.time :start_time
t.time :end_time
t.string :location
t.string :organizer
t.references :post, index: true
end
end
end
| 21.142857 | 44 | 0.64527 |
e27c645b46c147f678f1200aeb906363714ed639 | 557 | require 'active_support/test_case'
class ActiveSupport::TestCase
def new_user(attributes={})
User.new(valid_attributes(attributes))
end
def create_user(attributes={})
User.create!(valid_attributes(attributes))
end
def swap(object, new_values)
old_values = {}
new_values.each do |key, valu... | 18.566667 | 46 | 0.657092 |
01b4546e879b1bdfdd1a083c6ff69f66f990ae01 | 254 | class AddIndexesSpreeVariants < SpreeExtension::Migration[5.1]
disable_ddl_transaction!
def change
%i[gtin language parts_count material country].each do |field|
add_index :spree_variants, field, algorithm: :concurrently
end
end
end
| 25.4 | 66 | 0.759843 |
1cfea765d50d17a59b7843c4da2a6940f1a46d24 | 152 | class AddUserToDataImports < ActiveRecord::Migration[6.0]
def change
add_reference :data_imports, :user, null: false, foreign_key: true
end
end
| 25.333333 | 70 | 0.763158 |
f7b926acb522a01e259574f3c87babf953fc200f | 73,670 | require "spec_helper"
describe Mongoid::Relations::Embedded::Many do
[ :<<, :push ].each do |method|
describe "##{method}" do
context "when the parent is a new record" do
let(:person) do
Person.new
end
let(:address) do
Address.new
end
let!(:... | 21.847568 | 92 | 0.576897 |
084b9d27f4829316336dcce045091a39191d98b0 | 162 | class PostSerializer < ActiveModel::Serializer
attributes :id, :title, :content, :link, :media_type, :user, :likes, :likes_counted
has_many :comments
end | 32.4 | 87 | 0.734568 |
e8ba8a87bd38d359f33b7e5caa0bb71f141b1584 | 966 | require 'hashie'
require 'pathname'
module RooOnRails
class Config < Hashie::Mash
class << self
def load
path = Pathname '.roo_on_rails.yml'
path.exist? ? super(path) : new
end
def sidekiq_enabled?
enabled? 'SIDEKIQ_ENABLED'
end
def google_auth_enabled?
... | 21 | 65 | 0.63354 |
b95f357b77427ee0dd42679a6515de03e9e7e503 | 460 | module Spaceship
module Tunes
# Defines the different in-app purchase intro offer types
#
# As specified by Apple: https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnectInAppPurchase_Guide/Chapters/CreatingInAppPurchaseProducts.html
module IAPSubscription... | 35.384615 | 193 | 0.773913 |
b9be811fb340bce6f1c6629a106fc7226d492224 | 2,879 | module Fog
module AWS
class AutoScaling
class Real
require 'fog/aws/parsers/auto_scaling/basic'
# Creates a scheduled scaling action for a Auto Scaling group. If you
# leave a parameter unspecified, the corresponding value remains
# unchanged in the affected Auto Scaling gro... | 44.292308 | 117 | 0.595346 |
033421b8feaec6220d1236444d18639d9d90c24c | 185 | # frozen_string_literal: true
class Settings::ContactPublicSwitchPolicy < ApplicationPolicy
def create?
account &&
record.contact.contact_list.account == account
end
end
| 20.555556 | 61 | 0.762162 |
6244735f62ba4e5d92b473cf9243a2fbd60cc426 | 929 | module Rpc
class ProductResponseEnumerator
def initialize(products, created_products, delay = 0.5)
@products = products
@created_products = created_products
@delay = delay.to_f
end
def each_item
Rails.logger.info "got to ProductResponseEnumerator.each_item"
return enum_for(:... | 29.03125 | 74 | 0.627557 |
616894fb9ffa5ac96e495b9eccead98512bdd236 | 380 | # Add new columns to reflect the recent changes in the genetic data dictionary structure
class AddNewMolecularFields < ActiveRecord::Migration[5.0]
def change
add_column :molecular_data, :sourcetype, :text
add_column :molecular_data, :comments, :text
add_column :molecular_data, :datefirstnotified, :date
... | 38 | 88 | 0.773684 |
d5626efec91c3a2be81b9039607ccc14e399bc96 | 982 | cask "processing-beta" do
version "4.0b6,1281"
sha256 "36b20152dcc109e53731e73df48942aa777761c21304ba673db85999c390e720"
url "https://github.com/processing/processing4/releases/download/processing-#{version.csv.second}-#{version.csv.first}/processing-#{version.csv.first}-macos-x64.zip",
verified: "github.c... | 28.057143 | 168 | 0.677189 |
913a56a86e6d88755e9f0c798d60e04e8be992be | 586 | describe Quickbooks::Model::AccessTokenResponse do
it "can parse a successful response" do
xml = fixture("access_token_200.xml")
response = Quickbooks::Model::AccessTokenResponse.from_xml(xml)
expect(response.error?).to be false
expect(response.error_message).to eq ""
expect(response.token.length)... | 34.470588 | 67 | 0.730375 |
4adc26ff349bf7f6ac9f8c13bc934618fbb923f8 | 190 | class AddIsCustomerInviteToCompany < ActiveRecord::Migration[6.0]
def change
add_column :companies, :is_inviting_feature, :boolean, default: true, after: :line_channel_token
end
end
| 31.666667 | 100 | 0.789474 |
ff5e44dca9a9b9d082d4c0e5e7c13f1aa5c7c09e | 567 | Pod::Spec.new do |s|
s.name = "PDKeychainBindingsController"
s.version = "0.0.1"
s.summary = "PDKeychainBindingsController is intended to make using the Max OSX and iOS Keychains as easy as NSUserDefaults."
s.homepage = "https://github.com/carlbrown/PDKeychainBindingsController"
s.licens... | 47.25 | 132 | 0.684303 |
e230e4d59fc0175ef99cbb41667c62e1ae6e3c92 | 102 | module Factory
class SceneAutomatic < ApplicationRecord
include Model::SceneAutomatic
end
end
| 17 | 42 | 0.794118 |
6a25609e1a41f2bafdc1045f61cf9a842f308612 | 61 | class User < ActiveRecord::Base
belongs_to :user_level
end
| 15.25 | 31 | 0.786885 |
e9c77507edd4f945e026159074b584dd03fed295 | 6,724 | require_relative '../../../pegasus/src/env'
require_relative '../../../lib/state_abbr'
require 'cdo/solr'
require src_dir 'database'
SOLR = Solr::Server.new(host: CDO.solr_server)
def common_script_path(name)
File.join(File.dirname(__FILE__), name)
end
UNSUBSCRIBERS = {}.tap do |results|
DB[:contacts].where('uns... | 35.020833 | 357 | 0.700327 |
ff5a512456effaacf126a2f3ea0ddda4c5d86381 | 379 | require 'custom_benchmarks'
ActionController::Base.send :include, ActionController::CustomBenchmarking
# ADAPTERS
# MemCache Client
# Uncomment the require line below and add the following custom_benchmark
# declaration to application.rb to enabled the memcache-client adapter:
# custom_benchmark {|runtime| MemCache.c... | 34.454545 | 74 | 0.823219 |
2140aaa4fc00d3b472b43df8eb52c0ae6e139d74 | 906 | module InvoicesHelper
def invoice_link_header(current_user)
if params[:user_id]
link_to('Back to All Invoices', invoices_path) + tag(:br) +
link_to('Back to All Gigs', gigs_path) + tag(:br) +
link_to('Back to My Gigs', user_gigs_path(current_user)) + tag(:br) +
... | 36.24 | 81 | 0.586093 |
289086593ed2c7ad3e67d65ba6c53266d00f85d7 | 3,556 | require 'rails_helper'
feature 'Topic creator', js: true do
include UserSpecHelper
include MarkdownEditorHelper
# Setup a course with students and target for community.
let(:school) { create :school, :current }
let(:course) { create :course, school: school }
let(:level_1) { create :level, :one, course: co... | 32.623853 | 89 | 0.689539 |
eddc33fa6a13761b62af45aa0090c52312f16c0b | 2,243 | require 'sinatra'
require 'twilio-ruby'
get '/enter' do
Twilio::TwiML::VoiceResponse.new do |r|
r.say("
Welcome to the D.C. Office on Aging transportation hotline.
We will help you get a ride to where you need to go.
")
r.redirect('/age', method: 'get')
end.to_s
end
get '/age' do
Twilio:... | 27.024096 | 101 | 0.634418 |
e9cd1d6cdf9545822a32edc02ed166600d317b2b | 11,375 | require 'rails_helper'
if ExchangeTestingConfigurationHelper.individual_market_is_enabled?
RSpec.describe IvlNotices::EnrollmentNoticeBuilder, dbclean: :after_each do
let(:person) { FactoryGirl.create(:person, :with_consumer_role)}
let(:family) {FactoryGirl.create(:family, :with_primary_family_member, person: pers... | 51.704545 | 245 | 0.740132 |
f8aab3b2a7dd9f7a5c97a1baef622664cc19919a | 1,043 | class Libvterm < Formula
desc "C99 library which implements a VT220 or xterm terminal emulator."
homepage "http://www.leonerd.org.uk/code/libvterm/"
url "http://www.leonerd.org.uk/code/libvterm/libvterm-0+bzr681.tar.gz"
sha256 "abea46d1b0b831dec2af5d582319635cece63d260f8298d9ccce7c1c2e62a6e8"
bottle do
c... | 30.676471 | 92 | 0.72675 |
1df4b41cd33c90e888e30c4faf4da4dc63559128 | 2,023 | module Coursewareable
# Generic images uploader
class ImagesController < ApplicationController
# Abilities checking for our nested resource
load_and_authorize_resource :class => Coursewareable::Image
skip_authorize_resource :only => [:create, :index]
before_filter :load_classroom
# Images lis... | 26.973333 | 78 | 0.616411 |
391e41c29e08a8674e50a40c47812303ae3417b4 | 1,087 | class Like < ApplicationRecord
belongs_to :likable, polymorphic: true, counter_cache: true
belongs_to :account
after_create_commit :notify_users
before_destroy :delete_notifications
private
def delete_notifications
PersonalNotification.where(issuer_id: id, issuer_type: self.class.name).destroy_all
... | 38.821429 | 200 | 0.783809 |
b97d77baba1487a2b3a021963cca99e2f90f2dc3 | 1,605 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'ddtrace/version'
Gem::Specification.new do |spec|
spec.name = 'ddtrace'
spec.version = Datadog::VERSION::STRING
spec.required_ruby_version = ">= #{Datadog::V... | 37.325581 | 104 | 0.658567 |
b90b615159bc9b83fe66f625b9b0edf36f14c322 | 2,422 | def year_between(l, r)
->s { (l..r).cover?(Integer(s)) }
end
VALID_EYES = %w[amb blu brn gry grn hzl oth].map(&:freeze).freeze
VALID_PASSPORT = {
byr: year_between(1920, 2002),
iyr: year_between(2010, 2020),
eyr: year_between(2020, 2030),
hgt: ->hgt {
if hgt.end_with?('cm')
(150..193).cover?(Intege... | 25.765957 | 85 | 0.594963 |
62429b6aeae395cbdd7ea19978e0868b9cc22ff1 | 16,438 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.691964 | 159 | 0.584804 |
f837f4a534518322584e7774338726cb79ed51ef | 4,449 | # Copyright 2015, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 27.981132 | 78 | 0.675657 |
7a8b71ee4a1209d23abafd17e07fd73c6958abb6 | 1,322 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
Gem::Specification.new do |spec|
spec.name = 'aws-sdk-elasticbeans... | 40.060606 | 135 | 0.675492 |
1c4b08159371106aa4f9f06df6c8775c6a61a955 | 2,301 | #
# Author:: Adam Edwards (<adamed@chef.io>)
# Copyright:: Copyright (c) Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# htt... | 34.863636 | 159 | 0.744024 |
3912436dead859e32d86d19e1836a2abc82da61b | 156 | Styleguide::Engine.routes.draw do
root to: "pages#show"
get "example", to: "examples#show", as: :example
get "*path", to: "pages#show", as: :page
end
| 26 | 50 | 0.660256 |
5def1eaab6922795b2c3b30451156ec5370c1e11 | 851 | module MediacastProducer
module ASLClassLogging
def log_crit(msg)
ASLLogger.crit(self.class.to_s + ": " + msg)
end
def log_error(msg)
ASLLogger.error(self.class.to_s + ": " + msg)
end
def log_warn(msg)
ASLLogger.warn(self.class.to_s + ": " + msg)
end
def log_notice(msg... | 23 | 102 | 0.588719 |
abf08e878a895983df5bf280626b92ab4b2b4ce0 | 366 | class User < ActiveRecord::Base
has_and_belongs_to_many :stored_roles, -> { where('expire_at IS NULL OR expire_at > ?', Time.current) },
join_table: 'users_and_user_roles', foreign_key: 'user_id',
class_name: 'UserRole', association_foreign_key: 'user_role_id'
ha... | 36.6 | 106 | 0.669399 |
91a5d4a7d2266ca52e831bd20924f014eedd2e40 | 629 | describe User do
it 'only allows strong password' do
user = User.create(email: 'aurangzaib.danial@gmail.com', password: '123')
expect(user.persisted?).to eq(false)
end
it 'only allows unique email address' do
User.create(email: 'aurangzaib.danial@gmail.com', password: 'khan1234')
User.creat... | 29.952381 | 80 | 0.686804 |
2887cce8c14cff3bbc91b3cf82bd1960d3672257 | 840 | cask "leapp" do
arch = Hardware::CPU.intel? ? "" : "-arm64"
version "0.11.0"
if Hardware::CPU.intel?
sha256 "d8395dce82ee759ead020212d782abcd56ceaaa88d37ba875e3d13589c7203bf"
else
sha256 "51021c3b4e005122e4827d7c2faa4770fa3e7d6ce6b91840ecf3cd9fe93f2ece"
end
url "https://asset.noovolari.com/#{vers... | 25.454545 | 77 | 0.69881 |
3302b2bae3f77c300844e5b3ee386ce412a603e2 | 1,782 | # frozen_string_literal: true
module Gitlab
module Graphql
module Tracers
# This tracer writes logs for certain trace events.
# It reads duration metadata written by TimerTracer.
class LoggerTracer
def self.use(schema)
schema.tracer(self.new)
end
def trace(key... | 28.741935 | 103 | 0.607744 |
f7be2f294b09d5efdc3068bd0eb3ea5c0b4e379d | 378 | require 'latias/auditor'
module Latias
module Auditor
class Engine < ::Rails::Engine
isolate_namespace Latias::Auditor
# initializer "configuration" do
# puts "initialize configuration"
# # config.auditor = Latias::Auditor::Configuration.new
# puts
# end
ini... | 21 | 63 | 0.608466 |
b94092b75de120fa5d763ce6cdd530e03cefaae8 | 1,237 | # encoding: utf-8
class Nanoc::Helpers::BreadcrumbsTest < Nanoc::TestCase
include Nanoc::Helpers::Breadcrumbs
def test_breadcrumbs_trail_at_root
@items = Nanoc::ItemArray.new
@items << Nanoc::Item.new("root", {}, '/')
@item = @items.last
assert_equal [ @items[0] ], breadcrumbs_trail
end
def... | 28.113636 | 71 | 0.61924 |
bfb539328c473cc2ddbd7e4d25d428b670c227ac | 802 | # frozen_string_literal: true
require "rails_helper"
RSpec.describe SplitMentorMaterialPartForm, type: :model do
describe "validations" do
it { is_expected.to validate_presence_of(:title).with_message("Enter a title") }
it { is_expected.to validate_length_of(:title).is_at_most(255) }
it { is_expected.to... | 44.555556 | 90 | 0.763092 |
7a6dc51cdbc8e6ed497b063aa8872199d6d29b47 | 1,138 | name "memcached"
maintainer "Opscode, Inc."
maintainer_email "cookbooks@opscode.com"
license "Apache 2.0"
description "Installs memcached and provides a define to set up an instance of memcache via runit"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
vers... | 31.611111 | 104 | 0.685413 |
1d8562e3ababef34ade6149734eff56c02b0ffa9 | 608 | # encoding: utf-8
###
# to run use
# ruby -I ./lib -I ./test test/test_split.rb
require 'helper'
class TestSplit < MiniTest::Test
def test_eng
path = "#{CsvUtils.test_data_dir}/eng-england/2017-18/E0.csv"
columns = [ 'HomeTeam' ]
CsvUtils.split( path, *columns ) do |values, chunk|
pp value... | 19 | 68 | 0.621711 |
f88a357e52eea0a337df1b1016e31283f7f5e499 | 1,981 | require "hex_extensions/version"
module Hex
KILOBYTE = 1024
MEGABYTE = 1024 * KILOBYTE
GIGABYTE = 1024 * MEGABYTE
def assert(desc = nil, &block)
fail "assertion failed #{desc}\n #{Kernel.caller}" unless block.call
end
module_function :assert
def deep_copy(o)
Marshal.load(Marshal.dump(o))
end... | 25.397436 | 114 | 0.6421 |
39e2127882ff63021240f95d7f3a0020638f587f | 471 | class ShareController < ApplicationController
def share
begin
@day = Day.from_identifier(safe_params[:day])
@share_user = User.find(safe_params[:user_id])
@document = Document.for_user_shared(@share_user.id, @day.year, @day.month, @day.day).first
raise "Invalid document" unless @document
rescue => e
... | 24.789474 | 94 | 0.732484 |
39531e01795e061d0b635f7c2ef9805723a85efe | 6,746 | # frozen_string_literal: true
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 41.641975 | 98 | 0.610288 |
ed78121c35769a7918c451ed13bc768e05c6d9b7 | 2,371 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Report
include Msf::Exploit::Remote::Udp
include Msf::Auxiliary::UDPScanner
include Msf::... | 30.012658 | 94 | 0.599325 |
ab650979f52f23de129ea9e10e29473f5149f675 | 1,045 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'mock_beaneater/version'
Gem::Specification.new do |spec|
spec.name = "mock_beaneater"
spec.version = MockBeaneater::VERSION
spec.authors = ["Sean Xie"]
spec.email ... | 38.703704 | 74 | 0.658373 |
085ed65c9b0a14ba2d8ed8cc6ebd60be7e154e67 | 729 | Pod::Spec.new do |s|
s.name = 'AWSKinesisVideo'
s.version = '2.27.3'
s.summary = 'Amazon Web Services SDK for iOS.'
s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
s.homepage = '... | 40.5 | 157 | 0.620027 |
6acff9376aeb676f3e3c97232364ae0fc8333c0d | 3,824 | class Gtkx3 < Formula
desc "Toolkit for creating graphical user interfaces"
homepage "http://gtk.org/"
url "https://download.gnome.org/sources/gtk+/3.18/gtk+-3.18.7.tar.xz"
sha256 "a76e1cb0ac45ce5c2734f6778f2731a5c6a23d1ff6bd4db357774f014ee68820"
bottle do
sha256 "d938661ed85cca23feba465da1f8bedb16fdc096... | 30.110236 | 105 | 0.655335 |
1d84a1b12272c3c3c06bb9224e74a130b2ca07af | 61 | require 'git_guts'
require 'git_guts/map'
GitGuts::Map.start
| 15.25 | 22 | 0.786885 |
e97518998a706d1ebb20920a7e854c10529eb2d0 | 1,689 | # frozen_string_literal: true
module API
module V2
module CoinGecko
class HistoricalTrades < Grape::API
desc 'Get recent trades on market'
params do
requires :ticker_id,
type: String,
desc: 'A pair such as "LTC_BTC"',
coerce... | 38.386364 | 133 | 0.527531 |
1ab79fff0e69c00eac11c0304515a8a1a7db2614 | 5,063 | require 'spec_helper'
describe ":Epath" do
before :each do
# Stub out `rake routes` for `rails#app().routes()`
write_file 'routes.txt', <<~EOF
Prefix Verb URI Pattern Controller#Action
root GET / pages#index
login_page GET /pa... | 28.44382 | 92 | 0.672724 |
28f6ec7c29904b641722a7e5d64776030bdd0f71 | 8,544 | require 'pathname'
Puppet::Type.newtype(:dsc_spsite) do
require Pathname.new(__FILE__).dirname + '../../' + 'puppet/type/base_dsc'
require Pathname.new(__FILE__).dirname + '../../puppet_x/puppetlabs/dsc_type_helpers'
@doc = %q{
The DSC SPSite resource type.
Automatically generated from
'SharePointD... | 29.666667 | 130 | 0.650047 |
01cc967de9ff051c2335bd82edd8f2cc8f5242d9 | 1,305 | class Ncl < Formula
desc "A C++ library for parsing NEXUS files"
homepage "http://ncl.sourceforge.net/"
# doi "10.1093/bioinformatics/btg319"
# tag "bioinformatics"
url "https://downloads.sourceforge.net/project/ncl/NCL/ncl-2.1.18/ncl-2.1.18.tar.gz"
sha256 "6e792ede614f6969a0cd342fea1505b4ea3e3e4c0f50a1c0c1... | 35.27027 | 95 | 0.731034 |
ff473ed4ec096420a2f5272ac8531e5b0d746445 | 265 | class JSONAPIonify::Structure::Helpers::MetaDelegate
attr_reader :object
def initialize(object)
@object = object
end
def []=(k, v)
object[:meta] ||= {}
object[:meta][k] = v
end
def [](k)
object[:meta] && object[:meta][k]
end
end
| 15.588235 | 52 | 0.592453 |
1d0c93789ef5720a069391b9f59ec264121ec14d | 10,081 | require_relative '../helper/fueled_helper'
class String
def underscore
self.gsub(/::/, '/').
gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
gsub(/([a-z\d])([A-Z])/, '\1_\2').
tr("-", "_").
downcase
end
def to_titlecase
return self.underscore.split(/[ _]/).map(&:capitalize).join(' ')
en... | 36.003571 | 164 | 0.552326 |
03f77fb6d78a542616c84f71373b7648b85f0a8d | 6,157 | require 'rails_helper'
RSpec.describe 'Notifier::Builders::ConsumerRole', :dbclean => :after_each do
describe "A new model instance" do
let(:payload) {
file = Rails.root.join("spec", "test_data", "notices", "proj_elig_report_aqhp_2019_test_data.csv")
csv = CSV.open(file, "r", :headers => true)
... | 34.589888 | 156 | 0.631314 |
f882d29a0691ee8d9b9b00213f94b40be45b3fc2 | 84 | class VendorsFruit < ApplicationRecord
belongs_to :vendor
belongs_to :fruit
end
| 16.8 | 38 | 0.809524 |
03eab376d9888b5875b4495a6cb97ff6ba08173c | 9,853 | # frozen_string_literal: true
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 38.791339 | 200 | 0.7211 |
4a234cc947131f6fc151bdebab6dda7b0966808f | 3,591 | # This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause this
# file to always be loaded, without a need to explicitly require it in any files.... | 41.755814 | 85 | 0.741855 |
61a3bca9bf557282b22d24e08d29319156267556 | 202 | class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :user_name
t.string :email
t.string :password_digest
end
end
end
| 20.2 | 43 | 0.618812 |
012e56e4c89d4ad10171391959accbc5ec3d0b8b | 3,095 | require 'rack/utils'
module CRUDtree
class Generator
def initialize(master)
@master = master
@model_to_node = {}
@master.nodes.each {|node| add_node_models(node) }
end
def generate(resource, *names)
if resource.is_a? Symbol
names.unshift(resource)
node = @master
... | 31.907216 | 127 | 0.614863 |
0352fda31fee20cacd6f4f1dd22f1765a900cd70 | 214 | require 'simplecov'
SimpleCov.start do
add_filter "/spec/"
merge_timeout 3600
end
$:.unshift(File.expand_path('../lib', __FILE__))
require 'gearman'
RSpec.configure do |config|
config.mock_with :rspec
end
| 15.285714 | 48 | 0.738318 |
795f270a1446b52c1f3e05198bf0ff292245ec07 | 1,618 | require 'facter'
cpu_details = {
'vulnerabilities' => {},
'scaling_governor' => false,
'scaling_driver' => false,
'cpus' => {}
}
Facter.add(:cpu_details) do
confine :kernel => 'Linux'
confine do
File.directory?('/sys/devices/system/cpu/vulnerabilities')
end
setcode do
Dir.foreach('/sys/devices/... | 33.708333 | 97 | 0.682324 |
280712e45562254186dc71a9f06de87a77448a81 | 164 | # frozen_string_literal: true
module AAMVA
class Utils
def self.truncate(value, options = {})
value[0...options.fetch('length', -1)]
end
end
end
| 16.4 | 44 | 0.652439 |
ac8924da8f11cabf6d54801cf6fabc20d3cc93a3 | 759 | class PendingFeedbackController < ApplicationController
skip_before_filter :logged_in?
def form
@engagement = Engagement.find(params[:engagement_id])
@iteration = Iteration.find(params[:iteration_id])
@customer = @engagement.client.name
end
def process_response
feedback = params.permit(:duration, :demeano... | 34.5 | 118 | 0.777339 |
f7864e098db7506093ba843b4dfaff6052b8299f | 1,503 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
require 'aws-sdk-core'
require 'aws-sigv4'
require_relative 'aws-sdk-transcr... | 27.833333 | 93 | 0.765136 |
28f9fd066945bd5ce101ba70ab2f1ff9f63041ee | 1,291 | require "test_helper"
class GraphQL::SchemaComparator::Diff::DirectiveTest < Minitest::Test
def setup
@old_directive = GraphQL::Directive.define do
name "Default"
argument :a, types.Int, default_value: "No", description: "A Description"
argument :b, types.String
locations [:QUERY, :MUTATI... | 37.970588 | 114 | 0.683966 |
7a75b3e612156acb23a2d3efc7e16c757f0c03b7 | 1,158 | require_relative 'boot'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "action_cable/engine"
# require "sprockets/railti... | 34.058824 | 82 | 0.773748 |
e8cb364e23c806a38c83e146c15cbdb297de31bf | 1,959 | # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = %q{ruby-debug-base19}
s.version = "0.11.26"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Kent Sibilev", "Mark Moseley"]
s.date = %q{2009-09-08}
s.description = %... | 32.114754 | 106 | 0.653395 |
18256a1d2d366d838abe552218ea05fb13992f22 | 669 | cask 'chatty' do
version '0.9.7'
sha256 '3fcf4c6642f3f167f79818e8f9afbe1a927945d5e965fb29163ef371be1dbdd1'
# github.com/chatty/chatty was verified as official when first introduced to the cask
url "https://github.com/chatty/chatty/releases/download/v#{version}/Chatty_#{version}.zip"
appcast 'https://github.c... | 27.875 | 92 | 0.729447 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.