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 |
|---|---|---|---|---|---|
0880fc60e563d650a1451563ba581108032ec806 | 1,505 | # frozen_string_literal: true
# ## Schema Information
#
# Table name: `fittings`
#
# ### Columns
#
# Name | Type | Attributes
# ------------------------------- | ------------------ | ---------------------------
# **`id`** | `bigint` | `not null,... | 33.444444 | 84 | 0.396678 |
bf516866618cd76ec537b75cb79f9b31e28efc8d | 2,456 | # 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... | 38.375 | 104 | 0.684853 |
ac256c736b155139d7ab0f273bccab9272594fe9 | 1,202 | # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "polaris/version"
Gem::Specification.new do |s|
s.name = "polaris"
s.version = Polaris::VERSION::STRING
s.platform = Gem::Platform::RUBY
s.authors = ["Shawn Anderson"]
s.email = %q{shawn42@gmail.com}
s.homepage = %... | 34.342857 | 89 | 0.676373 |
3859880f620467c49f982582e9f5ca681b57612e | 39 | module Pract06
VERSION = "0.1.0"
end
| 9.75 | 19 | 0.666667 |
395115ec72689d18f1cc5b04787a3c28356d07f1 | 881 | require 'spec_helper'
require 'dandy/routing/syntax/actions'
RSpec.describe Syntax::Actions do
describe 'parse' do
it 'correctly parses name' do
actions = Syntax::Actions.new('some-text', 2)
element1 = double(:element1)
element2 = double(:element2)
action1 = double(:action1)
actio... | 29.366667 | 75 | 0.671964 |
263cb5800a643c4a19996f6f6fbbf04a7606df9c | 558 | require 'rails_helper'
RSpec.shared_examples "model is #valid?" do
it "is #valid?" do
expect(subject).to be_valid
end
it "has no errors" do
expect { subject.valid? }
.to_not change { subject.errors.values }
.from([])
end
end
RSpec.shared_examples "model is not #valid?" do |expected_error_... | 20.666667 | 68 | 0.65233 |
4a09cf50607cd9f53e3911fdd1a7744e767d10bf | 2,801 | require "spec_helper"
module Terraforming
module Resource
describe NATGateway do
let(:client) do
Aws::EC2::Client.new(stub_responses: true)
end
let(:nat_gateways) do
[
{
nat_gateway_id: "nat-0c5b68b2c4d64e037",
subnet_id: "subnet-cd5645f7",
... | 30.11828 | 81 | 0.492324 |
03d34c5742ae7e506a17aae63422ac730d292ff1 | 853 | module ZATCA
class Tag
TAG_IDS = {
seller_name: 1,
vat_registration_number: 2,
timestamp: 3,
invoice_total: 4,
vat_total: 5
}.freeze
attr_accessor :id, :key, :value
def initialize(key:, value:)
@id = TAG_IDS[key]
@key = key
@value = value.to_s
end
... | 24.371429 | 82 | 0.635404 |
21bafa9935a7ebb1d705a2ef09fd70af32b92ab6 | 41,341 | require 'date'
require 'fileutils'
module TZInfo
module Data
# Utility methods used by TZDataParser and associated classes.
#
# @private
module TZDataParserUtils #:nodoc:
# Wrapper for File.open that supports passing hash options for specifying
# encodings on Ruby 1.9+. The options are i... | 30.600296 | 295 | 0.537771 |
d5f8ed0c081466176fb3a0d267ac316c8a8ed27d | 917 | require 'formula'
require File.expand_path("../../Requirements/php-meta-requirement", __FILE__)
require File.expand_path("../../Requirements/phar-requirement", __FILE__)
class Phpcpd < Formula
homepage 'https://github.com/sebastianbergmann/phpcpd'
url 'https://phar.phpunit.de/phpcpd-2.0.0.phar'
sha1 'b4bdf58928f... | 26.970588 | 126 | 0.708833 |
398839f800be170f959cee6705859cee18b31869 | 11,573 | module Depp
class Domain
include ActiveModel::Conversion
include RemoveHold
extend ActiveModel::Naming
attr_accessor :name, :current_user, :epp_xml
STATUSES = %w[
clientDeleteProhibited
clientHold
clientRenewProhibited
clientTransferProhibited
clientUpdateProhibited... | 32.69209 | 113 | 0.540655 |
d54332c2bd81ac31769a0e0e35b51ec5a833f067 | 12,657 | #!/usr/bin/env ruby
# -*- mode: ruby; coding: utf-8 -*-
require 'test/unit'
require 'opencv'
require File.expand_path(File.dirname(__FILE__)) + '/helper'
include OpenCV
# Tests for drawing functions of OpenCV::CvMat
class TestCvMat_drawing < OpenCVTestCase
def test_DRAWING_OPTION
CvMat::DRAWING_OPTION[:color].t... | 36.162857 | 102 | 0.623766 |
01fc8bd6d348f19f5a9753e30a219a1e600b5c56 | 21,202 | # == Schema Information
#
# Table name: people
#
# id :integer not null, primary key
# given_name :text
# surname :text
# email :text
# primary_phone_number :text
# secondary_phone_number :text
# location_in_building :text
# descriptio... | 33.128125 | 115 | 0.667343 |
e210f39b44454dcc0d975d6aba6c32dc7e73dd88 | 102 | class Api::V4::ApplicationSerializer < ActiveModel::Serializer
delegate :cache_key, to: :object
end
| 25.5 | 62 | 0.784314 |
012705ca6c180b9bbd5ad46ff1a477fda163dbee | 1,478 | # encoding: utf-8
require 'logstash/plugin_mixins/event_support'
require 'logstash-core'
require 'logstash/plugin'
module LogStash
module PluginMixins
module EventSupport
module EventFactoryAdapter
##
# @api internal
# @param base [Class]: a class that inherits `LogStash::Plugin`... | 30.791667 | 114 | 0.599459 |
0826fde7c02105ff2b2ccb44f53f4b0768b05551 | 533 | require 'carrierwave/processing/mime_types'
class ImportUploader < CarrierWave::Uploader::Base
include CarrierWave::MimeTypes
process :set_content_type
# Override the directory where uploaded files will be stored.
# This is a sensible default for uploaders that are meant to be mounted:
def store_dir
"u... | 28.052632 | 74 | 0.75985 |
87872e5d742a27575df909e0750a1e0889e53323 | 150 | module Cms
class BasicPage < ActiveRecord::Base
self.table_name = :cms_basic_pages
validates :title, :content, :presence => true
end
end
| 18.75 | 49 | 0.713333 |
26574ed70d2159839d7b65ba965ccd63bc19599c | 1,617 | RSpec.describe DeadlineService, type: :service do
let(:organization) { build_stubbed(:organization, :without_deadlines) }
let(:partner_group) { build_stubbed(:partner_group, :without_deadlines, organization: organization) }
let(:partner) { build_stubbed(:partner, organization: organization, partner_group: partner... | 30.509434 | 103 | 0.692641 |
f71a526e546b387f3181da0116f9ff5cea2772bb | 363 | cask "keycastr" do
version "0.9.8"
sha256 "7d864bf9b9d9be36d6dd5e26ecbefdeafa7e5dbfead4e923535dc3212f5bca0e"
url "https://github.com/keycastr/keycastr/releases/download/v#{version}/KeyCastr.app.zip"
appcast "https://github.com/keycastr/keycastr/releases.atom"
name "KeyCastr"
homepage "https://github.com/ke... | 30.25 | 91 | 0.774105 |
1dfefc185aebbd876fe72116eee197ee0a1e68b3 | 1,447 | # helper class to create job directories
class OSC::Machete::JobDir
def initialize(parent_directory)
@target = Pathname.new(parent_directory).cleanpath
end
# Returns a unique path for a job
#
# @return [String] A path of a unique job directory as string.
def new_jobdir
@target + unique_dir
end
... | 25.385965 | 73 | 0.682101 |
bb0ff213268a81f2e9835980fae165c3eed519f9 | 2,475 | require 'souvlaki_rs/log'
require 'souvlaki_rs/airtime'
require 'souvlaki_rs/audioport'
require 'souvlaki_rs/basecamp'
require 'souvlaki_rs/config'
require 'souvlaki_rs/fetch'
require 'souvlaki_rs/mail'
require 'souvlaki_rs/tag'
require 'souvlaki_rs/util'
require 'souvlaki_rs/version'
module SouvlakiRS
# TMP_DIR_PAT... | 27.808989 | 103 | 0.639596 |
abcf99d968b180b7979b66a76491d0778c6b1c9d | 34 | module OGDB
VERSION = "0.0.1"
end | 11.333333 | 18 | 0.676471 |
ff5b8c287e9215a729a22667bbee21d84ce33900 | 681 | # Be sure to restart your server when you modify this file.
# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to diction... | 52.384615 | 196 | 0.820852 |
ff9aa896d0e36dea998fbb08cb1ecc9e0340cf6b | 1,086 | cask :v1 => 'macports' do
version '2.3.2'
if MacOS.release <= :mountain_lion
sha256 'd4648634b571ada1f81cdc5583a48d0ceed1ef55ce5a2de0bdaaaf4b570b77f0'
url "https://distfiles.macports.org/MacPorts/MacPorts-#{version}-10.8-MountainLion.pkg"
pkg "MacPorts-#{version}-10.8-MountainLion.pkg"
elsif MacOS.re... | 41.769231 | 115 | 0.735727 |
013fa0b1667ded5f869f69964fa92af0b835ef1c | 308 | require 'spec_helper'
RSpec.describe DataSources::LoopholesFactory do
subject { described_class.new(location: '/tmp', passphrase: '') }
describe '#builder' do
it 'returns builder' do
expect(subject.records_set_builder).to be_kind_of(DataSources::LoopholesRecordsSetBuilder)
end
end
end
| 25.666667 | 96 | 0.75 |
281a34e18f6a43ff4130a42c234323e0729bf331 | 815 | # frozen_string_literal: true
require 'test_helper'
class DescriptionTest < ActiveSupport::TestCase
setup do
@description = descriptions :ls_author
end
test 'blank attributes' do
@description.name = ''
@description.value = ''
assert @description.invalid?
assert_error @description, :name, :... | 23.285714 | 59 | 0.694479 |
91e479def2e7f727534fc2e44dec870c713f093f | 2,098 | require_domain_file
describe ManageIQ::Automate::Service::Retirement::StateMachines::
ServiceRetirement::UpdateServiceRetirementStatus do
let(:user) { FactoryGirl.create(:user_with_group) }
let(:miq_server) { EvmSpecHelper.local_miq_server }
let(:miq_request_task) do
FactoryGirl.c... | 32.276923 | 111 | 0.694948 |
ff228b1b25a90a82872a981f5c5788d54778d4f8 | 390 | class LicenseSerializer
include FastJsonapi::ObjectSerializer
attributes :id, :data
attribute :licensee do |license|
license.license.licensee
end
attribute :starts_at do |license|
license.license.starts_at
end
attribute :expires_at do |license|
license.license.expires_at
end
attribute ... | 18.571429 | 39 | 0.751282 |
018c99c1d67c7b81d09d26059226148d1e16e5d1 | 144 | # frozen_string_literal: true
class TalkListComponent < ApplicationComponent
def initialize(talks:)
super()
@talks = talks
end
end
| 16 | 46 | 0.736111 |
615b1b6a44fbadd8c758db91e223c9228af05e81 | 1,421 | =begin
#Datadog API V2 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.0.0-SNAPSHOT
Unless explicitly stated otherwise all files in this repository are licensed u... | 31.577778 | 107 | 0.767065 |
01007e6b42da33532e4546760df4cff8d6b68f74 | 1,435 | class SearchController < ApplicationController
def index
@pageLocation = ["Search"]
serverInteraction = ConnectionTracker.get(session.id)
@input = params[:input]
@assessmentID = params[:assessment]
searchKey = @assessmentID + "--" + @input
@page = params[:page].blan... | 38.783784 | 103 | 0.604878 |
f8d1923c30dc9679d60fc0e98b78c097bc1c6d06 | 108 | $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "cuenta_digital"
require "minitest/autorun"
| 21.6 | 54 | 0.777778 |
019b09c39950978883db1e8f2e215f3d04e4e17c | 1,308 | require 'uri'
module GovernmentOrganisationRegister
class PageLinksParser < Faraday::Response::Middleware
def on_complete(env)
header = env[:response_headers]['Link']
links = LinkHeader.parse(header).to_a
env[:links] = links.each.with_object({}) do |(uri, attributes), link_rels|
uri = U... | 26.693878 | 91 | 0.627676 |
ac9f943a3f75bd9b120c6016ab1bbfc8fcdf64b2 | 140 | class AddSeatToTrainBooking < ActiveRecord::Migration[5.1]
def change
add_column :train_bookings, :seat_preference, :string
end
end
| 23.333333 | 58 | 0.778571 |
e89d986c779f013b6ffa9b01bc486cb37db4416a | 1,384 | class JpegTurbo < Formula
desc "JPEG image codec that aids compression and decompression"
homepage "https://www.libjpeg-turbo.org/"
url "https://downloads.sourceforge.net/project/libjpeg-turbo/2.1.0/libjpeg-turbo-2.1.0.tar.gz"
sha256 "bef89803e506f27715c5627b1e3219c95b80fc31465d4452de2a909d382e4444"
license "... | 38.444444 | 96 | 0.70159 |
01ca4a139aff619b01a49642851c1ea8026101e4 | 12,407 | class CharmTools < Formula
include Language::Python::Virtualenv
desc "Tools for authoring and maintaining juju charms"
homepage "https://github.com/juju/charm-tools"
url "https://files.pythonhosted.org/packages/99/4d/16d7398fe5eefc602a8870fb3e93597aabe681b0f1497749148695cba4a1/charm-tools-2.2.3.tar.gz"
sha25... | 47.903475 | 149 | 0.828323 |
288ff75b0d1c0c3e35317a6dc502323180ea7822 | 1,725 | # -*- encoding: utf-8 -*-
# stub: addressable 2.8.0 ruby lib
Gem::Specification.new do |s|
s.name = "addressable".freeze
s.version = "2.8.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Bob Aman"... | 43.125 | 256 | 0.674203 |
7926874955b1ecf8ce3efd62bba0eff1ad755f01 | 942 | #
# Be sure to run `pod spec lint LeoCopyObject.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://gith... | 33.642857 | 103 | 0.633758 |
01fadede15693609decb795987e958e5ea1b7421 | 140 | require 'constants'
namespace REFRESH_SYM do
task RELEASE_SYM do
@ceedling[:release_invoker].refresh_c_deep_dependencies
end
end
| 14 | 59 | 0.792857 |
910efd1cd5e89bde4cca79adbeb30c7e96eecc7e | 1,451 | Pod::Spec.new do |s|
s.name = "TGRDataSource"
s.version = "0.2"
s.summary = "Convenience UITableView and UICollectionView data sources."
s.description = <<-DESC
Convenience UITableView and UICollectionView data sources.
* `TGRArrayDataSource` and `TGRFe... | 55.807692 | 322 | 0.683666 |
e95d89fd202a624b5dc233fb44b0be4f37083257 | 2,026 | Post.create!([
{title: "ddsjka", body: "kjasdsad"},
{title: "3j12j312", body: "j123kj123"},
{title: "k432kj432", body: "kj12kj312jk312"},
{title: "n432kj413", body: "4kj132jk324"},
{title: "4321432", body: "41234"},
{title: "432432", body: "4234324"},
{title: "1221124", body: "23432"},
{title: "424242",... | 42.208333 | 97 | 0.615992 |
d55f41f015d801fe7b0b2dad085730e7d2feb78f | 175 | # Be sure to restart your server when you modify this file.
HappyBottle::Application.config.session_store :cookie_store, key: '_happy_bottle_session', expire_after: 3.months
| 43.75 | 113 | 0.811429 |
e271734e96ebadb58ca17dbacfa8b1fee14a3c6b | 1,754 | class UsersController < ApplicationController
get '/users/new' do # redirects to teas page if user is already logged in
if !!current_user
flash[:message] = "You are already logged in."
redirect to "/teas"
else
erb :'users/create_user'
end
end
get '/login' do # redirects to teas ... | 27.40625 | 122 | 0.615735 |
5d6bb0f3839eb87626ebb9ef9b5eba9764af4bd5 | 679 | # frozen_string_literal: true
# This file is part of PacketGen
# See https://github.com/sdaubert/packetgen for more informations
# Copyright (C) 2016 Sylvain Daubert <sylvain.daubert@laposte.net>
# This program is published under MIT license.
require_relative 'pcaprub_wrapper'
module PacketGen
# Module to inject pa... | 28.291667 | 66 | 0.720177 |
01364e40d626f8557a1d98807940f5fad23ba5d5 | 572 | class FollowsController < ApplicationController
before_action :load_user, only: %i(following followers)
def following
@title = t "following"
@users = @user.following.page(params[:page]).per Settings.page_size
render "users/show_follow"
end
def followers
@title = t "followers"
@users = @use... | 22 | 71 | 0.695804 |
d56380701895faf6ac2dc8d96d1d173534909194 | 2,330 | require 'helper'
require 'aws_ecrpublic_repository'
require "aws-sdk-core"
require_relative 'mock/aws_ecrpublic_repository_mock'
class AwsEcrPublicRepositoryConstructorTest < Minitest::Test
def test_empty_params_not_ok
assert_raises(ArgumentError) { AwsEcrPublicRepository.new() }
end
def test_invalid_repos... | 27.093023 | 112 | 0.748927 |
1c2f458b2ff61153dbc4863612936dc991c454b2 | 1,928 | # require 'spec_helper'
# platforms = %w(debian ubuntu centos)
# platforms.each do |platform|
# describe "grafana_ on #{platform}" do
# step_into :grafana_config, :grafana_install, :grafana_config_ldap_attributes, :grafana_config_ldap_server, :grafana_config_ldap_group_mapping, :grafana_config_writer
# platf... | 34.428571 | 171 | 0.588174 |
33bd1e3a9c0e25501ab55ca3308d7815110dfe66 | 286 | FactoryBot.define do
factory :variant_in_stock, parent: :variant do
transient do
quantity_in_stock { 10 }
end
after(:create) do |variant, evaluator|
variant.stock_items.first.adjust_count_on_hand(
evaluator.quantity_in_stock
)
end
end
end
| 20.428571 | 53 | 0.685315 |
38af39f7da956fac8615c23f9396fc2be4298dd7 | 1,001 | class Day03
def initialize
@data = File.read('03b.txt').split("\n")
@digits = @data.first.length
end
def p2
o2 = find(tiebreak: '1')
co2 = find(tiebreak: '0')
puts o2.to_i(2) * co2.to_i(2)
end
def find(tiebreak:)
list = @data
digit = 0
while list.length > 1 do
a, b ... | 17.561404 | 67 | 0.46953 |
bf7ee9ceb39ac1b796c47e94053e3b4b6e609d5a | 1,121 | require "accent_to_ascii/version"
module AccentToAscii
ACCENTS_MAPPING = {
'E' => [200,201,202,203],
'e' => [232,233,234,235,7869],
'A' => [192,193,194,195,196,197],
'a' => [224,225,226,227,228,229,230],
'C' => [199],
'c' => [231],
'O' => [210,211,212,213,214,216,336],
'o' => [242,243... | 21.980392 | 76 | 0.551293 |
bfa667af8817d5eb81fff73d6300aa3cd38cd9c1 | 189 | class AddIndexToUsersEmail < ActiveRecord::Migration[5.2]
def change
add_index :users, :email, unique: true
#usersテーブルのemailカラムにインデックスを追加するために、add_indexメソッド(Rails)を使用
end
end
| 27 | 62 | 0.772487 |
395c39833727fdf0241cf06da29fde7b1d27f9ec | 9,784 | #-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2018 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,... | 31.56129 | 111 | 0.595258 |
e97369d477f1cb0fc664aa205c0397ddb5035bd0 | 1,834 | module Rhinoart
module ViewHelpers
module ApplicationHelper
def top_menu_items(parent = nil)
if parent.blank?
Page.where("active = true AND menu = true AND parent_id IS NULL").order(:position, :name)
else
Page.where("active = true AND menu = true AND parent_id = #{parent... | 25.830986 | 132 | 0.565976 |
1c8008b92fa3782e2f115e85799e2d487b6840fc | 4,573 | # frozen_string_literal: true
require 'uri'
require 'net/http'
require 'openssl'
module Datacite
#
# Datacite Client
#
# +attributes+ are expected in the following format
#
# {
# "doi": "10.5438/0012",
# "creators": [{
# "name": "DataCite Metadata Working Group"
# }],
# ... | 33.874074 | 118 | 0.645309 |
e9cda28456f11210b8466c030534dcb1388edf7a | 9,109 | # Copyright 2017 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 applicable law or agreed to in writing, ... | 46.712821 | 563 | 0.659677 |
876c73b30305447a81fb43f61c3fb9cf1c075b24 | 2,096 | require 'bulk_processor/back_end/dynosaur'
describe BulkProcessor::BackEnd::Dynosaur do
it_behaves_like 'a role', 'BackEnd'
describe '.new' do
it 'configures Dynosaur::Client::HerokuClient' do
BulkProcessor::BackEnd::Dynosaur.new(
processor_class: MockCSVProcessor,
payload: { 'foo' => 'b... | 26.871795 | 84 | 0.624046 |
61ee85034847724ce708898c204de868f0da441e | 1,353 | =begin
#ORY Keto
#A cloud native access control server providing best-practice patterns (RBAC, ABAC, ACL, AWS IAM Policies, Kubernetes Roles, ...) via REST APIs.
The version of the OpenAPI document: v0.0.0-alpha.1
Contact: hi@ory.sh
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.2.2
=end
... | 28.1875 | 144 | 0.750924 |
bb418a3f2c61663398e24e2f6cf1ea840177721d | 140 | module Aptible
module Api
class Permission < Resource
belongs_to :account
field :id
field :scope
end
end
end
| 12.727273 | 31 | 0.628571 |
082d3f3b91053e557ae93a14603ef194ec95c5d7 | 11,544 | # 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::Network::Mgmt::V2020_08_01
module Models
#
# Network security rule.
#
class SecurityRule < SubResource
include MsRest... | 35.302752 | 83 | 0.49359 |
bb121163a1dbd52165ec30a76e729e1cf5b02d11 | 2,947 | ; ISO_5428 UCS-2 encoding rule
; source: ftp://dkuug.dk/i18n/charmaps/ISO_5428
any [
#{21} (insert tail result #{E002}) |
#{22} (insert tail result #{E003}) |
#{23} (insert tail result #{E009}) |
#{24} (insert tail result #{E005}) |
#{25} (insert tail result #{E012}) |
#{26} (insert tail result #{E013}) |
#{27} ... | 37.303797 | 48 | 0.585002 |
e91e075340a2a8ea3341b0d1c4d4dc9fd39739c1 | 1,590 | $:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "buttafly/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "buttafly"
s.version = Buttafly::VERSION
s.authors = ["Frederick D. Schoeneman"]
s.email = ["fred... | 36.976744 | 133 | 0.747799 |
bb50932e186b112040b6c9f573f0f5d7eb855841 | 321 | class CreateDocAuths < ActiveRecord::Migration[5.1]
def change
create_table :doc_auths do |t|
t.references :user, null: false
t.datetime :attempted_at
t.integer :attempts, default: 0
t.datetime :license_confirmed_at
t.datetime :selfie_confirmed_at
t.timestamps
end
end
end... | 24.692308 | 51 | 0.688474 |
1ccba7f911460ea5ecc353d8c605e98e41039e52 | 12,780 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe SnippetsController do
let_it_be(:user) { create(:user) }
let_it_be(:other_user) { create(:user) }
let_it_be(:public_snippet) { create(:personal_snippet, :public, :repository, author: user) }
describe 'GET #index' do
let(:base_params) { { ... | 27.782609 | 102 | 0.630829 |
e816fa903870b1622c29e18923036e7535cc1c54 | 5,830 | # frozen_string_literal: true
# rubocop:disable Layout/LineLength
# == Schema Information
#
# Table name: report_reports
#
# id :uuid not null, primary key
# aggregation_name :string(255)
# bar_style :string(255) default("side_by_side")
# display_type :string(255) def... | 35.766871 | 116 | 0.666552 |
e8a30078ac2090080fb8a80bbe68cb3e52b9916b | 1,840 | # 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 rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel... | 22.168675 | 103 | 0.6625 |
796c0d90a5103838f7f29b4fade8809e2b73bea8 | 6,868 | # encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
# This module is intended to provide access to information about the host OS and
# [virtual] machine. It intentionally does no caching and maintains no state -
#... | 33.502439 | 99 | 0.585323 |
1c7d29dd2f9b1a5785298ee5ee3b86c60e23795f | 809 | class PostController < ApplicationController
def index
@post = Post.find(params[:id])
render :json => {post_content: @post.content, id: @post.id}
end
def new
end
def create
@post = Post.new(title: params[:post][:title],
content: params[:post][:content])
@post.save
... | 17.977778 | 63 | 0.603214 |
bfaf9f5604c3fa24a1c4a7440349f00dab39fefc | 2,552 | require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
describe Confluence::Bookmark do
include SessionHelperMethods
it "should initialize bookmark_url and description from hash" do
bookmark = Confluence::Bookmark.new :bookmark_url => 'http://github.com/rgabo/confluencer', :descripti... | 41.16129 | 180 | 0.717868 |
392feaa86e0275a936d6527e6c7ae6fd060ecc9c | 70 | # Including your original cookbook
include_recipe 'trifecta::default'
| 23.333333 | 34 | 0.828571 |
f87054d1b7c7e3b53141e37ca27e97cda96e4916 | 828 | # frozen_string_literal: true
require "rails_helper"
module Renalware::PD
describe AdequacyResultPolicy, type: :policy do
include PolicySpecHelper
subject(:policy) { described_class }
[:edit?, :destroy?].each do |permission|
permissions permission do
it "grants access if user super_admin"... | 26.709677 | 73 | 0.667874 |
e24ae2b7dd6396aafdcc00eb61b43bf856a195a6 | 1,874 | require 'spec_helper'
describe 'api/v1/cookbook_versions/show' do
let(:cookbook) { create(:cookbook, name: 'redis') }
let(:apt) { create(:cookbook, name: 'apt') }
let(:tarball) do
File.open('spec/support/cookbook_fixtures/redis-test-v1.tgz')
end
let(:cookbook_version) do
create(
:cookbook_vers... | 30.721311 | 128 | 0.707577 |
bf3cefbd915aa382116423b1370a08cd73d52cad | 169 | module NetSuite
module Records
class UnitsTypeUomList < Support::Sublist
include Namespaces::ListAcct
sublist :uom, UnitsTypeUom
end
end
end
| 13 | 45 | 0.698225 |
d5d6ce11bcf7fa76cf21bdf839c90d0cb3221578 | 5,133 | module Schedulable
module ActsAsSchedulable
extend ActiveSupport::Concern
included do
end
module ClassMethods
def acts_as_schedulable(name, options = {})
name||= :schedule
attribute = :date
has_one name, as: :schedulable, dependent: :d... | 37.467153 | 168 | 0.602572 |
91fa5e3e309b7600b34b581c94dd71f76d991485 | 180 | require 'spec_helper'
describe "Subjects" do
describe "GET /subjects", :solr => true do
it "works! (now write some real specs)" do
get subjects_path
end
end
end
| 18 | 46 | 0.666667 |
e28e9dfd65e6cfaeefb198534520f0dc714ab7cf | 2,688 | class NodeExporter < Formula
desc "Prometheus exporter for machine metrics"
homepage "https://prometheus.io/"
url "https://github.com/prometheus/node_exporter/archive/v1.1.2.tar.gz"
sha256 "edb40c783bd5767f174b916c89a768496ccae0f74811ba1d03c57c32cd250bbd"
license "Apache-2.0"
head "https://github.com/promet... | 32.385542 | 122 | 0.661458 |
acb42a59d74135349abfe42ad7ddca755d705749 | 1,280 |
module Commerce
class FaradayClient < HttpClient
# The constructor.
def initialize(timeout)
@connection = Faraday.new do |faraday|
faraday.request :multipart
faraday.request :url_encoded
faraday.ssl[:ca_file] = Certifi.where
faraday.adapter Faraday.default_ada... | 31.219512 | 107 | 0.686719 |
11390576f6d7c3ba6826ce5c3e811fd327958c32 | 2,265 | ##
# 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 = NormalRankin... | 29.038462 | 138 | 0.633113 |
4a82b2af5f63dbab98b528a6a60ea2b417165c12 | 733 | class Object
def to_param
to_s
end
end
class TrueClass
def to_param
self
end
end
class FalseClass
def to_param
self
end
end
class NilClass
def to_param
self
end
end
class Regexp #:nodoc:
def number_of_captures
Regexp.new("|#{source}").match('').captures.length
end
def mult... | 14.66 | 64 | 0.579809 |
33ee765278b05b4d6e144009f960a6d15494677d | 2,636 | class LinkedAccountsController < ApplicationController
before_action :authenticate_user!, except: :plaid_webhook
before_action :set_linked_account, only: [:show, :edit, :update, :destroy, :unlink]
skip_before_filter :verify_authenticity_token, only: :plaid_webhook
respond_to :html, :js, :json
def show
... | 27.175258 | 135 | 0.723065 |
d555c5b1d1a85ccee705c4984212b5263fab2591 | 152 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_sample_app_chapter_3_session'
| 38 | 90 | 0.822368 |
1895fda313853060cbcc8d9d8b85ef02f2ea31c8 | 1,206 | # -*- encoding: utf-8 -*-
require File.expand_path('../lib/gov_kit-ca/version', __FILE__)
Gem::Specification.new do |s|
s.name = "govkit-ca"
s.version = GovKit::CA::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Open North"]
s.email = ["info@opennorth.ca"]
s.homepage = "h... | 40.2 | 103 | 0.656716 |
4a932fb1940dc3d871ab733e9b42349a859a289d | 413 | # MonkeyPatch for Inherited Resources to works with strong parameters and rails 4.0
module InheritedResources
module BaseHelpers
protected
def build_resource
get_resource_ivar || set_resource_ivar(end_of_association_chain.send(method_for_build, request.get? ? {} : resource_params))
end
def upda... | 29.5 | 130 | 0.769976 |
bb1181fac11c5ede66b307d6b63e1c2153aa5376 | 282 | module Etsy4r
class TagCommands < Etsy4r::Commands
def get_top_tags
@client.process("/tags")
end
def get_child_tags(tag)
tag_param = tag.gsub(/\s|\-/, "_")
@client.process("/tags/#{tag_param}/children")
end
end
end
| 18.8 | 53 | 0.560284 |
7a2a22b72fa6266eec35d45c9fd0fc4104773527 | 3,851 | require 'common/common'
require 'json'
module Bosh
module AcropolisCloud
class NutanixVolumeGroupManager
include Helpers
# Constructor
# @param [NutanixRestClient] client Client instance
def initialize(client, logger)
@client = client
@logger = logger
end
# C... | 33.780702 | 80 | 0.592573 |
ac06a54e0c7c89a90d5f0ed1ed169e2d362e01da | 97 | Spree::Adjustment.class_eval do
scope :deposit, -> { where(source_type: 'Spree::Deposit') }
end | 32.333333 | 61 | 0.721649 |
33a9c2fd015f12f8301d48b62a5d99adfb40b72a | 112 | class TipoBien < ActiveRecord::Base
attr_accessible :nombre
has_many :biens
has_many :nombre_biens
end
| 16 | 35 | 0.767857 |
1a2ca6452cc3660e4dfe280e4a57730798f55003 | 1,386 | require "spec_helper"
RSpec.describe SigepWeb::Models::PostalObject do
subject(:postal_object) do
described_class.new(
label_number: "SX08689124BR", postage_code_service: "41068",
cubage: "0,0000", weight: "200", receiver: receiver,
dimension_object: dimension_object, processing_status: "0",
... | 35.538462 | 80 | 0.699134 |
e2a549028bf0fc60c4bb91e1d5d7e64250edaad3 | 145 | module Sampler
class Railtie < Rails::Railtie
railtie_name :sampler
rake_tasks do
load 'tasks/db/sample.rake'
end
end
end
| 14.5 | 33 | 0.675862 |
4a8b5dffba26031ce2984f9107e796385f001b10 | 1,042 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Sherlock::Location do
let(:location) { described_class.new(__FILE__, 1) }
describe 'from_ruby_location' do
it 'creates a Location from a Thread::Backtrace::Location' do
input = caller_locations[0]
output = described_class... | 24.232558 | 65 | 0.683301 |
62167343a897fae16ed3f684923af2ffebb8942a | 494 | module Tatami
module Models
class HttpRequest < ModelBase
attr_accessor :name, :base_uri, :method, :user_agent, :uri, :headers, :cookies, :path_infos, :query_strings, :fragment, :content
def to_s
"name=#{@name}, base_uri=#{@base_uri}, method=#{@method}, user_agent=#{@user_agent}, uri=#{@uri},... | 44.909091 | 251 | 0.668016 |
d559a185fbe432d780258f82b151e44bdda51c06 | 2,818 | # (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2021
require 'test_helper'
class ServerlesAgentTest < Minitest::Test
def test_report
stub_request(:post, "http://10.10.10.10:9292//bundle")
.to_return(status: 500)
.to_return(status: 200)
host_name = Class.new do
def host_name
... | 33.547619 | 160 | 0.695884 |
5da6efd954a501cd499f44b6437603ab5e3b2756 | 2,336 | require File.dirname(__FILE__) + "/../helpers/acceptance"
require "integrity/installer"
class InstallerTest < Test::Unit::AcceptanceTestCase
include FileUtils
story <<-EOS
As an user,
I want to easily install Integrity
So that I can spend time actually writing code
EOS
before(:each) do
rm_rf ... | 29.2 | 91 | 0.672517 |
08d667e9d60195e65a822fef85b531115dac1384 | 1,548 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Consumption::Mgmt::V2018_03_31
module Models
#
# Model object.
#
#
class BalancePropertiesAdjustmentDetailsItem
include MsRestAzure... | 25.8 | 77 | 0.528424 |
b972d2521c98ee8d9850b5252279357ac3aee5da | 3,433 | describe Authenticator do
describe '.for' do
it "instantiates the matching class" do
expect(Authenticator.for(:mode => 'database')).to be_a(Authenticator::Database)
expect(Authenticator.for(:mode => 'ldap')).to be_a(Authenticator::Ldap)
expect(Authenticator.for(:mode => 'ldaps')).to be_a(Authent... | 42.9125 | 123 | 0.678124 |
39861d8c1024cb2340efc992e47ece9d79a50e8e | 3,187 | # frozen_string_literal: true
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
##
# Dynamically build a handler for each omniauth provider
# -------------------------------------------------------------
IdentifierScheme.for_authentication.each do |scheme|
define_method(scheme... | 36.215909 | 135 | 0.635394 |
f82d48610cf3d6045f5f37f49dc6c7a5558caf04 | 5,851 | # Provides feature definitions.
require 'puppet/util/docs'
require 'puppet/util'
# This module models provider features and handles checking whether the features
# are present.
# @todo Unclear what is api and what is private in this module.
#
module Puppet::Util::ProviderFeatures
include Puppet::Util::Docs
# This c... | 32.505556 | 120 | 0.643138 |
5d29c9444169aedc8b646cba5fdc5d409395d133 | 36 | module Doge
VERSION = "0.1.0"
end
| 9 | 19 | 0.638889 |
5dc3dc72017da1d16755047ed600e7c654e19073 | 421 | class ContainerLog
include Mongoid::Document
include Mongoid::Timestamps
field :type, type: String
field :data, type: String
field :name, type: String
belongs_to :grid
belongs_to :host_node
belongs_to :grid_service
belongs_to :container
index({ grid_id: 1 })
index({ host_node: 1 })
index({ gr... | 20.047619 | 31 | 0.688836 |
6ab07556131acf803b2eb8ef07cc0bd284c415e4 | 18,110 | =begin
#
# benchmark.rb - a performance benchmarking library
#
# $Id$
#
# Created by Gotoken (gotoken@notwork.org).
#
# Documentation by Gotoken (original RD), Lyle Johnson (RDoc conversion), and
# Gavin Sinclair (editing).
#
=end
# == Overview
#
# The Benchmark module provides methods for benchmarking Ruby code,... | 31.605585 | 106 | 0.564274 |
6a4006d1abcf822e87be5409e66b708726451e33 | 123 | require 'test_helper'
class UserGuestTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 15.375 | 45 | 0.707317 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.