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 |
|---|---|---|---|---|---|
bbb14cd25ba42039e50701b0fabfbd6929c8ff9b | 1,261 | # frozen_string_literal: true
require "regexer"
require "./spec/shared_examples/shared_examples_for_contains_test"
RSpec.describe "Regexer::Pattern #starts_with" do
let(:val) { nil }
let(:pattern_block) do
lambda do |value|
-> { starts_with value }
end.call(val)
end
subject(:pattern) do
Re... | 28.022222 | 98 | 0.638382 |
f7046ba085c78420881a0f530e9c92fd4210bde5 | 149 | class Image < ActiveRecord::Base
self.table_name = 'sir_trevor_images'
mount_uploader :file, ImageUploader
validates :file, :presence => true
end | 29.8 | 39 | 0.778523 |
117a3774110bf98fd8dc7176fe6057ec18d29c57 | 9,175 | #encoding:utf-8
testfs_dir = File.expand_path(File.dirname(__FILE__))
require File.expand_path(File.join(testfs_dir, '/data_structure/inode.rb'))
require File.expand_path(File.join(testfs_dir, '/data_structure/dir_entry.rb'))
require File.expand_path(File.join(testfs_dir, '/data_structure/file_data.rb'))
require File.... | 27.552553 | 120 | 0.658093 |
1da439046ea6e288520587c613d8148fb92e3e71 | 43 | '1234'.succ #=> '1235'
'99'.succ #=> '100'
| 14.333333 | 22 | 0.488372 |
ffa0e81095d8f6f5d3600c9fe7430c748f689e93 | 470 | cask 'pgweb' do
version '0.9.8'
sha256 '07b1240f07fd826fb4987b4cc1859d5baf007b80f63602c58101f0437001d9f8'
url "https://github.com/sosedoff/pgweb/releases/download/v#{version}/pgweb_darwin_amd64.zip"
appcast 'https://github.com/sosedoff/pgweb/releases.atom',
checkpoint: 'd86058f025c53c9def9b11b905cc9c... | 36.153846 | 94 | 0.782979 |
d5dec8e20a606a540d8d08bba599795384f9ed7d | 6,133 | class Middleman::CoreExtensions::Internationalization < ::Middleman::Extension
option :no_fallbacks, false, 'Disable I18n fallbacks'
option :langs, nil, 'List of langs, will autodiscover by default'
option :lang_map, {}, 'Language shortname map'
option :path, '/:locale/', 'URL prefix path'
option :templates_d... | 32.973118 | 103 | 0.662971 |
5dbd1990896d3d6fa7267c721fc62d32ff0b59ae | 800 | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Ch... | 26.666667 | 111 | 0.6675 |
08a3adce8ccb9e1b691b50f8a4408df7b296dda9 | 86 | require 'angular/ngt/version'
require 'angular/ngt/engine'
require 'angular/ngt/haml'
| 21.5 | 29 | 0.790698 |
6aa94f7b20b1b35500ee84842becef0510bc846a | 396 | # frozen_string_literal: true
class AddIndexToCountPendingMirrorUpdates < ActiveRecord::Migration[5.1]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :project_mirror_data, [:last_update_at, :retry_count]
end
def down
remove_concu... | 22 | 81 | 0.790404 |
e925b4df8ed1d8c754a17f6d582c2b6ac0f420c8 | 5,259 | require 'test_helper'
class Kaui::BundlesControllerTest < Kaui::FunctionalTestHelper
test 'should be redirected if an invalid account id was specified in index screen' do
account_id = SecureRandom.uuid.to_s
get :index, :account_id => account_id
assert_redirected_to account_path(account_id)
assert_eq... | 40.145038 | 143 | 0.74729 |
38359470e3e7a9e75ea8eae63dc2381d025a6c99 | 1,055 | module TD::Types
# Describes a poll.
#
# @attr id [Integer] Unique poll identifier.
# @attr question [String] Poll question, 1-255 characters.
# @attr options [Array<TD::Types::PollOption>] List of poll answer options.
# @attr total_voter_count [Integer] Total number of voters, participating in the poll.
... | 45.869565 | 113 | 0.708057 |
d5a0a2dd88564e614d48e4bcdac9100e40096d0b | 5,857 | # frozen_string_literal: true
module Ci
module JobArtifacts
class DestroyBatchService
include BaseServiceUtility
include ::Gitlab::Utils::StrongMemoize
# Danger: Private - Should only be called in Ci Services that pass a batch of job artifacts
# Not for use outside of the Ci:: namespace
... | 38.788079 | 147 | 0.697115 |
114d6758d9125db7ac479fb03a5e48e821d1eb99 | 5,355 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Report
include Msf::Auxiliary::Scanner
include M... | 29.262295 | 122 | 0.571055 |
0361a037dd0356bdd3c72de2b7a8ba3aaf9b7b2e | 561 | require 'spec_helper'
module Finitio
describe SetType, 'initialize' do
subject{
SetType.new(intType)
}
context 'with valid arguments' do
it{ should be_a(SetType) }
it 'should set the instance variables' do
expect(subject.elm_type).to eq(intType)
end
end
context ... | 19.344828 | 76 | 0.616756 |
91ed2d1b733d19e45891049b012d1e9a63d7a561 | 4,351 | #!/usr/bin/ruby
# Copyright (c) 2015-2016 SUSE LLC
#
# 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, modify, merge... | 31.759124 | 89 | 0.67134 |
d5aecd6f7baba8ae3b1fe4ffe0131dd90d69da8f | 6,701 | =begin
#ORY Oathkeeper
#ORY Oathkeeper is a reverse proxy that checks the HTTP Authorization for validity against a set of rules. This service uses Hydra to validate access tokens and policies.
The version of the OpenAPI document: v0.0.0-alpha.62
Contact: hi@ory.am
Generated by: https://openapi-generator.tech
OpenAPI... | 30.459091 | 233 | 0.635129 |
f81ab106cd5844dc4e21f09fb92e76342e8e26a6 | 3,158 | class Bullet < Formula
desc "Physics SDK"
homepage "https://bulletphysics.org/"
url "https://github.com/bulletphysics/bullet3/archive/3.17.tar.gz"
sha256 "baa642c906576d4d98d041d0acb80d85dd6eff6e3c16a009b1abf1ccd2bc0a61"
license "Zlib"
head "https://github.com/bulletphysics/bullet3.git", branch: "master"
... | 33.595745 | 123 | 0.651995 |
e2b75503ac2882db1449d0b9f096da58b8b550f4 | 208 | # frozen_string_literal: true
class UrlPolicy < ApplicationPolicy
def index?
true
end
def edit?
user.associate_access?
end
def update?
edit?
end
def destroy?
edit?
end
end
| 10.4 | 35 | 0.658654 |
f8dff1d544c45baa3d1839871302a136b5f41fed | 925 | require_relative 'spec_helper'
describe 'Mongoid::EncryptedString integration' do
let(:string) { 'foo' }
describe 'create document without any attributes' do
subject { Document.create }
it 'sets encrypted string to nil' do
subject.string.must_be_nil
end
describe "when default is set to ... | 20.108696 | 73 | 0.677838 |
7ad15675f7f576f102d6e982f55ec87b5bcabf5b | 409 | module Far
class Options < Hash
attr_accessor :options
def self.far_options
[:replace, :no_replace, :please, :no_please]
end
def initialize(options={})
options.each do |k, v|
self[k.to_sym] = Option.new k, v
end
end
def to_command_line
self.reject do |k, v|
... | 18.590909 | 50 | 0.596577 |
03286764a59a475f459ee3a907725fff9aa83b37 | 27,107 | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 39.171965 | 118 | 0.625484 |
e203d6be0c3d3ac4ae8fa9ba0125e3a519ebc51a | 3,782 | require 'spec_helper'
describe Vaderc::Configuration do
context '#initialize' do
describe 'attributes' do
let(:configuration) { Vaderc::Configuration.new }
it 'has a default port' do
expect(configuration.port).to eq('6667')
end
it 'has a default mode' do
expect(configura... | 29.546875 | 79 | 0.558699 |
ac4b43c3e29877f254c3734109593a2931b47ce4 | 1,548 | #
# Be sure to run `pod lib lint Lib1.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 = 'Lib1'
s.vers... | 36 | 100 | 0.627261 |
1a436cb43af44af200ce2699b1f9f8895b3939cc | 418 | module RemoteService
class Base
class << self
def queue_name
"services.#{@queue ||= default_queue_name}"
end
private
def queue(name)
@queue = name
end
def default_queue_name
self.name.split(/::/).last.
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
... | 17.416667 | 51 | 0.480861 |
bb0f7c07954ff0450dd52ac53134e765f6671b7b | 390 | class CreateOrderedWorkPackages < ActiveRecord::Migration[5.1]
def change
create_table :ordered_work_packages do |t|
t.integer :position, index: true, null: false
t.references :query, type: :integer, foreign_key: { index: true, on_delete: :cascade }
t.references :work_package, type: :integer... | 35.454545 | 99 | 0.702564 |
61d7065c4330dca68279f21aca82c76d6d8ac73b | 433 | class Typewriter::ImageUploadsController < ApplicationController
skip_before_action :verify_authenticity_token
def create
render json: Typewriter::ImageUpload.create!(image_params).to_json
end
def show
upload = Typewriter::ImageUpload.find(params[:id])
render json: {
src: upload.image_src,
... | 18.826087 | 70 | 0.727483 |
4ab5b746dab4c2706925b0cbb405d95dacab6f81 | 1,445 | require "helper/acceptance"
class FlowdockNotificationTest < Test::Unit::AcceptanceTestCase
story <<-EOS
As an administrator,
I want to setup the Flowdock notifiers on my projects
So that I get alerts with every build
EOS
setup do
load "integrity/notifier/flowdock.rb"
@token = "fc7795d580... | 22.230769 | 74 | 0.672664 |
acca54cd52fbd4b51a6b123153381777d3fd5f1a | 3,553 | class Name < AbstractModel
# Is it safe to merge this Name with another? If any information will get
# lost we return false. In practice only if it has Namings.
def mergeable?
namings.empty?
end
# Merge all the stuff that refers to +old_name+ into +self+. Usually, no
# changes are made to +self+, ho... | 29.363636 | 114 | 0.642274 |
edbe428a28242892aecaa774be8b53e20ca854d3 | 1,306 | require 'test_helper'
describe Lotus::Validations do
describe '.attribute' do
it 'coerces attribute names to symbols' do
assert AttributeTest.defined_validation?(:attr)
end
it 'ensures attribute uniqueness' do
assert UniquenessAttributeTest.defined_validation?(:attr)
end
it 'collect... | 29.022222 | 105 | 0.667688 |
87b3f2c21a1699c67494819729d48c59a1d8a37b | 575 | #
# Append to empty file
#
user 'test_user'
file '/tmp/emptyfile'
append_if_no_line 'should add to empty file' do
path '/tmp/emptyfile'
line 'added line'
end
append_if_no_line 'missing_file' do
path '/tmp/missing_create'
line 'added line'
end
append_if_no_line 'missing_file with owner, group, mode' do
pa... | 17.424242 | 59 | 0.742609 |
1db10da957590a8298d2df61ab73a68b3da64ed8 | 1,345 | # -*- encoding: utf-8 -*-
# stub: dotenv 2.5.0 ruby lib
Gem::Specification.new do |s|
s.name = "dotenv"
s.version = "2.5.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Brandon Keepers"]
s.date = "2018-06-21... | 32.804878 | 105 | 0.628996 |
28316c8757c0f65278b041f958677a724d5575f0 | 5,469 | module ManageIQ::Providers::Vmware::InfraManager::Vm::RemoteConsole
require_dependency 'securerandom'
def console_supported?(type)
%w(VMRC VNC WEBMKS).include?(type.upcase)
end
def validate_remote_console_acquire_ticket(protocol, options = {})
raise(MiqException::RemoteConsoleNotSupportedError, "#{pro... | 37.204082 | 184 | 0.685134 |
b94305deabdfd6d17c3378b3d63fd53113b29840 | 1,072 | require 'spec_helper'
describe Mapper::Builder, '.run' do
subject { object.run(mapper_base_class, model, &block) }
let(:object) { described_class }
let(:model) { mock('Model') }
let(:builder) { mock('Builder', :mapper => mapper) }
let(... | 25.52381 | 86 | 0.567164 |
185109e6bb82e2a20eaaca2a951336ceb3681cd5 | 148 | class AddSenseLexemeId < ActiveRecord::Migration
def change
add_column :senses, :lexeme_id, :uuid
add_index :senses, :lexeme_id
end
end
| 21.142857 | 48 | 0.743243 |
387b42484522c68f62ba55179ed9be7b7bfc174e | 145 | RSpec::Matchers.define :be_file do
match do |actual|
ssh_exec(RSpec.configuration.host, commands.check_file(actual))
$? == 0
end
end
| 20.714286 | 67 | 0.703448 |
e2eaec2affdbf476de62454547a7c3176d004e02 | 75 | class Location < ActiveRecord::Base
include DocumentFrequencyConcern
end
| 18.75 | 35 | 0.84 |
e93bf671ede5b75710702e2ee9f7a539bf455b26 | 561 | # frozen_string_literal: true
# typed: true
# compiled: true
# run_filecheck: INITIAL
# run_filecheck: OPT
extend T::Sig
sig {params(str: String, obj: T.untyped).returns(T::Boolean)}
def streq(str, obj)
str === obj
end
# INITIAL-LABEL: "func_Object#streq"
# INITIAL: call i64 @sorbet_int_rb_str_equal
# INITIAL{LITE... | 20.777778 | 61 | 0.713012 |
e2a198cf1a4a9641ab0bb59f92ed6ed0bd2567db | 261 | class CreateUserLocationJoinTable < ActiveRecord::Migration
def change
create_table :user_location_joins do |t|
t.references :location, index: true, null: false
t.references :user, index: true, null: false
t.timestamps
end
end
end
| 26.1 | 59 | 0.712644 |
111d2597d76e304a960ef261abc00a27532973f1 | 12,329 | class Vendor < ActiveRecord::Base
include Concerns::RSAPublicKeyEncryptor
attr_accessor :synced
WIRE_PAYMENT_FIELDS = [:routing_number, :bank_account_number]
CHECK_PAYMENT_FIELDS = [:address1, :city, :zip, :state]
VENDOR_BUILDER_ATTRIBUTES = [:name, :address1, :address2, :city, :state, :zip, :email]
en... | 29.495215 | 196 | 0.725525 |
03e2d52de8dab13145631667a2df258d7ae42d93 | 2,745 | class Mpich < Formula
desc "Implementation of the MPI Message Passing Interface standard"
homepage "https://www.mpich.org/"
url "https://www.mpich.org/static/downloads/3.3.2/mpich-3.3.2.tar.gz"
mirror "https://fossies.org/linux/misc/mpich-3.3.2.tar.gz"
sha256 "4bfaf8837a54771d3e4922c84071ef80ffebddbb6971a0060... | 32.678571 | 94 | 0.643352 |
1d7d4c6dded703c2a16e473efaf32ebda2adcc05 | 2,260 | # frozen_string_literal: true
require 'spec_helper'
describe 'apache::mod::ext_filter', type: :class do
it_behaves_like 'a mod class, without including apache'
context 'on a Debian OS' do
let :facts do
{
osfamily: 'Debian',
operatingsystemrelease: '8',
lsbdistcodename: 'jessie',
... | 34.242424 | 122 | 0.60531 |
bf9cf9ebcc1d0809f6b9d19305a8249bc592f6fa | 883 | class ApplicationController < ActionController::API
include ActionView::Rendering
include ActionController::MimeResponds
def token(user)
JWT.encode(
{ user_id: user.id, exp: (Time.now + 2.hours).to_i },
ENV['TOKEN_SECRET'],
'HS256'
)
end
def verify_token
@current_user = JWT.dec... | 20.534884 | 84 | 0.667044 |
38e56481e0f908cbe63fdfbfd7ff67b30d027f79 | 5,336 | # 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::ServiceFabric::V6_2_0_9
module Models
#
# Statistics about setup or main entry point of a code package deployed on
# a Service ... | 32.339394 | 79 | 0.528298 |
87060f3b7f10b2d528b3416168e2e8824e3dd28f | 139 | # frozen_string_literal: true
module Spree
class PrototypeTaxon < Spree::Base
belongs_to :prototype
belongs_to :taxon
end
end
| 15.444444 | 36 | 0.748201 |
62004f3dbc6c7b47a164ef91c34420828a587a02 | 436 | # sets log level to :warning
Delayed::Backend::ActiveRecord::Job.class_eval do
class << self
def reserve_with_warning(*args, &block)
log_level = ActiveRecord::Base.logger.level
ActiveRecord::Base.logger.level = 1
reserve_without_warning(*args, &block)
ensure
ActiveRecord::Base.logger.l... | 27.25 | 49 | 0.71789 |
876c06e867989394e52bee33693de2675559c0f4 | 3,114 | # 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::ServiceFabric::V6_5_0_36
module Models
#
# Represents health evaluation for a node, containing information about the
# data and ... | 30.23301 | 79 | 0.506744 |
7a34d1602e68668e70618a5c69ebe4297a0af5fd | 1,094 | module Minotaur
#
# supporting logic for 'pluggable' generator-sets
#
class Theme
include Minotaur
include Minotaur::Geometry
# helpers?
# hmmmmmm? is this even connected to anything? IS THIS THING ON
def self.current_theme
@@current_theme ||= DEFAULT_THEME
end
def self.gen... | 22.791667 | 67 | 0.603291 |
f8b42ab8814763a6c8d7f5ae7475b57af05ce512 | 382 | class DisallowNullOnForeignKeys < ActiveRecord::Migration
def up
change_column_null :topics, :board_id, false
change_column_null :posts, :topic_id, false
change_column_null :images, :post_id, false
end
def down
change_column_null :topics, :board_id, true
change_column_null :posts, :topic_id, ... | 27.285714 | 57 | 0.751309 |
f8a19d396f753685ce502fd4db50907df3c12d79 | 2,957 | #
# Copyright (c) 2006-2010 National ICT Australia (NICTA), Australia
#
# Copyright (c) 2004-2009 WINLAB, Rutgers University, USA
#
# 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 res... | 38.402597 | 96 | 0.681434 |
8704d594f28f11985d22b878560f25a0d33cffa4 | 354 | ActiveRecord::Schema.define do
self.verbose = false
create_table :tags, :force => true do |t|
t.string :name
t.timestamps
end
create_table :topics, :force => true do |t|
t.string :name
t.timestamps
end
create_table :tags_topics, :force => true do |t|
t.belongs_to :tag
t.belongs_to... | 18.631579 | 50 | 0.655367 |
629d48badde052f64c20b0c8d4fe34b94c41803a | 4,794 | require 'spec_helper'
require 'puppet/type/sensu_hook'
describe Puppet::Type.type(:sensu_hook) do
let(:default_config) do
{
name: 'test',
command: 'test',
}
end
let(:config) do
default_config
end
let(:hook) do
described_class.new(config)
end
it 'should add to catalog without ... | 25.913514 | 104 | 0.617021 |
010817193f15d242b11311b9634126e3295b24d1 | 443 | module ActsAsDynamicRoute
module Hook
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def acts_as_dynamic_route(field, *args)
DynamicRouter.send(:register, self, field, *args)
class_eval %Q?
after_save :reload_routes
def reload_ro... | 20.136364 | 57 | 0.611738 |
26d0fa95f92cd077c6d77b45f03ad606e368a7f0 | 640 | class UpdateBudget
attr_accessor :budget
def initialize(budget:)
self.budget = budget
end
def call(attributes: {})
budget.assign_attributes(attributes)
convert_and_assign_value(budget, attributes[:value])
result = if budget.valid?
Result.new(budget.save, budget)
else
Result.n... | 21.333333 | 104 | 0.726563 |
f7742007ef0df97b1eba625857112158ed031dc2 | 4,293 | # frozen_string_literal: true
module Spotify
class SDK
class Item < Model
##
# Let's transform the item object into better for us.
# Before: { track: ..., played_at: ..., context: ... }
# After: { track_properties..., played_at: ..., context: ... }
#
# :nodoc:
def initia... | 27.170886 | 98 | 0.567901 |
bf99855f54d21a9e4ba46a3e90d45438685041f2 | 962 | # encoding: utf-8
# frozen_string_literal: true
# A utility that takes a class and a data hash. Creates an instance of the
# class and assigns relevant data from the hash to the instance.
class ObjectFactory
attr_reader :instance
def initialize(object)
@instance = object.new
end
def build(data)
@data... | 21.863636 | 74 | 0.70894 |
4a4cd0d834412b155e3c219220923d87aafa3b9d | 3,954 | # Copyright 2019 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, ... | 30.415385 | 107 | 0.651492 |
f7005103cb083f45c29506d16883c6370ff5ad9c | 150 | # Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Static::Application.initialize!
| 25 | 52 | 0.8 |
1d05144ee9a75a681b817ead8ceed7dcc8d1cf88 | 858 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/google_ads/v0/enums/keyword_match_type.proto
require 'google/protobuf'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "google.ads.googleads.v0.enums.KeywordMatchTypeEnum" do
end
add_enum "google.ads.googleads.v... | 39 | 179 | 0.794872 |
1a81c0548cd2627c5afcefbeb0fe608893bed45c | 1,456 | # Windows tests only run on Windows.
if ENV['OS'] == 'Windows_NT'
require 'spec_helper'
require 'em/pure_ruby'
require 'rubygems'
require 'appium_lib'
require 'rutl/appium/appium_extension'
require 'rutl/appium/appium_server'
require 'rutl/appium/windows_test_app_wrapper'
require 'rspec'
RSpec.descri... | 22.060606 | 63 | 0.587912 |
f860a4c0ce017eb230774ebf40483ec0f17dbeec | 998 | =begin
#Tatum API
## Authentication <!-- ReDoc-Inject: <security-definitions> -->
OpenAPI spec version: 3.9.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 3.0.31
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for Tatum::InlineResponse20067
# Auto... | 24.341463 | 102 | 0.737475 |
18dad7d7530a69e423b0de28f90b6da9760413cb | 26,073 | require 'spec_helper'
require 'repositories/app_usage_event_repository'
module VCAP::CloudController
module Repositories
RSpec.describe AppUsageEventRepository do
subject(:repository) { AppUsageEventRepository.new }
describe '#find' do
context 'when the event exists' do
let(:event)... | 37.088193 | 135 | 0.57968 |
61c7984a6b3069124a382de7c378681ddc183bd4 | 1,305 | require File.expand_path('../../../spec_helper', __FILE__)
require 'set'
describe "Set#proper_superset?" do
before :each do
@set = Set[1, 2, 3, 4]
end
it "returns true if passed a Set that self is a proper superset of" do
@set.proper_superset?(Set[]).should be_true
Set[1, 2, 3].proper_superset?(Set[... | 37.285714 | 83 | 0.698084 |
0815d3d592e6c62a0fdc90b35f8cc9938d284a55 | 2,903 | #
# Be sure to run `pod lib lint MYPickerView.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 = 'MYPick... | 32.988636 | 107 | 0.606269 |
21b8b899b15d68a5709138814b4084b35d55ce56 | 1,551 | # frozen_string_literal: true
# auto_register: false
require 'dry/transaction'
require 'pg_export/import'
require 'pg_export/container'
require 'pg_export/lib/pg_export/value_objects/dump_file'
class PgExport
module Transactions
class ExportDump
include Dry::Transaction(container: PgExport::Container)
... | 27.210526 | 80 | 0.687943 |
617ca3165e181e586c792819e1b39c666e079e0f | 717 | module FHIR
# fhir/currency_code.rb
class CurrencyCode < PrimitiveCode
include Mongoid::Document
def as_json(*args)
result = super
result.delete('id')
unless self.fhirId.nil?
result['id'] = self.fhirId
result.delete('fhirId')
end
result
end
... | 25.607143 | 101 | 0.624826 |
7ae2128ab71384019e5aa69d18560db3d43222a0 | 635 | namespace :ss do
#
# 0 * * * * bundle exec rake ss:hourly
#
task hourly: :environment do
if ::SS.config.cms.disable.blank?
::Tasks::Cms.each_sites do |site|
puts "# #{site.name} (#{site.host})"
# サイト内検索の更新
::Tasks::SS.invoke_task("cms:es:feed_releases", site.host) if site.elas... | 24.423077 | 97 | 0.606299 |
eddd04f684141c779a3bc60b4bc74856264f1286 | 1,906 | #
# This class was auto-generated.
#
require 'onlinepayments/sdk/data_object'
require 'onlinepayments/sdk/domain/mandate_customer'
module OnlinePayments::SDK
module Domain
# @attr [String] alias
# @attr [OnlinePayments::SDK::Domain::MandateCustomer] customer
# @attr [String] customer_reference
# @at... | 37.372549 | 109 | 0.679433 |
03ecdcbacda6e1fcefd2c36b5b1ddff8e98c4e37 | 100 | # frozen_string_literal: true
require_relative 'model/transaction'
require_relative 'model/report'
| 20 | 36 | 0.84 |
1d152c103f79b399c792a1c6b26c56d7443ce42c | 1,779 | # frozen_string_literal: true
class SkillsController < HtmlController
include Pagy::Backend
has_scope :exclude_deleted, only: :index, type: :boolean, default: true
has_scope :search, only: :index
def index
authorize Skill
@pagy, @skills = pagy apply_scopes(policy_scope(Skill.includes(:organization)))
... | 27.369231 | 151 | 0.726251 |
b976badc33450b7f2d00fce3b0dfc398e7bd9f4c | 350 | require 'spec_helper'
describe Kata::Kyu8 do
it 'Return a fake binary number' do
Kata::Kyu8.fake_binary('45385593107843568').must_equal('01011110001100111')
Kata::Kyu8.fake_binary('509321967506747').must_equal('101000111101101')
Kata::Kyu8.fake_binary('366058562030849490134388085').must_equal('0110111100... | 35 | 99 | 0.782857 |
087f043a366b5b7d13dce08c682f8793c4fa580b | 73 | require_relative 'support/tuple_algebra'
require_relative 'support/keys'
| 24.333333 | 40 | 0.863014 |
61e90303759f103eceb6ea6e40f90eac373aa9ef | 2,793 | # 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::V2018_01_01
module Models
#
# Response for the ListRouteFilters API service call.
#
class RouteFilterListResu... | 27.93 | 80 | 0.524884 |
e212a8f4e97a719ccb365136bb8a2babc01c9390 | 1,768 | # frozen_string_literal: true
class CompareProjectCsvDecorator
include ActionView::Helpers::DateHelper
include ActionView::Helpers::NumberHelper
include ApplicationHelper
include ProjectsHelper
def initialize(project, host)
@project = project
@host = host
@url_decorator = CompareProjectUrlCsvDec... | 25.257143 | 104 | 0.723416 |
ac1829751ec7003ffbb51352947d8d7518f80c71 | 3,344 | require "spec_helper"
require "json"
describe InfluxDB::Client do
let(:subject) do
described_class.new(
"database",
{
host: "influxdb.test",
port: 9999,
username: "username",
password: "password",
time_precision: "s"
}.merg... | 27.186992 | 96 | 0.579844 |
089e98db805c9931103e68824adde6a6590393b0 | 382 | module ApplicationHelper
def current_user
if(user_id=session[:user_id])
@current_user ||=User.find_by(id:user_id)
elsif (user_id=cookies.signed[:user_id])
user=User.find_by(id:user_id)
if user && user.authenticated?(cookies[:remember_token])
log_in_user(user)
@current_user=user
end
end
end
... | 19.1 | 59 | 0.725131 |
ac1ad92ec1479591db233568b10055ef3fc4a6ab | 1,581 | # -*- coding: binary -*-
module Rex
module Payloads
module Win32
require 'rex/payloads/win32/kernel/common'
require 'rex/payloads/win32/kernel/recovery'
require 'rex/payloads/win32/kernel/stager'
require 'rex/payloads/win32/kernel/migration'
module Kernel
#
# Constructs a kernel-mode payload using the supplied opt... | 28.745455 | 83 | 0.714105 |
7a4a1e4777b63e87f4cdf77ca77964b8bfbad6c4 | 607 |
Pod::Spec.new do |spec|
spec.name = "DropDownMeun"
spec.version = "0.0.1"
spec.summary = "一个快速集成的下拉筛选控件"
spec.description = <<-DESC
基于 OC 实现的下拉筛选控件
DESC
spec.homepage = "https://github.com/iOS-PPG/DropDownMeun"
spec.license = "MIT"
spec.author ... | 25.291667 | 106 | 0.558484 |
28281210401768999e55f8c44b5008670dd9d537 | 367 | require 'formula'
class Vcsh < Formula
homepage 'https://github.com/RichiH/vcsh'
url 'https://github.com/RichiH/vcsh/archive/v1.20130724-homebrew.tar.gz'
version '1.20130724'
sha1 '3cda5c059bbe40fbd55ff8d0d74dd9f327a15da2'
depends_on 'mr'
def install
bin.install 'vcsh'
man1.install 'vcsh.1'
end... | 18.35 | 74 | 0.705722 |
e9245724f718c7efc5d686dbe179b65ea4e90f3b | 956 | {
matrix_id: '1454',
name: 'boneS01',
group: 'Oberwolfach',
description: 'Oberwolfach: 3D trabecular bone',
author: 'B. van Rietbergen, E. Rudnyi, J. Korvink',
editor: 'E. Rudnyi',
date: '2006',
kind: 'model reduction problem',
problem_2D_or_3D: '1',
num_rows: '127224',
num_c... | 28.969697 | 86 | 0.661088 |
212b6c4654de2e3e24bc39a766d824496b3afb14 | 594 | # frozen_string_literal: true
module ActiveRecord # :nodoc:
# = Active Record \Serialization
module Serialization
extend ActiveSupport::Concern
include ActiveModel::Serializers::JSON
included do
self.include_root_in_json = false
end
def serializable_hash(options = nil)
if self.cla... | 23.76 | 66 | 0.683502 |
b90e3dfd75e8781f7c1416603318db05c4f2a60e | 624 | Spree::Sample.load_sample("orders")
order = Spree::Order.last
inventory_unit = order.inventory_units.first
stock_location = inventory_unit.find_stock_item.stock_location
return_item = Spree::ReturnItem.create(inventory_unit: inventory_unit)
return_item.exchange_variant = return_item.eligible_exchang... | 28.363636 | 75 | 0.796474 |
6ac63df452d863836bb64bdd210d68c8e13f62ad | 4,650 | ##
# 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 = GoodRanking ... | 28.703704 | 116 | 0.592688 |
f8d7819fb15d8b0378bd975eba72cab2d61f27a5 | 1,278 | # 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... | 37.588235 | 74 | 0.786385 |
5ddb48d9157be9134a47a7b02b7c40e785844b91 | 601 | Pod::Spec.new do |s|
s.name = "FHTTPClient"
s.version = "0.0.3"
s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
s.summary = "A simple iOS HTTP Client for REST services."
s.homepage = "https://github.com/furymobile/FHTTPClient"
s.author = { "Fury Mo... | 42.928571 | 95 | 0.605657 |
f7fd8ecbc4a775651620310bd8bb7806f66d3e4d | 506 | cask "amd-power-gadget" do
version "0.6.6"
sha256 "2a09858baf24ea757fada5243c20c94bfc92054b6ba8dd04e0e77c423915fe96"
url "https://github.com/trulyspinach/SMCAMDProcessor/releases/download/#{version}/AMD.Power.Gadget.app.zip"
appcast "https://github.com/trulyspinach/SMCAMDProcessor/releases.atom"
name "AMD Po... | 38.923077 | 109 | 0.79249 |
ed6708e2cee7b91d5ac5fc7abd72c7842308a7f2 | 817 |
module RabbitMQ
module FFI
class ConnectionTune < ::FFI::Struct
layout(
:channel_max, :uint16,
:frame_max, :uint32,
:heartbeat, :uint16
)
def self.id
:connection_tune
end
def id
:connection_tune
end
def apply(c... | 20.425 | 65 | 0.53978 |
397933cb9ee2373caa9a6c21fedb1f675dff041e | 159 | class CreateAromas < ActiveRecord::Migration[5.2]
def change
create_table :aromas do |t|
t.string :aroma_name
t.timestamps
end
end
end
| 17.666667 | 49 | 0.672956 |
f8bde530c9f6a520a1522df7183d98b63ec3efdf | 2,771 | #!/usr/bin/env ruby
# Encoding: utf-8
#
# Copyright 2018 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 ... | 30.450549 | 91 | 0.694695 |
edbd48b9cf2fe4933fa700a4fe9111dd8deffe86 | 833 | require 'synapse/process_manager/correlation'
require 'synapse/process_manager/correlation_resolver'
require 'synapse/process_manager/correlation_set'
require 'synapse/process_manager/lock_manager'
require 'synapse/process_manager/pessimistic_lock_manager'
require 'synapse/process_manager/process'
require 'synapse/proc... | 43.842105 | 61 | 0.87515 |
2137d96f746235e77802d290cedbed78503629d5 | 183 | # frozen_string_literal: true
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
require "bundler/setup" # Set up gems listed in the Gemfile.
require "bootsnap/setup"
| 30.5 | 65 | 0.748634 |
e9452f28c252a81731b6866e455d3b22e27c5435 | 1,894 | # frozen_string_literal: true
require File.expand_path("../lib/mail_catcher/version", __FILE__)
Gem::Specification.new do |s|
s.name = "mailcatcher"
s.version = MailCatcher::VERSION
s.license = "MIT"
s.summary = "Runs an SMTP server, catches and displays email in a web interface."
s.description = <<-END
... | 33.821429 | 83 | 0.689018 |
089ff25649049921d190d4010a39142c673a9d9c | 120 | module OpenFlashChart
class BarBase < Base
def attach_to_right_y_axis
@axis = 'right'
end
end
end
| 15 | 30 | 0.658333 |
620559093bf173899df68387fe5b798566fa76ee | 1,263 | module Fog
module AWS
class DynamoDB
class Real
# Get DynamoDB items
#
# ==== Parameters
# * 'request_items'<~Hash>:
# * 'table_name'<~Hash>:
# * 'Keys'<~Array>: array of keys
#
# ==== Returns
# * response<~Excon::Response>:
... | 32.384615 | 147 | 0.517815 |
d574b9fa9d82cda28acc05394e5c361486ace85e | 1,145 | require "language/node"
class BashLanguageServer < Formula
desc "Language Server for Bash"
homepage "https://github.com/bash-lsp/bash-language-server"
url "https://registry.npmjs.org/bash-language-server/-/bash-language-server-3.0.4.tgz"
sha256 "88a676b6ad4dc6409a813588fd975a97f881b8f4c2bb4fcb3d4880302606dc2d"... | 29.358974 | 115 | 0.672489 |
2143fe2e434170758a895262493daa7e8621733f | 171 | require 'active_support/lazy_load_hooks'
require 'web_console/engine'
require 'web_console/repl'
module WebConsole
ActiveSupport.run_load_hooks(:web_console, self)
end
| 21.375 | 50 | 0.836257 |
abbf44e6da25269221950d92fbf7f2b883bc5117 | 2,908 | module Rebels
class CreateService < ServiceBase
PreconditionFailedError = Class.new(StandardError)
attr_reader :rebel, :local_group, :source
def initialize(source: nil, local_group: nil)
@rebel = Rebel.new
@local_group = local_group
@source = source
end
def run(params = {})
... | 23.836066 | 77 | 0.587001 |
91353d924a61c8efb7c0e8d520c91c28db5cb8ac | 273 | class CreateContactHistories < ActiveRecord::Migration
def self.up
create_table :contact_histories do |t|
t.integer :person_id
t.text :type
t.text :email
t.timestamps
end
end
def self.down
drop_table :contact_histories
end
end
| 17.0625 | 54 | 0.681319 |
79b76709ee76b7a2f21db0ba9c5ee91c9e7b7f8e | 616 | # frozen_string_literal: true
require 'kaminari/mongoid/mongoid_criteria_methods'
module Kaminari
module Mongoid
module MongoidExtension
module Document
extend ActiveSupport::Concern
include Kaminari::ConfigurationMethods
included do
scope Kaminari.config.page_method_name... | 26.782609 | 99 | 0.655844 |
ff38f736936140511c782fa7b323772a4ae8c174 | 1,295 | class WidgetsController < ApplicationController
include PasswordRequired::ControllerConcern
password_required for: [:create, :update, :destroy],
with: ->(password) { password == 'password' }
before_action :set_widget, only: [:show, :edit, :update, :destroy]
# GET /widgets
def index
... | 19.923077 | 73 | 0.668726 |
e2147c582fd93125edfd8a3b5ea481d0cdd24834 | 258 | class CreateObjectFieldOptions < ActiveRecord::Migration
def change
create_table :object_field_options do |t|
t.integer :object_field_id
t.string :name
t.string :description
t.string :value
t.timestamps
end
end
end
| 19.846154 | 56 | 0.689922 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.