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 |
|---|---|---|---|---|---|
e8512b9eaa511d453c3c05cbd00b39419c25a966 | 287 | module Faker
class RickAndMorty < Base
class << self
def character
fetch('rick_and_morty.characters')
end
def location
fetch('rick_and_morty.locations')
end
def quote
fetch('rick_and_morty.quotes')
end
end
end
end | 16.882353 | 42 | 0.599303 |
ffb0ce3f641f68c52c1a267b915d93514b6544d7 | 529 | # This code was automatically generated using xdrgen
# DO NOT EDIT or your changes may be overwritten
require 'xdr'
# === xdr source ============================================================
#
# struct ChangeTrustOp {
# Asset line;
#
# // if limit is set to 0, deletes the trust line
# int64 ... | 24.045455 | 77 | 0.480151 |
614b0473c7e37c1e2a81deffbfc63888ffbc36dd | 3,333 | require 'spec_helper'
describe Gitlab::CrossProjectAccess do
let(:super_class) { Class.new }
let(:descendant_class) { Class.new(super_class) }
let(:current_instance) { described_class.new }
before do
allow(described_class).to receive(:instance).and_return(current_instance)
end
describe '#add_check' d... | 39.211765 | 89 | 0.59856 |
26f55cf0e790357e3a93eb436e322c1c0eab612f | 1,893 | class Cms::Relation < Cms::Base
self.prefix = "#{Settings.cms_path_prefix}/cm/simple/"
self.primary_key = :ciRelationId
self.timeout = 300
validate do |r|
[:fromCi, :toCi].each do |key|
if r.respond_to?(key)
ci = r.send(key)
if ci.present? && !ci.valid?
ci.errors.fu... | 21.511364 | 83 | 0.664025 |
7ae2aa3a9a0acb0f54d20a7219700671a1e352af | 22,648 | # 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,... | 38.063866 | 203 | 0.648799 |
bb0575f04d68d48b138a24598aa0bacfcffc8464 | 375 | require "virtus"
module Fosdick
class Configuration
include Virtus.model
attribute :client_code, String
attribute :client_name, String, default: "test"
attribute :username, String
attribute :password, String
attribute :test_mode, Boolean, default: true
attribute :host, String, default: ... | 23.4375 | 82 | 0.730667 |
28e83beddaed82928db27bceca12d7f280774591 | 603 | # frozen_string_literal: true
# coordinator module
module CoordinatorHelper
include SessionsHelper
def courses_by_coordinator
case permission[:level]
when 1
@coordinator = coordinator_by_user(session[:user_id])
@courses = Course.find_by(id: @coordinator.course_id)
end
end
def discipli... | 26.217391 | 73 | 0.752902 |
f7a175a1ad0138f18639c17a21da12ca6079610d | 49 | module DinoUtils
VERSION = "0.1.21".freeze
end
| 12.25 | 27 | 0.714286 |
26d99623192976ebf4007300b4a0e02ab349efac | 436 | require "webrat/core/configuration"
require "webrat/core/xml"
require "webrat/core/xml/nokogiri"
require "webrat/core/logging"
require "webrat/core/elements/form"
require "webrat/core/scope"
require "webrat/core/elements/link"
require "webrat/core/elements/area"
require "webrat/core/elements/label"
require "webrat/core... | 31.142857 | 44 | 0.807339 |
031282a03927a87fd6245d3c7ddf27a067d73284 | 1,668 | class Qrcp < Formula
desc "Transfer files to and from your computer by scanning a QR code"
homepage "https://claudiodangelis.com/qrcp"
url "https://github.com/claudiodangelis/qrcp/archive/0.8.4.tar.gz"
sha256 "b77673bad880c9ffec1fa20cef6e46ae717702edd95bca3076919225e396db57"
license "MIT"
bottle do
sha... | 35.489362 | 122 | 0.721223 |
4ae4a48d2f459a425ed3e43e6b877f1dcbfb1e27 | 1,789 | require 'test_helper'
class FollowingTest < ActionDispatch::IntegrationTest
def setup
@user = users(:mason)
@other = users(:karli)
log_in_as(@user)
end
test "following page" do
get following_user_path(@user)
assert_not @user.following.empty?
assert_match @user.following.count.to_s, resp... | 27.523077 | 77 | 0.698714 |
61d1e83c7b8340fdc1f558ba2907a049047a2514 | 28 | module LinkedAppsHelper
end
| 9.333333 | 23 | 0.892857 |
4aedb664e346dd0404a037ad85a85a822293f89d | 961 | cask "elgato-stream-deck" do
version "5.1.2.14743"
sha256 "0382345e795e489cdcb6602d5e5165ffa436e172c659f632c7ce7f23d98515ff"
url "https://edge.elgato.com/egc/macos/sd/Stream_Deck_#{version}.pkg"
name "Elgato Stream Deck"
desc "Assign keys, and then decorate and label them"
homepage "https://www.elgato.com/... | 32.033333 | 82 | 0.716961 |
1c18d472cbda11bfa8333dc8616689e3cbd4f5ed | 153 | class FixDefaultValueForUserDisabled < ActiveRecord::Migration[5.0]
def change
change_column :users, :disabled, :boolean, default: false
end
end
| 25.5 | 67 | 0.771242 |
3994e8f8298b56415009b67b9d07f1abaa4f4c3b | 872 | RSpec.describe Metamorfose::Input::CSV do
let(:filename) { File.join(Metamorfose.root_path, 'spec', 'support', 'sample.csv') }
it 'should reads a CSV file with headers' do
expected_output = [{ 'id' => '1', 'name' => 'foo', 'age' => '42' }]
settings = { filename: filename, headers: true }
rows = execut... | 24.914286 | 86 | 0.634174 |
acacfd261e06916db9b3e9cdbde5634546847c5c | 20,045 | # Copyright 2019 DragonRuby LLC
# MIT License
# console.rb has been released under MIT (*only this file*).
# Contributors outside of DragonRuby who also hold Copyright:
# - Kevin Fischer: https://github.com/kfischer-okarin
module GTK
class Console
attr_accessor :show_reason, :log, :logo, :background_color,
... | 27.572215 | 185 | 0.601596 |
1d3e18043e7930d1c2b14617ffa9ea6912c428fb | 111 | class ApplicationController < ActionController::API
include FastJsonApiResponse
include ExceptionHandler
end
| 22.2 | 51 | 0.873874 |
d525527c333930df7831d575f0821c17c81a2fc9 | 2,903 | # frozen_string_literal: true
require 'spree/config'
module Spree
module Core
class Engine < ::Rails::Engine
CREDIT_CARD_NUMBER_PARAM = /payment.*source.*\.number$/
CREDIT_CARD_VERIFICATION_VALUE_PARAM = /payment.*source.*\.verification_value$/
isolate_namespace Spree
engine_name 'spree... | 42.072464 | 111 | 0.726145 |
1cc04f81911c7b5e1d7069e7a74fb0ac0c7d353e | 1,585 | module Support
module Messages
module Outlook
class ResyncEmailIds
def initialize(messages_updated_after: 15.minutes, ms_graph_client: MicrosoftGraph.client)
@messages_updated_after = messages_updated_after
@ms_graph_client = ms_graph_client
end
def call
... | 36.022727 | 139 | 0.671293 |
5d86ef627485556ce1f77f079f2a9170ccfe71c3 | 485 | require 'rails_helper'
describe V1::PhotoCommentsController do
describe 'GET /photo_comments/:id', version: 1 do
let(:record) { FactoryBot.create(:photo_comment) }
let(:record_url) { "/v1/photo_comments/#{record.id}" }
let(:public_record) { FactoryBot.create(:photo_comment, :public) }
let(:public_rec... | 34.642857 | 72 | 0.715464 |
03f3d15129daa68af042a1fdcf09839bbd063a94 | 445 | PowerConverter.define_conversion_for(:sipity_action) do |input, scope|
Deprecation.warn('PowerConverter is deprecated. Use `Sipity::WorkflowAction(input, workflow)` instead')
workflow_id = PowerConverter.convert_to_sipity_workflow_id(scope)
case input
when Sipity::WorkflowAction
input if input.workflow_id =... | 40.454545 | 105 | 0.795506 |
1a94139db78a4eac4b143a433ff5f74a1c2400af | 431 | name 'datomic'
maintainer 'Rally Software Development Corp'
maintainer_email 'rallysoftware-cookbooks@rallydev.com'
license 'MIT'
description 'Installs/Configures datomic'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version IO.read(File.join(File.dir... | 33.153846 | 85 | 0.700696 |
79b6fd610f8daf92dddd35c1d270eede2c19d06f | 1,099 | Pod::Spec.new do |s|
s.name = 'Google-Maps-iOS-SDK'
s.version = '1.2.2'
s.summary = 'Google Maps SDK for iOS.'
s.description = 'With the Google Maps SDK for iOS, you can add maps based on Google maps data to your application.'
s.homepage = 'https://developers.google.com/maps/documentation/ios/'
s.license = ... | 37.896552 | 154 | 0.679709 |
b9e988954568fcee6c3e5240cd22a24a64fbb2a2 | 1,544 | # frozen_string_literal: true
require 'puppet-strings/json'
# module for parsing Yard Registries and generating markdown
module PuppetStrings::Markdown
require_relative 'markdown/puppet_classes'
require_relative 'markdown/functions'
require_relative 'markdown/defined_types'
require_relative 'markdown/data_typ... | 34.311111 | 86 | 0.74158 |
33739661fed7980bc4c2dc105ee4ae00c99a3435 | 1,527 | $:.push File.expand_path("../lib", __FILE__)
require "pickle/version"
Gem::Specification.new do |s|
s.name = "pickle"
s.version = Pickle::VERSION.dup
s.platform = Gem::Platform::RUBY
s.licenses = ["MIT"]
s.authors = ["Ian White", "James Le Cuirot", "Mathieu Jobin"]
s.description = "Easy model creation and ... | 38.175 | 91 | 0.715128 |
1129971e367e089b6fe6c9d69ca1ebba0b2bed91 | 41 | ::Authentication.delete_after = 6.months
| 20.5 | 40 | 0.804878 |
ed743561cde0adfbf337afcb8e289c548a78c543 | 629 | class Teller
def initialize(catalog)
@catalog = catalog
@offers = {}
end
def add_special_offer(offer_type, product, argument)
@offers[product] = Offer.new(offer_type, product, argument)
end
def checks_out_articles_from(the_cart)
receipt = Receipt.new
product_quantities = the_cart.items
... | 22.464286 | 63 | 0.693164 |
011bb02ecb974ee31d4a613b05573b1a38b60203 | 3,476 | # frozen_string_literal: true
class BaseEdiInService < BaseService
attr_reader :flow_type, :edi_in_transaction, :edi_records, :file_name, :logger
def initialize(id, file_path, logger, edi_result)
@logger = logger
@edi_result = edi_result
@file_name = File.basename(file_path)
@_edi_in_repo = EdiApp... | 28.966667 | 113 | 0.709436 |
ed8b6538914a7d14ea5b72ed08a589ecab6f15f2 | 1,013 | # frozen_string_literal: true
Gem::Specification.new do |spec|
spec.name = "jekyll-theme-hamilton"
spec.version = "4.0.0"
spec.authors = ["Shangzhi Huang"]
spec.email = ["ngzhio@gmail.com"]
# spec.summary = "A minimal and beautiful Jekyll theme best for writing and note-ta... | 40.52 | 132 | 0.666338 |
39fd972d6e1fe8221d443766b8b75ee4d2436339 | 491 | cask 'fly' do
version '3.4.1'
sha256 '8ae189e40ee77e74946e4a7d930ed924189a76575334c7f3c759ca3755066871'
url "https://github.com/concourse/concourse/releases/download/v#{version}/fly_darwin_amd64"
appcast 'https://github.com/concourse/concourse/releases.atom',
checkpoint: 'd0863da02be2c7b36bdeb29f312c... | 32.733333 | 93 | 0.778004 |
1d9be4ef28316c8af0e0727aadf0153202944930 | 1,268 | # Copyright (c) 2007-2021 Andy Maleh
#
# 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, publish,
# d... | 37.294118 | 72 | 0.763407 |
019845cb7abfad48812a3b46532ad0abbcf5d174 | 17,065 | # frozen_string_literal: true
require "ipaddr"
require "active_support/core_ext/kernel/reporting"
require "active_support/file_update_checker"
require "active_support/configuration_file"
require "rails/engine/configuration"
require "rails/source_annotation_extractor"
module Rails
class Application
class Configu... | 36.698925 | 167 | 0.584178 |
79656aa41f292696e8f5315db7e19df9d94a3da7 | 1,483 | # The system versions are too old to build ld64
class CctoolsHeaders < Formula
desc "cctools headers via Apple"
homepage "https://opensource.apple.com/"
url "https://opensource.apple.com/tarballs/cctools/cctools-855.tar.gz"
sha256 "751748ddf32c8ea84c175f32792721fa44424dad6acbf163f84f41e9617dbc58"
bottle do
... | 42.371429 | 93 | 0.779501 |
edbe5070ce9a92b6a3607bde78a2b835bad6dc88 | 17,873 | require 'pty'
require 'shellwords'
require 'fileutils'
require 'credentials_manager/account_manager'
module FastlaneCore
# The TransporterInputError occurs when you passed wrong inputs to the {Deliver::ItunesTransporter}
class TransporterInputError < StandardError
end
# The TransporterTransferError occurs when... | 41.759346 | 167 | 0.665473 |
79958a300b030cc4ca250bfe7193126eb071f7ad | 466 | class AccountActivationsController < ApplicationController
def edit
user = User.find_by(email: params[:email])
if user && !user.activated? && user.authenticated?(:activation, params[:id])
user.activate
log_in user
flash[:success] = "Account activated"
... | 29.125 | 84 | 0.587983 |
6a16e6df23dc77d3b82bab1b5b133940c7d5661d | 2,203 | # frozen_string_literal: true
module Gitlab
module Ci
module Pipeline
module Chain
Command = Struct.new(
:source, :project, :current_user,
:origin_ref, :checkout_sha, :after_sha, :before_sha, :source_sha, :target_sha,
:trigger_request, :schedule, :merge_request, :exter... | 27.5375 | 88 | 0.555152 |
61b59ae2384cb98c69ac38134f9aa4483ad1dff7 | 5,417 | require_relative "./mts_objects"
module MTS
class Objectifier
attr_accessor :methods_ast, :methods_objects
def initialize methods_ast_hash
@methods_ast = methods_ast_hash
@methods_objects = {}
@methods_ast.keys.each do |key|
parse_method @methods_ast[ [key[0],key[1]] ]... | 25.195349 | 87 | 0.576888 |
916b44ad70abed974260ed6794a2ceea96188298 | 1,580 | # The ASF licenses this file to You 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, softw... | 30.980392 | 74 | 0.686076 |
e2df12b0e678d5cdea102c2462c1f4efce93f647 | 1,289 | require 'rspec/core'
SPEC_DIRECTORY = File.dirname(__FILE__)
describe 'puppet-bolt container' do
include Pupperware::SpecHelpers
before(:all) do
@image = ENV['PUPPET_TEST_DOCKER_IMAGE']
if @image.nil?
error_message = <<-MSG
* * * * *
PUPPET_TEST_DOCKER_IMAGE environment variable must be set so we
... | 31.439024 | 105 | 0.691234 |
7ae3386fb37a88115a5fd81e01e5bafc76039174 | 331 | module Trejo
module Generators
class InstallGenerator < Rails::Generators::Base
source_root File.expand_path('../../templates', __FILE__)
desc 'Creates Trejo initializer for your application'
def copy_initializer
template 'initializer.rb', 'config/initializers/trejo.rb'
end
en... | 27.583333 | 65 | 0.700906 |
79e31b6b193bf51a6973622d8edbb0fbd56488d6 | 4,414 | #-- copyright
# OpenProject Documents Plugin
#
# Former OpenProject Core functionality extracted into a plugin.
#
# Copyright (C) 2009-2014 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.
#
# Open... | 34.217054 | 119 | 0.648845 |
7ac6ecec18b6ab1a06eeaf931ffd39116770a044 | 185 | class AddPropageAllVariantsToSpreeStockLocation < ActiveRecord::Migration
def change
add_column :spree_stock_locations, :propagate_all_variants, :boolean, default: true
end
end
| 30.833333 | 87 | 0.827027 |
e22b054e343dd00653b2ac8bc72837f36464468a | 328 | # frozen_string_literal: true
module RailsBand
module ActionController
module Event
# A wrapper for the event that is passed to `halted_callback.action_controller`.
class HaltedCallback < BaseEvent
def filter
@filter ||= @event.payload.fetch(:filter)
end
end
end
... | 21.866667 | 86 | 0.667683 |
f751209df84f8d718765996909b019b07a37d0fb | 1,139 | class CollectionWalletDatatable < AjaxDatatablesRails::ActiveRecord
extend Forwardable
def view_columns
@view_columns ||= {
id: { source: 'Wallet.id', cond: :like },
currency_id: { source: 'Wallet.currency_id', cond: :like },
name: { source: 'Wallet.name', cond: :like },
address: {... | 27.780488 | 79 | 0.586479 |
1ae54d4f8fd217d72eb25c9ab51f99575bcc19e5 | 380 | # frozen_string_literal: true
require "bundler/setup"
require "dry/initializer"
require "tram/page"
require "support/blank_page"
require "support/example_page"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
config... | 22.352941 | 63 | 0.765789 |
62a46721b4d0ef04ad271997f2ab878af75cfce4 | 1,252 | #
# 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... | 31.3 | 74 | 0.745208 |
790197aac232567590453825c7a6b21293c4888b | 5,032 | #
# Be sure to run `pod spec lint YTTest.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
# To see working Podspecs in the CocoaPods repo see https://github.com/... | 36.201439 | 93 | 0.585652 |
4a9e7b44e80117005bed4ac43718803573727738 | 994 | class CatalogController < ApplicationController
require_dependency 'vendor/plugins/blacklight/app/controllers/catalog_controller.rb'
# get single document from the solr index
def show
@response = get_solr_response_for_doc_id
@document = SolrDocument.new(@response.docs.first)
@address = Address.find_... | 38.230769 | 86 | 0.699195 |
383fd1af18218cc37ab7c8accdef2afea519d4d1 | 79 | require 'test_helper'
class DataciteDoiHelperTest < ActionView::TestCase
end | 13.166667 | 50 | 0.822785 |
91a92584da1efbbf3e83fe980d372faf8bb7d54d | 1,175 | describe Dpl::Providers::Testfairy do
let(:args) { |e| %w(--api_key key --app_file file) + args_from_description(e) }
file 'file'
before { stub_request(:post, 'https://upload.testfairy.com/api/upload').and_return(body: JSON.dump(status: 'success')) }
before { |c| subject.run unless c.metadata[:example_group][... | 29.375 | 122 | 0.660426 |
4a5d41f275eb13382f68b146575fc6f90b7e84f1 | 152 | $LDFLAGS = "-L/usr/local/lib"
have_library("gdbm", "dbm_open") or have_library("dbm", "dbm_open")
if have_func("dbm_open")
create_makefile("dbm")
end
| 25.333333 | 67 | 0.710526 |
21ee0fc3a1e899d334dce982f38cebaed9e06cf9 | 184 | class TenantsController < ApplicationController
def index
end
def new
end
def create
end
def show
end
def edit
end
def update
end
def destroy
end
end
| 8 | 47 | 0.668478 |
bfa4585fa6e4eaa497d1fef759ab71649db45c03 | 4,122 | class Legit < Formula
include Language::Python::Virtualenv
desc "Command-line interface for Git, optimized for workflow simplicity"
homepage "https://frostming.github.io/legit/"
url "https://files.pythonhosted.org/packages/cb/e4/8cc5904c486241bf2edc4dd84f357fa96686dc85f48eedb835af65f821bf/legit-1.2.0.post0.tar... | 42.061224 | 139 | 0.770015 |
ff8e2052f8b1e574d216efced24f9a1d37200b11 | 195 | class VacancyGetMoreInfoClick < Counter
@redis_counter_name = :get_more_info_counter
@persisted_column = :total_get_more_info_clicks
def initialize(vacancy)
@model = vacancy
end
end
| 21.666667 | 49 | 0.789744 |
08cd6e764f72b762e7f0de17b6e40b1d7c292830 | 254 | class CreateUsers < ActiveRecord::Migration[6.1]
def change
create_table :users do |t|
t.string :email
t.string :password_digest
t.string :username
t.string :uid
t.string :provider
t.timestamps
end
end
end
| 19.538462 | 48 | 0.637795 |
21cc6dfdd16738783a547b50a8995799c1585865 | 11,515 | require 'gon'
require 'fogbugz'
class ApplicationController < ActionController::Base
include Gitlab::GonHelper
include GitlabRoutingHelper
include PageLayoutHelper
include SafeParamsHelper
include SentryHelper
include WorkhorseHelper
include EnforcesTwoFactorAuthentication
include WithPerformanceBar
... | 29.225888 | 340 | 0.71802 |
877f5052876410e481aa9ca454eb202c28725d54 | 198 | class CreateCats < ActiveRecord::Migration[5.1]
def change
create_table :cats do |t|
t.string :name
t.string :breed
t.string :sex
t.timestamps
end
end
end
| 16.5 | 47 | 0.60101 |
b9a57c7122c4de163dccd894d5dfdfc6ff282a9c | 1,334 | =begin
### P-roblem
Write a method that will take a short line of text, and print it within a box.
# link:
# input: string
# output: printed string in a box
top / bottom line '+--+'
height 3 `|`
## requirements / assumptions
- valid string
- empty string outputs box
- box plus string will fit in terminal window... | 18.527778 | 78 | 0.663418 |
113c7058abe39581b05500df06bb3ada4d1c7208 | 4,220 | class Kafka < Formula
desc "Publish-subscribe messaging rethought as a distributed commit log"
homepage "https://kafka.apache.org/"
url "https://www.apache.org/dyn/closer.lua?path=kafka/2.7.0/kafka_2.13-2.7.0.tgz"
mirror "https://archive.apache.org/dist/kafka/2.7.0/kafka_2.13-2.7.0.tgz"
sha256 "1dd84b763676a0... | 37.017544 | 166 | 0.646919 |
26aede04ae8d009da0ffdd30569e1f77fa571a28 | 2,848 | # frozen_string_literal: true
require "spec_helper"
describe "GraphQL::Execution::Errors" do
class ErrorsTestSchema < GraphQL::Schema
class ErrorA < RuntimeError; end
class ErrorB < RuntimeError; end
class ErrorC < RuntimeError
attr_reader :value
def initialize(value:)
@value = value
... | 26.616822 | 115 | 0.577247 |
6a58f3fa7655fe025e546c866497e8ee62a81dd6 | 596 | class Mio
module Requests
def self.make_request type, agent, url, opts, body=nil, content_type='application/vnd.nativ.mio.v1+json', accept='application/json'
if content_type.nil?
content_type = 'application/vnd.nativ.mio.v1+json'
end
agent.method(type).call do |r|
r.url url
... | 24.833333 | 135 | 0.588926 |
7ab4843a3620963c912ad207dc0daff6e4b7d2d0 | 1,212 | # frozen_string_literal: true
require 'rails_helper'
require 'spree/core/validators/email'
RSpec.describe Spree::EmailValidator do
class Tester
include ActiveModel::Validations
attr_accessor :email_address
validates :email_address, 'spree/email' => true
end
let(:valid_emails) {
[
'valid@e... | 22.444444 | 51 | 0.635314 |
e860794f308b7f6b872f1c9d7293bec0391a821f | 3,298 | # 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::ContainerRegistry::Mgmt::V2017_03_01
module Models
#
# The parameters for creating a container registry.
#
class RegistryCre... | 31.113208 | 79 | 0.510006 |
e2ab5348929073f67653d202c00748dba5f36b6e | 2,226 | require 'spec_helper'
describe Admin::RedirectsController do
render_views
before do
FactoryGirl.create(:blog)
#TODO Delete after removing fixtures
Profile.delete_all
henri = FactoryGirl.create(:user, :login => 'henri', :profile => FactoryGirl.create(:profile_admin, :label => Profile::ADMIN))
r... | 25.011236 | 130 | 0.632075 |
4ab33e4af365783af1c62af1954fb1e2f2bde069 | 704 | require 'test_helper'
class ArtistVersionsControllerTest < ActionController::TestCase
context "An artist versions controller" do
setup do
CurrentUser.user = FactoryGirl.create(:gold_user)
CurrentUser.ip_addr = "127.0.0.1"
@artist = FactoryGirl.create(:artist)
end
teardown do
Curr... | 26.074074 | 84 | 0.666193 |
d530be24a249d4792bfe16c6fdc17f7c788ac0f7 | 19,991 | # 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 u... | 24.558968 | 85 | 0.519734 |
281487755760d0e75dbb719ab5ae2f1d479d0a66 | 1,689 | # Copyright (c) 2017-present, Facebook, Inc. All rights reserved.
#
# You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
# copy, modify, and distribute this software in source code or binary form for use
# in connection with the web services and APIs provided by Facebook.
#
# As with any so... | 35.93617 | 82 | 0.731794 |
61da3ecc1b6cceab9c43951e08532f1098bb6d94 | 1,302 | # Copyright 2015 Evgeniy Gurinovich
#
# 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 writin... | 28.933333 | 79 | 0.773425 |
bfb4848cd939ed4fe84ba00458209df726a6a1ce | 7,602 | # 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_10_01
module Models
#
# VirtualWAN Resource.
#
class VirtualWAN < Resource
include MsRestAzure
... | 33.052174 | 78 | 0.463299 |
ff370d8fc7ec6f16c917d6682a23ee9f5d9f7401 | 115 | class CommentSerializer < ActiveModel::Serializer
attributes :id, :title, :body, :show_id
belongs_to :show
end
| 23 | 49 | 0.765217 |
e916b3c3070cc1eab59a8d44cf75e4eceeba2336 | 1,958 | #!/usr/bin/env ruby -rubygems
# coding: utf-8
Gem::Specification.new do |spec|
spec.version = File.read('VERSION').chomp
spec.date = File.mtime('VERSION').strftime('%Y-%m-%d')
spec.name = "rdf-vocab"
spec.authors = ["David Chandek-Stark", "Aaron Coburn", "Gregg Kellogg"]
spec.e... | 42.565217 | 79 | 0.645046 |
617638675f615cda69f7fedf256a0348f9cd8a69 | 6,421 | =begin
#Site Manager API
#Site Manager API
The version of the OpenAPI document: 1.0.0
Contact: autosde@il.ibm.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.0.0-SNAPSHOT
=end
require 'date'
module OpenapiClient
# TODO add description
class AccountPostRequest
# description
... | 29.319635 | 211 | 0.620931 |
4a7e5b198607c2c72fe36d0800c6f426c6da0dac | 856 | # typed: false
require 'ddtrace/contrib/integration'
require 'ddtrace/contrib/delayed_job/configuration/settings'
require 'ddtrace/contrib/delayed_job/patcher'
module Datadog
module Contrib
module DelayedJob
# Description of DelayedJob integration
class Integration
include Contrib::Integratio... | 21.4 | 84 | 0.633178 |
5d6581ad8929d2788709fc33db3bc3d4bd972e59 | 6,876 | class Gws::Workflow::FileEnumerator < Enumerator
def initialize(site, wf_files, encoding: "Shift_JIS")
@cur_site = site
@wf_files = wf_files.dup
@encoding = encoding
super() do |yielder|
load_forms
build_term_handlers
yielder << bom + encode(headers.to_csv)
@wf_files.each do ... | 28.296296 | 120 | 0.661431 |
0196efe6dc9c789697975bad3ef5179b46182390 | 363 | RSpec.shared_context :temp_dir do
before do
@temp_dir = Dir.mktmpdir
@current_dir = Dir.pwd
Dir.chdir @temp_dir
end
after do
Dir.chdir @current_dir
FileUtils.rm_rf @temp_dir
end
def create_dummy_spec_files(*files)
files.each do |file|
FileUtils.mkdir_p File.dirname(file)
... | 18.15 | 42 | 0.680441 |
9133d1dadcc3695e42242c2e7aa43fb075797577 | 664 | # == Schema Information
#
# Table name: crudhistoryactions
#
# id :bigint not null, primary key
# action :string
# content :text
# created_at :datetime not null
# updated_at :datetime not null
# user_id :integer
#
class Crudhistoryaction < ApplicationRecord
scope :... | 26.56 | 55 | 0.575301 |
d535ddf2cccb0631c9b030fb6ee2b1e2190f91bf | 37,560 | require 'active_record/connection_adapters/abstract_adapter'
require_library_or_gem 'dbi' unless defined?(DBI)
require 'core_ext/dbi'
require 'core_ext/active_record'
require 'base64'
module ActiveRecord
class Base
def self.sqlserver_connection(config) #:nodoc:
config.symbolize_keys!
mode ... | 37.597598 | 245 | 0.584824 |
33dc5efcc638c0b90d92f131da164c3357b1f6f3 | 564 | namespace :copycopter do
desc "Notify Copycopter of a new deploy."
task :deploy => :environment do
CopycopterClient.deploy
puts "Successfully marked all blurbs as published."
end
desc "Export Copycopter blurbs to yaml."
task :export => :environment do
CopycopterClient.cache.sync
if yml = Cop... | 26.857143 | 55 | 0.680851 |
62d68687945174b7c086d94842d6b925f6e8fafb | 1,396 | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | 31.727273 | 79 | 0.702722 |
ed2679ba1826cfcee2389a0e1e8bd8bcfae598d1 | 445 | # frozen_string_literal: true
class CreatePosts < ActiveRecord::Migration[6.0]
def change
create_table :posts do |t|
t.string :title
t.text :body
t.references :forum, null: false, foreign_key: true
t.references :user, null: false, foreign_key: true
t.references :subforum, null: true... | 24.722222 | 57 | 0.669663 |
6ae5ab0caa05ebaac27361b7108999e6b548f69c | 1,246 | require_relative './util'
Sequel.migration do
up do
# Alas, PostgreSQL, there is a lot of manual work. At least you use
# internal ID values to link these together, so we don't have to update,
# eg, the column default value references when we rename sequences.
rename_table :installers, :recipes
... | 33.675676 | 80 | 0.694222 |
b9d75efe8a32dec96ef176bfcffe40c16564c051 | 160 | class UsersController < ApplicationController
def show
@user = User.find(params[:id])
@groups = @user.groups
@events = @user.events.past
end
end | 22.857143 | 45 | 0.6875 |
bf40d6b59a0a9b7a39ade8015faab62f6de5f958 | 4,639 | # 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::DevTestLabs::Mgmt::V2018_09_15
#
# The DevTest Labs Client.
#
class Operations
include MsRestAzure
#
# Creates and initia... | 38.658333 | 141 | 0.685061 |
ab616fe957776c41fbdb087939ce85138d6cdf81 | 68 | class SearchEngine
module Types
include Dry.Types()
end
end
| 11.333333 | 23 | 0.720588 |
91caf4bba798dc68dd0a3be74cafaac866517146 | 906 | # frozen_string_literal: true
# test_via: ../query.rb
module GraphQL
class Query
module ArgumentsCache
# @return [Hash<InternalRepresentation::Node, GraphQL::Language::NodesDirectiveNode => Hash<GraphQL::Field, GraphQL::Directive => GraphQL::Query::Arguments>>]
def self.build(query)
Hash.new d... | 34.846154 | 164 | 0.615894 |
abb8a19b2b1de356123f98681cfa7569afcaee3f | 8,102 | module Spree
class Payment < Spree::Base
include Spree::Core::NumberGenerator.new(prefix: 'P', letters: true, length: 7)
extend FriendlyId
friendly_id :number, slug_column: :number, use: :slugged
include Spree::Payment::Processing
NON_RISKY_AVS_CODES = ['B', 'D', 'H', 'J', 'M', 'Q', 'T', 'V', '... | 33.204918 | 154 | 0.639348 |
e2a2e848ba31c9740a8badbae9aaec62c45e4d93 | 1,372 | # frozen_string_literal: true
require_relative 'lib/indieauth_discovery/version'
Gem::Specification.new do |spec|
spec.name = 'indieauth_discovery'
spec.version = IndieAuthDiscovery::VERSION
spec.authors = ['Tony Burns']
spec.email = ['tony@tonyburns.net']
spec.summary = ... | 41.575758 | 112 | 0.69898 |
ab29c448049e6c24f7d89d14d38b10171ff8f655 | 1,387 | MAIN_USER = "testinguser"
ANOTHER_USER = "anotheruser"
# *VERY* basic login capability
def loginas(user)
uri = URI.parse(current_url)
query = URI.decode_www_form(uri.query ? uri.query : '').to_h
query[:username] = user
uri.query = URI.encode_www_form(query)
visit uri.to_s
end
Given(/^I have a user$/) do
U... | 23.116667 | 76 | 0.667628 |
1a46f0f3cdc585cca72f3cb5b3879ef10b2f1e49 | 825 | require 'mkmf-rice'
extension_name = 'python3_parser'
dir_config(extension_name)
have_library('stdc++')
$CFLAGS << ' -std=c++14'
include_paths = [
'.',
'antlrgen',
'antlr4-upstream/runtime/Cpp/runtime/src',
'antlr4-upstream/runtime/Cpp/runtime/src/atn',
'antlr4-upstream/runtime/Cpp/runtime/src/dfa',
'an... | 23.571429 | 57 | 0.717576 |
b9256bad52c45d0d92702638dc401e2c101eda9d | 1,363 | class ApplicationHelper::Toolbar::MiqCapacityView < ApplicationHelper::Toolbar::Basic
button_group('miq_capacity_download_main', [
select(
:miq_capacity_download_choice,
'fa fa-download fa-lg',
N_('Download'),
nil,
:klass => ApplicationHelper::Button::UtilizationDownload,
:item... | 34.948718 | 85 | 0.552458 |
f8e29638cbc1934f7bdb480a967cffe07e80980b | 1,790 | require 'rails_helper'
RSpec.describe Api::V0::NewsletterSubscriptionsController, :type => :controller, skip: true do
describe "POST create" do
before(:each) do
stub_request(:post, "https://us8.api.mailchimp.com/2.0/lists/subscribe.json").
to_return(:status => 200, :body => "", :headers => {})
... | 42.619048 | 179 | 0.711173 |
6ae18d0e4e200a2eb3acdbe84a72f1ae7ef91410 | 1,618 | class SdlGfx < Formula
desc "Graphics drawing primitives and other support functions"
homepage "https://www.ferzkopp.net/joomla/content/view/19/14/"
url "https://www.ferzkopp.net/Software/SDL_gfx-2.0/SDL_gfx-2.0.26.tar.gz"
sha256 "7ceb4ffb6fc63ffba5f1290572db43d74386cd0781c123bc912da50d34945446"
livecheck do... | 44.944444 | 106 | 0.726205 |
4a4e89e053621864c61d35d78b27807e93f8a783 | 209 | class <%= class_name %>::Inventory::Persister < ManageIQ::Providers::Inventory::Persister
require_nested :<%= manager_type %>
def initialize_inventory_collections
add_cloud_collection(:vms)
end
end
| 26.125 | 89 | 0.755981 |
ed8062aebec6ab397d5a06a336eb57f0c5065cb5 | 5,397 | # Implements an outbound invoice.
module MerchantSidekick
class PurchaseInvoice < Invoice
belongs_to :purchase_order, :foreign_key => :order_id, :class_name => "MerchantSidekick::PurchaseOrder"
# overrides superclass
def purchase_invoice?
true
end
# authorizes the payment
# payment_obj... | 29.983333 | 118 | 0.61108 |
f7f08b50b3e948b079ee9b06491fcadea365273a | 595 | module Fog
module Parsers
module AWS
module ELBV2
class SetSecurityGroups < Fog::Parsers::Base
def reset
@security_group_ids = []
@response = { 'SetSecurityGroupsResult' => {}, 'ResponseMetadata' => {} }
end
def end_element(name)
cas... | 24.791667 | 92 | 0.536134 |
4a744c50b809ddac200e51baea4726685cea64a3 | 51 | module MotoWebEngine
module RunsHelper
end
end
| 10.2 | 20 | 0.803922 |
116ca3b4588139d6f3846626f36c904a781eea7f | 309 | cask "font-hepta-slab" do
version :latest
sha256 :no_check
url "https://github.com/google/fonts/raw/master/ofl/heptaslab/HeptaSlab%5Bwght%5D.ttf",
verified: "github.com/google/fonts/"
name "Hepta Slab"
homepage "https://fonts.google.com/specimen/Hepta+Slab"
font "HeptaSlab[wght].ttf"
end
| 25.75 | 89 | 0.721683 |
bb957738b7f1743214f5f7b7f93cce6b12c339c1 | 305 | require 'active_support/all'
require 'chronic'
require 'flt'
require 'flt/d'
require 'financier/amortization'
require 'financier/date'
require 'financier/ledger'
require 'financier/rate'
require 'financier/transaction'
require 'financier/version'
module Financier
class Error < StandardError; end
end
| 19.0625 | 34 | 0.796721 |
1ca7c29ac82ae1b4158b6cbf4cc8adf2a784979d | 992 | cask 'appcode' do
version '2017.1.3,171.4694.27'
sha256 '85461480392290fa2fd941196d5677e5c2869fe03fbe95a8cda1d452f61f5b28'
url "https://download.jetbrains.com/objc/AppCode-#{version.before_comma}.dmg"
appcast 'https://data.services.jetbrains.com/products/releases?code=AC&latest=true&type=release',
ch... | 38.153846 | 140 | 0.693548 |
e9d5d95351ffddc3a849b7845604fbed30ebb5f3 | 1,283 | #
# Cookbook Name:: lamp-stack
# Attribute:: default
#
# Copyright 2014, HiST AITeL
#
# 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
#
# Unle... | 44.241379 | 181 | 0.696804 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.