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 |
|---|---|---|---|---|---|
08cc59f6d6203a1f21f58af838f5186481f54098 | 220 | class CreateDonors < ActiveRecord::Migration[5.1]
def change
create_table :donors do |t|
t.string :name
t.string :email
t.string :password_digest
t.timestamps :null=>false
end
end
end
| 20 | 49 | 0.654545 |
013e8e0752f949ab58d612499109613789460805 | 6,078 |
#
# specifying flor
#
# Sun May 6 16:43:25 JST 2018
#
require 'spec_helper'
describe 'Flor pcore' do
before :each do
@executor = Flor::TransientExecutor.new
end
describe 'on' do
context 'error' do
it 'sets an error handler in its parent' do
@executor.launch(
%q{
... | 24.808163 | 72 | 0.300592 |
bb8bd9771676570e84201be08fce7bffa4a9ef51 | 1,759 | module Canvas
class CourseUsers < Proxy
include SafeJsonParser
def initialize(options = {})
super(options)
@course_id = options[:course_id]
@paging_callback = options[:paging_callback]
end
def course_users(options = {})
default_options = {:cache => true}
options.revers... | 31.981818 | 142 | 0.656623 |
e24eb9312349286df9e0e850714955d86bcfdd8e | 180 | require 'spec_helper'
describe HomeController do
describe 'GET index' do
it 'returns http success' do
get 'index'
response.should be_success
end
end
end
| 13.846154 | 32 | 0.683333 |
ed6cb3472daacc3ff92df3ee10eff6ce9f05f4e9 | 52 | json.extract! @noise, :id, :created_at, :updated_at
| 26 | 51 | 0.730769 |
918739e08edadf64af3d8c46d305c31116471b37 | 459 | name 'golang'
maintainer 'Alexander Rozhnov'
maintainer_email 'gnox73@gmail.com'
license 'Apache 2.0'
description 'Installs go programming language'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.5.0'
recipe "golang", "Installs go programing... | 30.6 | 72 | 0.71024 |
ac87fca4f26465eb4f5044de2ffa78de3e40708b | 9,734 | require 'spec_helper'
module Pageflow
describe Revision do
describe '#creator attribute' do
it 'is required for published revisions' do
revision = build(:revision, :published, :creator => nil)
expect(revision).to have(1).errors_on(:creator)
end
it 'is not required for draft re... | 30.706625 | 114 | 0.646291 |
ff9e28314434470ce7b86a5a891b0bef615da117 | 442 | cask "freeyourmusic" do
version "5.6.2"
sha256 "fa83cd96cfe20e6f53f33a6137dc4f3c223f3ea56cfb9559ab7ba8f2bbacedbf"
# dzqeytqqx888.cloudfront.net/ was verified as official when first introduced to the cask
url "https://dzqeytqqx888.cloudfront.net/FreeYourMusic-#{version}.dmg"
appcast "https://stamp-live.s3.ama... | 34 | 91 | 0.778281 |
613c89b0d44b95f0bc1797d6b6a0d6c268091e56 | 153 | # Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Wallgig::Application.initialize!
| 25.5 | 52 | 0.79085 |
185c940ea64e1fc2b6bc08a27d8962cb9398a8f9 | 161 | # This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run KarvonSaroy::Application
| 32.2 | 67 | 0.776398 |
619d1a19df2b11e3d146d6c0c715070f73f01691 | 670 | Pod::Spec.new do |s|
s.name = "BENTagsView"
s.version = "0.9.0"
s.summary = "A simple UIView sublass for displaying a series of tags."
s.description = "BENTagsView allows you to quickly add a series of tags to any UIView. It is easy to add tags, customize fonts and colors, and to turn tags o... | 47.857143 | 171 | 0.631343 |
877afcd7d37afbe112f7b92310a9b1d5d4d0ef6a | 2,682 | module Shoulda
module Matchers
module ActionController
# The `redirect_to` matcher tests that an action redirects to a certain
# location. In a test suite using RSpec, it is very similar to
# rspec-rails's `redirect_to` matcher. In a test suite using Test::Unit /
# Shoulda, it provides a m... | 27.367347 | 81 | 0.547353 |
2858b7977f1132a3ebc347861cc7c1d9d896259c | 802 | # -*- encoding: utf-8 -*-
require File.expand_path('../lib/markdown-rails/version', __FILE__)
Gem::Specification.new do |s|
s.name = "markdown-rails"
s.version = MarkdownRails::VERSION
s.authors = ["Jo Liss"]
s.email = ["joliss42@gmail.com"]
s.homepage = "https://github.com/joliss/mar... | 36.454545 | 89 | 0.63217 |
11505748cce3e1b4057730232253e1d2e4294714 | 1,675 | # coding: utf-8
=begin
Copyright (c) 2013 Carl Sampson <chs@chs.us>
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, modif... | 42.948718 | 78 | 0.73194 |
08cde225b3649778aece60122e0b8145e5fb91ed | 514 |
Pod::Spec.new do |s|
s.name = "StructArchiver"
s.version = "0.0.7"
s.summary = "Archive struct into NSData and unarchive in Swift."
s.homepage = "https://github.com/naru-jpn/struct-archiver"
s.license = { :type => "MIT", :file => "LICENSE.txt" }
s.author = { "naru-jpn" => "... | 36.714286 | 97 | 0.566148 |
03b64006478fc5f8093f8ae66e00f055962a7d29 | 3,554 | #-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-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.
#
# OpenProject is a fork of ChiliProject,... | 42.309524 | 125 | 0.637591 |
ab13bd0181af205544629923585ca91362644baa | 348 | require 'test_helper'
class TestFileUpload < Aucast::Test
def test_upload_call_endpoint
file_path = "test/sample/audio.mp3"
mock_endpoint = Minitest::Mock.new
mock_endpoint.expect(:upload, nil, [file_path])
file = Aucast::FileUpload.new(file_path)
file.upload(mock_endpoint)
assert_moc... | 20.470588 | 51 | 0.724138 |
1c63a415e4e8b5fbe8daf7ef45b14d28bb31db5a | 7,855 | Puppet::Type.type(:zone).provide(:solaris) do
desc "Provider for Solaris zones."
commands :adm => "/usr/sbin/zoneadm", :cfg => "/usr/sbin/zonecfg"
defaultfor :osfamily => :solaris
mk_resource_methods
# Convert the output of a list into a hash
def self.line2hash(line)
fields = [:id, :name, :ensure, :z... | 27.179931 | 105 | 0.597708 |
e8456859895823b3001fa1601fc734ce9033b2f5 | 167 | class Foo
def f
super
end
end
Foo.new.f
__END__
# Errors
smoke/super2.rb:3: [error] no superclass method: Foo#f
# Classes
class Foo
def f: -> untyped
end
| 9.823529 | 54 | 0.676647 |
f7a389bf54684cecc15c97413b65e32f3ea1f67e | 672 | class RequeueContent
include Sidekiq::Worker
include PerformAsyncInQueue
sidekiq_options queue: :import
def perform(edition_id, version, action = "bulk.reindex")
edition = Edition.find(edition_id)
presenter = DownstreamPayload.new(edition, version, draft: false)
queue_payload = presenter.message_q... | 30.545455 | 70 | 0.735119 |
6a3aaf4faa9b4ddfc3031c416d931bdcd43db7da | 1,527 | class Cloudkeys
def listofcsps
cloud_provider = ['(1) Amazon EC2 (VPC only)',
'(2) Amazon EC2-Classic (not yet available)',
'(3) GoGrid (not yet available)',
'(4) OpenStack (not yet available)',
'(5) Rackspace Cloud (not yet available)'... | 40.184211 | 80 | 0.51408 |
b9a420c903951f78b996cdad7c2c4694a40a2755 | 397 | cask 'trilium-notes' do
version '0.36.4'
sha256 'aed0cc98625390b6fa29dca485f10671cb41eb728d860ff9506aa653f601c35d'
url "https://github.com/zadam/trilium/releases/download/v#{version}/trilium-mac-x64-#{version}.zip"
appcast 'https://github.com/zadam/trilium/releases.atom'
name 'Trilium Notes'
homepage 'http... | 33.083333 | 101 | 0.765743 |
bf9979b7b6d030ac00b120ba9d56691a2aa6e415 | 4,722 | require 'rails_helper'
RSpec.feature 'Add additional courses flow' do
include CandidateHelper
include CourseOptionHelpers
scenario 'Candidate is signed in' do
given_there_are_course_options
and_i_am_signed_in
when_i_visit_my_application_page
and_i_click_on_course_choices
when_i_choose_that... | 32.342466 | 116 | 0.827615 |
1d53bf56a5efa5da56e86c11e9b4508f82697cc3 | 549 | # frozen_string_literal: true
module Geo
class HashedStorageAttachmentsEventStore < EventStore
self.event_type = :hashed_storage_attachments_event
private
def build_event
Geo::HashedStorageAttachmentsEvent.new(
project: project,
old_attachments_path: old_attachments_path,
... | 21.115385 | 55 | 0.73224 |
ac801f494f8486494dbd3e45bb649ef1d9a84138 | 491 | require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module VolunteerBoard
class Application < Rails::Application
# Settings in config/environments/* take precedence over thos... | 30.6875 | 82 | 0.765784 |
03a6cf5803467830b6d31f9a860716664484f928 | 1,116 | class LimburgMunicipalities2017Step2 < ActiveRecord::Migration[5.0]
def self.up
directory = Rails.root.join('db/migrate/20200123161613_limburg_municipalities_2017_step_2')
data_path = directory.join('data.csv')
commits_path = directory.join('commits.yml')
datasets = []
# By default, CSV... | 30.162162 | 98 | 0.659498 |
ac5e85e3b80b3ec07d308d539c752bdfdee7f26d | 593 | require 'rbvmomi'
require 'i18n'
require 'vSphere/util/vim_helpers'
require 'vSphere/util/vm_helpers'
module VagrantPlugins
module VSphere
module Action
class Resume
include Util::VimHelpers
include Util::VmHelpers
def initialize(app, _env)
@app = app
end
... | 19.129032 | 69 | 0.58516 |
032745fb1d1d3b70fac4f1e7a02b6722ad441202 | 3,021 | # -*- encoding: utf-8 -*-
# stub: sqlite3 1.3.13 ruby lib
# stub: ext/sqlite3/extconf.rb
Gem::Specification.new do |s|
s.name = "sqlite3"
s.version = "1.3.13"
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["J... | 53 | 272 | 0.656405 |
03de4919ea81e59122e6a671975cac59337cec05 | 2,279 | require 'test_helper'
require 'iord/hooks'
class CommentsControllerTest < ActionController::TestCase
setup do
@comment = create(:comment)
@product_id = @comment.commentable.id
end
test "should get index" do
get :index, product_id: @product_id
assert_response :success
end
test "should get js... | 26.811765 | 92 | 0.690654 |
e956fe77f86b9df546e3864f64b6388fcf8a7bac | 173 | require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../shared/dup', __FILE__)
describe "Proc#dup" do
it_behaves_like :proc_dup, :dup
end
| 24.714286 | 58 | 0.728324 |
acf042480305119133b9c2774f1104eb05dd241d | 62 | require "ym_links/engine"
require "cocoon"
module YmLinks
end | 12.4 | 25 | 0.806452 |
61308f877be8b4b37190cdf8c18ce3faa399b2f5 | 418,429 | # 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
module Aws::Glue
module Types
# Access to a resource was denied.
#
# @!attribute [rw] message
... | 33.38618 | 145 | 0.599227 |
bfba6a772652d0484c90dc8e746241a47439d476 | 166 | class AddMonthlyWageAdjustmentToSalary < ActiveRecord::Migration[5.1]
def change
add_column :salaries, :monthly_wage_adjustment, :float, default: 1.0
end
end
| 27.666667 | 72 | 0.783133 |
33b77a5a4b87b089285d7c51c8dc0d1c9dbe681c | 11,410 | =begin
#Ahello REST API documentation
#На данной странице вы можете выполнять запросы к API, для этого необходимо указать 'appId', который был передан вам сотрудниками тех. поддержки в поле api_key. Укажите также PartnerUserId (это CRM Id пользователя или его email ), partnerUserId передается в заголовке запроса. Важ... | 32.787356 | 568 | 0.71972 |
e24ecca415d6baf561c5e0d56ef12c300932be0f | 1,290 | require 'test_helper'
class SessionsControllerTest < ActionController::TestCase
setup do
@user = User.create(
provider: 'provider',
uid: 'uid',
name: 'name',
email: 'email@example.com'
)
end
teardown do
@user.destroy
end
test 'should get new' do
get :new, provider: '... | 24.339623 | 73 | 0.69845 |
011b8173aa2d1ac80b07fb449e1b39103cbc6fa1 | 2,795 | # frozen_string_literal: true
class EthereumGateway
class BlockFetcher < AbstractCommand
def call(block_number, contract_addresses: nil, follow_addresses: nil, follow_txids: nil)
logger.debug("Fetch block #{block_number}")
@contract_addresses = contract_addresses
@follow_addresses = follow_addr... | 47.372881 | 180 | 0.664758 |
79d49233acab436cd5bcf360b7cfec2d81cf1715 | 10,647 | ###############################################################################
# Copyright (c) 2015 Cisco and/or its affiliates.
#
# 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:... | 31.5 | 87 | 0.59707 |
1d60d0b0522a2025755a48322b44b90c77cf021e | 358 | # frozen_string_literal: true
module RootResourceDecoratorCommon
extend ActiveSupport::Concern
included do
def db_edit_root_resource_path
case self.class.name
when "Work" then db_edit_work_path(self)
when "Character" then db_edit_character_path(self)
when "Series" then db_edit_series_p... | 22.375 | 56 | 0.740223 |
26df4e31b7fd1d6ff9fc463b1dbaae131df825b9 | 2,595 | # ~*~ encoding: utf-8 ~*~
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
require File.expand_path '../../lib/gollum-lib/file_view', __FILE__
class FakePage
def initialize filepath
@filepath = filepath
end
# From page.rb
def filename_stripped
::File.basename(@filepath, ::File... | 21.446281 | 117 | 0.676686 |
61a0df39b8072807d1cb2c7609048b7e6a0e386d | 3,604 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2020_07_01
module Models
#
# Authorization in an ExpressRouteCircuit resource.
#
class ExpressRouteCircuitAu... | 30.542373 | 79 | 0.511654 |
18ef752b19836142a72332f69edecc8b31583af8 | 902 | # -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "abrio/version"
Gem::Specification.new do |s|
s.name = "abrio"
s.version = Abrio::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Roger Leite"]
s.email = ["roger.leite@abril.com.br"]
s.homepage ... | 36.08 | 83 | 0.617517 |
ac3a59cb582766c949898d83973df91b35a90b33 | 227 | require 'helper'
class TestWp2refinery < Test::Unit::TestCase
should "probably rename this file and start testing for real" do
flunk "hey buddy, you should probably rename this file and start testing for real"
end
end
| 28.375 | 86 | 0.762115 |
e9176aadfb20c88b00f8f7b61b8c7a8b07bc3346 | 256 | class Processing3 < Cask
version '3.0a4'
sha256 '60f3c5d720587956833156ffc11ac762741e37cfe02355e92c5c0daed6bb2ed6'
url "http://download.processing.org/processing-#{version}-macosx.zip"
homepage 'http://processing.org/'
app 'Processing.app'
end
| 25.6 | 75 | 0.777344 |
3823c7f4492e052110316b2e241fa24fc39090e1 | 350 | require 'open-uri'
class LocalAuthoritiesInEnglandRegister
URL = 'https://local-authority-eng.register.gov.uk/records.json?page-size=5000'.freeze
def self.entries
local_authorities_register_results = JSON.parse(URI.open(URL).read)
local_authorities_register_results
.values
.map { |result| res... | 25 | 88 | 0.742857 |
bfe13d37765b1b72adf18b7e418c427163b2f7d1 | 678 | module VagrantPlugins
module GuestRedHat
module Cap
class Flavor
def self.flavor(machine)
# Read the version file
output = ""
machine.communicate.sudo("cat /etc/redhat-release") do |_, data|
output = data
end
# Detect various flavors we ... | 27.12 | 100 | 0.557522 |
4a14ae0965167cc1c50335f1029db4f74dc75eeb | 2,313 | require 'mixpanel-ruby'
require 'thread'
require 'json'
require 'securerandom'
# As your application scales, it's likely you'll want to
# to detect events in one place and send them somewhere
# else. For example, you might write the events to a queue
# to be consumed by another process.
#
# This demo shows how you mig... | 32.125 | 76 | 0.659317 |
5d5c456f54c6bf457e92642bb00425709f70e8c7 | 1,638 | # frozen_string_literal: true
module UiRules
class LoggedActionRule < Base
def generate_rules
@repo = DevelopmentApp::LoggingRepo.new
make_form_object
apply_form_values
if @mode == :diff
common_values_for_fields diff_fields
else
common_values_for_fields common_field... | 26 | 105 | 0.59707 |
3846e8d7f4e71fdc424eb5fe3d1c4b11b9260a77 | 278 | require 'sinatra'
require "./lib/sinatra-react"
set :environment, :development
set :public_folder, Proc.new { File.join(root, "public") }
set :views, Proc.new { File.join(root, "templates") }
# Listen on 0.0.0.0
set :bind, '0.0.0.0'
set :port, 4000
Sinatra::Application.run!
| 21.384615 | 58 | 0.694245 |
5d9419a68ad4ea61b9c20337101d698579ee3d97 | 211 | class CreateFieldsProjects < ActiveRecord::Migration
def change
create_table :fields_projects do |t|
t.integer :field_id
t.integer :project_id
t.timestamps null: false
end
end
end
| 19.181818 | 52 | 0.701422 |
edd2fcc8da2b3d5cc9c3529314bdaa50bb380db7 | 58 | require 'spree_core'
require 'spree_hero_carousel/engine'
| 19.333333 | 36 | 0.844828 |
7976ddae301d49e3852478611dfb8f773415a817 | 1,229 | class ResetBadAmendments < ActiveRecord::Migration
def up
# there are protocols with bad amendment images that need to be redownloaded
files = [
'/system/protocols/2/16/16-08.54_amendment_1.jpg',
'/system/protocols/2/36/36-22.62_amendment_2.jpg',
'/system/protocols/2/39/39-30.28_amendment_1.jpg',
... | 34.138889 | 123 | 0.701383 |
91fd2bffff3de25e198854e84ea47ed24fc274f4 | 1,790 | require "extend/ENV"
require "formula"
require "cli_parser"
module Homebrew
module_function
def sh_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`sh` [<options>]
Start a Homebrew build environment shell. Uses our years-battle-hardened
Homebrew build logic to help your `.... | 31.403509 | 90 | 0.652514 |
e9316b6c10def24cb181dd15fa2bf129fd9fa4a3 | 4,143 | namespace :rails do
namespace :freeze do
desc "Lock this application to the current gems (by unpacking them into vendor/rails)"
task :gems do
deps = %w(actionpack activerecord actionmailer activesupport actionwebservice)
require 'rubygems'
Gem.manage_gems
rails = (version = ENV['VERSI... | 36.663717 | 135 | 0.615496 |
38bca20972a630faa13685ff73076977b7764d43 | 91 | # -*- encoding: utf-8 -*-
module Kitchen
module Ansible
VERSION = '0.40.1'
end
end
| 13 | 25 | 0.604396 |
39ff5095f059c897666723be764d24db4b50e48c | 6,183 | # 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... | 30.160976 | 100 | 0.644509 |
e2284f962045ca34d53515f7211c8fcc72e7f3ac | 1,940 | class Knock < Formula
desc "Port-knock server"
homepage "https://zeroflux.org/projects/knock"
url "https://zeroflux.org/proj/knock/files/knock-0.7.tar.gz"
sha256 "9938479c321066424f74c61f6bee46dfd355a828263dc89561a1ece3f56578a4"
license "GPL-2.0"
livecheck do
url "https://www.zeroflux.org/projects/knoc... | 45.116279 | 122 | 0.768041 |
bfec5ea5d1a77966d93d983391d38055d60a4674 | 858 | require 'active_support/security_utils'
module ActiveElasticJob
class MessageVerifier #:nodoc:
# Raised when digest generated by
# <tt>ActiveJob::QueueAdapters::ActiveElasticJobAdapter</tt> could not
# be verified.
class InvalidDigest < StandardError
end
def initialize(secret)
@secret... | 24.514286 | 74 | 0.687646 |
01234f4376f173ed845296759a4303423d584370 | 2,401 | require 'action_mailer'
require 'pp'
class ExceptionNotifier
class Notifier < ActionMailer::Base
self.mailer_name = 'exception_notifier'
self.append_view_path "#{File.dirname(__FILE__)}/views"
class << self
def default_sender_address
%("Exception Notifier" <exception.notifier@default.com>)... | 28.583333 | 119 | 0.63182 |
5d0104bdf9e74e97073c260d8e7491f058fa5ba6 | 274 | name 'cook2'
maintainer 'YOUR_COMPANY_NAME'
maintainer_email 'YOUR_EMAIL'
license 'All rights reserved'
description 'Installs/Configures cook2'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'
| 34.25 | 72 | 0.682482 |
ac86c77909401d508f53ad4a042ce6ede3c95e48 | 11,276 | require 'test_helper'
class LockableTest < ActiveSupport::TestCase
def setup
setup_mailer
end
test "should respect maximum attempts configuration" do
user = create_user
user.confirm
swap Devise, maximum_attempts: 2 do
2.times { user.valid_for_authentication?{ false } }
assert user.re... | 32.125356 | 142 | 0.723306 |
1cfc06fede49846965df2adfc7d7dd3b1695f17c | 396 | module Prime
module Anjin
class Customer < Common::Resource
field :id
field :name
collection :staking_positions, type: StakingPosition
def initialize(attrs)
super(attrs.fetch('attributes', {}).merge(
id: attrs['id'],
staking_positions: attrs.dig('relationships... | 22 | 89 | 0.616162 |
ab534637da3e2c254a2e3f80e322f92605e7a0fc | 888 | Rails.application.routes.draw do
get 'password_resets/new'
get 'password_resets/edit'
get 'sessions/new'
get 'users/new'
root 'static_pages#home'
get '/help', to: 'static_pages#help'
get '/about', to: 'static_pages#about'
get '/contact', to: 'static_pages#contact'
get '/signup', to: 'use... | 28.645161 | 101 | 0.657658 |
1ab80fe24544cbd6d1098d5744235b7b2b1eefc5 | 35,675 | # frozen_string_literal: true
require 'tempfile'
require 'forwardable'
require "rubygems/package"
module Gitlab
module Git
class Repository
include Gitlab::Git::RepositoryMirroring
include Gitlab::Git::WrapsGitalyErrors
include Gitlab::EncodingHelper
include Gitlab::Utils::StrongMemoize
... | 31.431718 | 157 | 0.637253 |
62e4d791c19b1248bcb3fdb4e49a95561560d2eb | 301 | require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe 'Maps' do
it 'should return a sequence of maps as a merged map' do
expect(Maps.merge(sequence(:a,2,:b,4).to_maps)).to eq({a:2,b:4})
expect(Maps.merge(sequence(1,2,3,4).to_maps(false))).to eq({1=>2,3=>4})
end
end | 30.1 | 75 | 0.677741 |
bf5e8cf8726ef62bf6bc22f474000691ae055993 | 747 | Rails.application.routes.draw do
get 'password_resets/new'
get 'password_resets/edit'
root 'static_pages#home'
get '/help', to: 'static_pages#help'
get '/about', to: 'static_pages#about'
get '/contact', to: 'static_pages#contact'
get '/signup', to: 'users#new'
get '/login', to: 's... | 35.571429 | 71 | 0.64257 |
ff6a7fe8a401520b68a13598ababd093b1260530 | 1,612 | require 'yaml'
module Backup
class Database
attr_reader :config, :db_dir
def initialize
@config = YAML.load_file(File.join(Rails.root,'config','database.yml'))[Rails.env]
@db_dir = Rails.root.join('backup')
FileUtils.mkdir_p(@db_dir) unless Dir.exists?(@db_dir)
end
def dump
... | 27.322034 | 88 | 0.557072 |
f80424b5516cd6d5acad7ae390e236ba5f3a74bc | 2,783 | module ActiveRecord
module ConnectionAdapters
module Redshift
module Quoting
# Escapes binary strings for bytea input to the database.
def escape_bytea(value)
@connection.escape_bytea(value) if value
end
# Unescapes bytea output from a database to the binary string... | 27.83 | 84 | 0.54761 |
26e5dca2c779254c6af1b14e3bc7320a88c27942 | 2,574 | class User < ApplicationRecord
############################################################################################
## PeterGate Roles ##
## The :user role is added by default and shouldn't be included in this list. ##
##... | 33.868421 | 104 | 0.607226 |
ab169cd1ccc635594467352615c64c708f81301a | 2,926 | # Copyright (C) 2014-2016 VMware, Inc.
=begin
This program is used during development to read a
type-specific 'map' and generate code for inclusion in
the corresponding defined type (manifest/*.pp) file.
For each property a line is generated including property
name and key path. For example:
failover_level => ... | 32.876404 | 111 | 0.724197 |
d5b2c3ce16157c5826d93123486964bac5a13e8c | 739 | def configure_repositories
ActiveFedora::Rdf::Repositories.clear_repositories!
if Rails.env.test?
ActiveFedora::Rdf::Repositories.add_repository :default, RDF::Repository.new
ActiveFedora::Rdf::Repositories.add_repository :vocabs, RDF::Repository.new
else
ActiveFedora::Rdf::Repositories.add_repository... | 49.266667 | 195 | 0.756428 |
ac6837de26845a3ec1f7ecd7965fa92e8c1b7d3c | 1,627 | require 'open3'
class GitlabCustomHook
def pre_receive(changes, repo_path)
hook = hook_file('pre-receive', repo_path)
return true if hook.nil?
call_receive_hook(hook, changes)
end
def post_receive(changes, repo_path)
hook = hook_file('post-receive', repo_path)
return true if hook.nil?
... | 24.283582 | 68 | 0.668101 |
1d8aaeea8f2279f58a9b2ba4025207925609cce1 | 7,711 | require 'spec_helper'
describe API::Features do
let(:user) { create(:user) }
let(:admin) { create(:admin) }
before do
Flipper.unregister_groups
Flipper.register(:perf_team) do |actor|
actor.respond_to?(:admin) && actor.admin?
end
end
describe 'GET /features' do
let(:expected_features... | 32.263598 | 106 | 0.535858 |
1d55ac40d3a98c76f3938b4e3ea356f81a6e45d0 | 6,267 | require 'spec_helper'
module Dooby
describe List do
before(:all) do
@location = 'location'
end
describe '#new' do
it "should load the list of items if list.yml exists" do
File.should_receive(:exist?).with(CURRENT_TODO_LIST_FILE).and_return true
YAML.should... | 31.492462 | 175 | 0.557045 |
4a9064a375eb8d7f17846116c1c8506f824718a7 | 1,842 | require "#{File.dirname(__FILE__)}/../spec_helper"
SimpleCov.command_name('DocString') unless RUBY_VERSION.to_s < '1.9.0'
describe 'DocString, Integration' do
context 'getting stuff' do
before(:each) do
source = ['Feature: Test feature',
'',
' Scenario: Test test',
... | 27.492537 | 95 | 0.62595 |
d56992501a02812954a7733338bafe0a01a83a25 | 103 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'sparse'
require 'minitest/autorun' | 25.75 | 58 | 0.747573 |
21b7280eff2a783230ab4621ba4a6d8ec935c04a | 396 | cask 'swikauthor' do
version '1.3'
sha256 '5a891ed920678104f5afc80c8525ddca28265635af46893774d3d91c13b988c9'
url "http://media.swikshare.com/download/SwikAuthorBeta_v#{version}.dmg"
appcast 'http://swikshare.com/',
checkpoint: 'ea6f92d0460639ec716f709c86ce16e784eb9b699a1e8be47342fac23404d0d6'
name ... | 30.461538 | 88 | 0.775253 |
33f2d4cee6d93495d1eb2579d908dcb3684d84a9 | 2,486 | Scrapgallery::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.a... | 36.558824 | 104 | 0.760257 |
33498027be0dcb43e338001a29291e6376d163be | 426 | require 'spec_helper'
describe 'Aggregations' do
let(:found) { fixture(:sakurai) }
let(:not_found) { fixture(:mizuguchi) }
let(:extra) { fixture(:suda) }
subject { Springy.query(index: SPEC_INDEX, type: FIXTURE_TYPE) }
it 'uses a raw json hash' do
q = subject.aggs(my_agg: {filter: {term: {url_slug: fou... | 25.058824 | 77 | 0.664319 |
3885369ca488d53846c2c6bf8ce3e33232e58f3f | 171 | class Question < ActiveRecord::Base
validates :title, presence: true
validates :exam_id, presence: true
belongs_to :exam
has_many :answer, :dependent => :destroy
end
| 21.375 | 41 | 0.760234 |
1ad080d9971cb07fb1d8be55a99e5afc36b03e59 | 265 | module Roo
module Hasherize
# Gem version builder module
module VERSION
MAJOR = 0
MINOR = 1
PATCH = 2
SUFFIX = '-alpha'
NUMBER = [MAJOR, MINOR, PATCH].compact.join('.')
STRING = "#{NUMBER}#{SUFFIX}"
end
end
end
| 17.666667 | 54 | 0.558491 |
acf760c02dfaae1f182e6567545f18f6928d1c5a | 1,074 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# dat... | 42.96 | 86 | 0.748603 |
26e999f6cd837deddfe658c99002004368f6c12b | 792 | # frozen_string_literal: true
class RoomApi::Eg007CreateFormGroupService
attr_reader :args
def initialize(args)
@args = args
end
def worker
# Step 2 start
configuration = DocuSign_Rooms::Configuration.new
configuration.host = Rails.configuration.rooms_host
api_client = DocuSign_Rooms::Ap... | 21.405405 | 83 | 0.684343 |
b925601fdc0305bceac4344ffb6340ab4bb89fe4 | 8,222 | require "spec_helper"
describe Mongoid::Reloadable do
describe "#reload" do
context 'when persistence options are set' do
let(:person) do
Person.with(collection: 'other') do |person_class|
person_class.create
end
end
let(:reloaded) do
Person.with(collection... | 23.160563 | 81 | 0.544028 |
8733622d0ce75b125a40798d0e449feed51b3bc9 | 716 | require 'rails_helper'
describe ActivityAdjustment do
describe '.ratio' do
let!(:activity) do
FactoryBot.create(:activity).tap do |activity|
activity.adjustments.create(source: activity, date: '2013-01-01', ratio: 2, reason: 'split')
activity.adjustments.create(source: activity, date: '2013... | 32.545455 | 100 | 0.671788 |
6a2ed86c120cb50c9917cf55e13d65b009ac7d16 | 1,398 | # Encoding: utf-8
#
# This is auto-generated code, changes will be overwritten.
#
# Copyright:: Copyright 2013, Google Inc. All Rights Reserved.
# License:: Licensed under the Apache License, Version 2.0.
#
# Code generated by AdsCommon library 0.9.5 on 2015-02-11 12:50:05.
require 'ads_common/savon_service'
require '... | 29.744681 | 79 | 0.744635 |
bfa96ef51be869b7d7e3efc03f286aa74746c7e3 | 583 | # frozen_string_literal: true
module Addressing
class LazySubdivisions
def initialize(parents)
@parents = parents
@subdivisions = {}
@initialized = false
end
def [](key)
do_initialize unless @initialized
@subdivisions[key]
end
def any?
do_initialize unless @i... | 17.147059 | 47 | 0.639794 |
62798e2a44a0b297e1646bc664b89d922f7e7cca | 3,693 | require 'spec_helper_acceptance'
describe 'nginx::resource::vhost define:' do
context 'new vhost on port 80' do
it 'configures a nginx vhost' do
pp = "
class { 'nginx': }
nginx::resource::vhost { 'www.puppetlabs.com':
ensure => present,
www_root => '/var/www/www.puppetlabs.com... | 32.681416 | 104 | 0.617926 |
6a35702d0f90b6f95c76913dfccb3ed9a912099a | 928 | # Methods for working with AnAlyze
# API docs: https://docs.relinklabs.com/marlowe/#Analyze
require 'httparty'
module RelinkApi
module Analyze
CREATE_REQUIRED_PARAMS = %w(jobId profile)
CREATE_PROFILE_REQUIRED_PARAMS = %w(name summary positions
email skills educ... | 30.933333 | 79 | 0.617457 |
79e2d66266d60cd63527cb1dfd76fc5df0bdff29 | 850 | require 'hanami/utils/deprecation'
class DeprecationTest
def old_method
Hanami::Utils::Deprecation.new('old_method is deprecated, please use new_method')
new_method
end
def new_method
end
end
class DeprecationWrapperTest
def initialize
@engine = DeprecationTest.new
end
def run
@engine.... | 25 | 126 | 0.738824 |
bf0489823f25fea3ccec64b0d9673132447ed638 | 9,668 | # encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0
# Changes may cause incorrect behavior and will be lost if the code is
# rege... | 40.793249 | 154 | 0.743484 |
5d6953e30df10f443b887f6dcf2848dd00853316 | 406 | # frozen_string_literal: true
module ActiveConcurrency
module Threads
class Worker < ActiveConcurrency::Base::Worker
def initialize(name: nil)
super(name: name)
@thread = Thread.new(@name) { perform }
end
def exit!
@thread.exit
end
def join
@thread... | 15.037037 | 50 | 0.576355 |
f71ae86ee57094113f8c55156d58e6be9f477d7c | 2,676 | # -*- encoding: utf-8 -*-
# stub: jekyll 3.9.0 ruby lib
Gem::Specification.new do |s|
s.name = "jekyll".freeze
s.version = "3.9.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Tom Preston-Werner"... | 45.355932 | 112 | 0.653214 |
18006c0e5f967823091b2879e2db0262fe640915 | 32,721 | require 'helper'
require 'base64'
require 'ostruct'
require 'nokogiri'
module TestEndiciaHelper
def fake_response(hash = {}, body = "")
hash.stubs(:body).returns(body)
hash
end
def expect_label_request_attribute(key, value, returns = fake_response)
Endicia.expects(:post).with do |request_url, option... | 36.356667 | 117 | 0.632041 |
1c04a7eb6ec2d63e60f3e3c238ff38e775d5fb59 | 610 | require 'rails_helper'
RSpec.feature 'Visit Election', type: :feature do
scenario 'creates a candidate' do
user = create(:user)
create(:election, :autumn)
postt = create(:post, :autumn)
sign_in_as(user, path: candidates_path)
find(:linkhref, new_candidate_path).click
page.status_code.should ... | 30.5 | 96 | 0.713115 |
aba73dfb99508bb09a9e2ed488e3541d6383a2b2 | 2,847 | class Labplot < Formula
desc "Application for interactive graphing and analysis of scientific data"
homepage "https://labplot.kde.org/"
url "https://download.kde.org/stable/labplot/2.7.0/labplot-2.7.0.tar.xz"
sha256 "5c4d6ed7df6e98557a6b78f018933c92654b7e50e7f051ad89ec4755e0f4e935"
head "git://anongit.kde.org... | 33.892857 | 111 | 0.710924 |
919d1427d2e80e77bfcd61f7bc6b2ae9b182dbe3 | 1,680 | module StandardAPI
module RouteHelpers
# StandardAPI wrapper for ActionDispatch::Routing::Mapper::Resources#resources
#
# Includes the following routes
#
# GET /schema
# GET /calculate
#
# For example
#
# standard_resources :views
#
# is equivilent to:
... | 26.25 | 82 | 0.602381 |
5d05b8e6d43b4c9683ae23e7fc697305f4c1ea85 | 829 | class Jemalloc < Formula
desc "malloc implementation emphasizing fragmentation avoidance"
homepage "http://www.canonware.com/jemalloc/download.html"
url "https://github.com/jemalloc/jemalloc/releases/download/4.0.0/jemalloc-4.0.0.tar.bz2"
sha256 "214dbc74c3669b34219b0c5a55cb96f07cb12f44c834ed9ee64d1185ee6c3ef2"... | 41.45 | 92 | 0.780458 |
bfd275a5741ad1da0e8d64a9d2f441fb0637612b | 848 | # frozen_string_literal: true
require 'sidekiq'
module Mobile
module V0
class Vet360LinkingJob
include Sidekiq::Worker
sidekiq_options(retry: false)
def perform(uuid)
user = IAMUser.find(uuid)
result = Mobile::V0::Profile::SyncUpdateService.new(user).await_vet360_account_link... | 30.285714 | 119 | 0.649764 |
6a5c513b0f584875440ec73abc619949a512d858 | 1,009 | require 'generators/ember/generator_helpers'
module Ember
module Generators
class ComponentGenerator < ::Rails::Generators::NamedBase
include Ember::Generators::GeneratorHelpers
source_root File.expand_path("../../templates", __FILE__)
desc "Creates a new Ember.js component and component temp... | 43.869565 | 325 | 0.737364 |
ab0b672549143987ca4554f3edf70a325b8e15e1 | 11,878 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Project' do
include ProjectForksHelper
include MobileHelpers
describe 'creating from template' do
let(:user) { create(:user) }
let(:template) { Gitlab::ProjectTemplate.find(:rails) }
before do
sign_in user
visit new_pr... | 30.070886 | 139 | 0.66619 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.