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 |
|---|---|---|---|---|---|
918a85158f83ec29b1a05dae7ea29183869cc866 | 2,677 | require 'ostruct'
require_relative '../spec_helper_lite'
require_relative '../fixtures/models/tag_list'
describe TagList do
include Conversions
describe "given a blank string" do
before do
@it = TagList.new("")
end
it "is empty" do
@it.must_be_empty
end
it "stringifies to the emp... | 20.751938 | 64 | 0.617482 |
26778083c5190ea4d9ae46b365a15e8c590cbf00 | 1,021 | class Githubris::OAuth
REQUEST_ACCESS_URL = Addressable::URI.parse("https://github.com/login/oauth/authorize")
def initialize(client_id, client_secret, api=Githubris::API.new)
@client_id = client_id
@client_secret = client_secret
@api = api
end
def request_access_url(query={})
add_query_params... | 24.309524 | 89 | 0.688541 |
6a17d932d034efe2eb5979204432ed87c1a8efe2 | 2,744 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe GitlabSchema.types['TerraformStateVersion'] do
include GraphqlHelpers
it { expect(described_class.graphql_name).to eq('TerraformStateVersion') }
it { expect(described_class).to require_graphql_authorizations(:read_terraform_state) }
describe... | 33.876543 | 126 | 0.667638 |
1c61d3c888955760b71dede53cef785145ae4029 | 2,657 | class User < ApplicationRecord
include Mergeable
enum sync_approval_status: {
requested: 'requested',
allowed: 'allowed',
denied: 'denied'
}, _prefix: true
has_secure_password
has_many :user_facilities, dependent: :delete_all
has_many :facilities, through: :user_facilities
has_many :blood_p... | 24.376147 | 118 | 0.736921 |
5d328efe0079f3e8ef4fa70763d8b17c3dbd99fc | 848 | class MainController < ApplicationController
before_action :current_election
def search
if @current_election.state == 'all'
@states = State.ransack(name_cont: search_params).result(distinct: true)
end
@districts = District.election(@current_election).
ransack(name_cont: search_params).resul... | 27.354839 | 78 | 0.658019 |
1cc74a6c7b9c98dd9e81364189e5e42b49bc8dce | 3,687 | require "app/presenters/weekly_calendar_presenter"
require "app/queries/show_weekly_calendar"
RSpec.describe Carpanta::Presenters::WeeklyCalendarPresenter do
let(:date) { Date.new(2021, 1, 28) }
let(:weekly_calendar) do
Carpanta::Queries::ShowWeeklyCalendar::WeeklyCalendar.new(
date: Domain::Shared::Date... | 28.145038 | 102 | 0.66287 |
110a1d85b72c5acb1f865adc4cb5319186e11ea4 | 779 | actions :add, :remove, :enable, :disable
default_action :add
attribute :service, kind_of: String, required: true,
equal_to: %w(accessibility calendar contacts icloud location reminders)
attribute :applications, kind_of: [Array, NilClass], default: nil
attribute :user, kind_of: [String, NilClass], ... | 48.6875 | 103 | 0.758665 |
1a004997249e8d596a3c07af939469c9886581cc | 180 | class CreateTestLogs < ActiveRecord::Migration
def change
create_table :test_logs do |t|
t.string :cno
t.integer :city_code
t.timestamps
end
end
end
| 16.363636 | 46 | 0.666667 |
39d88336061f24abc153abe30dc2c2b4ffa0c4f3 | 502 | class Agents::SessionsController < Devise::SessionsController
# before_filter :configure_sign_in_params, only: [:create]
# GET /resource/sign_in
# def new
# super
# end
# POST /resource/sign_in
# def create
# super
# end
# DELETE /resource/sign_out
# def destroy
# super
# end
# prote... | 19.307692 | 69 | 0.691235 |
08a24234e7896c8a7f58f4ab2de7388380b32a3a | 8,199 | # frozen_string_literal: true
require 'spec_helper'
describe 'validate_x509_rsa_key_pair' do
let(:valid_cert) do
<<DOC
-----BEGIN CERTIFICATE-----
MIIC9jCCAeCgAwIBAgIRAK11n3X7aypJ7FPM8UFyAeowCwYJKoZIhvcNAQELMBIx
EDAOBgNVBAoTB0FjbWUgQ28wHhcNMTUxMTIzMjIzOTU4WhcNMTYxMTIyMjIzOTU4
WjASMRAwDgYDVQQKEwdBY21lIENvMIIBIjA... | 45.049451 | 165 | 0.832297 |
03c4b2151dd5c4791019ba07a2ccc0d6170a34ca | 136 | require 'test_helper'
class FoodControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
| 17 | 58 | 0.735294 |
21cd59856a013bedfcc740b0c89668129bbd4253 | 1,438 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v3/services/invoice_service.proto
require 'google/protobuf'
require 'google/ads/google_ads/v3/enums/month_of_year_pb'
require 'google/ads/google_ads/v3/resources/invoice_pb'
require 'google/api/annotations_pb'
require 'google/ap... | 38.864865 | 155 | 0.757302 |
62dd81185305d6c8cad5a60ca186796d03954ccb | 471 | module Pod
module Generator
class BridgeSupport
extend Executable
executable :gen_bridge_metadata
attr_reader :headers
def initialize(headers)
@headers = headers
end
def search_paths
@headers.map { |header| "-I '#{header.dirname}'" }.uniq
end
def... | 20.478261 | 103 | 0.59448 |
0320087ee8f0819cfd7f04030d6e30eb6f212f65 | 94 | class Tag < ActiveRecord::Base
has_many :taggings
has_many :tasks, through: :taggings
end
| 18.8 | 37 | 0.755319 |
edff3b0c55e0053fb558bec68281fff2c2ada6c1 | 1,813 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class MetasploitModule < Msf::Exploit::Remote
Rank = GreatRanking
include Msf::Exploit::Remote::Tcp
def initialize(info = {})
super(update_info(info,
... | 27.892308 | 107 | 0.548814 |
38094eecebf968a51ed800b1c91a550fc498de86 | 5,677 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/logging/v2/logging.proto
require 'google/api/client_pb'
require 'google/api/field_behavior_pb'
require 'google/api/monitored_resource_pb'
require 'google/api/resource_pb'
require 'google/logging/v2/log_entry_pb'
require 'google/logging/v2/logg... | 52.564815 | 192 | 0.759732 |
4aeb103504c563a92bae1e07bffac54ef742a8d7 | 6,737 | require 'mechanize/test_case'
class TestMechanizePage < Mechanize::TestCase
def setup
super
@uri = URI 'http://example/'
end
def test_selector_methods
page = html_page <<-BODY
<html>
<meta>
<head><title></title>
<body>
<span class="name" id="out">Eamonn</span>
<span>/</span>
<spa... | 23.975089 | 122 | 0.61229 |
033db15b074d95fa648658993f869eef16175f3c | 4,748 | require 'spec_helper'
describe Unread::Reader do
before :each do
@reader = Reader.create! :name => 'David'
@other_reader = Reader.create :name => 'Matz'
wait
@email1 = Email.create!
wait
@email2 = Email.create!
end
describe :have_not_read do
it "should return all readers that have no... | 29.490683 | 93 | 0.661752 |
012b611f86e83bc9e17c4f5f005abdacdb042379 | 721 | # frozen_string_literal: true
module HTTP
module Features
class AutoInflate < Feature
def wrap_response(response)
return response unless %w[deflate gzip x-gzip].include?(response.headers[:content_encoding])
Response.new(
:status => response.status,
:version => response.v... | 27.730769 | 100 | 0.644938 |
6a1ed85ee0ced7fb4ba9d60daaeedac5eb413a06 | 3,299 | module Grids::Configuration
class InProjectBaseRegistration < ::Grids::Configuration::Registration
widgets 'work_packages_table',
'work_packages_graph',
'project_description',
'project_details',
'subprojects',
'work_packages_calendar',
'work_... | 27.264463 | 83 | 0.644135 |
39fafa4d2697332d5756e4c14ee075ab9ac017f7 | 164 | module TulOhist::Models
class Av < ActiveFedora::Base
has_metadata name: "base", label: "Base metadata", type: TulOhist::Datastreams::BaseDatastream
end
end | 32.8 | 98 | 0.75 |
619780e346c82161836b1fdccbd8957dc8473b6f | 3,826 | require 'spec_helper'
require 'excursion/datastores/memcache'
describe 'Excursion::Datastores::Memcache' do
def dummy_pool
Excursion::Specs::DUMMY_MEMCACHE_SERVER
end
def fill_pool
dc = Dalli::Client.new dummy_pool, {namespace: 'excursion'}
dc.flush_all
Excursion::Specs::Mocks::SIMPLE_VALUES.ea... | 28.552239 | 127 | 0.650549 |
913f979158a91fe4ff6511645913e6d523a6b74e | 148 | class AddPasswordResetSentAtToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :password_reset_sent_at, :datetime
end
end
| 24.666667 | 66 | 0.790541 |
08e7436b9834895d9a1a2292c1cfb6ca56b9deb0 | 4,972 | require "set"
module Onceler
module Recordable
def self.extended(instance)
instance.instance_eval do
@__retvals = {}
@__inherited_retvals = {}
@__ignore_ivars = instance_variables
end
end
def __prepare_recording(recording)
method = recording.name
define_si... | 31.468354 | 121 | 0.615044 |
03344db8d2d14cc55c8f3e76af2cabe89e694840 | 26,795 | # frozen_string_literal: true
require "active_support/core_ext/array/extract_options"
require "active_support/core_ext/hash/keys"
require "active_support/core_ext/object/inclusion"
require "action_view/helpers/asset_url_helper"
require "action_view/helpers/tag_helper"
module ActionView
# = Action View Asset Tag Hel... | 48.192446 | 156 | 0.608621 |
62089d9571b386b7f4a9738677a62a7f6be7f118 | 841 | module CMS
class Settings
DEFAULT_MODE = 'published'.freeze
def initialize(settings, session)
@settings = settings
@session = session
end
def render_draft_content?
admin? && cms_session.draft?
end
def admin?
valid_token?(user_cms_token)
end
def valid_token?... | 18.688889 | 73 | 0.637337 |
e865c0ea619b38af8db0f6a6790e1e6321b50d35 | 7,089 | # encoding: utf-8
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# /spec/fixtures/responses/whois.ati.tn/tn/status_registered.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#
require 'spec_helper'
require 'w... | 43.22561 | 120 | 0.703061 |
9150a0feb5b6e9391824cdfb3585389348e3207a | 1,795 | class Daq < Formula
desc "Network intrusion prevention and detection system"
homepage "https://www.snort.org/"
url "https://www.snort.org/downloads/snort/daq-2.0.6.tar.gz"
sha256 "b40e1d1273e08aaeaa86e69d4f28d535b7e53bdb3898adf539266b63137be7cb"
bottle do
cellar :any
sha256 "d01c68e8ece0df01a1132b959... | 35.9 | 106 | 0.707521 |
d59edfa3d5cbc16f1f077d15a560b2d68d464682 | 1,253 | $:.unshift(File.expand_path('../../lib/', __FILE__))
require_relative '../lib/mkto_rest'
# or require 'mkto_gem' if you installed the gem
require 'yaml'
=begin
This script looks for the hostname, client id and key in .mktorest.
Create that file with the following (yaml) format:
---
:hostname: ''
:client_... | 21.982456 | 124 | 0.682362 |
d5b55625a0675e94c6ee21c2fe82f19adb932d8b | 2,040 | require_relative '../../../libraries/helpers'
describe 'find_carbon_cache_services' do
let(:node) do
Hash[
'graphite' => {
'carbon' => {
'service_type' => 'runit',
'caches' => {
'a' => { 'line_reciever_port' => 2003 },
'b' => { 'line_reciever_port' => 200... | 29.565217 | 86 | 0.617647 |
39b7ef338276eea1f362725cf4a0984facbd06f6 | 6,276 | # encoding: utf-8
# Set the default text field size when input is a string. Default is nil.
# Formtastic::FormBuilder.default_text_field_size = 50
# Set the default text area height when input is a text. Default is 20.
# Formtastic::FormBuilder.default_text_area_height = 5
# Set the default text area width when inpu... | 55.052632 | 121 | 0.775972 |
b9e0dcc177930b1ac84afb0fbd3733a0754cf991 | 3,109 | # Copyright::
# Copyright (C) 2011 MISHIMA, Hiroyuki <missy at be.to / hmishima at nagasaki-u.ac.jp>
# License:: The Ruby licence (Ryby's / GPLv2 dual)
#
# In the hg18 database, this table is actually separated
# into "chr1_*", "chr2_*", etc. This class dynamically
# define *::Chr1_*, *::Chr2_*, etc. The
# Rmsk.f... | 37.914634 | 120 | 0.547121 |
61bfca8a11205d61e46144817f145166f8b696f3 | 4,952 | # frozen_string_literal: true
desc "Releases pending gems for a pull request"
long_desc \
"This tool continues the releases associated with a release pull request." \
" It is normally used to retry or continue releases that aborted due to" \
" an error. This tool is normally called from a GitHub Actions wor... | 34.873239 | 87 | 0.681543 |
2662c129538f4f740211dca3a6d5382e4f16c94c | 3,120 | # frozen_string_literal: true
RSpec.describe "bundle install with :allow_offline_install" do
before do
bundle "config set allow_offline_install true"
end
context "with no cached data locally" do
it "still installs" do
skip "corrupt test gem" if Gem.win_platform?
install_gemfile! <<-G, :arti... | 31.515152 | 144 | 0.605769 |
ab44d37bebf16be599847516c4156322feb75a90 | 1,678 | cask 'keybase' do
version '1.0.47-20180508010858,c06519b740'
sha256 'd58d857a72d5710c68b42fb7432d11e46edb6e393fc66d0e5961b4ba4be26bb4'
url "https://prerelease.keybase.io/darwin-updates/Keybase-#{version.before_comma}%2B#{version.after_comma}.zip"
appcast 'https://prerelease.keybase.io/update-darwin-prod-v2.jso... | 37.288889 | 113 | 0.557211 |
ff2b04db66853cfcdf8fbd28e0e6d2e45a03b17e | 247 | class BadChecksum < TestCask
version '1.2.3'
sha256 'badbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadbadb'
url TestHelper.local_binary_url('caffeine.zip')
homepage 'http://example.com/local-caffeine'
app 'Caffeine.app'
end
| 24.7 | 75 | 0.793522 |
4a4a25ea5318fcf9492ff9bd4e329118713bc5fc | 1,253 | require_relative 'boot'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "action_cable/eng... | 34.805556 | 82 | 0.775738 |
187c88b96004c2912b2d47a4e9fa30e7c4eac3f3 | 2,038 | require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "binary sequence store" do
it "should be able to load sequences" do
path = File.join TEST_DATA_DIR, '1', 'CnyUnifiedSeq'
seqs = Bio::Velvet::Underground::BinarySequenceStore.new path
seqs[1].should == 'CACTTATCTCTACCAAAGATCACGATTT... | 41.591837 | 374 | 0.748773 |
1cdbfe08a49726ac96e328811617ada44baaa0ef | 1,461 | module HeadlineChoice
def get_headlines(source)
@headlines = []
case source.to_s
when "espn"
self.scrape_espn
get_choice("espn")
when "mlb"
self.scrape_mlb
get_choice("mlb")
when "cbs"
self.scrape_cbs
get_choice("cbs")
when "fox"
... | 24.762712 | 65 | 0.546201 |
336ac9f314192a87625b99aa8036d3aacbe47ac2 | 767 | require 'test_helper'
class StaticPagesControllerTest < ActionDispatch::IntegrationTest
def setup
@base_title = 'Post Blog Service'
end
test 'should get root' do
get root_path
assert_response :success
end
test 'should get home' do
get root_path
assert_response :success
assert_select '... | 23.242424 | 65 | 0.70013 |
1cb4da6273db9e9dbf86e33539fbfd52626bbb20 | 42 | module LunarShell
VERSION = "0.5.2"
end
| 10.5 | 19 | 0.690476 |
6284d1b1d50ed46d76ca0bb2d28d71e0168f8c35 | 969 | # 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... | 42.130435 | 86 | 0.768834 |
ed69a5f5cecb5028148db1fe0aac15ecbf70e268 | 17,138 | # typed: false
# frozen_string_literal: true
require "formula_installer"
require "unpack_strategy"
require "utils/topological_hash"
require "cask/config"
require "cask/download"
require "cask/staged"
require "cask/quarantine"
require "cgi"
module Cask
# Installer for a {Cask}.
#
# @api private
class Install... | 31.16 | 120 | 0.664838 |
1a693a6793eca76bc85f16470b6930529ac37c1d | 71,334 | # 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... | 60.299239 | 477 | 0.580761 |
872862a01c2bebea64693a438d72e07e3d0eb9d7 | 586 | class Libbsd < Formula
desc "Utility functions from BSD systems"
homepage "https://libbsd.freedesktop.org/"
url "https://libbsd.freedesktop.org/releases/libbsd-0.11.3.tar.xz"
sha256 "ff95cf8184151dacae4247832f8d4ea8800fa127dbd15033ecfe839f285b42a1"
license "BSD-3-Clause"
depends_on "libmd"
depends_on :li... | 25.478261 | 75 | 0.699659 |
62aad48a3e5bcf2a4f842abb3c25c6683fbff71c | 10,334 | class User < ActiveRecord::Base
acts_as_authentic do |config|
config.validates_uniqueness_of_email_field_options = {if: -> { false }} # Don't validate email uniqueness
config.crypto_provider = Authlogic::CryptoProviders::Sha1
Authlogic::CryptoProviders::Sha1.join_token = ''
Authlogic::CryptoProviders:... | 33.993421 | 154 | 0.692471 |
33c24c7588440c0552907d90610c8787d4596e6b | 3,315 | module Heirloom
module CLI
class Rotate
include Heirloom::CLI::Shared
def self.command_summary
'Rotate keys for an Heirloom'
end
def initialize
@opts = read_options
@logger = HeirloomLogger.new :log_level => @opts[:level]
@config = load_config :logger => ... | 38.103448 | 110 | 0.505581 |
0375c4428f064aab2a4fb37d9e97bae62803334d | 11,335 | # 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... | 36.682848 | 123 | 0.550243 |
e2bedae09bae22b4745cff21fe956018876ec858 | 421 | class User < ActiveRecord::Base
# Include default devise modules.
# notice that :omniauthable is not included in this block
# notice that :confirmable is not included in this block
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
# note that thi... | 38.272727 | 71 | 0.764846 |
11671c65fc6ff1b7fcef30e8ed636637eee44a54 | 15,113 | require 'helper'
describe Octokit::Client::Apps do
before(:each) do
Octokit.reset!
@client = oauth_client
@jwt_client = Octokit::Client.new(:bearer_token => new_jwt_token)
use_vcr_placeholder_for(@jwt_client.bearer_token, '<JWT_BEARER_TOKEN>')
end
after(:each) do
Octokit.reset!
end
... | 37.224138 | 128 | 0.701383 |
7a5d0cd47bf065c09118572268f0bb971755ce97 | 1,190 | require "spec_helper"
require "core_ext/hash_replace_key"
RSpec.describe HashReplaceKey do
describe "#replace_key" do
it "replaces a key with a given replacement and returns a new hash" do
original = { foo: "bar" }
new_hash = original.replace_key(:foo, :baz)
expect(new_hash).to include(baz: "... | 26.444444 | 74 | 0.660504 |
1a672c410dea637750b23c8b75acf46120b794ef | 1,032 | #
# Project:: Ansible Role - Linux Users
#
# Copyright 2020, Route 1337, LLC, All Rights Reserved.
#
# Maintainers:
# - Matthew Ahrenstein: matthew@route1337.com
#
# See LICENSE
#
# Prereqs tests
if ['ubuntu', 'centos'].include?(os[:name])
# Verify zsh is installed
describe package('zsh') do
it { should be_i... | 21.5 | 94 | 0.670543 |
ffc87de98d2f1195e767251b3e510d73b1eddf22 | 222 | require_relative './deploy/logger'
require_relative './deploy/aws'
require_relative '../tasks/task_builder'
module Deploy
def logger(file = 'log/deploy.log')
Logger.logger(file)
end
module_function :logger
end
| 18.5 | 40 | 0.747748 |
87bc689ecfea40c867cba654548f8dac9cab90d2 | 524 | require 'spec_helper'
describe DeleteClassificationWorker do
it 'deletes the classification if it exists' do
workflow = create :workflow
subject = create :subject
classification = create :classification, workflow: workflow, subject: subject
described_class.new.perform(classification.id)
expect(C... | 27.578947 | 81 | 0.755725 |
1c26512224db743fc409153533e7828ca8f84558 | 1,852 | class TasksController < ApplicationController
before_action :set_task, only: [ :show, :update, :destroy ]
def index
tasks = TaskBlueprint.render Task.sorted
render json: tasks
end
def show
render json: TaskBlueprint.render(@task, view: :extended)
end
def create
if @task = Task.create(task_... | 25.722222 | 119 | 0.675486 |
2624d01cf0143c551d3ab1e0f7ad65c8c2dad24f | 1,214 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::MediaServices::Mgmt::V2019_05_01_preview
module Models
#
# The LiveEvent action input parameter definition.
#
class LiveEventActionInput
... | 26.391304 | 75 | 0.582372 |
6199699787216c992534742a8d198dff23ed0fa5 | 796 | # Uncomment this if you reference any of your controllers in activate
# require_dependency 'application'
class FlashContentExtension < Radiant::Extension
version "0.1"
description "Adds tags to make it easier to embed Adobe Flash content"
url "http://github.com/ceaser/radiant-flash_content-extension"
# defi... | 27.448276 | 121 | 0.722362 |
28ac102db5f06a02cc87505039b378254d1c32e1 | 149 | class CreateUserBadges < ActiveRecord::Migration
def change
create_table :user_badges do |t|
t.timestamps null: false
end
end
end
| 16.555556 | 48 | 0.711409 |
0391a5f1ac7ac3d979f0b462073f3b2c624b4d16 | 4,484 | # encoding: UTF-8
require 'minitest/autorun'
require 'yaml'
require 'big_query'
require 'pry-byebug'
module BigQuery
class Client
attr_accessor :client
end
end
class BigQueryTest < MiniTest::Unit::TestCase
def setup
@bq = BigQuery::Client.new(config)
if @bq.tables_formatted.include? 'test'
@bq... | 28.201258 | 124 | 0.624665 |
6a711c17af4db3919d4314a206e586aadd2b9acf | 406 | module Diversities
class ReligionForm < Form
RELIGION = ["no-religion",
"christian-including-church-of-england-catholic-protestant-and-all-other-christian-denominations",
"buddhist", "hindu", "jewish", "muslim", "sikh",
"prefer-not-to-say", "any-other-religion"].fre... | 33.833333 | 114 | 0.64532 |
ff0cd8c57f2b874823b9c73494232efeccbc34a1 | 2,084 | # frozen_string_literal: true
# Model class for 1910 US Census records.
class Census1910Record < CensusRecord
self.table_name = 'census_1910_records'
alias_attribute :profession, :occupation
belongs_to :locality, inverse_of: :census1910_records
validates :language_spoken, vocabulary: { name: :language, all... | 25.108434 | 124 | 0.681862 |
6a0260025206103e0de7d0e235c0a256bc9329e3 | 153 | # frozen_string_literal: true
class ETL::PersonSyncer < ETL::Syncer
def origin_class
::Person
end
def target_class
ETL::Person
end
end
| 12.75 | 37 | 0.705882 |
f7f10674a828e5dee544d44e11939603235b3644 | 1,637 | class PlacesController < ApplicationController
def index
@places = Place.all.paginate(:page => params[:page])
end
def show
@place = Place.find(params[:id])
end
# def new
# @place = Place.new
# end
# def create
# @place = Place.new(place_params)
# if @place.save
# redirect_to @place
# ... | 20.987179 | 173 | 0.651802 |
ffa0505bc36204d0f4328d749a0c538ca5461793 | 2,142 | ##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = GreatRankin... | 30.169014 | 92 | 0.548553 |
ac81a2aac7690c1a7043fec7403826d5bb22614b | 18,798 | require 'sidekiq/web'
require 'api/api'
Gitlab::Application.routes.draw do
if Gitlab::Sherlock.enabled?
namespace :sherlock do
resources :transactions, only: [:index, :show] do
resources :queries, only: [:show]
resources :file_samples, only: [:show]
collection do
delete :... | 27.204052 | 184 | 0.537717 |
bfddea2ccd776e6ef47bdec5c370721fc4dacefb | 1,584 | require 'puppet/provider/mikrotik_api'
Puppet::Type.type(:mikrotik_interface_bridge).provide(:mikrotik_api, :parent => Puppet::Provider::Mikrotik_Api) do
confine :feature => :mtik
mk_resource_methods
def self.instances
interfaces = Puppet::Provider::Mikrotik_Api::get_all("/interface/bridge")
instance... | 28.285714 | 114 | 0.600379 |
f71a8e64b2595bab3748e01e5bdaa2a77a3e6a15 | 223 | require "rails_helper"
RSpec.describe HearingType, type: :model do
it { is_expected.to belong_to(:casa_org) }
it { is_expected.to validate_presence_of(:active) }
it { is_expected.to validate_presence_of(:name) }
end
| 27.875 | 53 | 0.757848 |
61c6a4c8acb353bbbb62f8417cb6f7cff152a018 | 1,943 | module Quickbooks
module Model
class PurchaseOrder < BaseModel
include GlobalTaxCalculation
#== Constants
REST_RESOURCE = 'purchaseorder'
XML_COLLECTION_NODE = "PurchaseOrder"
XML_NODE = "PurchaseOrder"
xml_accessor :id, :from => 'Id', :as => Integer
xml_accessor :sync_... | 47.390244 | 116 | 0.672156 |
033fe054283fed849c872c1e53daf43d1f6bf690 | 979 | # -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rubycas-server-core/version'
Gem::Specification.new do |gem|
gem.name = "rubycas-server-core"
gem.version = RubyCAS::Server::Core::Version::STRING
gem.authors ... | 42.565217 | 114 | 0.664964 |
d58f8ecf28b580eb140a06f21af93112953ff288 | 1,896 | require 'setka/workflow/version'
# Ruby implementations of Setka Workflow API for integration an external
# publishing platform written in the Ruby language with Setka Workflow.
#
# First of all access token should be obtained. It can be acomplished on
# Integration page of Settings
# (https://workflow.setka.io/spacen... | 28.298507 | 72 | 0.684072 |
4a359aa9b7aa5ca9077ec565a2cf3ca1ca92e309 | 1,750 | class Zshdb < Formula
desc "Debugger for zsh"
homepage "https://github.com/rocky/zshdb"
url "https://downloads.sourceforge.net/project/bashdb/zshdb/1.1.2/zshdb-1.1.2.tar.gz"
sha256 "bf9cb36f60ce6833c5cd880c58d6741873b33f5d546079eebcfce258d609e9af"
license "GPL-3.0"
# We check the "zshdb" directory page bec... | 34.313725 | 95 | 0.698286 |
b917e8629f597f797f3ca6ecf15d21fa2a518c68 | 329 | require "ruby-cbc/version"
require "cbc-wrapper"
module Cbc
end
files = %w[
conflict_solver
model
problem
version
ilp/constant
ilp/constraint
ilp/objective
ilp/term
ilp/term_array
ilp/var
utils/compressed_row_storage
]
files.each do |file|
require File.expand_path("../ruby-cbc/#{file}", __FIL... | 13.708333 | 59 | 0.723404 |
f7bf4a41299962fb95253960abf9e9bf8304b72a | 37,827 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'MODS titleInfo <--> cocina mappings' do
describe 'Basic title' do
# How to ID: only subelement of titleInfo is title and no titleInfo type attribute
it_behaves_like 'MODS cocina mapping' do
let(:mods) do
<<~XML
<tit... | 28.527149 | 166 | 0.399662 |
39e32103122e0e31192e8052c8a602c84d7476ea | 3,372 | require 'fastlane_core/ui/ui'
module Fastlane
UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
module Helper
class InstallProvisioningProfileHelper
def self.show_message
UI.message("Hello from the install_provisioning_profile plugin helper!")
end
def self.install_profile_f... | 40.142857 | 163 | 0.700474 |
bfe3c7634c1c05eec6892766aa1e915911bcfb2a | 1,163 | # frozen_string_literal: true
require 'common/client/concerns/service_status'
require 'common/models/base'
require 'ihub/models/appointment'
module IHub
module Appointments
class Response < Common::Base
include Common::Client::Concerns::ServiceStatus
attribute :status, Integer
attribute :appo... | 20.767857 | 77 | 0.60877 |
38a06617f19656852ac5905f09cbbf154bb9bd3c | 838 | #update forum information
require "rubygems"
require "rest_client"
require "json"
# Need to specify category_id,forum_id in url
# eg:
# site = RestClient::Resource.new("http://domain.freshdesk.com/categories/4/forums/11.json","sample@freshdesk.com","test")
site = RestClient::Resource.new("http://domain.freshdesk.com... | 46.555556 | 198 | 0.757757 |
91df74a2de6e0793c4671c782adb620ce3db398d | 488 | module Ownlan
module Attack
class Client < Base
def process
generate_packet
send_packet
end
def generate_packet(target_ip = nil)
gw_ip = ServiceObjects::NetworkInformation.gateway_ip
saddr = config.source_mac
daddr = config.victim_mac || victi... | 19.52 | 77 | 0.625 |
ac81831d11919eaaa66c08e6b957b6125e27f45e | 116 | define :openldap_client, :mothra => "a big monster" do
cat "#{params[:name]}" do
pretty_kitty true
end
end
| 19.333333 | 54 | 0.663793 |
1c766c4e839256c2f4c098ba22da03d5523a5dcc | 10,391 | # Copyright 2018 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, so... | 32.987302 | 98 | 0.640458 |
080ac62df2363f307d63a6ab9497ffe3c878a23d | 6,825 | #!/usr/bin/env oo-ruby
#--
# Copyright 2013 Red Hat, 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 applicabl... | 31.597222 | 132 | 0.717509 |
f7b53b722b4380b7e1803be4622ff85a73346ccb | 80 | module Merb
module StaticPagesHelper
end # StaticPagesHelper
end # Merb | 16 | 26 | 0.75 |
87ae9ca7d274980fb0fc3d5818fcb22b72c229f1 | 3,458 | #
# Copyright (c) 2015 - 2018 Luke Hackett
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modif... | 42.691358 | 105 | 0.744361 |
280d295e26046ba675d05dd83e63989f609f8cd4 | 113 | module AthenaHealth
class PatientCollection < BaseCollection
attribute :patients, Array[Patient]
end
end
| 18.833333 | 42 | 0.787611 |
7a2c9ed5e8bca277864d8f57f8e227d0a33c85e0 | 3,378 | module Api
module V3
module CountriesComTradeIndicators
class ComTradeRequest
class ComTradeError < StandardError; end
RG_TO_ACTIVITY = {
1 => 'importer',
2 => 'exporter'
}
def initialize(uri)
@uri = URI(uri)
end
def call
... | 28.627119 | 78 | 0.541741 |
91825fc124a350d4ad40ce25d37a0ea1af2022cf | 16,867 | class PhpAT56 < Formula
desc "General-purpose scripting language"
homepage "https://secure.php.net/"
url "https://php.net/get/php-5.6.38.tar.xz/from/this/mirror"
sha256 "c2fac47dc6316bd230f0ea91d8a5498af122fb6a3eb43f796c9ea5f59b04aa1e"
revision 2
bottle do
sha256 "a4d5ae99450c84af82dd65248d78981f34251f... | 32.815175 | 198 | 0.63479 |
0143bf693c7d327aed98b375754b9e584cdf12ea | 10,583 | # frozen_string_literal: true
RSpec.shared_examples 'a multiple recipients email' do
it 'is sent to the given recipient' do
is_expected.to deliver_to recipient.notification_email
end
end
RSpec.shared_examples 'an email sent from GitLab' do
it 'has the characteristics of an email sent from GitLab' do
sen... | 37.133333 | 152 | 0.73174 |
4a507e61a21420b816316575f364c04151218c3a | 1,727 | class GitTown < Formula
desc "High-level command-line interface for Git"
homepage "https://www.git-town.com/"
url "https://github.com/git-town/git-town/archive/v7.4.0.tar.gz"
sha256 "f9ff00839fde70bc9b5024bae9a51d8b00e0bb309c3542ed65be50bb8a13e6a5"
license "MIT"
bottle do
rebuild 1
sha256 cellar: :... | 42.121951 | 122 | 0.730168 |
accf8308f27d70c515eb6de22c9785d3d84a40fb | 206 | Rails.configuration.stripe = {
:publishable_key => 'pk_test_HFtPBBUHWHIoJAqmb2YVhhbX',
:secret_key => 'sk_test_5fwH9FxRW7oP3u4eHYLfnPJH'
}
Stripe.api_key = Rails.configuration.stripe[:secret_key]
| 29.428571 | 57 | 0.776699 |
5d353ab4938df63c934392548fae583748b5f6f0 | 40 | module PistePal
VERSION = "1.2.0"
end
| 10 | 19 | 0.675 |
1828c5925ed3addad99508b7f8b0011e674ef241 | 344 | module FbGraph
module Connections
module Noreply
def noreply(options = {})
members = self.connection(:noreply, options)
members.map! do |member|
User.new(member[:id], member.merge(
:access_token => options[:access_token] || self.access_token
))
end
... | 24.571429 | 72 | 0.584302 |
5d4cc6caa1ea4a23cb38cbaf3f00a0048763da2f | 1,284 | cask 'airfoil' do
version '5.8.6'
sha256 '57cd3c272332c9f2398fb2fc6517dfdb757c9b52fbb30e5e317f0bd45f837846'
url 'https://rogueamoeba.com/airfoil/download/Airfoil.zip'
appcast 'https://rogueamoeba.net/ping/versionCheck.cgi?format=sparkle&bundleid=com.rogueamoeba.Airfoil&platform=osx'
name 'Airfoil'
homepage... | 40.125 | 118 | 0.655763 |
6130b3d74ce58d99980a212aa285d08825f0c4c8 | 2,934 | name "chef"
default_version "local_source"
license :project_license
# For the specific super-special version "local_source", build the source from
# the local git checkout. This is what you'd want to occur by default if you
# just ran omnibus build locally.
version("local_source") do
source path: File.expand_path("... | 33.340909 | 96 | 0.732106 |
79363ab406d056bba3ed2048f48592e28a88bd42 | 1,167 | class Quex < Formula
desc "Generate lexical analyzers"
homepage "http://quex.org/"
url "https://downloads.sourceforge.net/project/quex/DOWNLOAD/quex-0.68.2.tar.gz"
sha256 "b6a9325f92110c52126fec18432d0d6c9bd8a7593bde950db303881aac16a506"
head "https://svn.code.sf.net/p/quex/code/trunk"
bottle do
cellar... | 31.540541 | 93 | 0.713796 |
f7178e3ca8875c9403352d856542c1d65e992991 | 60 | class Meal < ApplicationRecord
belongs_to :category
end
| 15 | 30 | 0.783333 |
2854e06f4b7ea0a08c87484eab4ae362fa3ac84d | 4,851 | require "spec_helper"
require "pry"
describe Liql do
let(:layout) { File.read(File.expand_path("../support/layout.html.liquid", __FILE__)) }
it "has a version number" do
expect(Liql::VERSION).not_to be nil
end
it "binds assigns on static values" do
mapping = Liql.parse(<<-LIQUID)
{% assign foo ... | 33.455172 | 99 | 0.647289 |
18055f1e99512a4eaec6d6f7a842ba87f79ef70e | 499 | class String
def base_conversion(src, dest)
x = self.chars.inject(0) { |acc, c|
acc * src + c.ord - '0'.ord
}
result = ""
while x > 0
div, mod = x.divmod(dest)
result = (mod + (mod < 10 ? '0'.ord : 'A'.ord - 10)).chr + result
x... | 23.761905 | 85 | 0.418838 |
1d579ce6802fcad5d05289cc3897d66600ab2846 | 1,285 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'I18ner/version'
Gem::Specification.new do |spec|
spec.name = "I18ner"
spec.version = I18ner::VERSION
spec.authors = ["Adam Panzer"]
spec.email = ["adam.panzer... | 34.72973 | 96 | 0.669261 |
39f015acec928335eacb41f0a4a1a6cc620e8e7b | 1,339 | # ruby 5-math-and-numbers.rb
num_a = 5.0
num_b = 2.0
# Printing Numbers
print ("A: ")
puts (num_a)
print ("B: ")
puts (num_b)
# <== Printing Calcs ==>
print ("\nSum: ")
puts (num_a + num_b)
print ("Subtraction: ")
puts (num_a - num_b)
print ("Multiplication: ")
puts (num_a * num_b)
print ("Division: ")
puts... | 23.086207 | 92 | 0.646751 |
3859146729323dbd574383c84bb11f8f0ecd6986 | 867 | require_relative '../spec_helper'
require_lib 'reek/report'
RSpec.describe Reek::Report do
describe '.report_class' do
it 'returns the correct class' do
expect(described_class.report_class(:text)).to eq Reek::Report::TextReport
end
end
describe '.location_formatter' do
it 'returns the correct ... | 29.896552 | 116 | 0.745098 |
61303bf726ad75166bcabe031b4541a0887908ed | 1,246 | namespace :acceptance do
desc "displays components that can be tested"
task :components do
exec("vagrant-spec components --config=acceptance/vagrant-spec.config.rb")
end
task :setup do
box = 'alpine/alpine64'
box_version = '3.7.0'
provider_name = 'virtualbox'
box_owner, box_name = box.split... | 27.086957 | 149 | 0.639647 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.