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 |
|---|---|---|---|---|---|
613b9cfafc823b18b59e1044cf2345860d77b58e | 927 | require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = 'ABI41_0_0EXDocumentPicker'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.license = package['license... | 35.653846 | 188 | 0.617044 |
e8e02946becf3f698a90c0d5e1005254e1f3b9d3 | 353 | cask "font-kelly-slab" do
version :latest
sha256 :no_check
# github.com/google/fonts/ was verified as official when first introduced to the cask
url "https://github.com/google/fonts/raw/master/ofl/kellyslab/KellySlab-Regular.ttf"
name "Kelly Slab"
homepage "https://fonts.google.com/specimen/Kelly+Slab"
... | 29.416667 | 87 | 0.753541 |
1c354230100fc0d5e5b2b87ac5574cd53ce98c7f | 2,154 | # Copyright 2007-2014 Greg Hurrell. All rights reserved.
# Licensed under the terms of the BSD 2-clause license.
require 'walrat'
module Walrat
# Simple wrapper for MatchData objects that implements length, to_s and
# to_str methods.
#
# By implementing to_str, MatchDataWrappers can be directly compared with
... | 32.636364 | 79 | 0.71727 |
3369c23f7725aad93bb6238c8562f5ba6c6cdbf5 | 6,518 | require 'rubygems'
require 'pathname'
gem 'dm-core', '=0.9.2'
require 'dm-core'
dir = Pathname(__FILE__).dirname.expand_path / 'dm-validations'
require dir / 'validation_errors'
require dir / 'contextual_validators'
require dir / 'auto_validate'
require dir / 'generic_validator'
require dir / 'required_field_valida... | 31.186603 | 93 | 0.656797 |
f7dd61fea1bb34f040ccdaf533f263e4eb88613f | 1,974 | require "rails_helper"
module FloodRiskEngine
RSpec.describe GridReferenceValidator, type: :model do
class Foo
include ActiveModel::Validations
attr_accessor :grid_reference, :with_message, :with_allow_blank
def initialize(input)
@grid_reference = @with_message = @with_allow_blank = inp... | 25.636364 | 76 | 0.620061 |
3919a757d916d17b0a6213b2d05fc39ca3c52e13 | 980 | #
# This file is auto-generated, do not edit
#
module RecombeeApiClient
require_relative 'request'
require_relative '../errors'
##
#Get all the current property values of a given item.
#
class GetItemValues < ApiRequest
attr_reader :item_id
attr_accessor :timeout
attr_accessor :ensure_https
... | 18.846154 | 75 | 0.622449 |
9106939f0170f568c5b2296d2aa51cebc13fa7f3 | 917 | $LOAD_PATH.push File.expand_path('../lib', __FILE__)
require 'activerecord/jsonb/associations/version'
Gem::Specification.new do |spec|
spec.name = 'activerecord-jsonb-associations'
spec.version = ActiveRecord::JSONB::Associations::VERSION
spec.authors = ['Yury Lebedev']
spec.email = ['le... | 31.62069 | 76 | 0.684842 |
e29a31aba1d5999bab06c9fb4dd9e9a9682be306 | 2,373 | require File.dirname(__FILE__) + '/spec_helper.rb'
require File.dirname(__FILE__) + '/../lib/curies.rb'
describe "The Curie library" do
it "should be able to parse a safe curie into a fully qualified URI" do
Curie.parse("[foaf:person]").should eql("http://xmlns.com/foaf/0.1/person")
end
it "should be abl... | 49.4375 | 131 | 0.689844 |
4a639807511f980d48bf02f46bb9f450e3cafc8a | 6,504 | # Eneroth Townhouse System
# Copyright Julia Christina Eneroth, eneroth3@gmail.com
module EneBuildings
file = __FILE__
unless file_loaded? file
file_loaded file
# Context menu for select tool.
UI.add_context_menu_handler do |menu|
if b = Building.get_from_selection
menu.add_separator
menu.add_... | 46.12766 | 131 | 0.771064 |
bb7ccc6b4c9ac1a0506148ba16785ec9718f5d4f | 485 | # encoding: UTF-8
# frozen_string_literal: true
require 'yaml'
namespace :seed do
task blockchains: :environment do
Blockchain.transaction do
blockchain = Blockchain.find_by_key("eth")
if blockchain.blank?
blockchain = Blockchain.create!("key":"eth", "status":"active", "height":5817659)
... | 24.25 | 89 | 0.645361 |
6253c24f1bbdf2949f5663aba38f24c59b8a8ad1 | 2,240 | require 'spec_helper'
describe SessionsController, type: :controller do
let!(:users) { create_list(:user, 2) }
let(:user) { users.first }
context "using json", :zoo_home_user do
before(:each) do
request.env["HTTP_ACCEPT"] = "application/json"
request.env["CONTENT_TYPE"] = "application/json"
... | 26.352941 | 71 | 0.570089 |
abd1847dd39dd67fb8fe9a68d428b6e51ac3f332 | 986 | # Copyright 2016, BlackBerry Limited
#
# 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 wri... | 32.866667 | 96 | 0.762677 |
622b6b236ebf2a8460e47dec244f8338dd434f50 | 455 | module Slowpoke
module Migration
def connection
connection = super
if Slowpoke.migration_statement_timeout && !@migration_statement_timeout_set
connection.execute("SET statement_timeout = #{Slowpoke.migration_statement_timeout.to_i}")
@migration_statement_timeout_set = true
end
... | 26.764706 | 98 | 0.749451 |
180d63ac4fc6e8b3ea85877652be0bb855d90f26 | 3,976 | # ----------------------------------------------------------------------------
# <copyright company="Aspose" file="copy_file_request.rb">
# Copyright (c) 2018-2020 Aspose Pty Ltd. All rights reserved.
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a
# copy... | 43.217391 | 129 | 0.654427 |
4ab2ec209f39cafebad43b269a422c3c2dc779a8 | 982 | require 'elastic_apm'
module ElasticAPM
module Grape
# ActiveSupport::Notifications.subscribe('endpoint_run.grape') do |name, started, finished, unique_id, payload|
# env = payload[:env]
# route_name = env['api.endpoint']&.routes&.first&.pattern&.origin || env['REQUEST_PATH']
# span_name = [env... | 36.37037 | 115 | 0.639511 |
03a50f16244c4a3e748df669f36e4110e49df3cf | 908 | Rails.application.routes.draw do
get 'password_resets/new'
get 'password_resets/edit'
get 'sessions/new'
root 'static_pages#home'
get '/help', to: 'static_pages#help'
get '/about', to: 'static_pages#about'
get '/contact', to: 'static_pages#contact'
get '/signup', to: 'users#new'
post ... | 30.266667 | 101 | 0.656388 |
017d99cd977a67ccc7d21ce90d30026b4e42544d | 1,601 | class Fastlane < Formula
desc "Easiest way to build and release mobile apps"
homepage "https://fastlane.tools"
url "https://github.com/fastlane/fastlane/archive/2.158.0.tar.gz"
sha256 "7e9b4e9092f9f19589eb988f1f9b3bde8fc07c81420a80f9fdbf9ae45f5c456b"
license "MIT"
head "https://github.com/fastlane/fastlane.... | 32.02 | 94 | 0.709557 |
f745c56109a6f606b48fb8a65b2fbd8723834250 | 365 | require "bundler/setup"
require "dsl_parse"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect_with :r... | 24.333333 | 66 | 0.753425 |
f7d092c6a7845403753315577060f503f5a8abd5 | 1,991 | class DeviseTokenAuthCreateUsers < ActiveRecord::Migration[5.0]
def change
change_table :users do |t|
t.text :tokens
end
# add_index :users, :email
add_index :users, [:uid, :provider], :unique => true
# add_index :users , :reset_password_token, :unique => true
end
# def change
# ... | 31.109375 | 112 | 0.594174 |
871ddcac09b12358763dd4f1eaed8eee221573a4 | 996 | Sketchup::require "geores_src/geores_import/geores_rexml/child.rb"
module REXML
module DTD
class NotationDecl < Child
START = "<!NOTATION"
START_RE = /^\s*#{START}/um
PUBLIC = /^\s*#{START}\s+(\w[\w-]*)\s+(PUBLIC)\s+((["']).*?\4)\s*>/um
SYSTEM = /^\s*#{START}\s+(\w[\w-]*)\s+(SYSTEM)\s+((["']).*?\4)\s*>/u... | 24.9 | 83 | 0.588353 |
61d344b3a7cd8c16df7d12cf66235cef72c70a47 | 987 | require File.expand_path(File.dirname(__FILE__) + "/test_helper")
class ListDocLogsBangTest < MiniTest::Test
describe "doc_logs!" do
before do
DocRaptor.api_key "something something"
end
describe "with bogus arguments" do
it "should raise an error if something other than an options hash is p... | 34.034483 | 94 | 0.70922 |
2898ef041e5f9805ba8519be058ac5031d5096df | 13,110 | # 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, software
# distributed under the... | 33.875969 | 80 | 0.614569 |
0818dd9cf1e604e9f91db4355ec7b200554ebc61 | 31,401 | require 'traject'
require 'traject/util'
require 'traject/indexer/settings'
require 'traject/horizon_bib_auth_merge'
require 'marc'
require 'marc/marc4j' # for marc4j jars
module Traject
#
# = Settings
#
# == Connection
#
# [horizon.jdbc_url] JDBC connection URL using jtds. Should include username, but ... | 40.206146 | 207 | 0.629088 |
2159ad09c780fb16161aca705b7a6ceb235a5bd7 | 351 | class Needle
attr_accessor :name, :mtime, :size
def initialize(path)
@path = path
@name = File.basename(@path)
@mtime = File.mtime(@path)
@size = Filesize.from("#{File.size(@path)} B").pretty
end
def directory?
File.directory? @path
end
def file?
... | 18.473684 | 61 | 0.555556 |
edfed190e8b9b8ff302661dd2fb7753d50d9b24e | 507 | cask 'bloodhound' do
version '1.2.1'
sha256 '63abbfb483811a004171a8680402e613ca6129c7bd152d67321e65d90b70810b'
url "https://github.com/BloodHoundAD/BloodHound/releases/download/#{version}/BloodHound-darwin-x64.zip"
appcast 'https://github.com/BloodHoundAD/BloodHound/releases.atom',
checkpoint: 'e97ce... | 39 | 105 | 0.798817 |
ab9cf05c90384f88b214e13e82a189214ce2da37 | 1,256 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'flash-messenger/version'
Gem::Specification.new do |spec|
spec.name = "flash-messenger"
spec.version = FlashMessenger::VERSION
spec.authors = ["Chen, Yi-Cyuan"]
spec.... | 39.25 | 104 | 0.714968 |
0303a3551e02476b57a10e37ec86a9da52423921 | 557 | # frozen_string_literal: true
module RubyCritic
module SourceControlSystem
class Mercurial < Base
register_system
def self.supported?
`hg verify 2>&1` && $CHILD_STATUS.success?
end
def self.to_s
'Mercurial'
end
def revisions_count(path)
`hg log #{pat... | 18.566667 | 80 | 0.601436 |
0367a1f7faa8e9d5801233b27ba2b652e2c7e536 | 3,109 | require 'test_helper'
class UserTest < ActiveSupport::TestCase
def setup
@user = User.new(name: "Example User", email: "user@example.com",
password: "foobar", password_confirmation: "foobar")
end
test "should be valid" do
assert @user.valid?
end
test "name should be present" d... | 28.263636 | 78 | 0.671599 |
4ae43a72f9fdbe3317cdc8ff106746b2a7b58c31 | 1,961 | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Ch... | 59.424242 | 153 | 0.713921 |
edb39742a1facf4a2f5a2d8109748eba06392c2b | 534 | class UserMailer < ApplicationMailer
# Subject can be set in your I18n file at config/locales/en.yml
# with the following lookup:
#
# en.user_mailer.account_activation.subject
#
def account_activation(user)
@user = user
mail to: @user.email, subject: "Account activation"
end
# Subject can be... | 22.25 | 65 | 0.696629 |
f8abbd9f4c11c5758182efdad41a536cf6dee604 | 3,350 | # frozen_string_literal: true
require 'cucumber/core/test/step'
module Cucumber::Core::Test
describe Step do
describe "describing itself" do
let(:step_or_hook) { double }
before(:each) do
allow( step_or_hook ).to receive(:location)
end
it "describes itself to a visitor" do
... | 33.5 | 98 | 0.630746 |
b9c35692345dee1bb8036ab4587655624bca886c | 2,365 | module Bunny
def self.instance
@instance
end
def self.run(options = {})
@instance = BunnyInstance.new(options)
yield @instance
end
def self.new(options = {})
@instance = BunnyInstance.new(options)
@instance
end
class Consumer
def initialize(channel, queue, consumer_tag = 'test',... | 17.389706 | 107 | 0.606765 |
b9a42e0b854070e8d0c59881fe6fcd814e58afac | 47 | class PlanetSchematic < ActiveRecord::Base
end
| 15.666667 | 42 | 0.829787 |
e2593a8355fabcb721bbfc142c367be64b4b8340 | 2,461 | module Autoini
class Contents
KLASSES = [Pair, Section, Comment, BlankLine]
attr_reader :lines
def self.parse(contents)
return new if contents.nil? || contents.empty?
elements = []
section = nil
contents.split("\n").each do |l|
e = KLASSES.map{ |k| k.parse_with_comment(Au... | 23.438095 | 77 | 0.525396 |
21902298c0b4109329d056de27a7cdec260856a9 | 5,464 | require 'test/unit'
require 'tmpdir'
require 'fileutils'
require 'pathname'
class TestDir < Test::Unit::TestCase
def setup
@verbose = $VERBOSE
$VERBOSE = nil
@root = Pathname.new(Dir.mktmpdir('__test_dir__')).realpath.to_s
@nodir = File.join(@root, "dummy")
for i in ?a..?z
if i.ord % 2 ==... | 24.392857 | 113 | 0.560212 |
5dff00c5d0cd8a6e57287aff55eb72cd5a94cea6 | 2,542 | require 'rails_helper'
# rubocop:disable Metrics/BlockLength
RSpec.describe Framework, type: :model do
context 'Validations for Framework' do
let(:user) { User.new(name: 'Testing1') }
let(:language) { Language.new(name: 'Language1') }
let(:framework) { Framework.new(name: 'Framework1') }
it 'Should be... | 37.940299 | 107 | 0.605429 |
4a5870a69695df769878dbc3332a8e7e933df585 | 467 | require 'set'
def parse_changes
File.open('frequency_changes.txt').map { |line| Integer(line.chomp!) }
end
def first_recurring(changes)
freq = 0
frequencies = Set.new
changes.cycle do |change|
frequencies << freq
freq += change
if frequencies.include? freq
return freq
end
end
retur... | 17.296296 | 72 | 0.704497 |
ab74f6b085d633ea6358f9160eae27f93277fa43 | 2,175 | require 'rails_event_store_active_record'
require 'support/rspec_defaults'
require 'support/mutant_timeout'
require 'rails'
$verbose = ENV.has_key?('VERBOSE') ? true : false
ENV['DATABASE_URL'] ||= 'sqlite3:db.sqlite3'
ENV['RAILS_VERSION'] ||= Rails::VERSION::STRING
MigrationCode = File.read(File.expand_path('../..... | 31.985294 | 142 | 0.716322 |
7a47ad7d532beb28e6436063119af1e0be669bb2 | 1,425 | require 'fog/core/collection'
require 'fog/rackspace/models/dns/record'
module Fog
module DNS
class Rackspace
class Records < Fog::Collection
attribute :zone
attribute :total_entries, :aliases => 'totalEntries'
model Fog::DNS::Rackspace::Record
def all
requires :... | 24.152542 | 75 | 0.575439 |
79055d049aa78b06df86ab13264810752b0b3575 | 1,709 | #-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2021 the OpenProject GmbH
#
# 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 ... | 29.982456 | 91 | 0.726156 |
b9e61d7d305e04fb5a94bade926f634107d2fc12 | 2,712 | module CanonicalVocabulary
module Renewals
module RenewalBuilder
def residency(member)
if member.person.addresses.blank?
member = @primary
end
member.person.addresses[0].location_state_code == 'DC' ? 'D.C. Resident' : 'Not a D.C. Resident'
end
def citiz... | 37.666667 | 124 | 0.656342 |
e2bae83b1f3efe5a372a7d90f4665634269b9045 | 414 | require 'spec_helper'
describe 'dhcp::host', :type => :define do
let :title do
'test_host'
end
let(:facts) do
{
:concat_basedir => '/dne',
:osfamily => 'RedHat',
}
end
let :params do
{
'ip' => '1.2.3.4',
'mac' => '90:FB:A6:E4:08:9F',
'comment' => '... | 18 | 62 | 0.521739 |
612909ef143b444a09f00991ed2fb3c687f42812 | 4,853 | require 'thread'
module CfCanaries
class Breeder
def initialize(options)
@options = options
end
def breed(logger, runner)
logger.info 'targeting and logging in'
runner.cf!([
"api",
@options.target,
@options.skip_ssl_validation ? "--skip-ssl-validation" : nil
... | 28.380117 | 187 | 0.603338 |
ff31cb899da22e7bc868f67f706e9deb53e9313f | 1,394 | $:.push File.expand_path("lib", __dir__)
# Maintain your gem's version:
require "decidim/meetings/extras/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |spec|
spec.name = "decidim-meetings-extras"
spec.version = Decidim::Meetings::Extras::VERSION
spec.authors ... | 38.722222 | 96 | 0.721664 |
03013d8e0cee4783b7a820cbcada36300a251e55 | 901 | # frozen_string_literal: true
module Dynflow
class Action::Suspended
attr_reader :execution_plan_id, :step_id
def initialize(action)
@world = action.world
@execution_plan_id = action.execution_plan_id
@step_id = action.run_step_id
end
def plan_event(event, tim... | 31.068966 | 95 | 0.693674 |
086c4636ac2e947fe8269536e8daaca4203f8eec | 2,694 | require 'spec_helper'
describe Agents::PublicTransportAgent do
before do
valid_params = {
"name" => "sf muni agent",
"options" => {
"alert_window_in_minutes" => "20",
"stops" => ['N|5221', 'N|5215'],
"agency" => "sf-muni"
}
}
@agent = Agents::PublicTransportAgent.... | 35.447368 | 139 | 0.622123 |
61bbcba6dd0acc52a9821dc4b5af00f3f979c8b9 | 988 | require 'active_support/concern'
module CloakPolicy
module Scorable
extend ActiveSupport::Concern
included do
has_many :scores, as: :scorable, dependent: :destroy
has_many :vectors, through: :scores, as: :scorable
end
def weight_for(vector_id)
array = scores.where(vector_id: vect... | 24.7 | 79 | 0.65081 |
287c381b832788ffc11900c3e7cbac2ddd5ea296 | 1,141 | require 'open-uri'
require 'uri'
require 'nokogiri'
class Crawler
MAX_DEPTH = 5.freeze
def self.run
Root.all.each do |root|
new(root.url, root).crawl
end
end
def initialize(url, root, depth = 1)
@url = url
@root = root
@depth = depth
end
def crawl
unless source_exists?
... | 17.029851 | 79 | 0.601227 |
f8570d614e2d6f7bb4547163c3d01d37b7e773ff | 507 | require 'terminal-announce'
require 'bundler/cli'
module Gears
# Deals with the dependencies from Gears packages
module Dependencies
def self.install(from_path:)
install_gems from_path
end
def self.install_gems(package_path)
gemfile = "#{package_path}/Gemfile"
return unless File.exis... | 25.35 | 56 | 0.698225 |
0373c2a05c1ff159590777195fd0740d835f4dfd | 626 | # frozen_string_literal: true
require "forwardable"
module EveOnline
module ESI
class UniverseStar < Base
extend Forwardable
API_PATH = "/v1/universe/stars/%<star_id>s/"
attr_reader :id
def initialize(options)
super
@id = options.fetch(:id)
end
def_delega... | 17.388889 | 73 | 0.605431 |
187daf9ad8e356852f2a77e56cff197c61156086 | 368 | # frozen_string_literal: true
# Class who represents CartPage Page in SauceDemo
class CartPage < SitePrism::Page
element :list_cart_name, '.inventory_item_name'
element :list_cart_item, '.cart_item'
def remove_item(name)
find('button[class="btn_secondary cart_button"]', text: 'REMOVE', visible: true).click ... | 30.666667 | 128 | 0.766304 |
18f804c7daf37b576a88b46dc7e03e290006c51a | 791 | require File.expand_path('../../../spec_helper', __FILE__)
require 'cgi'
describe "CGI.escapeElement when passed String, elements, ..." do
it "escapes only the tags of the passed elements in the passed String" do
res = CGI.escapeElement('<BR><A HREF="url"></A>', "A", "IMG")
res.should == "<BR><A HREF=&quo... | 37.666667 | 75 | 0.59292 |
f86390e4839c6d88ddd8a3f60478d7a66a775c06 | 1,574 | class ContainerNodeController < ApplicationController
include ContainersCommonMixin
include ContainersExternalLoggingSupportMixin
include Mixins::BreadcrumbsMixin
before_action :check_privileges
before_action :get_session_data
after_action :cleanup_action
after_action :set_session_data
def show_list
... | 24.984127 | 85 | 0.724269 |
7a4bad07784474a120f5adec108c42e52e96fc8a | 343 | max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
threads min_threads_count, max_threads_count
port ENV.fetch("PORT") { 3000 }
environment ENV.fetch("RAILS_ENV") { "development" }
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" ... | 38.111111 | 72 | 0.749271 |
87909c7517d29c534b05a26270cb4d5ee96e578e | 2,125 | require "spec_helper"
describe 'build_taxon_concept (spec helper method)' do
before(:all) do
load_foundation_cache
@event = HarvestEvent.gen
@scientific_name = 'Something cool'
@hierarchy = Hierarchy.gen
@taxon_concept = build_taxon_concept(comments: [], toc: [], bhl: [], image... | 30.797101 | 122 | 0.672941 |
9197252c44ce0a055b36b43da29da459f00e71cf | 380 | require 'base_kde_formula'
class Poxml < BaseKdeFormula
homepage 'http://www.kde.org/'
url 'http://download.kde.org/stable/4.11.4/src/poxml-4.11.4.tar.xz'
sha1 'e73ae271f82ff077b454ce6c72a5f4ba4dc108aa'
devel do
url 'http://download.kde.org/stable/4.12.0/src/poxml-4.12.0.tar.xz'
sha1 '30d8d0f06a47965f... | 25.333333 | 71 | 0.742105 |
ed2a1ed41765f15424f327e536d2749b6707448d | 1,110 | class MutableVote < ActiveRecord::Base
include VoteBehaviour
belongs_to :voter
belongs_to :candidate
belongs_to :election
validates_uniqueness_of :voter,
null: false,
scope: :election_id
validates_presence_of :candidate_id,
... | 26.428571 | 98 | 0.66036 |
ac8c76bf2474823cfdec0ca48ca6a0564c6689c7 | 68 | # frozen_string_literal: true
module Alain
VERSION = "0.5.0"
end
| 11.333333 | 29 | 0.720588 |
7975dcffba274e62e638e1c6e7c612c369d2a506 | 1,135 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
module MetasploitModule
CachedSize = 1468324
include Msf::Payload::Single
include Msf::Sessions::MeterpreterOptions
include Msf::Sessions::MettleConfig
def initialize(... | 26.395349 | 94 | 0.595595 |
384a0b3d2c815997d561fa5b86befd79ad720590 | 1,585 | Pod::Spec.new do |s|
s.name = "CrashReporterAC"
s.version = "0.3.0"
s.summary = "Introduces the missing Crash Dialog for Microsofts AppCenter."
s.description = <<-DESC
A bug report contains device logs, stack traces, and other diagnostic information to help ... | 72.045455 | 479 | 0.671924 |
0339bae1b4bffa6c3cf41e289235c90f897aad49 | 148 | FactoryGirl.define do
factory :establishment do
sequence(:name) {|n| "Establishment #{n}"}
sequence(:short_name) {|n| "SSS#{n}"}
end
end | 24.666667 | 46 | 0.655405 |
01a7807a1df08f992895aa2729fbf16739d69c8c | 78 | class AddIndex < ActiveRecord::Migration
def up
end
def down
end
end
| 9.75 | 40 | 0.705128 |
e81475b89abd975dc03d9b0fa8e8b0e1227d0057 | 3,107 | # Cloud Foundry Java Buildpack
# Copyright 2013-2017 the original author or authors.
#
# 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
#
# Un... | 37.890244 | 118 | 0.738977 |
d5f196b5f153dd335a4dc0ba9ea6275e2316ac2b | 629 | class RelationshipsController < ApplicationController
before_action :logged_in_user
# POST /relationships
def create
@user = User.find(params[:followed_id])
current_user.follow(@user)
respond_to do |format|
format.html { redirect_to @user }
format.js # => app/views/relationships/crea... | 25.16 | 62 | 0.677266 |
038ee2412d8936ba4b4dfa0dcd8569fd5ab0ad59 | 936 | cask 'boostnote' do
version '0.15.3'
sha256 '6ab1815ff0eb555b2dc01239243f849541f072eb51325fb57a0d5008e40713d7'
# github.com/BoostIO/boost-releases/ was verified as official when first introduced to the cask
url "https://github.com/BoostIO/boost-releases/releases/download/v#{version}/Boostnote-mac.zip"
appcas... | 34.666667 | 97 | 0.642094 |
f7fcb5f430bdb1340398d4097876d5f9335d08bd | 4,512 | #
# Deploys OpsWorks CKAN App to jobs layer
#
# Copyright 2021, Queensland Government
#
#
# 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
#
# ... | 30.486486 | 184 | 0.691046 |
d57a5db851c7aea084c9878f6dec5acfc252c75b | 702 | cask 'qbittorrent' do
version '3.3.12'
sha256 '85296a52d45d5ed814e3a66c7c687d95b192d80bfaa9821ac4a97be7e2f791cf'
# sourceforge.net/qbittorrent was verified as official when first introduced to the cask
url "https://downloads.sourceforge.net/qbittorrent/qbittorrent-mac/qbittorrent-#{version}/qbittorrent-#{versi... | 46.8 | 119 | 0.787749 |
1d3b426c307c209d1c2c8101d3b5d42f6c619ff3 | 330 | # frozen_string_literal: true
module FoxPage
module Refinements
module Underscore
refine String do
def underscore
gsub(/([a-z\d])([A-Z])/, '\1_\2').downcase
end
end
refine Symbol do
def underscore
to_s.underscore.to_sym
end
end
end
... | 16.5 | 52 | 0.563636 |
61ebf91c21204cfce2d2d2ddf2e08632fec11f29 | 192 | class CreateComments < ActiveRecord::Migration[5.2]
def change
create_table :comments do |t|
t.text :content
t.integer :user_id
t.integer :post_id
end
end
end
| 19.2 | 51 | 0.651042 |
e892dc88f6d9a1fea0047e4a8cbc8132fd88c34b | 1,906 | require_dependency 'mailer'
module RedmineDiffEmail
module Patches
module MailerPatch
def self.included(base)
base.send(:include, InstanceMethods)
base.class_eval do
unloadable
end
end
module InstanceMethods
def changeset_added(changeset, is_attache... | 29.323077 | 159 | 0.623295 |
ac2e4ef99c9edd62024aa22a4bc5162ed245570d | 566 | module Kuby::KubeDB::DSL::API::V1
class S3Spec < ::KubeDSL::DSLObject
value_field :prefix
value_field :endpoint
value_field :bucket
validates :prefix, field: { format: :string }, presence: false
validates :endpoint, field: { format: :string }, presence: false
validates :bucket, field: { forma... | 23.583333 | 68 | 0.627208 |
e8f165b47f2f6f9c6678c403bd7ce85e8eaea09e | 139 | class Article < ApplicationRecord
attribute :markdown
attribute :rendered
has_many_media
belongs_to :owner, polymorphic: true
end
| 17.375 | 38 | 0.791367 |
87d4ea00ec58f7e34b521e7b86a396b3ce553ef7 | 6,407 | # frozen_string_literal: true
require "support/vacols_database_cleaner"
require "rails_helper"
feature "Intake Add Issues Page", :all_dbs do
include IntakeHelpers
before do
setup_intake_flags
end
let(:veteran_file_number) { "123412345" }
let(:veteran) do
Generators::Veteran.build(file_number: vete... | 36.19774 | 120 | 0.68472 |
ac4e7b948b41573b05489c1a98d3f2cde30ae90e | 820 | Pod::Spec.new do |s|
s.name = 'ZLPhotoBrowser'
s.version = '2.7.4'
s.summary = 'A simple way to multiselect photos from ablum, force touch to preview photo, support portrait and landscape, edit photo, multiple languages(Chinese,English,Japanese)'
s.homepage = 'https://github.com/longitachi... | 39.047619 | 186 | 0.656098 |
4ada1fc2d08fa2c3dc3a8f1d7248b2ec26fcae76 | 477 | Given /^an outline with the title "([^\"]*)"$/ do |title|
outline = {:kind => 'Outline', :title => title}
RestClient.put "#{host}/#{database}/#{title}", outline.to_json
end
Given /^an outline with the title "([^\"]*)" created "([^\"]*)" minutes ago$/ do |title, minutes|
outline = {:kind => 'Outline', :title => t... | 43.363636 | 130 | 0.603774 |
18402afc89a39e64a1e73052e53bd3427f9340f8 | 916 | module GitAnalysis
# prints information about the repository
class Printer
attr_reader :repo
attr_reader :open_pr_count
attr_reader :closed_pr_count
def initialize(repo_object, open_pr_count, closed_pr_count)
@repo = repo_object
@open_pr_count = open_pr_count
@closed_pr_count = cl... | 30.533333 | 173 | 0.686681 |
2138f12a3f24d7d6b0cd6749dc1b2bd3a88f240e | 881 | # frozen_string_literal: true
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "break/version"
Gem::Specification.new do |spec|
spec.name = "break"
spec.version = Break::VERSION
spec.authors = ["Genadi Samokovarov"]
spec.email = ["gsam... | 33.884615 | 95 | 0.684449 |
6ac605563f5ff900a0a05801a87070ea63925632 | 967 | # vim: syntax=ruby:expandtab:shiftwidth=2:softtabstop=2:tabstop=2
#
# Copyright (c) 2012-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found ... | 29.30303 | 78 | 0.580145 |
4aee8abdec313276af7f658edec45effb9458962 | 650 | class AlignmentsController < ApplicationController
include AlignmentsManager::BuildAlignments
def getPDBalignment
pdbId = params[:name]
info = fetchPDBalignment(pdbId)
return render json: info, status: :ok
end
def getPDBcoverage
pdbId_ch = params[:name]
info = fetchPDBcoverage(pdbId_ch)
... | 22.413793 | 57 | 0.690769 |
1cde4394433a3cb663665c43a7011455a5dd56ce | 1,146 | # Copyright 2014 Rico Simke, Leipzig University Library
# http://www.ub.uni-leipzig.de
#
# This code is the result of the project "Die Bibliothek der Milliarden Wörter".
# This project is funded by the European Social Fund. "Die Bibliothek der
# Milliarden Wörter" is a cooperation project between the Leipzig University... | 44.076923 | 80 | 0.776614 |
e9db60d544c5dcdec863788429fa31ee2fe9b582 | 513 | class InstructorSerializer < ActiveModel::Serializer
attributes :id, :first_name, :second_name, :course_list
has_many :courses
def course_list
object.courses.map do |course|
{
id: course.id,
instructor: {
id: course.instructor
},
user: {
id: course.us... | 22.304348 | 57 | 0.60039 |
7a72b933e8edf819189d7bb9026913e0e77dadce | 1,894 | class RakudoStar < Formula
desc "Perl 6 compiler"
homepage "https://rakudo.org/"
url "https://rakudo.org/dl/star/rakudo-star-2020.01.tar.gz"
sha256 "f1696577670d4ff5b464e572b1b0b8c390e6571e1fb8471cbf369fa39712c668"
bottle do
sha256 "62c80b5c001ffede84e442a8b0f8cb8526e2b8ee2e5b15b6637d7c39c8164d04" => :ca... | 36.423077 | 104 | 0.703273 |
6123b62273be7df673c1501305e5d5048ac7e1f3 | 4,823 | require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "SiteZoneTargeting API" do
before(:all) do
client = Adzerk::Client.new(API_KEY)
@flights = client.flights
@advertisers = client.advertisers
@channels = client.channels
@campaigns = client.campaigns
@priorities = clien... | 34.205674 | 124 | 0.60792 |
6a987def403e4ebcf5156e245ba5b59d501ae151 | 287 | class WebkitNightly < Cask
version 'r159487'
sha256 '6d59673fdac0c380f66c1da6ae5742377b68add2f0bb33737bd7e1cec7ba821c'
url 'http://builds.nightly.webkit.org/files/trunk/mac/WebKit-SVN-r159487.dmg'
homepage 'http://nightly.webkit.org/'
license :unknown
app 'WebKit.app'
end
| 26.090909 | 79 | 0.780488 |
e2c88c77400b9ca0ac91e8a7fdad957fed851f52 | 971 | require 'rack'
require 'rack/utils'
if Rack.release > '2'
module Rack::Indifferent
class QueryParser < Rack::QueryParser
# Work around for invalid optimization in rack
def parse_nested_query(qs, d=nil)
return make_params.to_params_hash if qs.nil? || qs.empty?
super
end
... | 26.243243 | 69 | 0.629248 |
019e0330dcc066a813a5d70071a7057245080aea | 1,583 | require "spec_helper"
describe ProcessOrderPrintable do
subject { described_class }
let(:order_printable_atts) {
{printable_type: "Arcturian Mega Donkey",
include_product_names: true}
}
let(:order_printable) { create(:order_printable, order_printable_atts) }
let(:order_printable_id) { order_printa... | 35.177778 | 112 | 0.73784 |
082d2e73bbd44c71df866b4741f8361f1176181f | 1,384 | #
# Copyright 2015-2017, Noah Kantrowitz
#
# 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 w... | 30.755556 | 114 | 0.739162 |
26cd8145189a958cfce3599e720746794cb1add0 | 272 | class CreateComments < ActiveRecord::Migration[5.1]
def change
create_table :comments do |t|
t.text :content
t.belongs_to :commentable, polymorphic: true
t.timestamps
end
add_index :comments, [:commentable_id, :commentable_type]
end
end
| 22.666667 | 61 | 0.698529 |
911ca14d295ed02d845c80d30684157aa9d0959e | 2,360 | class Etcd < Formula
desc "Key value store for shared configuration and service discovery"
homepage "https://github.com/coreos/etcd"
url "https://github.com/coreos/etcd/archive/v3.2.7.tar.gz"
sha256 "b91a40102b944ba8e4dad439721c7068eccbc1d0cb0e7f2ded9dad134d2875ce"
head "https://github.com/coreos/etcd.git"
... | 32.328767 | 106 | 0.650847 |
ed3dfe325d93a6a978d9b23658819b63b44ff435 | 2,145 | require 'rails_helper'
describe 'Static pages', type: :request do
subject { page }
let(:user) { create :user }
describe 'home page' do
before do
2.times { create :project }
5.times { create :pull_request }
visit root_path
end
it { is_expected.to have_link('Log in with GitHub', hre... | 31.086957 | 86 | 0.674126 |
03aea0d1f42131c4d9348b9ae38c3cfdf3a8f9a7 | 1,365 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require 'profiles/latest/resourcehealth_module_definition'
require 'profiles/latest/modules/resourcehealth_profile_module'
module Azure::ResourceHealth::Profiles::... | 34.125 | 94 | 0.663004 |
b90acab3686da2f7ff2c479f5292990195c3bf2b | 2,431 | class Hardlink < Formula
desc "Replace file copies using hardlinks"
homepage "https://jak-linux.org/projects/hardlink/"
url "https://jak-linux.org/projects/hardlink/hardlink_0.3.0.tar.xz"
sha256 "e8c93dfcb24aeb44a75281ed73757cb862cc63b225d565db1c270af9dbb7300f"
license "MIT"
bottle do
sha256 cellar: :a... | 48.62 | 123 | 0.705471 |
33aafe69443571e4d31bd2a8bebfb565e3925e88 | 3,219 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Ci::Minutes::ProjectMonthlyUsage do
let_it_be(:project) { create(:project) }
describe 'unique index' do
before do
create(:ci_project_monthly_usage, project: project)
end
it 'raises unique index violation' do
expect { crea... | 34.244681 | 128 | 0.714508 |
7a3f5e4c93c1b88b92ff1ca6d6bc4336665ce52c | 216 | class User < ActiveRecord::Base
has_many :tweets
has_secure_password
def slug
self.username.downcase.gsub(" ", "-")
end
def self.find_by_slug(slug)
self.all.find{|u| u.slug == slug }
end
end
| 13.5 | 41 | 0.657407 |
edfa5c04d3fb346eaac4281aeebc23ee4d18b58d | 5,287 | require 'microsoft_kiota_abstractions'
require_relative '../../../../users'
require_relative '../../../mail_folders'
require_relative '../../messages'
require_relative '../multi_value_extended_properties'
require_relative './item'
module Graphrubyv4::Users::MailFolders::Messages::MultiValueExtendedProperties::Item
... | 44.428571 | 189 | 0.647815 |
2817ee9dda26c85e723ee24ae2eac825220952bb | 368 | require "bundler/setup"
require "tk_component"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect_with... | 24.533333 | 66 | 0.755435 |
87319a136ecd2573d687ba9c80174bdbf8eaafee | 6,917 | =begin
#Kubernetes
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.2.3
=end
require 'date'
module Kubernetes
# IngressList is a collecti... | 30.471366 | 279 | 0.628596 |
f81d0d98deebd89e2815818a3769a51485b93759 | 2,036 | require 'spec_helper'
describe Spice::Connection do
before do
Spice.mock
end
after do
Spice.reset
end
let(:connection) do
Spice::Connection.new
end
describe "#clients" do
before do
stub_get("/search/client?q=%2A%3A%2A&sort=X_CHEF_id_CHEF_X+asc&start=0&rows=1000").
# ... | 24.829268 | 102 | 0.624263 |
08723ec1e532c6e837c150a104f7d546f5fe8582 | 6,971 | include_recipe 'bcpc-hadoop::hadoop_config'
::Chef::Recipe.send(:include, Bcpc_Hadoop::Helper)
::Chef::Resource::Bash.send(:include, Bcpc_Hadoop::Helper)
ruby_block 'create-yarn-directories' do
block do
node.run_state[:bcpc_hadoop_disks][:mounts].each do |disk_number|
Chef::Resource::Directory.new("/disk/#... | 40.294798 | 167 | 0.704347 |
6aed99bc836be2bf8f12a8737522b9df585a2399 | 1,260 | # frozen_string_literal: true
require 'shark_on_lambda/rake_tasks'
RSpec.describe 'Rake task `shark-on-lambda:routes`' do
subject(:task) do
Rake::Task.tasks.find { |task| task.name == 'shark-on-lambda:routes' }
end
before do
Class.new(SharkOnLambda::Application)
SharkOnLambda.application.routes.dra... | 35 | 80 | 0.568254 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.