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 |
|---|---|---|---|---|---|
bfc73936e5610555a41a602615946f47449c1930 | 177 | module Admin
module Conversations
class BlocksController < ApplicationController
def index
@conversations = Conversation.blocked
end
end
end
end
| 17.7 | 50 | 0.700565 |
fffd1ce3be8775a57e93303ced4afbbdf2a55494 | 5,915 | input = <<eos
--config.file="prometheus.yml"
Prometheus configuration file path.
--web.listen-address="0.0.0.0:9090"
Address to listen on for UI, API, and
telemetry.
--web.config.file="" [EXPERIMENTAL] Path to configuration file that
can enable TLS or authentication.
--web.read-timeout=5m Maximum duration be... | 36.067073 | 79 | 0.732883 |
879f1a3f470d2ff1e9dc04090c585f04ec53c511 | 834 | #
# Be sure to run `pod lib lint EMVendors.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 http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'EMVendors'... | 36.26087 | 102 | 0.625899 |
ab3c9c871d362d4cec3e5cadcbdfbf1a4618aaee | 2,273 | require 'spec_helper'
require 'puppet/pops'
require 'puppet/loaders'
describe 'the assert_type function' do
after(:all) { Puppet::Pops::Loaders.clear }
around(:each) do |example|
loaders = Puppet::Pops::Loaders.new(Puppet::Node::Environment.create(:testing, []))
Puppet.override({:loaders => loaders}, "te... | 28.772152 | 96 | 0.678399 |
e8a97c97256bf03d0950da445585a90993ec559c | 4,105 | # 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.
MIN_RAILS_VERSION = 4
if defined?(::Rails) && ::Rails::VERSION::MAJOR.to_i >= MIN_RAILS_VERSION && !NewRelic::LanguageSupport.using_engine?('jruby')
require Fi... | 31.098485 | 126 | 0.730816 |
61eed3188b07320046d2c9a276591081698ad3b2 | 223 | class CollectionCell < UICollectionViewCell
def on_load
find(self).apply_style :collection_cell
find(self.contentView).tap do |q|
q.append(UILabel, :title).get.text = rand(100).to_s
end
end
end
| 18.583333 | 57 | 0.690583 |
5dc603832f160f84e4c89fdb7a18451b6593fead | 122 | require 'io/console'
while 1 do
r = IO.select([ STDIN ])
p r[0]
if r = STDIN
p STDIN.getch
end
sleep(1)
end
| 11.090909 | 26 | 0.590164 |
6a0b45051993cabec5aa60810dc7636ffd432239 | 99 | # frozen_string_literal: true
FactoryBot.define do
factory :like do
user
post
end
end
| 11 | 29 | 0.707071 |
e2e8b60edc87be7ae2a8764574c42a56a0fb6a0a | 5,665 | require "rails_helper"
RSpec.describe "casa_cases/show", type: :system do
let(:organization) { create(:casa_org) }
let(:admin) { create(:casa_admin, casa_org: organization) }
let(:volunteer) { build(:volunteer, display_name: "Bob Loblaw", casa_org: organization) }
let(:casa_case) {
create(:casa_case, :with... | 33.52071 | 126 | 0.68985 |
4a868c922486ef1d35df82af2991c61eb4bc0728 | 329 | cask 'outline' do
version '3.23.1'
sha256 'cd41a98975ca6349f9c12053cde2b0e4f4727c9936558cb9558a6ab5a5ebfe09'
url "http://static.outline.ws/versions/Outline_#{version}.zip"
appcast 'https://gorillized.s3.amazonaws.com/versions/update_channel.xml'
name 'Outline'
homepage 'http://outline.ws/'
app 'Outline.... | 27.416667 | 75 | 0.762918 |
e9444880037259c3691be62e0ec777b1751f41d5 | 1,653 | # == Schema Information
#
# Table name: languages
#
# id :integer not null, primary key
# name :string(32) not null
# is_right_to_left :boolean default(FALSE)
# can_transliterate :boolean default(FALSE)
# created_at :datetime
# updated_at ... | 31.788462 | 104 | 0.646703 |
ed4d3e0859b8db479c17d74c9919c9d2632ceca7 | 473 | # frozen_string_literal: true
module SolidusGdpr
class DataExporter
# @api private
class SendArchive
attr_reader :email, :archive_path
def initialize(email, archive_path:)
@email = email
@archive_path = archive_path
end
def call
SolidusGdpr.configuration.expo... | 20.565217 | 80 | 0.651163 |
ffc430eac4ea5f7764a02e1d9b4d2ecf32726c11 | 122 | class EventUserSerializer < ActiveModel::Serializer
attributes(
:id,
:user_id,
:event_id,
:role
)
end
| 13.555556 | 51 | 0.647541 |
ed8dc837ab758552e89356fa366158641104c439 | 1,080 | require_relative 'externals/bash_sheller'
require_relative 'externals/pipe_maker'
require_relative 'externals/process_spawner'
require_relative 'externals/random'
require_relative 'externals/stdout_logger'
require_relative 'externals/asynchronous_threader'
require_relative 'node'
require_relative 'prober'
require_relat... | 31.764706 | 62 | 0.723148 |
e2ae2738d2f1112e2ba92116106dff3306121cd0 | 3,636 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'User searches for issues', :js do
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
let!(:issue1) { create(:issue, title: 'issue Foo', project: project, created_at: 1.hour.ago) }
let!(:issue2) { create... | 27.338346 | 96 | 0.64659 |
e82f5b54f6a6084237913ad629b80ac85007d197 | 3,270 | require 'spec_helper'
module Ransack
describe Configuration do
it 'yields Ransack on configure' do
Ransack.configure do |config|
expect(config).to eq Ransack
end
end
it 'adds predicates' do
Ransack.configure do |config|
config.add_predicate :test_predicate
end
... | 31.142857 | 92 | 0.655352 |
e8af6690b7f45c377d0b3e3ffb1e8976ccb9a333 | 363 | class CreateProjects < ActiveRecord::Migration
def change
create_table :projects do |t|
t.string :title, null: false
t.date :end_date, null: false
t.integer :days_left, default: 0
t.integer :current_count, default: 0
t.integer :total_count, null: false
t.string :counter
... | 24.2 | 46 | 0.661157 |
1a8fd2d83dd5a9f4d92c4d8328f146dc749713ea | 168 | json.extract! comment4, :id, :content, :post_id, :something, :somethingelse, :something, :more, :created_at, :updated_at
json.url comment4_url(comment4, format: :json)
| 56 | 120 | 0.755952 |
39e2284342e1c97adc6db7113507255f9567d819 | 1,476 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'meta_commit/version'
Gem::Specification.new do |spec|
spec.name = "meta_commit"
spec.version = MetaCommit::VERSION
spec.authors = ["Stanislav Dobrovolskiy","Vitalii Shw... | 42.171429 | 104 | 0.676829 |
616e15cf21fd53e49cb0fbc2b3cd9fee92f4914f | 430 | require 'rails_helper'
# Specs in this file have access to a helper object that includes
# the DemosHelper. For example:
#
# describe DemosHelper do
# describe "string concat" do
# it "concats two strings with spaces" do
# expect(helper.concat_strings("this","that")).to eq("this that")
# end
# end
# ... | 26.875 | 71 | 0.704651 |
33cb9de3c9b48302d8cc65e6174eff3e87a20128 | 2,872 | require 'partials/idp_selection_partial_controller'
require 'partials/analytics_cookie_partial_controller'
class RedirectToIdpWarningController < ApplicationController
include IdpSelectionPartialController
include AnalyticsCookiePartialController
include ViewableIdpPartialController
SELECTED_IDP_HISTORY_LENGT... | 29.306122 | 150 | 0.764624 |
7a30d0b1a3a39a05675cfc01664419b42ca76e36 | 614 | require 'spec_helper_acceptance'
# Ensure NIS CLient is not installed - Section 2.3.1
describe package('ypbind') do
it { should_not be_installed }
end
# Ensure rsh Client is not installed - Section 2.3.2
describe package('rsh') do
it { should_not be_installed}
end
# Ensure talk client is not installed - Sect... | 25.583333 | 55 | 0.739414 |
218d4e34d98b6c68888eb2a556fa0a007840507b | 1,270 | require 'rails_helper'
describe "New author page", type: :feature do
let(:first_name) { 'Alan' }
let(:last_name) { 'Turing' }
let(:homepage) { 'http://wikipedia.de/Alan_Turing' }
before do
Author.create(first_name: first_name, last_name: last_name, homepage: homepage)
visit authors_path
end
it "s... | 28.863636 | 83 | 0.69685 |
4affb07d06c4e4add296a38a57694a760db50102 | 37 | module Sober
VERSION = '0.0.2'
end
| 9.25 | 19 | 0.648649 |
38090c0f3ea0bb610f96bb406052418115280555 | 1,615 | # frozen_string_literal: true
require 'view/actionable'
require 'view/company'
module View
class BuyCompanies < Snabberb::Component
include Actionable
needs :selected_company, default: nil, store: true
def render
@corporation = @game.current_entity
h(:div, 'Buy Private Companies', [
... | 23.75 | 94 | 0.572136 |
212b49dc4d65e4258d9a68c2aead27e1742f4be1 | 6,904 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe ContentMetadataGenerator do
subject(:generate) do
described_class.generate(druid: 'druid:bc123de5678', object: model)
end
let(:model) do
Cocina::Models.build_request(JSON.parse(data))
end
let(:druid) { 'druid:bc123de5678' }
let... | 30.959641 | 128 | 0.531576 |
0125f05489c7fe6e3a4df723ffe21b6b4a0934dc | 350 | cask "wondershare-filmora" do
version "9.5.1.13"
sha256 "c61779db5cf1f4b8f5f102f1c77139aeeabeced08979ed51e607c1b1639b80fc"
url "http://download.wondershare.com/filmora#{version.major}-mac_full718.dmg"
name "Wondershare Filmora9"
homepage "https://filmora.wondershare.com/video-editor/"
app "Wondershare Fil... | 31.818182 | 79 | 0.785714 |
0306f857c36e5ca18678f6a8c52e2f0fe36ca2e5 | 15,852 | # typed: false
# frozen_string_literal: true
module Homebrew
module Diagnostic
class Volumes
def initialize
@volumes = get_mounts
end
def which(path)
vols = get_mounts path
# no volume found
return -1 if vols.empty?
vol_index = @volumes.index(vols[0])
... | 32.819876 | 103 | 0.614118 |
08a7f3dc06107d77640678783e9da4d92e77b53b | 102 | #!/usr/bin/env ruby -Ks
require "mkmf"
$CFLAGS << ' -W -Wall'
create_makefile("bitpack/bitpack")
| 11.333333 | 34 | 0.647059 |
1c921e7d5acbc4289694a39582b3d5cafea01593 | 158 | require 'rails_helper'
RSpec.describe User, :type => :model do
let(:user) { Factory.build(:user) }
subject(:user) { user }
it { should be_valid }
end
| 17.555556 | 39 | 0.658228 |
2648543dbc037916af070167201857a3e1ba509e | 2,789 | #!/usr/bin/env ruby
# Encoding: utf-8
#
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
#
# License:: 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
#
# ... | 30.988889 | 79 | 0.659376 |
1dfc586f94461c9de50195ab97ace2b412aa9a11 | 150 | class Experience < ApplicationRecord
validates :title, presence: true
validates :name, presence: true
validates :start_date, presence: true
end
| 25 | 39 | 0.78 |
796d5b58094806df470b7ff66749dd10bfd21fe8 | 2,032 | class ChangeEnumsToIntegers < ActiveRecord::Migration[5.0]
class ShipmentModel < ApplicationRecord
self.table_name = "shipments"
SHIPPING_CARRIER_MAP = {
"fedex" => 0,
"usps" => 1,
"ups" => 2
}
REVERSE_SHIPPING_CARRIER_MAP = SHIPPING_CARRIER_MAP.invert
def new_shipping_carrier... | 24.481928 | 84 | 0.663878 |
01bbc385fb67724eb8cbc1a625bc5c6ead6303d0 | 2,908 | require 'spec_helper'
describe 'Keyword Hint Enrichment' do
before do
@item = Consummo::FeedItem.new(title: "The quick brown fox jumps over the lazy dog")
end
context 'Nil text for Enrichment' do
it 'should return a nil value' do
sut = Consummo::KeywordHintEnricher.new(keywords: %w(Apple Banana Pea... | 40.388889 | 121 | 0.685007 |
ab8be996e5f05fbd8e79e1d8dbd64fd49012f5d5 | 2,986 | # 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::CognitiveServices::EntitySearch::V1_0
module Models
#
# Defines a contractual rule for link attribution.
#
class Contractual... | 28.438095 | 79 | 0.499665 |
4a099ba2f124af8282595c1af0463e56616467e6 | 441 | ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require 'rails/test_help'
require 'minitest/reporters'
MiniTest::Reporters.use!
class ActiveSupport::TestCase
# Run tests in parallel with specified workers
parallelize(workers: :number_of_processors)
# Setup all fixtures in test/fixtures/*.y... | 25.941176 | 82 | 0.759637 |
6a7fee1cd6a5c553c2afda6b8a873c709c585dbb | 134 | require 'test_helper'
class ConversationTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
| 16.75 | 56 | 0.731343 |
ed5f0a01cf9b2978484ef8c20f0ff2944127468a | 3,178 | require 'spec_helper'
describe Overcommit::ConfigurationValidator do
let(:output) { StringIO.new }
let(:logger) { Overcommit::Logger.new(output) }
let(:options) { { logger: logger } }
let(:config) { Overcommit::Configuration.new(config_hash, validate: false) }
subject { described_class.new.validate(config, ... | 27.162393 | 85 | 0.591567 |
28b5a0316c5e82bb2eda5d51c5e97267f77ba6bf | 1,398 | # 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-mediatailor... | 26.377358 | 83 | 0.752504 |
61a6cc005fd2cb48e3f1b1e072859a0bac151195 | 463 | class PagesController < ApplicationController
skip_before_action :authenticate_user!
before_action :deny_spammers!, only: [:show]
def show
template = "pages/#{params[:page]}"
if template_exists? template
render layout: true, template: template
else
raise ActionController::RoutingError.new... | 25.722222 | 77 | 0.712743 |
6189d7eefa5c27f4da95af9b4cfd3f3a7843cf6e | 3,218 | # frozen_string_literal: true
# db_title = 'Demo vragenlijst' # Dagboekvragenlijst moet geen titel hebben alleen een logo
#
# db_name1 = 'demo'
# dagboek1 = Questionnaire.find_by(name: db_name1)
# dagboek1 ||= Questionnaire.new(name: db_name1)
# dagboek1.key = File.basename(__FILE__)[0...-3]
# dagboek_content = [
# ... | 27.982609 | 112 | 0.548167 |
1c48d886e8bc0595ace9ed547742f8a8743e64d6 | 331 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Relay::Mgmt::V2017_04_01
module Models
#
# Defines values for Relaytype
#
module Relaytype
NetTcp = "NetTcp"
Http = "Http"
end... | 20.6875 | 70 | 0.679758 |
5dac411ceed40f5535205e1f943c19901b2e3add | 2,307 | # (c) Copyright 2006-2007 Nick Sieger <nicksieger@gmail.com>
# See the file LICENSE.txt included with the distribution for
# software license details.
require File.dirname(__FILE__) + "/../../../spec_helper.rb"
require 'rake'
def save_env(v)
ENV["PREV_#{v}"] = ENV[v]
end
def restore_env(v)
ENV[v] = ENV["PREV_#{v}... | 31.175676 | 98 | 0.687473 |
08504d4124bb482bae0e8e69e855981e4e18ea89 | 569 | # frozen_string_literal: true
require "rails/generators/test_unit"
module TestUnit # :nodoc:
module Generators # :nodoc:
class SystemGenerator < Base # :nodoc:
check_class_collision suffix: "Test"
def create_test_files
if !File.exist?(File.join("test/application_system_test_case.rb"))
... | 28.45 | 106 | 0.699473 |
035a62ce556adb8ec9e855d855d74d145f86fd17 | 781 | # frozen_string_literal: true
require 'rails/generators/base'
module Evnt
# HandlerGenerator.
class HandlerGenerator < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)
argument :informations, type: :array, optional: false
def create_handler
path = informations.f... | 21.694444 | 67 | 0.640205 |
ac1485292daebd87bccba3a22b0e20a56b10ecfc | 371 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Batch::Mgmt::V2017_01_01
module Models
#
# Defines values for PackageState
#
module PackageState
Pending = "pending"
Active = "act... | 21.823529 | 70 | 0.681941 |
e98ceac4253c4bdd6d07d9e71e8c264be02126a8 | 957 | require File.dirname(__FILE__) + '/../../spec_helper'
require File.dirname(__FILE__) + '/fixtures/classes'
describe "Array#include?" do
it "returns true if object is present, false otherwise" do
[1, 2, "a", "b"].include?("c").should == false
[1, 2, "a", "b"].include?("a").should == true
end
it "determin... | 28.147059 | 65 | 0.602926 |
bb937578772160bffd55b8748cbb36088a5d00ec | 383 | require 'base_kde_formula'
class Kmplot < BaseKdeFormula
homepage 'http://www.kde.org/'
url 'http://download.kde.org/stable/4.11.4/src/kmplot-4.11.4.tar.xz'
sha1 '84c64369da91994b19e6f6ed7cd23fe1ad84c5ce'
devel do
url 'http://download.kde.org/stable/4.12.0/src/kmplot-4.12.0.tar.xz'
sha1 '6f6253c7cf265... | 25.533333 | 72 | 0.744125 |
015c30ba17d06dfe509aed685e47d755562f8960 | 769 | cask 'uninstallpkg' do
version '1.1.5'
sha256 '8a92278d73334007d1df581584f7364adede9b74d4d46580055a435484c459cd'
url "https://www.corecode.io/downloads/uninstallpkg_#{version}.zip"
appcast 'https://www.corecode.io/uninstallpkg/uninstallpkg.xml'
name 'UninstallPKG'
homepage 'https://www.corecode.io/uninstal... | 36.619048 | 94 | 0.717815 |
33fb81924dff8e80c39dcc537ff813b1bbe3e5c2 | 1,306 | class RepliesController < ApplicationController
before_action :set_reply, only: [:show, :edit, :update, :destroy]
before_action :set_artical, only: [:show, :edit, :update, :destroy]
def new
@reply = Reply.new
end
def index
@replies = Reply.All
end
def show
end
def creat... | 22.135593 | 87 | 0.630168 |
ffe3097955ef9f9bd79c47c8932ee40dde05d775 | 346 | module Flickr
class Image
URL_TEMPLATE = 'https://farm%s.staticflickr.com/%s/%s_%s.jpg'.freeze
attr_reader :url
def initialize(id:, farm:, server:, secret:)
@url = URL_TEMPLATE % [farm, server, id, secret]
end
def read
blob = Curl.get(url).body_str
Magick::Image.from_blob(blob... | 20.352941 | 72 | 0.635838 |
1c29b9e71fc4ce4b991f1740acce3645b625cd14 | 401 | # frozen_string_literal: true
require File.dirname(__FILE__) + '/../spec_helper'
describe YARD::Tags::DefaultTag do
it "creates a tag with defaults" do
o = YARD::Tags::DefaultTag.new('tagname', 'desc', ['types'], 'name', ['defaults'])
expect(o.defaults).to eq ['defaults']
expect(o.tag_name).to eq 'tagnam... | 30.846154 | 86 | 0.663342 |
3920171205f62992d416012c6baef4b0c926f186 | 25,484 | module API
class Users < Grape::API
include PaginationParams
include APIGuard
include Helpers::CustomAttributes
allow_access_with_scope :read_user, if: -> (request) { request.get? }
resource :users, requirements: { uid: /[0-9]*/, id: /[0-9]*/ } do
include CustomAttributesEndpoints
b... | 34.437838 | 150 | 0.620036 |
f7d986c78e80257322aeecce4ea9e34d3644e57b | 909 | #ExStart:
require 'aspose_slides_cloud'
class Document
include AsposeSlidesCloud
include AsposeStorageCloud
def initialize
#Get App key and App SID from https://cloud.aspose.com
AsposeApp.app_key_and_sid("", "")
@slides_api = SlidesApi.new
end
def upload_file(file_name)
@storage_api = Stor... | 25.971429 | 113 | 0.735974 |
bb7d5e6a61037a8ed409868988e802c632735716 | 5,704 | # frozen_string_literal: true
require 'grape'
require 'grape-swagger/instance'
require 'grape-swagger/version'
require 'grape-swagger/endpoint'
require 'grape-swagger/errors'
require 'grape-swagger/doc_methods'
require 'grape-swagger/model_parsers'
module GrapeSwagger
class << self
def model_parsers
@m... | 33.162791 | 108 | 0.718093 |
abcc021e77a785fbccd2c57ded86fc5faabdacd4 | 522 | # frozen_string_literal: true
class AddFeaturedTopicsToCategories < ActiveRecord::Migration[4.2]
def up
add_column :categories, :num_featured_topics, :integer, default: 3
result = execute("select value from site_settings where name = 'category_featured_topics' and value != '3'")
if result.count > 0 && r... | 30.705882 | 112 | 0.722222 |
39711aff2f69a43bbac25cd50885ea01902aa8d0 | 9,674 | # coding: utf-8
require 'helper'
describe Twitter::REST::Favorites do
before do
@client = Twitter::REST::Client.new(:consumer_key => 'CK', :consumer_secret => 'CS', :access_token => 'AT', :access_token_secret => 'AS')
end
describe '#favorites' do
context 'with a screen name passed' do
before do
... | 47.655172 | 221 | 0.649783 |
b9fca41b7520ed7ea0fe1b80268e0172726904bd | 725 | module Fog
module Compute
class Rackspace
class Real
# Get details for image by id
#
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'id'<~Integer> - Id of the image
# * 'name'<~String> - Name of the image
# * ... | 27.884615 | 74 | 0.477241 |
181cbcab39b454841a25120341b6fa7d4cfb4a31 | 636 | require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
include RspecPuppetFacts
# Add facts for a Docker bridge interface
def add_docker_iface(facts, name = 'docker0', params = {})
interface_params = {
:ipaddress => '172.17.0.1',
:macaddress => '02:42:41:0b:31:b8',
:mtu => '150... | 27.652174 | 78 | 0.663522 |
87dba1c2b580047074311ebc6693326fc90fc325 | 297 | class GameWizardStep1Validator < ActiveModel::Validator
def validate(document)
if document.step1?
if Game.where(title: document.title).exists? && document.cache_key.starts_with?('new_')
document.errors[:title] << I18n.t('games.errors.title_taken')
end
end
end
end
| 27 | 93 | 0.700337 |
39c8f1e6bdf170cb6d27c28ed1937fa829fd31f7 | 638 | # frozen_string_literal: true
module API
class Pages < Grape::API
before do
require_pages_config_enabled!
authenticated_with_can_read_all_resources!
end
params do
requires :id, type: String, desc: 'The ID of a project'
end
resource :projects, requirements: API::NAMESPACE_OR_PRO... | 23.62963 | 79 | 0.678683 |
edb030c61525f6729d3f46690943b6103c079579 | 2,729 | Pod::Spec.new do |s|
s.name = "KIOpenSSL"
s.version = "1.0.2#{("a".."z").to_a.index 'g'}"
s.summary = "OpenSSL for iOS"
s.description = "OpenSSL is an SSL/TLS and Crypto toolkit. Deprecated in Mac OS and gone in iOS, this spec gives your project non-deprecated OpenSSL support. Supports iOS in... | 52.480769 | 228 | 0.559546 |
39dbd013331833c92031f1b254ff268cd7ec463a | 1,258 | class Reposurgeon < Formula
desc "Edit version-control repository history"
homepage "http://www.catb.org/esr/reposurgeon/"
url "https://gitlab.com/esr/reposurgeon.git",
:tag => "4.15",
:revision => "0128a04cbfa6e29841d696284798f63bfd104b79"
head "https://gitlab.com/esr/reposurgeon.git"
bottle do... | 31.45 | 93 | 0.693959 |
bfcc09d40c0d4840eea980fcd865a54dd3e5a135 | 1,227 | # frozen_string_literal: true
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 28.534884 | 74 | 0.664222 |
381de4736065aa14c4f6f9cd3a7d816f27e8c018 | 1,772 | require_relative '../spec_helper'
describe TrafficJam do
include RedisHelper
TrafficJam.configure do |config|
config.redis = RedisHelper.redis
end
let(:period) { 0.1 }
let(:limit) do
TrafficJam::SimpleLimit.new(:test, "user1", max: 3, period: period)
end
describe :increment do
after do
... | 22.43038 | 75 | 0.640519 |
01f21801e0f39a8294d095db3384b54e0adfb54b | 1,186 | =begin
#OpenAPI Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.0-SNAPSHOT
=en... | 24.708333 | 157 | 0.719224 |
62aac65639f4789ee870d92a11fd9e5f6219457d | 238 | class CreateClients < ActiveRecord::Migration[6.0]
def change
create_table :client do |t|
t.text :name
t.text :phone
t.text :datestamp
t.text :barber
t.text :color
t.timestamps
end
end
end
| 17 | 50 | 0.609244 |
0833dcfbb684245fc0b48cfd4f04ca59ab8195e9 | 115 | class DropExerciseWorkouts < ActiveRecord::Migration[6.0]
def change
drop_table :exercise_workouts
end
end
| 19.166667 | 57 | 0.782609 |
03f45529e685a369a8e380a60bedd109a074ad0b | 652 | require File.dirname(__FILE__) + '/../spec_helper'
describe YARD::CLI::MarkupTypes do
it "lists all available markup types" do
YARD::CLI::MarkupTypes.run
data = log.io.string
exts = YARD::Templates::Helpers::MarkupHelper::MARKUP_EXTENSIONS
YARD::Templates::Helpers::MarkupHelper::MARKUP_PROVIDERS.each... | 28.347826 | 86 | 0.65184 |
ff4fc6aa9db51cbe63e308edce4b74c107309682 | 215 | module Api
class IssuesBlockJob < IssuesStatusChangedJob
include IsPublishable
action "issue_status_changed"
timestamp Proc.new { Time.now.utc.iso8601}
def status
"blocked"
end
end
end
| 19.545455 | 47 | 0.716279 |
1ab10eaff3dfc3c54f92a2fd29b11e93946dffe8 | 2,652 | require 'spec_helper'
describe Storytime::Post do
describe "#to_partial_path" do
before{ Storytime::BlogPost.instance_variable_set "@_to_partial_path", nil }
after{ Storytime::BlogPost.instance_variable_set "@_to_partial_path", nil }
it "includes site in the path" do
allow(File).to receive(:exist... | 30.482759 | 80 | 0.687783 |
91e1c6334a15dc2fea7490c614d0c8145c7f38d1 | 120 | require 'coveralls/rake/task'
Coveralls::RakeTask.new
task :test_with_coveralls => [:spec, :cucumber, 'coveralls:push']
| 30 | 65 | 0.766667 |
2614f2c175b5729f119013a1adec8bc8dccebba1 | 9,032 | require 'puppet-lint/checkplugin'
class PuppetLint::Checks
# Public: Get an Array of problem Hashes.
attr_reader :problems
# Public: Get an Array of PuppetLint::Lexer::Token objects.
attr_reader :tokens
# Public: Initialise a new PuppetLint::Checks object and prepare the check
# methods.
def initialize... | 33.328413 | 84 | 0.598096 |
f80341c1947a1432b324010d7626382eba32dba0 | 687 | Pod::Spec.new do |s|
s.name = "RNBraintreeDropIn"
s.version = "1.0.0"
s.summary = "RNBraintreeDropIn"
s.description = <<-DESC
RNBraintreeDropIn
DESC
s.homepage = "https://github.com/bamlab/react-native-braintree-payments-drop-in"
s.license = "... | 40.411765 | 120 | 0.558952 |
7a0d379f067cfc7294ee1de5da2529a7d60d7519 | 7,598 | require File.dirname(__FILE__) + '/spec_helper.rb'
include RR
require File.dirname(__FILE__) + "/../config/test_config.rb"
describe "PostgreSQL schema support" do
before(:each) do
config = deep_copy(standard_config)
config.options[:rep_prefix] = 'rx'
config.left[:schema_search_path] = 'rr'
config.r... | 35.671362 | 95 | 0.668729 |
bfad7cca308e335b6fdc8effe099bb291192b7da | 66 | FactoryGirl.define do
factory :genre do
movie nil
end
end
| 11 | 21 | 0.712121 |
4aa9b725e91d990b2b8485c7f2f0b837351ca899 | 152 | class PremiumPayment < ApplicationRecord
belongs_to :user
COST_PER_MONTH = 10000000
def end_at
start_at + seconds_credited.seconds
end
end
| 16.888889 | 40 | 0.776316 |
bb1ff14fc9c58f70ecf03641c4e7fdfd0dfad9e6 | 1,871 | class Konsole < Formula
desc "KDE's terminal emulator"
homepage "https://www.kde.org"
url "https://download.kde.org/stable/release-service/20.04.0/src/konsole-20.04.0.tar.xz"
sha256 "179b2bb442e13c22032e56457986c68074b31a5c2da67e0e6e854658a37e24de"
head "git://anongit.kde.org/konsole.git"
depends_on "cmak... | 32.824561 | 110 | 0.684126 |
bb65d337802180c79ff7973420a06b48d985860c | 152 | Rails.application.routes.draw do
mount Searchengine::Engine => "/search"
resources :shows do
collection do
searchable
end
end
end
| 13.818182 | 41 | 0.684211 |
d52ce3125adb48243a9659df0d695912a036fb82 | 191 | require 'voicearchive/client'
module Voicearchive
class UserClient < Client
def get_coordinators
response = call('coordinators')
JSON.parse(response.body)
end
end
end
| 19.1 | 37 | 0.717277 |
1c11069d5f58c7b0bdb972f4d003f3ae13918c6e | 922 | # 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, ... | 31.793103 | 74 | 0.726681 |
f81d2e61cd8f14f4fa98f27fa79ce994408e1da6 | 841 | cask 'datacolor-spyder-elite' do
version '5.2'
sha256 '12290c3ab2e7585d97430da6d6ed1fe3d39f0032c8f3401fdaedb7d567c17197'
# d3d9ci7ypuovlo.cloudfront.net/spyder was verified as official when first introduced to the cask
url "http://d3d9ci7ypuovlo.cloudfront.net/spyder#{version.major}/Spyder#{version.major}Elite... | 44.263158 | 132 | 0.762188 |
4aca1eba94d08bab828e5bf8200dbbc7b7eff0cb | 775 | module Bosh::Director
module DeploymentPlan
class LinkPath < Struct.new(:deployment, :job, :template, :name, :path)
def self.parse(current_deployment_name, path, logger)
parts = path.split('.')
if parts.size == 3
logger.debug("Link '#{path}' does not specify deployment, using curr... | 27.678571 | 94 | 0.59871 |
bf8671b2dd11e1f40d911c5971ca34d9797db0ef | 342 | # An example of how to define a screen group
# Hippo::Screen.define_group '<%= identifier %>-screens' do | group |
# group.title = "<%= namespace %> Screens"
# group.description = "Screens relating to <%= namespace %>"
# group.icon = "heart"
# end
Hippo::Screen.for_extension '<%= identifier %>... | 31.090909 | 69 | 0.619883 |
03c57c3edd4e7c866e5cd9edbf6a7e685876f330 | 52 | def truth
42
end
def incrementing(n)
n + 1
end
| 6.5 | 19 | 0.653846 |
ac89912b09c575b23e83ca7932dd9438a24f2861 | 4,174 | require 'docx/containers'
require 'docx/elements'
require 'nokogiri'
require 'zip'
module Docx
# The Document class wraps around a docx file and provides methods to
# interface with it.
#
# # get a Docx::Document for a docx file in the local directory
# doc = Docx::Document.open("test.docx")
#
# # ... | 27.826667 | 333 | 0.633206 |
7a3946d76e64e7932de1ac19268daf3e7645ff34 | 20,901 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use... | 30.782032 | 132 | 0.666236 |
e2f590429d8378cab9a933a8be9aa59e12fb5c23 | 9,314 | require 'spec_helper'
describe Nebulous::Parser do
context 'around parsing CSVs:' do
subject { Nebulous::Parser }
let(:path) { './spec/support/assets/crlf-comma-delimited.csv' }
let(:parser) { subject.new(path) }
context '#initialize' do
it 'can be initialized' do
expect(parser).to be... | 28.570552 | 79 | 0.559266 |
62c81a6f038a2f74eb08884eaf2235a861ca3f46 | 6,696 | require File.expand_path('../../../spec_helper', __FILE__)
class EEtee::Context
def builder
MonitoringProtocols::Collectd::Builder
end
end
describe 'Collectd Ruby parser' do
before do
@builder_class = MonitoringProtocols::Collectd::Builder
@packet = ->(cmd, *args){
@builder_class.send(cmd, *ar... | 31.43662 | 112 | 0.538082 |
e20a19aa1be464dcc98f0c2ec332310f07174212 | 1,962 | # -*- encoding: utf-8 -*-
# stub: devise 4.4.3 ruby lib
Gem::Specification.new do |s|
s.name = "devise".freeze
s.version = "4.4.3"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Jos\u{e9} Valim".fr... | 42.652174 | 112 | 0.647808 |
abf57fd626528b70d082a4e8ba45e6bab4e340bc | 102 | module AtlysVoting
module ApplicationHelper
include Rails.application.routes.url_helpers
end
end
| 17 | 45 | 0.843137 |
28e46903bf2bda55cb4b6ff20696bac962620df7 | 170 | class ACPJob < ApplicationJob
queue_as :low
def perform(job_class)
job = job_class.constantize
ACP.perform_each do
job.perform_later
end
end
end
| 15.454545 | 31 | 0.705882 |
ff5b5c380b46e79d3156e9598b3b69399fe52709 | 866 | class HhResponse < ActiveRecord::Base
delegate :name, :city, :link, to: :hh_vacancy, prefix: :vacancy, allow_nil: true
serialize :resume
belongs_to :issue
belongs_to :hh_vacancy
def applicant_first_name
resume['first_name'] if resume
end
def applicant_last_name
resume['last_name']... | 19.244444 | 89 | 0.650115 |
e25f3b27511ee450a68633b74865721c2094fa70 | 9,896 | # frozen_string_literal: true
require 'rails_helper'
# Test article rendering for installed themes
RSpec.describe ArticlesController, type: :controller do
render_views
let(:blog) { create :blog }
with_each_theme do |theme, _view_path|
context "with theme #{theme}" do
before do
blog.theme = t... | 34.601399 | 147 | 0.576597 |
260be2cb3bbe57bb9d10b5571cb56f58d4b54e40 | 5,998 | require 'spec_helper'
describe 'cis_hardening::services::special' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
# Check for main class
it {
is_expected.to contain_class('cis_hardening::services::special')
}
# 2.2.1 - Time Synchron... | 26.539823 | 93 | 0.526676 |
3303e1646b2ec82884cbaaa2f114cab9a9c8fa2a | 5,258 | # This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require it in any
# file... | 43.816667 | 92 | 0.743248 |
e2405f39d3b4926ec51f822b8d76445b930e53ef | 967 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Creating a DAST Site Token' do
include GraphqlHelpers
let_it_be(:project) { create(:project) }
let_it_be(:current_user) { create(:user) }
let_it_be(:dast_site_token) { create(:dast_site_token, project: project)}
let_it_be(:dast_site_valida... | 31.193548 | 117 | 0.746639 |
e29e796cfe64f3c6ee0f75eddd0582275d40cc61 | 1,491 | # helper methods for rspec
# These particular methods pertain to using the bib2lod converter code
# from the LD4L-Labs project, at https://github.com/ld4l-labs/bib2lod
# Pre-Reqs:
# 1. https://github.com/ld4l-labs/bib2lod must be cloned
# 2. location of clone repo must be in MARC2BIBFRAME_PATH
module Helpers
... | 42.6 | 104 | 0.754527 |
1a358cf8d54541165068909bada456ae59a51d54 | 903 | Pod::Spec.new do |s|
s.name = 'SBJson'
s.version = '3.1'
s.license = 'BSD'
s.summary = 'This library implements strict JSON parsing and generation in Objective-C.'
s.deprecated_in_favor_of = 'SBJson4'
s.description = <<-DESC
All versions of SBJson prior to version 4 are deprecated... | 39.26087 | 91 | 0.606866 |
bb233b0bb23268736e0c56fc922ed2e45be60441 | 441 | define :nginx_site_for do
user = app_name = params[:name]
conf_path = "/home/#{user}/production/shared/config/nginx.production.conf"
template conf_path do
source 'nginx.conf.erb'
mode 0775
owner user
group user
action :create_if_missing
variables app_name: app_name
cookbook '__nginx'
... | 22.05 | 76 | 0.693878 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.