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 |
|---|---|---|---|---|---|
618d168dab56db2b8c56c2e022a7751b5906e20a | 313 | require 'coderay'
# scan this file
tokens = CodeRay.scan(File.read($0) * 1, :ruby)
# output it with two styles of line numbers
out = tokens.div(:line_numbers => :table)
out << '<hr />'
out << tokens.div(:line_numbers => :inline, :line_number_start => 8)
puts out.page(:title => 'CodeRay HTML Encoder Example')
| 26.083333 | 68 | 0.683706 |
ffb6e33ea93768d4c8c43acad231f7e570052cb7 | 1,083 | # 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.1 | 86 | 0.749769 |
f7768c7488680c8a64de391be5eb3774d0aa9881 | 3,917 | module SmartAnswer
class HelpIfYouAreArrestedAbroadFlow < Flow
def define
start_page_content_id "cb62c931-a0fa-4363-b33d-12ac06d6232a"
flow_content_id "d5074786-f3cc-410e-bc3d-d52008f0a692"
name 'help-if-you-are-arrested-abroad'
status :published
satisfies_need "100220"
arrest... | 34.973214 | 291 | 0.663773 |
e832617d52b793699849cdb7bea986992fbc3b75 | 326 | ActiveRecord::Schema.define do
self.verbose = false
create_table :tests, force: true do |t|
t.string :name
t.integer :alter
t.string :ort
t.timestamps
end
create_table :users, force: true do |t|
t.string :key
t.string :name
t.integer :age
t.datetime :dob
t.timestamps
en... | 15.52381 | 41 | 0.641104 |
5ddd3d0e31282359e9ce01198fea74cf12eff833 | 1,045 | require "pathname"
# This is a bit complex but can't be avoided since otherwise we have to log 5000000 backtrace lines
module ActiveRecord
module SqlAnalyzer
class BacktraceFilter
def self.library_paths
@library_paths ||= begin
paths = Gem.path + Gem.path.select {|f| File.exists?(f) }.map... | 26.794872 | 99 | 0.551196 |
bfd5e468d9eab16166363e17e7302ea048aa0411 | 2,611 | require 'spec_helper'
describe UcbRails::Configuration::Email do
# let(:test_config_file) { UcbRails::Engine.root.join('spec/fixtures/config.yml')}
let(:klass) { UcbRails::Configuration::Email }
let(:amb) { ActionMailer::Base }
after(:all) do
ActionMailer::Base.delivery_method = :test
end
describ... | 26.917526 | 84 | 0.617005 |
391d40024dba72b935b5a1b753e3f34f05a8ca14 | 730 | cask 'localdev' do
version '0.5.4'
sha256 '963048baf4b119d4940cf0e939e505d6792111451b9df3cd9dabad4c20776d15'
# pantheon-localdev.s3.amazonaws.com was verified as official when first introduced to the cask
url "https://pantheon-localdev.s3.amazonaws.com/Localdev-v#{version}.dmg"
name 'Localdev'
homepage 'ht... | 31.73913 | 97 | 0.619178 |
d5460a2efd96b98629ac0968f35848b74aaf3268 | 3,473 | class Polls::QuestionnairePdf < Prawn::Document
include Polls::PdfHeaders
include Polls::PdfScores
include Polls::PdfColumns
attr_accessor :relative_path
def initialize report, current_organization
@report = report
@current_organization = current_organization
@pdf = Prawn::Document.create_generi... | 25.166667 | 113 | 0.668298 |
7a82cb2ebc3b9f914eebf21669858f8bb1a84197 | 632 | # frozen_string_literal: true
FactoryBot.define do
factory :end_product_update do
user { create(:user) }
original_decision_review { create(:higher_level_review) }
transient do
number_of_request_issues { 2 }
end
after(:build) do |epu, evaluator|
issue_type = Constants.EP_CLAIM_TYPES.... | 26.333333 | 94 | 0.710443 |
6a44c13ab0c5cb91bcc0ef7f372456e51ae71412 | 13,455 | #
# Cookbook Name:: cookbook-openshift3
# Recipe:: master_cluster
#
# Copyright (c) 2015 The Authors, All Rights Reserved.
require 'chef/log'
Chef::Log.level = :debug
master_servers = node['cookbook-openshift3']['use_params_roles'] && !Chef::Config[:solo] ? search(:node, %(role:"#{node['cookbook-openshift3']['master_... | 51.551724 | 472 | 0.731624 |
91371c83861f4bddc7ef1e7770bedb65ffad0617 | 3,872 | require 'rails_helper'
RSpec.feature 'Editing a school’s Chromebook details from the support area' do
let(:school_details_page) { PageObjects::Support::SchoolDetailsPage.new }
before do
allow(Gsuite).to receive(:is_gsuite_domain?).and_return(true)
given_i_sign_in_as_a_support_user_with_access_to_the_compu... | 36.528302 | 120 | 0.810434 |
3896148eb8f93ef4bd891772e220271156218c93 | 1,789 | class Caf < Formula
# Renamed from libccpa
desc "Implementation of the Actor Model for C++"
homepage "https://www.actor-framework.org/"
url "https://github.com/actor-framework/actor-framework/archive/0.18.5.tar.gz"
sha256 "4c96f896f000218bb65890b4d7175451834add73750d5f33b0c7fe82b7d5a679"
license "BSD-3-Clau... | 34.403846 | 122 | 0.666853 |
e2a3f0e05b8fd7f2aaf192c24c41a86b4f9ea577 | 3,241 | class DonationsController < ApplicationController
before_filter :redirect_to_ssl, :only => :index
before_filter :force_cache, :only => :index
before_filter :force_no_cache, :only => :complete
ERROR_MESSAGES = {
"0" => "Transaction approved",
"1" => "Transaction could not be processed",
"E" => "Tr... | 33.412371 | 92 | 0.716446 |
38cb38563b7a39b422f1bd2cfdae2d3a03e7f854 | 57,860 | # frozen_string_literal: false
#
# = drb/drb.rb
#
# Distributed Ruby: _dRuby_ version 2.0.4
#
# Copyright (c) 1999-2003 Masatoshi SEKI. You can redistribute it and/or
# modify it under the same terms as Ruby.
#
# Author:: Masatoshi SEKI
#
# Documentation:: William Webber (william@williamwebber.com)
#
# == Overview
#
#... | 30.891618 | 95 | 0.648946 |
4a2a45430b76856456c407b2500392299b0936ea | 748 | #
# Copyright 2021 ThoughtWorks, 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 ... | 35.619048 | 106 | 0.766043 |
d556c85f9ee945ed6fec0c54ef4fdebe686ea0f9 | 4,837 | require_relative "xcodebuild_raw"
class XcodebuildCommand # rubocop:disable Metrics/ClassLength
def initialize(options)
@options = options
case options[:target].platform.name
when :ios
@options[:device] = "iphoneos"
@options[:simulator] = "iphonesimulator"
when :tvos
@options[:devic... | 27.327684 | 102 | 0.689684 |
381563b04af3d71d9784ab9c56ccd1e51892e1f3 | 795 | module CommonApp
module Invite
module Assign
class Teacher
attr_reader :applicant_id, :recommender_id, :member_id
def initialize(applicant_id, recommender_id, member_id)
@applicant_id = applicant_id
@recommender_id = recommender_id
@member_id = member_id
... | 18.928571 | 63 | 0.543396 |
180bd3911d487463b0949d6adde0cc40906b471c | 214 | # frozen_string_literal: true
class CreateBenchmarkDefinitions < ActiveRecord::Migration[5.0]
def change
create_table :benchmark_definitions do |t|
t.string :name
t.timestamps
end
end
end
| 17.833333 | 63 | 0.724299 |
790f46c2fff3b67fa86ff240389173c8d2659be3 | 1,313 |
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "activerecord-normalizations/version"
Gem::Specification.new do |spec|
spec.name = "activerecord-normalizations"
spec.version = ActiveRecord::Normalizations::VERSION
spec.authors = ["c... | 41.03125 | 87 | 0.667936 |
87b5ab46aa25ddb838428ba9af2f335a0acf522a | 4,326 | module Alchemy
module Admin
class ElementsController < Alchemy::Admin::BaseController
cache_sweeper Alchemy::ContentSweeper, :only => [:create, :update, :destroy]
def index
@page = Page.find(params[:page_id], :include => {:elements => :contents})
@cells = @page.cells
if @cell... | 34.333333 | 125 | 0.624133 |
62a7221c70263d7617d844bb041058371e7ce920 | 1,531 | module SessionsHelper
# Logs in the given user.
def log_in(user)
session[:user_id] = user.id
end
# Remembers a user in a persistent session.
def remember(user)
user.remember
cookies.permanent.signed[:user_id] = user.id
cookies.permanent[:remember_token] = user.remember_token
end
# Retur... | 24.301587 | 73 | 0.693664 |
21df7084b1a0095df3cebfc702c01004b6b6d336 | 2,206 | class Znc < Formula
desc "Advanced IRC bouncer"
homepage "https://wiki.znc.in/ZNC"
url "https://znc.in/releases/archive/znc-1.7.1.tar.gz"
sha256 "44cfea7158ea05dc2547c7c6bc22371e66c869def90351de0ab90a9c200d39c4"
revision 2
bottle do
sha256 "4ebcf80b5a6c2224597d16f4b3500645df250946a0ae989a1b7e28eebd1503... | 30.219178 | 106 | 0.652312 |
9179d0f5b023f0b934ae865d82404b032cf01479 | 1,226 | module Fog
module VcloudDirector
class Compute
class Real
extend Fog::Deprecation
deprecate :post_task_cancel, :post_cancel_task
# Cancel a task.
#
# @param [String] id Object identifier of the task.
# @return [Excon::Response]
#
# @see http:/... | 27.863636 | 125 | 0.548124 |
b9c1f50c7c89c66fe02599aa234f01bf98b7fed5 | 13,724 | module SimpleForm
module Components
module Errors
# def has_errors?
# has_custom_error? || (object && object.respond_to?(:errors) && errors.present?)
# end
#
# def errors
# @errors ||= has_custom_error? ? [options[:error]] : (errors_on_attribute + errors_on_association).com... | 37.395095 | 115 | 0.67524 |
011592c601af5a3e6faf08c04f5497351b1b415b | 2,425 | # frozen_string_literal: true
# == Schema Information
#
# Table name: work_images
#
# id :integer not null, primary key
# work_id :integer not null
# user_id :integer not null
# attachment_file_name :string not null
# atta... | 29.938272 | 122 | 0.644124 |
03de137788b98168c208876ff123128cb38bdcb8 | 1,903 | # frozen_string_literal: false
require 'test/unit'
require 'uri'
class URI::TestParser < Test::Unit::TestCase
def uri_to_ary(uri)
uri.class.component.collect {|c| uri.send(c)}
end
def test_inspect
assert_match(/URI::RFC2396_Parser/, URI::Parser.new.inspect)
assert_match(/URI::RFC3986_Parser/, URI::R... | 28.402985 | 120 | 0.631109 |
875c3613c0178886293e5287ab2653a6cc94a46e | 3,680 | require 'my_tasks/param_validator'
module MyTasks
class Merged < UserSpecificModel
include MyTasks::ParamValidator
include Cache::LiveUpdatesEnabled
attr_reader :enabled_sources
def initialize(uid, options={})
super(uid, options)
#To avoid issues with tz, use DateTime instead of Date (h... | 33.761468 | 131 | 0.63913 |
f7b278071d5d08675c248aad2cc099c88b3e2897 | 1,353 | def image name, &block
@namespace = namespace name do |namespace|
require_relative '../rake/docker'
@name = name
@override[:all] and @override[:all].each do |override_key, override_value|
instance_variable_set "@#{override_key}", override_value
end
@override[@name] and @override[@name].... | 27.06 | 80 | 0.654102 |
0134469aeeda34fcc98dd538b8e7f2aa0eee7c11 | 685 | class MSpecScript
# Language features specs
set :language, [ 'language' ]
# Core library specs
set :core, [
'core',
# 1.9
'^core/basicobject'
]
# Standard library specs
set :library, [
'library',
# 1.9 feature
'^library/cmath',
'^library/continuation',
'^library/coverag... | 19.027778 | 62 | 0.611679 |
ed184309ab49e2704348ba39b8ebf9f8ec1f2542 | 1,018 | # frozen_string_literal: true
module Gitlab
module Ci
module Pipeline
module Expression
class Parser
def initialize(tokens)
@tokens = tokens.to_enum
@nodes = []
end
##
# This produces a reverse descent parse tree.
#
... | 23.674419 | 66 | 0.472495 |
e9cae0fdd27815f5481b6cfacd9c30af1eca56bc | 1,922 | require 'zip'
class PagesController < ApplicationController
def index
@generated_count = REDIS[:generated_count]
end
def download
package = generate_package(
url: params[:url],
name: params[:name],
description: params[:description],
key: SecureRandom.hex(16... | 22.348837 | 72 | 0.629553 |
2851d69a48a1416277ce52880bef32a7090b0f36 | 242 | require 'pjax'
module PjaxRails
class Engine < ::Rails::Engine
initializer 'pjax_rails.add_controller' do
ActiveSupport.on_load :action_controller do
ActionController::Base.send :include, Pjax
end
end
end
end
| 20.166667 | 50 | 0.706612 |
7914026d82fe7fba077fd47d65889b038b83efe2 | 7,531 | # frozen_string_literal: true
require "rails"
require "active_job"
require "active_job/queue_adapters"
require "zeitwerk"
Zeitwerk::Loader.for_gem.tap do |loader|
loader.inflector.inflect({
"cli" => "CLI",
})
loader.ignore(File.join(File.dirname(__FILE__), "g... | 47.664557 | 171 | 0.728721 |
bb06f7ed53769e5a33a139825371ddbb846097b1 | 9,754 | module StandardAPI
module Controller
delegate :preloadables, to: :helpers
def self.included(klass)
klass.helper_method :includes, :orders, :model, :models, :resource_limit,
:default_limit
klass.before_action :set_standardapi_headers
klass.rescue_from StandardAPI::ParameterMissing, ... | 27.710227 | 112 | 0.617388 |
874907a77eb021d6850a1a4f7f3491a9349f3399 | 5,104 | #
# Be sure to run `pod spec lint MyPods.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
# To see working Podspecs in the CocoaPods repo see https://github.com/... | 36.719424 | 93 | 0.591889 |
38aa59ca06b310c249ede7aafcbc5560e9233a14 | 413 | ###
# This is the place to override the apache2 cookbook's default attributes.
#
# Do not edit THIS file directly. Instead, create
# "apache2/attributes/customize.rb" in your cookbook repository and
# put the overrides in YOUR customize.rb file.
###
# The following shows how to override the Apache contact and timeout ... | 31.769231 | 78 | 0.743341 |
e2f16d27cac27a27e34f98a6f2a1a819f262fee5 | 124 | require 'test_helper'
class MoveEffectTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 15.5 | 46 | 0.709677 |
4aea5fce5afe79e530d8619792bfdae22703cbbf | 3,448 | module Eneroth::MaterialAreaCounter
DEFAULT_MATERIAL_NAME = "Default Material"
# Find an arbitrary unit vector that is not parallel to given vector.
#
# @param [Geom::Vector3d]
# @return [Geom::Vector3d]
def self.arbitrary_non_parallel_vector(vector)
vector.parallel?(Z_AXIS) ? X_AXIS : Z_AXIS
end
... | 29.220339 | 108 | 0.688515 |
5dc3e794546843bf8d0468ed22cddb3a6dde2415 | 463 | require 'test_helper'
class SessionsHelperTest < ActionView::TestCase
def setup
@user = users(:me)
remember(@user)
end
test "current_user returns right user when session is nil" do
assert_equal @user, current_user
assert is_logged_in?
end
test "current_user returns nil when r... | 24.368421 | 74 | 0.714903 |
610f524b5e6faa34d8146fc4c72e747008bb1aba | 163 | require "spec_helper"
describe Mavenlink::InsightsAccessGroup, stub_requests: true, type: :model do
it_should_behave_like "model", "insights_access_groups"
end
| 27.166667 | 77 | 0.815951 |
03c4f14b04b3ff9e1840662eedd73c425e261115 | 115 | class AddLinksToWorks < ActiveRecord::Migration[5.2]
def change
add_column :works, :links, :string
end
end
| 19.166667 | 52 | 0.730435 |
e9edeab430a68410553e2f92be15dbe5129b3dcf | 229 | class Api::ContentsController < ApplicationController
def index
@contents = Contents::QueryService.get_contents(search_params)
end
private
def search_params
params.require(:q).permit(:city, :category)
end
end
| 19.083333 | 66 | 0.751092 |
26977919af6e090c94ec4ed6e97ec069abb41a39 | 298 | # -*- encoding : utf-8 -*-
class QuestionMigration < ActiveRecord::Migration
def self.up
create_table :questions do |t|
t.string :questions
t.string :answer
t.integer :level_id
t.timestamps null: false
end
end
def self.down
drop_table :questions
end
end
| 18.625 | 49 | 0.654362 |
79f764d6ac2bd5836accc88c504ff27355929cd4 | 1,527 | # -*- encoding: utf-8 -*-
# stub: builder 3.2.4 ruby lib
Gem::Specification.new do |s|
s.name = "builder".freeze
s.version = "3.2.4"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Jim Weirich".free... | 63.625 | 278 | 0.713818 |
1c52d4c72d89a7ce4da56a4a0186cc194dfb4002 | 3,141 | module SharedNote
include Spinach::DSL
Given 'I delete a comment' do
find('.note').hover
find(".js-note-delete").click
end
Given 'I haven\'t written any comment text' do
within(".js-main-target-form") do
fill_in "note[note]", with: ""
end
end
Given 'I leave a comment like "XML attac... | 25.536585 | 78 | 0.647883 |
796cd8d805eab7f1c5980471ce7ff387f2620753 | 743 | ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/reporters'
Minitest::Reporters.use!
class ActiveSupport::TestCase
fixtures :all
include ApplicationHelper
# テストユーザーがログイン中の場合にtrueを返す
def is_logged_in?
!session[:user_id].n... | 23.967742 | 70 | 0.652759 |
18d4a47b69a707c997b410c2995a285ee6b43903 | 10,911 | # frozen_string_literal: true
require "dependabot/clients/github_with_retries"
require "dependabot/clients/gitlab_with_retries"
require "dependabot/clients/bitbucket_with_retries"
require "dependabot/shared_helpers"
require "dependabot/git_metadata_fetcher"
require "dependabot/git_commit_checker"
require "dependabot/m... | 32.667665 | 80 | 0.575749 |
e8e7850cbeb6b81552d2d4b155cd02647bc2da1d | 1,091 | module EvmClient
class Function
attr_accessor :name, :inputs, :outputs, :signature, :minified_signature, :constant, :function_string
def initialize(data)
@name = data["name"]
@constant = data["constant"]
@inputs = data["inputs"].map do |input|
EvmClient::FunctionInput.new(in... | 26.609756 | 104 | 0.59945 |
5de64e8c473f173b064b04e4e287d64760cf404c | 44 | module SaganCrafter
VERSION = "0.4.1"
end
| 11 | 19 | 0.704545 |
ed3b6d3d11350bb151312c79b84c7ac974e4a7ee | 194 | require 'provisioner/version'
require 'provisioner/configurable'
require 'provisioner/loggable'
require 'provisioner/commands/up'
module Provisioner
extend Configurable
extend Loggable
end
| 19.4 | 34 | 0.829897 |
edc82ae891c6eb806e11f566c1c2a03337667994 | 904 | #
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'google_sign_in'
s.version = '0.0.1'
s.summary = 'Google Sign-In plugin for Flutter'
s.description = <<-DESC
Enables Google Sign-In in Flutter apps.
... | 36.16 | 95 | 0.595133 |
e9a93c607fc6907d9f1d2c8174fb849999816c03 | 5,134 | #
# Copyright:: Copyright (c) 2014 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
#
# http://www.apache.org/licenses/LICENSE-2.... | 30.742515 | 122 | 0.664199 |
28453582faea1b2fded9b842d17d38c3bda55487 | 40 | module PayrollOvertimeMastersHelper
end
| 13.333333 | 35 | 0.925 |
e856e783bfe43bb561e102b633e6ff57b2e43d78 | 1,442 | class Jetty < Formula
desc "Java servlet engine and webserver"
homepage "https://www.eclipse.org/jetty/"
url "https://search.maven.org/remotecontent?filepath=org/eclipse/jetty/jetty-distribution/9.4.34.v20201102/jetty-distribution-9.4.34.v20201102.tar.gz"
version "9.4.34.v20201102"
sha256 "aa82f1a2ff4ed700a19... | 29.428571 | 152 | 0.643551 |
4abb579b718b628a402c244a1ab64e4822701971 | 1,143 | module Ricer::Plugin::Channel
class Join < Ricer::Plug::Trigger
needs_permission :halfop
has_setting :auto, type: :boolean, scope: :channel, permission: :halfop, default: true
has_setting :onkick, type: :boolean, scope: :channel, permission: :operator, default: false
def set_autojoi... | 27.878049 | 95 | 0.669291 |
9171cea0c497dd11a18d4941f31f6371fff8e146 | 24,401 | # 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,... | 40.265677 | 121 | 0.623499 |
610e0aff7514d2ad9839b468fa37bcb63599055c | 1,050 | #
# Licensed Materials - Property of IBM
#
# (c) Copyright IBM Corp. 2007,2008,2009
#
class TestIbmDb < Test::Unit::TestCase
def test_6528_ScopingProblemBindParam
assert_expect do
def checked_db2_execute(stmt)
IBM_DB::execute stmt
row = IBM_DB::fetch_array stmt
row.each { |child... | 21.875 | 78 | 0.627619 |
b96f96fd8e3d0f760880f049af18961040d08608 | 84 | # frozen_string_literal: true
FactoryBot.define do
factory :votable do
end
end
| 12 | 29 | 0.77381 |
f76fead7462d2b5ffa61a8b8efdf076a2cce8a9b | 1,532 | =begin
#Alfresco Content Services REST API
#**Core API** Provides access to the core features of Alfresco Content Services.
OpenAPI spec version: 1
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in c... | 28.37037 | 103 | 0.763055 |
1de69d3419975a9a403764cedb42950135e53488 | 273 | class BaseController < ApplicationController
before_action :authenticate_http
def authenticate_http
user = 'admin'
pass = 'admin'
authenticate_or_request_with_http_basic do |username, password|
username == user && password == pass
end
end
end | 24.818182 | 67 | 0.725275 |
b93f927dbbdd35415014f9d2a5dfb9b95461ea35 | 12,113 | # == Schema Information
#
# Table name: transactions
#
# id :integer not null, primary key
# starter_id :string(255) not null
# starter_uuid :binary(16) not null
# listing_id :integer not n... | 36.158209 | 164 | 0.682242 |
26071973ac3a48422962f206cc6bffc034e6e8c8 | 134 | module HtmlComposite
class ColgroupTag < Tag
def to_s
"<colgroup#{attributes_list}>#{super}</colgroup>"
end
end
end
| 16.75 | 55 | 0.671642 |
1888543a130d89c30ba0444d04cb1864921f728c | 123 | class Round < ApplicationRecord
belongs_to :game
belongs_to :prompt
has_many :answers, :dependent => :delete_all
end
| 20.5 | 46 | 0.764228 |
e299d45f8392b2783c9620232cc6599a793bb3d4 | 1,592 | Pod::Spec.new do |s|
s.name = "iDroidLayout2"
s.version = "0.2.1"
s.summary = "iDroid-Layout2 is a port of Androids layout system and its drawable and resources framework to iOS."
s.description = <<-DESC
The main reason for this project is to learn more about the Android layout system a... | 58.962963 | 411 | 0.692211 |
bf37910f2fd40a1fa2b3787a119d83dd04e87bdf | 1,511 | class Flavor < ApplicationRecord
include NewWithTypeStiMixin
include CloudTenancyMixin
acts_as_miq_taggable
belongs_to :ext_management_system, :foreign_key => :ems_id, :class_name => "ManageIQ::Providers::CloudManager"
has_many :vms
has_many :cloud_tenant_flavors, :dependent => :destroy
has_many :... | 35.97619 | 114 | 0.610192 |
e2ea66415fba4f2b122b479bb558f1c9621c3797 | 1,164 | # frozen_string_literal: true
require "rails/generators/erb"
module Erb # :nodoc:
module Generators # :nodoc:
class MailerGenerator < Base # :nodoc:
argument :actions, type: :array, default: [], banner: "method method"
def copy_view_files
view_base_path = File.join("app/views", class_path, ... | 27.069767 | 112 | 0.613402 |
ab9aa68b29927242f314f9ef8c341a8b917afdbb | 957 | # frozen_string_literal: true
Gem::Specification.new do |spec|
spec.name = "jekyll-bootstrap-4"
spec.version = "0.1.0"
spec.authors = ["Ivan Reyes"]
spec.email = ["ivanreyesconde@gmail.com"]
spec.summary = "Simple Bootstrap theme integrated with Jekyll"
spec.homepage ... | 39.875 | 132 | 0.653083 |
bb7ed3b604c0a6528138187594111da8f247daf5 | 1,837 | class Gource < Formula
desc "Version Control Visualization Tool"
homepage "https://github.com/acaudwell/Gource"
url "https://github.com/acaudwell/Gource/releases/download/gource-0.51/gource-0.51.tar.gz"
sha256 "19a3f888b1825aa7ed46f52cebce5012e3c62439e3d281102f21814c7a58e79a"
license "GPL-3.0"
revision 1
... | 32.22807 | 92 | 0.701143 |
28d7f4f49f77388cce7c1c4856c529d92df92dd1 | 342 | require File.dirname(__FILE__) + '/../spec_helper'
describe Admin::DashboardHelper do
#Delete this example and add some real ones or delete this file
it "should include the Admin::DashboardHelper" do
included_modules = self.metaclass.send :included_modules
included_modules.should include(Admin::Dashboar... | 28.5 | 65 | 0.766082 |
1c16adee714179ec5e98390c3ebbead9eb7d5d88 | 1,737 | require 'spec_helper'
describe 'knot' do
context 'supported operating systems' do
['Debian', 'RedHat'].each do |osfamily|
describe "knot class without any parameters on #{osfamily}" do
let(:params) {{ }}
let(:facts) {{
:osfamily => osfamily,
:lsbdistid => 'Debian',
... | 32.166667 | 102 | 0.55498 |
4a20fd1b03a8ed76f41da825aa69a658eec18502 | 6,320 | =begin
#Accounting API
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 2.3.0
Contact: api@xero.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.1
=end
require 'time'
require 'date'
module... | 29.952607 | 210 | 0.630063 |
ed9d012eba4cab1858d1fb324695e8cf4f790538 | 1,636 | class DeviseOverrides::PasswordsController < Devise::PasswordsController
include AuthHelper
skip_before_action :require_no_authentication, raise: false
skip_before_action :authenticate_user!, raise: false
def update
# params: reset_password_token, password, password_confirmation
original_token = param... | 34.808511 | 121 | 0.754279 |
110cdf166e14a2d791e09491d25f55247d0042e2 | 710 | require_dependency 'barong/mock_sms'
Barong::App.define do |config|
config.set(:twilio_phone_number, '+15005550000')
config.set(:twilio_account_sid, '')
config.set(:twilio_auth_token, '')
config.set(:sms_content_template, 'Your verification code for Barong: {{code}}')
end
sid = Barong::App.config.twilio_accou... | 28.4 | 82 | 0.721127 |
ab96613346f1aa495e8072a5ebf61d9db1fec54c | 4,287 | # frozen_string_literal: true
class Fisk
module Instructions
# Instruction CMOVB
forms = []
operands = []
encodings = []
# cmovb: r16, r16
operands << OPERAND_TYPES[7]
operands << OPERAND_TYPES[8]
encodings << Class.new(Fisk::Encoding) {
def encode buffer, operands
add_p... | 27.480769 | 48 | 0.538139 |
d5ba9a2041826f69fcb82933081d21cbf3ead451 | 6,821 |
require 'minitest/autorun'
require 'Confetti/lib/Test'
require 'CSpec'
require 'LSpec'
#----------------------------------------------------------------------------------------------
class WithLots < Confetti::Test
def create_fs?; false; end
def create_vob?; false; end
@@cspec_nexp = <<END
(cspec
:tag nbu.mcu... | 26.960474 | 108 | 0.596247 |
6a362c228de69828931badb235443cff9a03ae36 | 1,717 | #
# Be sure to run `pod lib lint SALIMALYASICurved.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = ... | 39.022727 | 114 | 0.651718 |
e9517beb0f54cf07349727dd25ada9878ba229cc | 268 | # frozen_string_literal: true
class CreateRakemanTaskParameters < ActiveRecord::Migration[6.0]
def change
create_table :rakeman_task_parameters do |t|
t.string :name, null: false
t.references :rakeman_rake_task
t.timestamps
end
end
end
| 20.615385 | 64 | 0.727612 |
7a6827b1c50e1f748eb89d307f7814191e70b560 | 25,018 | # frozen_string_literal: true
class MyParser < Parser::Base; end
RSpec.shared_examples_for "parser type registration" do
after do
Parser::SourceParser.parser_types.delete(:my_parser)
Parser::SourceParser.parser_type_extensions.delete(:my_parser)
end
end
RSpec.describe YARD::Parser::SourceParser do
befo... | 34.365385 | 117 | 0.603046 |
61315afda8d2b34474bbd7eb8d425a0e4e0182a4 | 4,012 | # frozen_string_literal: true
require 'rails_helper'
module DiscourseCodeReview
describe GithubRepo do
def with_tmpdir(&blk)
path = "#{Pathname.new(Dir.tmpdir).realpath}/#{SecureRandom.hex}"
begin
blk.call(path)
ensure
FileUtils.rm_rf(path)
end
end
attr_reader :c... | 27.292517 | 79 | 0.595464 |
e86f0466dfb7eaf5e8eb503005f661717be29ef3 | 1,176 | # frozen_string_literal: true
require 'fog/core/collection'
require 'fog/aliyun/models/compute/route_entry'
module Fog
module Aliyun
class Compute
class RouteEntrys < Fog::Collection
attribute :route_table
model Fog::Aliyun::Compute::RouteEntry
def all(options = {})
req... | 26.727273 | 160 | 0.586735 |
bff0c2fe05dd992c4356e5a14549d9d3da00c76a | 2,479 | # frozen_string_literal: true
require 'set'
# https://adventofcode.com/2021/day/15
class D15
def initialize(input)
parse_input(input)
end
def p1
a_star
@costs[@height - 1][@width - 1]
end
def p2
expand_grid
a_star
@costs[@height - 1][@width - 1]
end
private
def parse_input(... | 22.743119 | 73 | 0.606293 |
4aaee8f6a8fdb642e404f319724a6302ee33b077 | 28,434 | # frozen_string_literal: true
# typed: strict
# NB: This is not actually a decorator. It's just named that way for consistency
# with DocumentDecorator and ModelDecorator (which both seem to have been written
# with an incorrect understanding of the decorator pattern). These "decorators"
# should really just be static... | 35.103704 | 156 | 0.668144 |
218a9b95e7ca82d9b33fbd9995b5c973a855a21d | 11,135 | #
# Author:: Seth Chisamore (<schisamo@opscode.com>)
# Copyright:: Copyright 2011 Opscode, 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
#
# ... | 46.589958 | 204 | 0.714324 |
18b3e9c896090fe7770a5685993b5db3a89d7447 | 13,847 | #-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2013 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of ... | 71.010256 | 132 | 0.343829 |
8729cd9754fb389378e57bf944d54fd1feece548 | 340 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/AuthAPI.proto
require 'google/protobuf'
require 'proto/CommonModels_pb'
require 'proto/AuthModels_pb'
require 'google/api/annotations_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("proto/AuthAPI.proto", :syntax => :pr... | 24.285714 | 58 | 0.779412 |
1ca51678b90bab290d5fe3e9688e8d4953f0fb66 | 853 | Pod::Spec.new do |s|
s.name = "BasicComponents"
s.version = "0.1.0"
s.summary = "BasicComponents includes Miracle A/S commonly used base components for iOS projects."
s.homepage = "https://bitbucket.org/loevdahl/basiccomponents/overview"
s.license = { :type => "MIT", :file => "LIC... | 31.592593 | 116 | 0.622509 |
03c0f1eda38002db97cc337ea4d3540817d7ee32 | 643 | # frozen_string_literal: true
class UserAuthenticator
# put SimpleCommand before the class' ancestors chain
prepend SimpleCommand
# optional, initialize the command with some arguments
def initialize(email, password)
@email = email
@password = password
end
# mandatory: define a #call method. its ... | 21.433333 | 72 | 0.696734 |
bff1090828abbf96cf558db1e00396738769f5be | 160 | schedule('30s') do
send_event('travis-builds', TravisBuilds.update)
end
schedule('30s') do
send_event('travis-build-image', TravisBuilds.build_images)
end
| 20 | 61 | 0.7625 |
ff8db613ee4f3bdf39615d7a26586e51917e4b0d | 1,339 | # frozen_string_literal: true
module Dry
module AutoInject
DuplicateDependencyError = Class.new(StandardError)
DependencyNameInvalid = Class.new(StandardError)
VALID_NAME = /([a-z_][a-zA-Z_0-9]*)$/.freeze
class DependencyMap
def initialize(*dependencies)
@map = {}
dependencie... | 21.95082 | 91 | 0.598208 |
e8faa1e50d53d05de0426d6322e9ad9e0dbe4da6 | 4,553 | # 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::Storage::Mgmt::V2018_02_01
module Models
#
# The parameters to list SAS credentials of a storage account.
#
class AccountSas... | 33.233577 | 79 | 0.522513 |
ac0c647a998e4acf730fb96b941c252a83a3aada | 1,302 | # 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::Compute::Mgmt::V2018_06_01
module Models
#
# Contains the data disk images information.
#
class DataDiskImage
include... | 26.04 | 77 | 0.558372 |
18506b15e746b0a068639d290d0f5d1de5a02b7a | 2,039 | require 'spec_helper'
require 'elba/client'
describe Elba::Client do
include Elba::Mocks
context '.new' do
it 'raises an error when missing credentials' do
expect { described_class.new }.to raise_error
end
end
describe '(an instance)' do
subject { described_class.new(test_config) }
l... | 25.17284 | 84 | 0.613046 |
4a15406bd14064825b2b09a73f00c53eaf2f6011 | 158 | require 'mxx_ru/cpp'
MxxRu::Cpp::exe_target {
required_prj 'so_5/prj.rb'
target '_unit.test.internal_stats.simple_coop_count'
cpp_source 'main.cpp'
}
| 13.166667 | 53 | 0.746835 |
7939c3912b3f61f96f18183a2b03498a7bb90b76 | 444 | class AddRepliesCountToBroadcastsTopicsAndUsers < ActiveRecord::Migration[5.2]
def change
add_column :broadcasts, :replies_count, :integer, null: false, default: 0
add_index :broadcasts, :replies_count
add_column :topics, :replies_count, :integer, null: false, default: 0
add_index :topics, :replies_co... | 40.363636 | 78 | 0.75 |
183d3bcee2f32ad83c0d30daf5d8fc87c74d4e5c | 3,170 | # encoding: UTF-8
# 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 sou... | 37.294118 | 95 | 0.673502 |
b9f57169ea57a766ff44920eb502c5738d4b80e7 | 30,141 | # frozen_string_literal: true
require 'securerandom'
class Repository
REF_MERGE_REQUEST = 'merge-requests'
REF_KEEP_AROUND = 'keep-around'
REF_ENVIRONMENTS = 'environments'
REF_PIPELINES = 'pipelines'
ARCHIVE_CACHE_TIME = 60 # Cache archives referred to by a (mutable) ref for 1 minute
ARCHIVE_CACHE_TIME_... | 25.849914 | 134 | 0.703726 |
e92f5f986773d655dc1ecf6eef627db79b6e3985 | 2,211 | =begin
#Sematext Cloud API
#API Explorer provides access and documentation for Sematext REST API. The REST API requires the API Key to be sent as part of `Authorization` header. E.g.: `Authorization : apiKey e5f18450-205a-48eb-8589-7d49edaea813`.
OpenAPI spec version: v3
Generated by: https://github.com/swagger-api/... | 28.714286 | 219 | 0.718679 |
26ae584c0ac55aebb1217fc080dbb754170acf2b | 1,297 | # -*- ruby encoding: utf-8 -*-
require 'mime/types'
require 'minitest_helper'
class TestMIMETypesLoader < Minitest::Test
def setup
@path = File.expand_path('../fixture', __FILE__)
@loader = MIME::Types::Loader.new(@path)
end
def assert_correctly_loaded(types)
assert_includes(types, 'application/1... | 30.162791 | 77 | 0.699306 |
182cdee0f36fee4b1955ff94cbd8c4636f572caf | 465 | Pod::Spec.new do |s|
s.name = 'Godzippa'
s.version = '0.1.2'
s.license = 'MIT'
s.summary = 'GZip Compression / Decompression Category for NSData.'
s.homepage = 'https://github.com/mattt/Godzippa'
s.author = { 'Mattt Thompson' => 'm@mattt.me' }
s.source = { :git => 'https://github.com/mattt/Godz... | 31 | 70 | 0.595699 |
f7efc509bdd9ecffa1b098fe52a8cd198d221061 | 1,340 | require 'ostruct'
require "dnsimpler/version"
require 'dnsimpler/http'
module DNSimpler
MATTRS = %w[username token base_uri debug]
MATTRS.each do |mattr|
module_eval <<-RUBY_EVAL, __FILE__, __LINE__
def self.#{mattr}; return @@#{mattr}; end;
def self.#{mattr}=(attr); @@#{mattr} = attr; end;
RU... | 21.269841 | 103 | 0.621642 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.