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 |
|---|---|---|---|---|---|
210a2f5c1b3c38d1d6a470307c5d597a48c973b8 | 1,554 | #
# Be sure to run `pod lib lint HLBaseClass.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'HLBaseC... | 36.139535 | 106 | 0.635779 |
262c3bb798102f2af3e24ea2998a3a9296e1fc5d | 1,180 | require 'api/defaults'
module API
module Users
class SignInWithGoogle < Grape::API
include Defaults
format :json
STUB_PASSWORD = "google_pass_MCEnhRLhNqMmhOGq1Blu".freeze
params do
requires :name, type: String
requires :email, type: String
requires :image_url, t... | 25.106383 | 63 | 0.55678 |
e9d962401170a98f37d41308e0ba921f7e0453b8 | 7,770 | module Fog
module Compute
class OpenStack
class Real
def create_server(name, image_ref, flavor_ref, options = {})
data = {
'server' => {
'flavorRef' => flavor_ref,
'name' => name
}
}
data['server']['imageRef'] = i... | 41.329787 | 172 | 0.479279 |
330126276939974297ecab6d24ba2faee109f5dc | 329 | module Profiles
class SubmissionsController < ApplicationController
def index
@q = current_user.submissions.kept.ransack(params[:q])
@q.sorts = 'created_at desc' if @q.sorts.empty?
@pagy, @submissions = pagy(@q.result, i18n_key: 'activerecord.models.submission')
skip_policy_scope
end
... | 29.909091 | 87 | 0.705167 |
0183dcce2baa5a6e86ff5848a9fbe2ec4dc441e6 | 1,298 | require "api_utils/version"
module ApiUtils
module_function
# Convert a string from "something_like_this" to "somethingLikeThis"
# @param [String] underscored_word
# @return [String]
def camelize(underscored_word)
underscored_word.gsub(/(?:_)(.)/) { Regexp.last_match(1).upcase }
end
# camelize all ... | 24.961538 | 78 | 0.596302 |
39ba52d130b1ac7a20e8fbdd02eec04ff595c507 | 2,430 | # frozen_string_literal: true
require_dependency "#{Rails.root}/lib/word_count"
require_dependency "#{Rails.root}/lib/analytics/histogram_plotter"
#= Presenter for courses / campaign view
class CoursesPresenter
attr_reader :current_user, :campaign_param
def initialize(current_user:, campaign_param: nil, courses_... | 24.545455 | 88 | 0.732099 |
18bc33c43af3565662342ef23a3f9a04845af646 | 1,828 | # frozen_string_literal: true
require "rails_helper"
RSpec.describe ApplicationController do
let(:request) { ActionDispatch::Request.new({}) }
describe "#new_session_path" do
it "returns the new session path" do
controller = described_class.new
allow(controller).to receive(:request).and_return(req... | 41.545455 | 104 | 0.749453 |
9145682ace4a14c598e96e507d690ef41b71bdc3 | 9,709 | # frozen_string_literal: true
require "dependabot/dependency"
require "dependabot/dependency_file"
require "dependabot/nuget/update_checker/version_finder"
RSpec.describe Dependabot::Nuget::UpdateChecker::VersionFinder do
let(:finder) do
described_class.new(
dependency: dependency,
dependency_files:... | 34.799283 | 79 | 0.628386 |
abafa8b5692a36eb6e104fba1c5a7d372f090210 | 609 | # This file was automatically generated by Trapeze, the safety-net generator for
# Ruby. Visit http://trapeze.rubyforge.org/ for more information.
require 'test/unit'
class FooTest < Test::Unit::TestCase
def setup
@foo = Foo.new
end
def test_should_be_instance_of_class
assert_instance_of Class, Fo... | 24.36 | 80 | 0.738916 |
aba709b395f1f16039d503038e1c2acb109fdace | 602 | # frozen_string_literal: true
module Admin
module Suppliers
class SuppliersController < Admin::BaseController
skip_after_action :verify_authorized, only: :index
def index
lead_providers = policy_scope(LeadProvider).sort_by(&:name)
delivery_partners = policy_scope(DeliveryPartner).sor... | 31.684211 | 90 | 0.714286 |
2622901cbb06fd36caadcaa99904718d4bc7fbb7 | 4,792 | # -*- coding: binary -*-
module Rex
module Java
module Serialization
module Model
# This class provides a field description representation (fieldDesc). It's used for
# both primitive descriptions (primitiveDesc) and object descriptions (objectDesc).
class Field < Element
... | 27.860465 | 99 | 0.51899 |
d5f705416c98df82cefadf4a07787fcde4a08124 | 6,638 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Amadeus::Namespaces do
describe 'Amadeus::Client' do
before do
@amadeus = Amadeus::Client.new(
client_id: '123',
client_secret: '234'
)
end
describe '.reference_data' do
it 'should return a ReferenceDat... | 30.449541 | 88 | 0.651853 |
ab2b505828206130c6f2997e55e74729899cdbb0 | 230 | module Janky
module Views
class Layout < Mustache
def title
"Janky Hubot"
end
def page_class
nil
end
def root
@request.env['SCRIPT_NAME']
end
end
end
end
| 11.5 | 35 | 0.526087 |
872e80ae00a8038c15f276a9c8a631325ce74bde | 23 |
require "bixby/bench"
| 7.666667 | 21 | 0.73913 |
acb04222d5e24f01c210204a9830f0abd2275e9a | 1,993 | # frozen_string_literal: true
require 'hanami/cli'
require 'fam/cli/common_arg_defs'
module Fam::CLI
module Get
class Person < Command
CommonArgDefs
.new(self)
.input_path
.person_name
def call(
input_path:,
person_name:,
**
)
finish(
... | 18.453704 | 78 | 0.501756 |
1dfb6f3b001d151aea2f8237633431886ed71ef1 | 1,049 | Pod::Spec.new do |s|
s.name = "ArtisanSDK"
s.version = '2.0.18'
s.summary = "Artisan is the first all-in-one platform for mobile app analytics, A/B testing, and personalization."
s.homepage = "http://useartisan.com"
s.license = { :type => 'Proprietary', :file => 'FILE_LICENSE' }
s... | 55.210526 | 166 | 0.636797 |
0127168c67cb129b446add1be283226c7af9357e | 690 | class StanfordParser < Formula
desc "Statistical NLP parser"
homepage "https://nlp.stanford.edu/software/lex-parser.shtml"
url "https://nlp.stanford.edu/software/stanford-parser-4.2.0.zip"
sha256 "8c2110c78f7f82b66bcf91089a18e415669eda4346bbd9a6e3bc2bde63e5fed1"
license "GPL-2.0-or-later"
livecheck do
... | 27.6 | 78 | 0.704348 |
6145a7bb59ff994deaf88966a51d20b78f850fd5 | 781 | require 'test_helper'
class MicropostsControllerTest < ActionDispatch::IntegrationTest
def setup
@micropost = microposts(:orange)
end
test "should redirect create when not logged in" do
assert_no_difference 'Micropost.count' do
post microposts_path, params: { micropost: { content: "Loren ipsum" } }
end
... | 24.40625 | 74 | 0.775928 |
1c88be6ec3f93668ae55cc857d31934a40127f86 | 794 | class AvroTools < Formula
desc "Avro command-line tools and utilities"
homepage "https://avro.apache.org/"
url "https://www.apache.org/dyn/closer.lua?path=avro/avro-1.11.0/java/avro-tools-1.11.0.jar"
mirror "https://archive.apache.org/dist/avro/avro-1.11.0/java/avro-tools-1.11.0.jar"
sha256 "43ba8e1d63d6273e8... | 33.083333 | 112 | 0.743073 |
ab042bf764d7c21a2ce5142d8585f679014b921d | 1,132 | class PermissionsController < ApplicationController
before_action :authenticate_user!
before_action :find_aircraft
before_action :find_user
respond_to :json
def update
@permission = @aircraft.permissions.where(user_id: @user.id).create_or_update(permission_params)
respond_with @permission do |format|... | 24.608696 | 127 | 0.731449 |
267799bfce988d3ef44742144848b96666280ebc | 837 | {
matrix_id: '567',
name: 'g7jac200sc',
group: 'Hollinger',
description: 'Jacobian from CEPII\'s \'G7marmotte\' OLG model, oldstack 200 (scaled)',
author: 'P. Hollinger',
editor: 'T. Davis',
date: '2001',
kind: 'economic problem',
problem_2D_or_3D: '0',
num_rows: '59310',
num... | 31 | 126 | 0.667861 |
3932548d3e8be4edc8456bc8c59c6aa30deff197 | 167 | courses = [
{name: "Beginner"},
{name: "Intermediate"},
{name: "Advanced"},
{name: "Toefl"}
]
courses.each do |course|
Course.create(course)
end | 16.7 | 27 | 0.57485 |
4ad869d2ad28b92c50cc8f2cfc150012fa2e8d10 | 1,161 | # -*- encoding : utf-8 -*-
class PSD
class EngineData
# Sanitizes and helps with access to the document text.
class Text
# The current document split by newlines into an array.
attr_reader :text
# The current line number in the document.
attr_accessor :line
# Stores the docum... | 23.22 | 68 | 0.580534 |
011fee64f83d50c8c88029997abd0989551225a0 | 511 | module Spree::UserDecorator
def self.prepended(base)
base.has_many :wishlists, class_name: 'Spree::Wishlist'
end
def wishlist
default_wishlist = wishlists.where(is_default: true).first
default_wishlist ||= wishlists.first
default_wishlist ||= wishlists.create(name: Spree.t(:default_wishlist_name)... | 31.9375 | 98 | 0.776908 |
d53532771299013a64a42dbfcc69f7a6bff631d0 | 553 | Pod::Spec.new do |s|
s.name = 'Objection'
s.version = '1.6.5'
s.summary = 'A lightweight dependency injection framework for Objective-C.'
s.author = { 'Justin DeWind' => 'dewind@atomicobject.com' }
s.source = { :git => 'https://github.com/atomicobject/objection.git', :tag => "#{s... | 36.866667 | 102 | 0.607595 |
1dea21c60afec56a3c3349a6d387752bd64a7c4e | 4,137 | #!/usr/bin/env ruby
#
# Check InfluxDB queries
# ===
#
# Dependencies
# -----------
# - InfluxDB client gem `influxdb` - used to query influxdb
# - JsonPath gem `jsonpath` - used to select result values
# - Dentaku gen `dentaku` - used to express thresholds
#
# Examples
# --------
# See the README here https://github.... | 26.690323 | 128 | 0.602611 |
acb40c21299f312d0e54c9fc90280c22b039e398 | 1,438 | # frozen_string_literal: true
require 'observer'
module BCDiceIRC
module GUI
module Observers
# ゲームシステムのオブザーバを格納するモジュール
module GameSystem
module_function
# IRCボット設定のオブザーバを返す
# @param [IRCBotConfig] config
# @return [Proc]
def irc_bot_config(config)
... | 24.793103 | 65 | 0.56815 |
5d157aa9c0813331260589816569d5428dc1291d | 1,165 | # Maintain your gem's version:
require File.expand_path('../lib/party_foul/version', __FILE__)
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = 'party_foul'
s.version = PartyFoul::VERSION
s.authors = ['Brian Cardarella', 'Dan McClain']
s.email = ['bc... | 37.580645 | 72 | 0.692704 |
914a1128dcebad902827282bc0abbce3b5dc72c9 | 1,384 | class Api::V1::Prime::Eth2Staking::ValidatorsController < Api::V1::Prime::Eth2Staking::BaseController
def index
jsonapi_paginate(scope) do |page|
render jsonapi: page, params: jsonapi_serializer_params.merge(jsonapi_include_params(page))
end
end
def show
render jsonapi: scope.first!, params: js... | 32.186047 | 131 | 0.731936 |
abb2df1f63cc1d5e2d10420cf212dfdee622c891 | 1,171 | class User < ApplicationRecord
attr_accessor :remember_token
before_save { self.email = email.downcase }
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\z/i
validates :name, presence: true, length: {maximum: 50}
validates :email, presence: true,
length: {maximum: 255},
... | 26.613636 | 78 | 0.689155 |
f7b267eebbe2814652a90c87a054632d57d5832e | 921 | #
# tkextlib/bwidget/labelframe.rb
# by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
#
require 'tk'
require 'tk/frame'
require 'tkextlib/bwidget.rb'
require 'tkextlib/bwidget/label'
module Tk
module BWidget
class LabelFrame < TkWindow
end
end
end
class Tk::BWidget::LabelFrame
... | 19.595745 | 75 | 0.688382 |
87324ff7ee813d28cd174ddedb16803720fb23b4 | 69 | class MetricMiddleware
def self.perform(params)
yield
end
end | 13.8 | 26 | 0.753623 |
ab4c07777d212e11d95b12163ab2dbe382642fe5 | 5,726 | module SparkleMotion
module LaunchPad
# Base class for Launchpad UI widgets.
class Widget
attr_reader :value, :position, :size, :colors
def initialize(launchpad:, position:, size:, colors:, value:)
@position = position
@size = size
@launchpad = launchpad
@... | 28.919192 | 98 | 0.546455 |
1a5009f941ab7066bfdaa749e838a31b25d38cb2 | 24,048 | # frozen_string_literal: true
require 'spec_helper'
module RailsBestPractices
module Reviews
describe RemoveUnusedMethodsInModelsReview do
let(:runner) {
Core::Runner.new(
prepares: Prepares::ModelPrepare.new,
reviews: RemoveUnusedMethodsInModelsReview.new('except_methods' => [... | 32.585366 | 144 | 0.551106 |
28a72ece9a5235ecbe5600bd2f24e8e21825d98d | 3,221 | # -*- coding:binary -*-
require 'spec_helper'
require 'rex/java'
require 'stringio'
RSpec.describe Rex::Java::Serialization::Model::BlockDataLong do
subject(:block) do
described_class.new
end
let(:sample_block) { "\x00\x00\x00\x10\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" }
let(:sa... | 30.102804 | 119 | 0.654766 |
e989698f2647e14364c3f834c823ea6ea37b2f36 | 3,617 | #-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2013 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of ... | 41.102273 | 114 | 0.699198 |
08eee6baec08acbe93ae5daa8ed2ab86533c9e26 | 2,274 |
if defined?(StatiaGov::Application)
StatiaGov::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
config.eager_load = true
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are enabled, since this is... | 36.095238 | 106 | 0.73263 |
790c23d00b35dafdb45e76ae77ed73f38fda3ecb | 6,342 | #-- encoding: UTF-8
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 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 ChiliProj... | 30.936585 | 96 | 0.650426 |
1a4dc5fa98a9351a4774041037a660860c86eb6c | 326 | class Diskwave < Cask
version '0.4.0'
sha256 '976324e46e4ca4d54240de13cf2c6f0db9afdb703b0e6ef78e2b5b5d36d63e75'
url 'http://diskwave.barthe.ph/download/DiskWave_0.4.dmg'
appcast 'http://diskwave.barthe.ph/sparkle/appcast_64bit.php'
homepage 'http://diskwave.barthe.ph/'
license :unknown
app 'DiskWave.app... | 27.166667 | 75 | 0.769939 |
abf9facfcdce06e700dbb6441985f060489cf3dc | 5,373 | $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
require 'pathname'
module Spork
BINARY = File.expand_path(File.dirname(__FILE__) + '/../bin/spork')
LIBDIR = Pathname.new(File.expand_path(File.dirname(__FILE__)))
autoload :Server, ... | 33.372671 | 156 | 0.645449 |
4a37cdedc9c3164823d596421485690474b72879 | 2,914 | # encoding: utf-8
require 'spec_helper'
describe Function::Predicate::LessThan, '#optimize' do
subject { object.optimize }
let(:attribute) { Attribute::Integer.new(:id, required: false, size: 1..2**31 - 1) }
let(:left) { attribute }
let(:right) ... | 28.291262 | 86 | 0.604324 |
085333287bbd891a8dbfb8284a0f97cddfaaf2bb | 41 | class GuoGuoLog < ActiveRecord::Base
end
| 13.666667 | 36 | 0.804878 |
38edcc9742f115e1caba52b62efa1b2127014195 | 567 | cask 'nosleep' do
version '1.4.0'
sha256 '29e7f771970dce41936372687a5160700e2208357ef1ce37d81ac95c9188efe8'
url "https://github.com/integralpro/nosleep/releases/download/v#{version}/NoSleep-#{version}.dmg"
appcast 'https://github.com/integralpro/nosleep/releases.atom',
checkpoint: '1eaf1f3d98aa20ecf0... | 33.352941 | 99 | 0.75485 |
08d617219d0251ecd1e0e08e5981893346734017 | 1,460 | def llvm_configure
case Rubinius::BUILD_CONFIG[:llvm]
when :svn, :prebuilt
"vendor/llvm/Release/bin/llvm-config"
when :config
Rubinius::BUILD_CONFIG[:llvm_configure]
else
raise "Tried to use LLVM unconfigure!"
end
end
def build_perl
Rubinius::BUILD_CONFIG[:build_perl]
end
def llvm_flags
retu... | 21.470588 | 78 | 0.676712 |
ffa0b0ad55d2266029fe2d79b04fbc4d73bc92c3 | 1,462 | require 'test_helper'
class UsersIndexTest < ActionDispatch::IntegrationTest
def setup
@admin = users(:michael)
@non_admin = users(:archer)
end
test "index as admin including pagination and delete links" do
log_in_as(@admin)
get users_path
assert_template 'users/index'
assert_select... | 26.107143 | 67 | 0.651847 |
7aa14e7c053796c34f2e0274e1ec3d0dbe223025 | 1,980 | # frozen_string_literal: true
class StandardCompetitionRanking
def initialize(data, options = {})
@data = data
@options = options.reverse_merge(sort_direction: :desc, set: :position)
end
def sort_data
return if @options[:sort_direction].nil? || (@options[:sort_direction] == false)
if @options[:... | 34.736842 | 170 | 0.586869 |
1cd787786cf26a917a88bc262cb698c216d2e543 | 323 | class CreateComments < ActiveRecord::Migration
def change
create_table :comments do |t|
t.references :user, index: true, foreign_key: true, null: false
t.references :character, index: true, foreign_key: true, null: false
t.string :body, null: false
t.timestamps null: false
end
end
e... | 26.916667 | 74 | 0.687307 |
e2d25d3cfc6e1660e906dee30cc9ec4af12e0627 | 341 | module Matestack
module Ui
module VueJs
module Components
module Collection
class Next < Matestack::Ui::Component
def response
a options.merge('v-on:click': 'vc.next()') do
yield
end
end
end
end
e... | 17.05 | 59 | 0.480938 |
18b615b32e2ecbe339e61c4c745acc12b746760f | 5,926 | require 'spec_helper'
describe Rakudax do
it 'has a version number' do
expect(Rakudax::VERSION).not_to be nil
end
#self.root
it 'Base.root is working directory' do
expect(Rakudax::Base.root).to eq(Pathname.pwd)
end
#self.exit_with_message(code, usage=false, msg=nil)
it 'Base.exit_with_message i... | 28.907317 | 113 | 0.539656 |
281c0e1b9e9407aaebd575487b1ce844f97dd489 | 58,671 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 42.515217 | 112 | 0.629272 |
e845f1dc7db840112ee08a7578af981bdcfa7c48 | 1,158 | # == Schema Information
#
# Table name: documents
#
# id :integer not null, primary key
# title :text not null
# filename :text not null
# date :date not null
# type ... | 36.1875 | 74 | 0.48532 |
116b2c74f52d9e2a1f42f58a5ea9e6de11a1bfeb | 179 | # Generated via
# `rails generate hyrax:work Resolution`
module Hyrax
class ResolutionPresenter < Hyrax::WorkShowPresenter
include Hyrax::LegalDocumentsPresenter
end
end
| 22.375 | 54 | 0.793296 |
eda383f324131f9a58410a3dc78030ca163c6802 | 794 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'coveralls'
Coveralls.wear!
require 'byebug'
require 'pry-byebug'
require 'activemodel/associations'
ActiveModel::Associations::Hooks.init
ActiveRecord::Base.establish_connection(
adapter: "sqlite3",
database: ":memory:"
)
# Test Class
class Use... | 19.85 | 79 | 0.74937 |
acfb77fb3a92eba91222f139b2a94cb6e7af53f6 | 1,217 | require 'test_helper'
module Downloads
class TumblrTest < ActiveSupport::TestCase
context "a download for a tumblr 500 sample" do
setup do
@source = "http://24.media.tumblr.com/fc328250915434e66e8e6a92773f79d0/tumblr_mf4nshfibc1s0oswoo1_500.jpg"
@tempfile = Tempfile.new("danbooru-test")
... | 33.805556 | 137 | 0.682005 |
1da03e0ed25b81d705c2be1098dca70ae29253b9 | 460 | class V8::Conversion
module Method
include V8::Conversion::Code
def to_v8
template = @@method_cache[self] ||= to_template
template.GetFunction()
end
class MethodCache
def initialize
@map = Ref::WeakValueMap.new
end
def [](method)
@map[method.to_s]
... | 17.692308 | 53 | 0.58913 |
ff53ef009ec76fd4a19a0348b763036e10fe237a | 942 | Deface::Override.new(:virtual_path => "spree/user_registrations/new",
:name => "add_socials_to_login_extras",
:insert_after => "[data-hook='login_extras']",
:text => %q(<%= render :partial => 'spree/shared/social' unless session[:omniauth] %>),
... | 52.333333 | 108 | 0.528662 |
7a32fe9cb162e77f2b97cc70598f08d889b14b47 | 911 | 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... | 29.387097 | 82 | 0.789243 |
6af7bb04eb89f34b04b2c8e9b20bff7fb489fba7 | 190 | class AddEmailToInvitations < ActiveRecord::Migration[4.2]
def self.up
add_column :invitations, :email, :string
end
def self.down
remove_column :invitations, :email
end
end
| 19 | 58 | 0.731579 |
7a905a9a15d8772f639adba8e747de0f09856577 | 319 | # frozen_string_literal: true
class FetchTweetsService
include Service
require 'net/http'
require 'json'
attr_accessor :zones
KEYWORDS = %w[coronavirus covid]
def call
Twitter::Search.perform(
q: "#{KEYWORDS.join(',')},#{zones}",
count: '20',
result_type: 'mixed'
)
end
end | 16.789474 | 42 | 0.639498 |
bb75b2fe369382b71ba5fd23e49c9a48f721aed1 | 539 | # Read about factories at https://github.com/thoughtbot/factory_bot
FactoryBot.define do
factory :performer do
name { Faker::Name.name }
description { Faker::Lorem.sentence }
trait(:with_shows) do
after(:create) do |performer|
create_list(:show, 2, performers: [performer])
end
en... | 24.5 | 67 | 0.653061 |
abc7a0f7402df44a14945e11f14f0241f87407fd | 2,785 | class Poppler < Formula
desc "PDF rendering library (based on the xpdf-3.0 code base)"
homepage "https://poppler.freedesktop.org/"
url "https://poppler.freedesktop.org/poppler-21.07.0.tar.xz"
sha256 "e26ab29f68065de4d6562f0a3e2b5435a83ca92be573b99a1c81998fa286a4d4"
license "GPL-2.0-only"
revision 1
head "... | 29.62766 | 92 | 0.685817 |
d588e20cb1133c1b409f6476be1b62a5852301bc | 1,757 | require_relative '../../test/helpers/mongo_support'
require_relative '../../lib/armagh/logging/alert'
require 'test/unit/assertions'
And(/^I should see a Document in "([^"]*)" with the following$/) do |collection, table|
result = MongoSupport.instance.find_document(collection, table.rows_hash)
assert_not_empty res... | 40.860465 | 163 | 0.742743 |
e894c9616043a5b24659ad6047ca841f7abe1042 | 403 | # frozen_string_literal: true
module FmRest
module TokenStore
class Base
attr_reader :options
def initialize(options = {})
@options = options
end
def load(key)
raise NotImplementedError
end
def store(key, value)
raise NotImplementedError
end
... | 15.5 | 34 | 0.60794 |
1a87524b3dcd5dffd5a88c7640805d73712d3954 | 8,190 | # frozen_string_literal: true
module DeviseTokenAuth::Concerns::User
extend ActiveSupport::Concern
def self.tokens_match?(token_hash, token)
@token_equality_cache ||= {}
key = "#{token_hash}/#{token}"
result = @token_equality_cache[key] ||= DeviseTokenAuth::TokenFactory.token_hash_is_token?(token_has... | 31.744186 | 113 | 0.701343 |
61a08cd261b6a66bbd4eea690fc128f9c5ef6da7 | 5,217 | ##
# $Id$
##
##
# 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'
require 'zlib'
class Metasploit3 < Msf::Exploit... | 27.171875 | 154 | 0.585969 |
f7c51c7a4aa72246a1f9f87f3a4338450a5bae65 | 168,771 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::AutoScaling
# @api private
module ClientApi
include Seaho... | 79.910511 | 222 | 0.791913 |
b9da0bb17f10a8680f499b3f282befb1b1de4136 | 2,934 | require File.expand_path(File.dirname(__FILE__) + '../../spec_helper')
describe "Client" do
before :each do
config_setup
end
describe "errors" do
before :each do
@error_report = LazyGoogleAnalytics::Client.new()
@error_report.parameters({'ids' => "ga:#{LazyGoogleAnalytics::Config.profile_i... | 29.636364 | 116 | 0.596455 |
e26dbe196d26d1c749a58006aa9e3628fb444ac2 | 520 | # frozen_string_literal: true
module RuboCop
module Daemon
module ClientCommand
class Restart < Base
def run
parser.parse(@argv)
ClientCommand::Stop.new([]).run
ClientCommand::Start.new(@argv).run
end
private
def parser
@parser ||= ... | 19.259259 | 67 | 0.525 |
ed31b9af9cc9bf0bd81598efa6cd7835871872ed | 92 | # desc "Explaining what the task does"
# task :oai_repository do
# # Task goes here
# end
| 18.4 | 38 | 0.695652 |
1a82ae0f5f76fe210490954eea071e9f2adaf5ee | 77 | # frozen_string_literal: true
json.partial! 'merchant', merchant: @merchant
| 19.25 | 45 | 0.779221 |
61adf372d4d628574b876f2a7ca7d623cc4eefc5 | 16,901 | desc 'Schema load for all databases: registry, api_log and whois'
task statuses: [:environment] do
statuses = {
'ok': [
],
'inactive': [
'clientDeleteProhibited',
'serverDeleteProhibited',
'clientHold',
'serverHold',
'clientRenewProhibited',
'serverRenewProhibited',
... | 26.998403 | 65 | 0.636057 |
39fa14cd32a9be2fb18b1595b09aad0b5a7a5725 | 1,372 | require 'test_helper'
class Pdf::ReportTest < ActiveSupport::TestCase
setup do
@account = FactoryBot.create(:simple_provider)
@service = FactoryBot.create(:simple_service, account: @account)
@report = Pdf::Report.new(@account, @service, period: :day).generate
end
test 'send_notification!' do
u... | 29.191489 | 105 | 0.734694 |
91a0ed7941bdeac4c4c6c0db9d6808857da0e7a5 | 1,593 | # Encoding: UTF-8
# Cookbook Name:: wildfly
# Recipe:: postgres_datasources
#
# Copyright (C) 2018 Brian Dwyer - Intelligent Digital Services
#
# 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
... | 31.235294 | 121 | 0.700565 |
1855d70e3b3c4800c74ad337dd5202ec98563483 | 783 | Pod::Spec.new do |spec|
spec.name = "Trikot.bluetooth"
spec.version = "0.0.1"
spec.summary = "Trikot.bluetooth ios Manager."
spec.description = "Trikot.bluetooth ios Manager."
spec.homepage = "https://github.com/mirego/trikot.bluetooth"
spec.license = "MIT license"
spec.a... | 39.15 | 110 | 0.646232 |
e917bf4fdd79dd31697828cb9c0bab603741031f | 54 | require File.join(File.dirname(__FILE__), 'bugherd')
| 27 | 53 | 0.759259 |
116c91af52c0ce89537693cc6a11233a9d5129a1 | 9,151 | # Copyright (c) 2015 AppNeta, Inc.
# All rights reserved.
require 'minitest_helper'
require 'rack'
describe "Typhoeus" do
before do
clear_all_traces
@collect_backtraces = TraceView::Config[:typhoeus][:collect_backtraces]
@log_args = TraceView::Config[:typhoeus][:log_args]
end
after do
TraceView... | 31.996503 | 113 | 0.686045 |
1d6cd538c6716d995212ae03a5e6042d6190f96e | 74 | def process_text(strings)
strings.map {|str| str.strip}.join(" ")
end
| 18.5 | 43 | 0.675676 |
215b3a1dea82ae32d955fc4ec5bca872f4b738b2 | 356 | namespace :github do
task :update_gists do
require 'open-uri'
Dir['public/gists/*.js'].each do |gist|
File.open(gist, 'w') do |file|
url = "http://gist.github.com/#{File.basename(gist)}"
puts "Updating #{File.basename(gist)} from #{url}..."
file << open(url).read
puts "`... | 23.733333 | 61 | 0.561798 |
62ab4899005f5f0ec2f1c643a410f27a2ab0616b | 2,723 | WaysIntoWork::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.a... | 34.0375 | 104 | 0.750643 |
338784ddcb0f0802fb3fcaa66fb606cce54561b0 | 1,611 | #
# Cookbook:: nginx_simplecgi
# Recipe:: init
#
# 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 agre... | 26.85 | 74 | 0.677219 |
62b43313419649a9e2bcf2e88b767478dedab9d3 | 155 | $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "nuid/sdk"
require 'minitest/autorun'
require 'minitest/pride'
require "minitest/autorun"
| 19.375 | 54 | 0.767742 |
6265b620bc760021167734d75ce4fd52ff2cd553 | 117 | class Book < ActiveRecord::Base
ThinkingSphinx::Callbacks.append(
self, :behaviours => [:sql, :deltas]
)
end
| 19.5 | 40 | 0.683761 |
03ff6e76b91655b58f980d957895e1d0d9d9f8cc | 1,547 | module Cloudspin
module Stack
module Rake
class ArtefactTask < ::Rake::TaskLib
def initialize(definition_folder:, dist_folder:)
@definition_folder = definition_folder
@dist_folder = dist_folder
define
end
def define
desc 'Assemble files to b... | 28.127273 | 111 | 0.585003 |
26e7ce5bfc869071db84c4cbdeb5632838ef7aa4 | 208 | # Sample code from Programing Ruby, page 124
require 'stringio'
ip = StringIO.new("now is\nthe time\nto learn\nRuby!")
op = StringIO.new("", "w")
ip.each_line do |line|
op.puts line.reverse
end
op.string
| 18.909091 | 54 | 0.711538 |
397700155200245aaeaae2e385b76a3458acfd0f | 4,137 | class TopicController < ApplicationController
def index
render_response(200, "Topic")
end
def show
if !params[:cluster_name].present? || !KafkaCluster.exists?(:name => params[:cluster_name])
render_response(400, 'Cluster name not present')
else
kafka = KAFKA... | 34.475 | 146 | 0.567319 |
edd9ec96514907b6099c4eaa7dd02932d4fc6359 | 3,051 | class AddRemoveCasWorkflow < ActiveRecord::Migration[6.0]
include MigrationHelper
class State < ApplicationRecord
self.table_name = 'workflow_states'
end
class Transition < ApplicationRecord
self.table_name = 'workflow_transitions'
belongs_to :project_type
end
def change
project_type = P... | 66.326087 | 137 | 0.788922 |
1ab184683c0100276368aab3fcc758edfd911526 | 7,683 | # frozen_string_literal: true
require "dry/core/deprecations"
require_relative "constants"
require_relative "provider/source"
module Dry
module System
# Providers can prepare and register one or more objects and typically work with third
# party code. A typical provider might be for a database library, or a... | 29.324427 | 132 | 0.612521 |
284f0843220872c63931f6597cf6e7eb0c86323e | 1,367 | # typed: true
module Kuby
module Redis
module DSL
module Databases
module V1
class RedisFailoverSpecSentinelAffinityPodAffinityPreferredDuringSchedulingIgnoredDuringExecutionPodAffinityTermNamespaceSelector < ::KubeDSL::DSLObject
key_value_field(:match_labels, format: :string)... | 45.566667 | 251 | 0.726408 |
7a568503b95d0a25384dc1e130a057131004d6ca | 1,151 | # frozen_string_literal: true
require 'spec_helper'
describe CircleCI::CLI::Command::CancelCommand, type: :command do
shared_examples_for 'a command cancels build' do
let(:expected_output) { 'build unhappychoice/default_reponame_from_api 1234 is canceled.' }
it 'should cancel build' do
allow(CircleCI... | 31.108108 | 96 | 0.721112 |
e88c7d3286e69590b5744fc94711c41ca87b0ea4 | 47,657 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 38.340306 | 230 | 0.65044 |
610fa91d288dfd7ab7746694bb938d9f1a5e0128 | 338 | require "oracle_hcm/resource"
module OracleHcm
class Assignment < Resource
property :business_unit_id, key: "BusinessUnitId"
property :business_unit, key: "BusinessUnitName"
property :assignment_status, key: "AssignmentStatusType"
property :primary?, key: "PrimaryFlag"
property :job_code, key: "J... | 28.166667 | 60 | 0.748521 |
4a7db8572c5e49e639fbfd5a5242d8b9821b6968 | 1,953 | require 'test/helper'
class InitTest < Test::Unit::TestCase
include FsMock
def test_init_doesnt_overwite_addon_manifest
File.open(@filename, 'w') { |f| f << '{}' }
any_instance_of(Heroku::Kensa::Client) do |client|
stub(client).gets { 'n' }
stub(client).print
stub(client).puts
end
... | 27.125 | 73 | 0.642601 |
4aac145f6977ffeab6d32d92a65fe05708d75aa9 | 1,329 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
require 'aws-sdk-core'
require 'aws-sigv4'
require_relative 'aws-sdk-ssooidc/ty... | 24.611111 | 80 | 0.735139 |
ed1f73cb9a15a713294aa7bf7f02759573f26cb7 | 1,077 | require "rails_helper"
describe Message do
it "should get a short id" do
m = create(:message)
expect(m.short_id).to match(/^\A[a-zA-Z0-9]{1,10}\z/)
end
it "validates the length of short_id" do
m_valid_short_id = create(:message)
m_valid_short_id.short_id = 'a' * 50
expect(m_valid_short_id).n... | 26.268293 | 68 | 0.645311 |
f713ffc4527d989fe7104fa1d3586180b1b94c0c | 900 | module PhotoCompetition
class FileUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
if Rails.env.production? || Rails.env.staging?
storage :fog
else
storage :file
end
def extension_whitelist
%w(jpg jpeg png)
end
version :thumb do
process resi... | 23.076923 | 104 | 0.683333 |
e8cbfdd3d41c8d77112e451279272ea767571405 | 5,036 | #!/opt/puppetlabs/puppet/bin/ruby
require 'json'
require 'puppet'
def profiles_create_or_update(*args)
header_params = {}
argstring = args[0].delete('\\')
arg_hash = JSON.parse(argstring)
# Remove task name from arguments - should contain all necessary parameters for URI
arg_hash.delete('_task')
operatio... | 32.282051 | 198 | 0.667593 |
2608255300d68e6884e6947beae5e16555ae0ebd | 2,445 | if ENV["COVERAGE"]
# Run Coverage report
require 'simplecov'
SimpleCov.start do
add_group 'Controllers', 'app/controllers'
add_group 'Helpers', 'app/helpers'
add_group 'Mailers', 'app/mailers'
add_group 'Models', 'app/models'
add_group 'Views', 'app/views'
add_group 'Libraries', 'lib'
en... | 29.457831 | 105 | 0.747239 |
187429a6c12e7e592c0e96eb537efbb04986468d | 1,219 | # frozen_string_literal: true
require "test_helper"
require "rails/generators/erb/component_generator"
Rails.application.load_generators
class ErbGeneratorTest < Rails::Generators::TestCase
tests Erb::Generators::ComponentGenerator
destination Dir.mktmpdir
setup :prepare_destination
arguments %w[user]
de... | 24.877551 | 81 | 0.768663 |
28309407fc4473574fc9112e3f93808598cdfa5e | 5,204 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HTTP::Wordpress
include Msf::Exploit::PhpEXE
def initialize(info={})
... | 32.525 | 143 | 0.635088 |
ac631c3cc05809eebdb4d752bdcf95028d5a7565 | 3,220 | require "active_model/validations/chef_version_validator"
class CookbookVersion < ApplicationRecord
include SeriousErrors
# Associations
# --------------------
has_many :cookbook_version_platforms, dependent: :destroy
has_many :supported_platforms, through: :cookbook_version_platforms
has_many :cookbook_d... | 30.666667 | 101 | 0.638199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.