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 |
|---|---|---|---|---|---|
e2824fdc70184d820e7fd76a0b87ba57c8c584fa | 39 | module BankJob
VERSION = "0.0.1"
end
| 9.75 | 19 | 0.666667 |
0108eefc069b614ced74e944e5abfe9500de9020 | 349 | namespace :elasticsearch do
desc 'reindex all orgs in search'
task reindex: :environment do
Organization.pluck(:id).each_slice(1000) do |ids|
args = ids.map { |id| ['Organization', id] }
Sidekiq::Client.push_bulk('class' => SearchIndexJob, 'args' => args)
puts "[#{Time.now.utc}] Queued #{ids.s... | 31.727273 | 74 | 0.647564 |
ac1e8fdd6a9da741da47664600af59004a5aa854 | 120 | # Loads mkmf which is used to make makefiles for Ruby extensions
require 'mkmf'
# Do the work
create_makefile('basic')
| 20 | 64 | 0.766667 |
1d8d18e1f618daeea1f39185c7fa9eb47fa950bb | 2,534 | class ServicesController < ApplicationController
before_action :set_service, except: [:index, :new, :create]
before_action :authenticate_user!, except: [:show]
before_action :is_authorised, only: [:listing, :pricing, :description, :photo_upload, :expertise_area, :location, :update]
def index
@service = cur... | 22.625 | 193 | 0.677585 |
28c65cedba80bdf8846912389f55534f5d66d544 | 1,224 | # 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,... | 34 | 82 | 0.748366 |
6272ef6f27834dd7b5b4e705e5313a3484098cc8 | 888 | # -*- encoding: utf-8 -*-
require 'spec_helper'
describe ActiveFedora::RDF do
describe ActiveFedora::RDF::Fcrepo do
it "registers the vocabularies" do
namespaces = [
"info:fedora/fedora-system:def/model#",
"info:fedora/fedora-system:def/view#",
"info:fedora/fedora-system:def/relatio... | 28.645161 | 61 | 0.64527 |
e91dc7c711592841145a1b289e105b84ade3080a | 325 | module Gws::Addon::Discussion::Todo
extend ActiveSupport::Concern
extend SS::Addon
included do
attr_accessor :in_discussion_forum
belongs_to :discussion_forum, class_name: "Gws::Discussion::Forum"
scope :discussion_forum, ->(discussion_forum) { where(discussion_forum_id: discussion_forum.id) }
end... | 27.083333 | 101 | 0.763077 |
61341c22b60dfd2a2abe7fdb4063fe3df14e10e6 | 2,138 | # 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::Signalr::Mgmt::V2018_03_01_preview
module Models
#
# The core properties of ARM resources.
#
class Resource
include M... | 26.073171 | 72 | 0.494855 |
21ab4540aa490de5c9012026024b8af4f329312d | 2,243 | require 'socket'
class Bud::BudServer < EM::Connection #:nodoc: all
def initialize(bud, channel_filter)
@bud = bud
@channel_filter = channel_filter
@filter_buf = {}
@pac = MessagePack::Unpacker.new
super
end
def receive_data(data)
# Feed the received data to the deserializer
@pac.fee... | 29.513158 | 95 | 0.625502 |
28eda08df051059652371c5f3cbf178ae4902ba3 | 4,320 | # frozen_string_literal: true
#
# Copyright:: 2020, Chef Software, Inc.
# Author:: Tim Smith (<tsmith@chef.io>)
#
# 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/licen... | 41.941748 | 405 | 0.60162 |
e8a89b4725609b25e8229e60315c64cb36ff9eb6 | 1,338 | module Applicants
class CreateStudentService
def initialize(applicant)
@applicant = applicant
@course = applicant.course
end
def create(tag)
Applicant.transaction do
student = create_new_student(tag)
# Make sure the tag is in the school's list of founder tags.
#... | 25.730769 | 114 | 0.647235 |
4a4bc55c3d4da7f59f941e1cbd50e61e8797f982 | 2,583 | require 'active_record'
ActiveRecord::Migration.verbose = false
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
class CreateModelsForTest < ActiveRecord::Migration[5.2]
def self.up
create_table :users do |t|
t.string :name
t.integer :posts_count, :default => 0... | 23.916667 | 87 | 0.625629 |
18eb69f2e7864a7361939e8fd20f29deb9d43c36 | 547 | module Intrigue
module Ident
module Check
class Nagios < Intrigue::Ident::Check::Base
def generate_checks(url)
[
{
type: "fingerprint",
category: "application",
tags: ["COTS","Administrative","Development"],
vendor: "Nagios",
product:"Nagios",
description:"Na... | 19.535714 | 62 | 0.575868 |
33a649ebde80c8b952ad3122dafba872427e79f6 | 1,111 | # This file keeps logic to load configurations of the entire library
module Frisky
@@redis = nil
@@config = nil
@@log = nil
def config=(config)
@@config = config
@@redis = Redis.new(host: config['redis']) if config['redis']
# Github
if config['github'] and config[... | 22.22 | 89 | 0.576958 |
7a627b0cea56ae290299d7c7915ea84ad8eb1624 | 2,100 | # 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::BatchAI::Mgmt::V2017_09_01_preview
module Models
#
# Use this to prepare the VM. NOTE: The volumes specified in mountVolumes
# a... | 30.882353 | 79 | 0.572381 |
333a01a51d12f805a9691a040256b2ecb79af6a5 | 4,088 | module FHIR
module Deserializer
module ConceptMap
include FHIR::Formats::Utilities
include FHIR::Deserializer::Utilities
def parse_xml_entry_OtherConceptComponent(entry)
return nil unless entry
model = FHIR::ConceptMap::OtherConceptComponen... | 65.935484 | 136 | 0.60225 |
26ed5d5fc0f3f1f6b5e1e33087a14f0cd1a680c3 | 1,682 | class Testkube < Formula
desc "Kubernetes-native framework for test definition and execution"
homepage "https://testkube.io"
url "https://github.com/kubeshop/testkube/archive/refs/tags/v1.1.0.tar.gz"
sha256 "dd0f2e27f836f2baab8ee0ddaa107d411eb6a9b3dfeeb8182934dc4cd99493dc"
license "MIT"
bottle do
sha25... | 43.128205 | 123 | 0.763377 |
7abf0d8f719adffb193d9e4a25b5a17159b65d8c | 5,872 | module Refile
module Attachment
# Macro which generates accessors for the given column which make it
# possible to upload and retrieve previously uploaded files through the
# generated accessors.
#
# The `raise_errors` option controls whether assigning an invalid file
# should immediately rais... | 35.161677 | 135 | 0.617337 |
ffcb05f254ec32ee219a5f080b603e385e9fb2c9 | 748 | Pod::Spec.new do |s|
s.name = 'BPForms'
s.version = '1.0.1'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.summary = 'Dynamic forms for iPhone/iPad - iOS 6, 7 and later.'
s.homepage = 'https://github.com/bpoplauschi/BPForms'
s.author = { 'Bogdan Poplauschi' => 'bpoplauschi@groupon.com' }
s.... | 31.166667 | 112 | 0.621658 |
f7323e6b02a7e04885053c221b5e2c28c0d8fc3b | 3,593 | # frozen_string_literal: true
# encoding: utf-8
# Copyright (C) 2017-2020 MongoDB 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
#
# Un... | 29.211382 | 104 | 0.623991 |
1abe923ea92e2532736b8f566458a0550f00693a | 6,278 | class Weboob < Formula
include Language::Python::Virtualenv
desc "Web Outside of Browsers"
homepage "https://weboob.org/"
url "https://git.weboob.org/weboob/weboob/uploads/7b91875f693b60e93c5976daa051034b/weboob-2.0.tar.gz"
mirror "https://files.pythonhosted.org/packages/88/c1/b3423348d8e2a557c7e0d53b5977cf1... | 43.296552 | 145 | 0.773495 |
38c7913f5040b8dbc27efb44952954bed7abeb77 | 1,587 | require 'bosh/director/api/controllers/base_controller'
module Bosh::Director
module Api::Controllers
class LinkAddressController < BaseController
register DeploymentsSecurity
def initialize(config)
super(config)
@deployment_manager = Api::DeploymentManager.new
@link_manager ... | 28.854545 | 142 | 0.644612 |
e2a2f8274a84ce07c7a480a8475210198ddfb847 | 175 | #!/usr/bin/env ruby -w
require "ripper"
require "pp"
ARGV.each do |p|
f = File.read p
puts
pp Ripper.lex f
puts
pp Ripper.sexp_raw f
puts
pp Ripper.sexp f
end
| 11.666667 | 22 | 0.651429 |
bb6de7189b41bfef646e44b8696879352984ac3e | 2,996 | # -*- encoding: utf-8 -*-
# stub: rails 4.2.2 ruby lib
Gem::Specification.new do |s|
s.name = "rails".freeze
s.version = "4.2.2"
s.required_rubygems_version = Gem::Requirement.new(">= 1.8.11".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["David Heinemeier... | 49.114754 | 207 | 0.650534 |
1c93f541655067e46cc9aed689dd03641319d527 | 678 | cask 'keepassxc' do
version '2.2.2'
sha256 'e9f80042d0aa1d19e5f20f492224895138cd752cd0a963c4dad1e42e1544a4dd'
# github.com/keepassxreboot/keepassxc was verified as official when first introduced to the cask
url "https://github.com/keepassxreboot/keepassxc/releases/download/#{version}/KeePassXC-#{version}.dmg"
... | 39.882353 | 105 | 0.775811 |
79364f1d0a6f4cbf037e6373300558b969c928a7 | 1,744 | require "spec_helper"
describe VideoBlur::Screen do
describe "ratio" do
let(:video) { VideoBlur::Video.new(input: "spec/resources/sample.mp4", output: nil) }
context "video is the same size as the screen" do
before(:each) do
allow(video).to receive(:size).and_return("1440x815")
end
... | 28.590164 | 94 | 0.599197 |
1cf4692c605ae4f950e416c8eca9987db2658fb4 | 624 | require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
require File.expand_path(File.dirname(__FILE__) + '/../../../../lib/sniffles/sniffers/cms/xcart')
describe Sniffles::Sniffers::Xcart do
describe "#output" do
context "xcart", :vcr => { :cassette_name => 'exprodirect_com' } do
let(:x... | 34.666667 | 97 | 0.637821 |
ff3807763062e1f9018dcfbbdf144c6c52745b46 | 855 | #
# Be sure to run `pod lib lint UYEditor.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 = "UYEditor"
s.v... | 29.482759 | 99 | 0.625731 |
39bca7c464bbf020d38ed6aa31d822287e1979f6 | 1,658 | require 'test_helper'
class OrderTest < ActiveSupport::TestCase
test '::order(column.asc)' do
assert_sql(<<~SQL, Property.order(Property.arel_table[:id].asc))
SELECT "properties".* FROM "properties" ORDER BY "properties"."id" ASC
SQL
end
test '::order(column1.asc, column2.asc)' do
assert_sql(... | 35.276596 | 101 | 0.680941 |
26db5db83fe2a8e8362b12e0fe00359d3eea79db | 354 | # 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::EventHub::Mgmt::V2017_04_01
module Models
#
# Defines values for SkuName
#
module SkuName
Basic = "Basic"
Standa... | 20.823529 | 70 | 0.683616 |
26630ad55db72ccdcb210770206579c755f67c55 | 2,557 | module SymmetricEncryption
module Generator
# Common internal method for generating accessors for decrypted accessors
# Primarily used by extensions
def self.generate_decrypted_accessors(model, decrypted_name, encrypted_name, options)
options = options.dup
random_iv = options.delete(:random_... | 49.173077 | 178 | 0.656629 |
5db3f7b676feab6afebc2b68d9e5187b5215ed60 | 187 | class AddGbifToNames < ActiveRecord::Migration[6.1]
def change
add_column :names, :gbif_json, :text, default: nil
add_column :names, :gbif_at, :datetime, default: nil
end
end
| 26.714286 | 56 | 0.721925 |
6a15ac7a8c096a48d24c4b681f63de13d7f6d605 | 2,461 | # coding: utf-8
Pod::Spec.new do |s|
# MARK: - Description
s.name = 'SwiftCommons'
s.summary = 'A collection of useful utility classes common to different iOS projects.'
s.version = '1.3.0'
s.platform = :ios
s.ios.deployment_target = '9.0'
s.swift... | 33.712329 | 140 | 0.694839 |
bf1ddebc5937b6c76802cbb0294380807a38c983 | 5,813 | require 'json'
require 'fileutils'
require_relative 'asset_information'
require_relative '../../service/transactor'
require_relative '../../defaults'
module Emojidex
module Data
# local caching functionality for collections
module CollectionCache
include Emojidex::Data::CollectionAssetInformation
... | 37.993464 | 182 | 0.61913 |
623ba3f89b507657ba70f5ddfa96087478fb14eb | 636 | require_relative '../jdbc_spec_helper'
describe 'logstash-output-jdbc: mysql', if: ENV['JDBC_MYSQL_JAR'] do
include_context 'rspec setup'
include_context 'when initializing'
include_context 'when outputting messages'
let(:jdbc_jar_env) do
'JDBC_MYSQL_JAR'
end
let(:systemd_database_service) do
'my... | 24.461538 | 90 | 0.698113 |
1da2496ce62736a72d4b1335c324899bb8ff618a | 815 | module ScormEngine
module Models
class DispatchZip < Base
# @attr
# The external identification of the dispatch.
# @return [String]
attr_accessor :dispatch_id
# @attr
# The type of ZIP package to generate.
# @return [String] (SCORM12, SCORM2004-3RD, AICC)
attr_acce... | 22.638889 | 55 | 0.586503 |
7ac6d930ea325646d3f711d80ef68bcddcd83042 | 7,940 | namespace :perf do
task :rails_load do
ENV["RAILS_ENV"] ||= "production"
ENV['RACK_ENV'] = ENV["RAILS_ENV"]
ENV["DISABLE_SPRING"] = "true"
ENV["SECRET_KEY_BASE"] ||= "foofoofoo"
ENV['LOG_LEVEL'] = "FATAL"
require 'rails'
puts "Booting: #{Rails.env}"
%W{ . lib test config }.each d... | 27.191781 | 129 | 0.63199 |
794a0eb4398c352092c8ff4f3125b703f0c66fb1 | 1,583 | module LinkingPaths
module Acts #:nodoc:
module Scribe #:nodoc:
def self.included(base) # :nodoc:
base.extend ClassMethods
end
module ClassMethods
activity_options ||= {}
def record_activity_of(actor, options = {})
include_scribe_instance_methods {
... | 31.039216 | 136 | 0.58307 |
08d56e0fe4785842dde166d48d391c4844ce2cde | 3,866 | ######################################################################
# Copyright (c) 2008-2016, Alliance for Sustainable Energy.
# All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the ... | 29.968992 | 108 | 0.554837 |
e9b5f3f962f7703c02a2e7a7311ce95dec970a4b | 2,161 | # frozen_string_literal: true
# The MIT License (MIT)
#
# Copyright (c) 2015 GitLab B.V.
#
# 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 t... | 33.246154 | 79 | 0.652476 |
91ccffb5bff5b0b3ab5f002d67df6fb344a42e09 | 6,169 | module MyersDiff
class WordDiff
BOUNDARIES_REGEX = /(\s+|[()\[\]{}'"]|\b)/.freeze
EXTENDED_WORD_CHARS_REGEX = /^[a-zA-Z\u{C0}-\u{FF}\u{D8}-\u{F6}\u{F8}-\u{2C6}\u{2C8}-\u{2D7}\u{2DE}-\u{2FF}\u{1E00}-\u{1EFF}]+$/u.freeze
def diff(s1, s2, **options)
old_string = cast_input(s1)
new_string = cast_... | 29.946602 | 140 | 0.583563 |
79019f37acf3d31f9c42b94da992c06525823c0c | 78 | require "backports/version"
require "backports/2.1"
require "backports/rails"
| 19.5 | 27 | 0.794872 |
08a895270dca609fe18ae8f875bea40d93980bec | 1,291 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
Gem::Specification.new do |spec|
spec.name = 'aws-sdk-codestarnoti... | 40.34375 | 125 | 0.680093 |
eda1c62eb3e6e9e32bdef5c9827cf248085138f3 | 1,316 | lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "tagabaybay/version"
Gem::Specification.new do |spec|
spec.name = "tagabaybay"
spec.version = Tagabaybay::VERSION
spec.authors = ["Norly Canarias"]
spec.email = ["canariasnorly@gm... | 41.125 | 98 | 0.674012 |
381ed4b31495bfcd4ad777e215b2c188e879dcc1 | 969 | class Slowhttptest < Formula
desc "Simulates application layer denial of service attacks"
homepage "https://github.com/shekyan/slowhttptest"
url "https://github.com/shekyan/slowhttptest/archive/v1.8.tar.gz"
sha256 "31f7f1779c3d8e6f095ab19559ea515b5397b5c021573ade9cdba2ee31aaef11"
head "https://github.com/shek... | 35.888889 | 93 | 0.711042 |
7a812ebe910ce5fe63bf5e413542217c783607bd | 824 | # frozen_string_literal: true
RSpec.describe Bootpay::Api do
it "verification" do
puts "verification"
receipt_id = '612df0250d681b001de61de6'
api = Bootpay::Api.new(
application_id: '5b8f6a4d396fa665fdc2b5ea',
private_key: 'rm6EYECr6aroQVG2ntW0A6LpWnkTgP4uQ3H18sDDUYw=',
)
if api.r... | 25.75 | 69 | 0.703883 |
1def78e9a214976ccd7f8ad289caecdff4399df9 | 478 | require File.join(Rails.root, "lib/mongoid_migration_task")
require 'date'
class ChangePersonDob< MongoidMigrationTask
def migrate
person=Person.where(hbx_id:ENV['hbx_id']).first
new_dob = Date.strptime(ENV['new_dob'],'%m/%d/%Y')
if person.nil?
puts "No person was found by the given hbx_id" unless R... | 31.866667 | 75 | 0.709205 |
1c5bd99037215b6a0126dcee7b9cf82a4df7db70 | 11,133 | # Copyright:: Copyright 2020 Trimble Inc.
# License:: The MIT License (MIT)
# Drawingelement is a base class for an item in the model that can be
# displayed. These items include edges, construction points, construction
# lines, and images. Arc curves and arcs are not included because they are not
# drawing elements b... | 28.042821 | 95 | 0.610707 |
4a5a888354639b2e194583c322721d09fb99590e | 722 | Pod::Spec.new do |s|
s.name = "FontAwesome.swift"
s.version = "1.4.3"
s.summary = "Use Font Awesome in your Swift projects"
s.homepage = "https://github.com/thii/FontAwesome.swift"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Thi D... | 38 | 106 | 0.580332 |
39a0becc62a25f05635f26d155474676d3db00ae | 4,440 | require 'rspec'
require 'tempfile'
require 'rspec/core/rake_task'
require 'bosh/dev/bat_helper'
require 'bosh/dev/sandbox/nginx'
require 'bosh/dev/sandbox/workspace'
require 'common/thread_pool'
require 'parallel_tests/tasks'
namespace :spec do
namespace :integration do
desc 'Run BOSH integration tests against a... | 36.097561 | 176 | 0.656982 |
f7be2242cb284c9631fda6f78273dfc69cc6065b | 209 | formats = {
am_pm: "%I:%M %p",
am_pm_long: "%b %e %Y, %l:%M %p",
am_pm_long_tz: "%b %e %Y, %l:%M %p %Z",
day_long: "%A, %B %d, %Y"
}
Time::DATE_FORMATS.merge! formats
Date::DATE_FORMATS.merge! formats
| 23.222222 | 41 | 0.569378 |
d5a79ccb81f7b9c02bfb849b83c2909563321c42 | 824 | require "rails_helper"
RSpec.describe SchedulesController, type: :routing do
describe "routing" do
it "routes to #index" do
expect(:get => "/schedules").to route_to("schedules#index")
end
it "routes to #show" do
expect(:get => "/schedules/1").to route_to("schedules#show", :id => "1")
end... | 26.580645 | 84 | 0.610437 |
ab93f8a3ac7fc0c31d10cefc2628d15432d55d65 | 1,236 | # frozen_string_literal: true
# we have to require StubPlayer first because ruby's module resolution is bad
require_relative "player/stub_player"
Dir.glob(File.join(__dir__, "player/*")) { |file| require_relative file }
module Muzak
# The namespace for muzak players.
module Player
extend Utils
# All cla... | 30.146341 | 81 | 0.70712 |
4a01fb48bd2e2fceabcdb89699576ae1e9c0663a | 7,709 | require 'spec_helper'
describe Rack::PassbookRack do
let(:register_delete_path) {'/v1/devices/fe772e610be3efafb65ed77772ca311a/registrations/pass.com.polyglotprogramminginc.testpass/27-1'}
let(:register_delete_params) {{'deviceLibraryIdentifier' => 'fe772e610be3efafb65ed77772ca311a',
'passTypeIdentifier' => ... | 32.944444 | 137 | 0.666753 |
26a9e66aed5910f920e30b184ca7f0cb04e0d190 | 329 | #
# Cookbook Name:: build
# Recipe:: smoke_tier_ec_upgrade_aws
#
# Copyright (c) 2015 The Authors, All Rights Reserved.
node.override['chef-server-acceptance']['identifier'] = 'tier-ec-upgrade'
include_recipe 'build::smoke_general_prep'
include_recipe 'build::tier_prepare_machine_configs'
include_recipe 'build::smo... | 23.5 | 73 | 0.781155 |
0886befe0443b6353b7d621e43464f862144a156 | 827 | # frozen_string_literal: true
require "minitest"
module Break
class TestingFrontend
class << self
def build(&block)
Class.new(self, &block)
end
def stack
@stack ||= []
end
def [](index)
stack[index]
end
def last
stack.last
end
... | 14.258621 | 43 | 0.561064 |
e9ad8f65f3ba66aca244e424d88459145d262c70 | 181 | class CreateCompanyCategories < ActiveRecord::Migration[6.0]
def change
create_table :company_categories do |t|
t.string :category
t.timestamps
end
end
end
| 18.1 | 60 | 0.707182 |
21169d231165382e342154725e76ea5c46e9c5cf | 375 | # Copyright (c) 2013 Universidade Federal Fluminense (UFF).
# This file is part of SAPOS. Please, consult the license terms in the LICENSE file.
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :allocation do
day { I18n.translate("date.day_names").first }
co... | 26.785714 | 84 | 0.744 |
3978b9081d2f886d8db718dce5df17a33cdafab1 | 100 | require './app'
require 'sidekiq/web'
run Rack::URLMap.new('/' => App, '/sidekiq' => Sidekiq::Web)
| 20 | 60 | 0.63 |
ed4e1bfdd5c3e40c71e94b9ef9c4503128450192 | 114 | require "test_helper"
class FingerTest < ActiveSupport::TestCase
test "the truth" do
refute true
end
end
| 14.25 | 42 | 0.736842 |
01e5ae37460321a77b1c68e246bb8e28ef4e4367 | 1,420 | # frozen_string_literal: true
require 'helper'
class TestAvatar < Test::Unit::TestCase
include DeterministicHelper
ROBOHASH = 'https://robohash.org'
assert_methods_are_deterministic(FFaker::Avatar, :image)
def setup
@tester = FFaker::Avatar
end
def test_avatar
assert_match(%r{\Ahttps://robohas... | 24.482759 | 78 | 0.685915 |
01705cdf1cce1d24b74de8367b1e9b042a8e2a9e | 128 | require 'test_helper'
class RobotConditionTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 16 | 50 | 0.71875 |
e941581e2f382ea2ac6a45ae3e600424f74f182f | 517 | module QuickenParser
class Transactions
include Enumerable
attr_accessor :timespan
def initialize(args={})
@txns = Array.new
args.each_pair do |key, value|
send("#{key}=", value)
end
end
def first
@txns.first
end
def last
@txns.last
end
def... | 13.972973 | 36 | 0.545455 |
798db0aae335749c7d9cf34283b8a30852c7c98b | 1,623 | # encoding: utf-8
#
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... | 32.46 | 72 | 0.680838 |
ffe8a287b41d83850cd4ac8d2e8dccf2e739ad25 | 10,480 | #
# Author:: Seth Chisamore <schisamo@chef.io>
# Cookbook:: php
# Resource:: pear
#
# Copyright:: 2011-2021, Chef Software, Inc <legal@chef.io>
#
# 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... | 34.587459 | 125 | 0.669179 |
9116a234da7b0995c42cf87f9748c9c96e3aba0a | 134 | class AddAuthorIdToPosts < ActiveRecord::Migration[5.1]
def change
add_column :exposition_posts, :author_id, :integer
end
end
| 22.333333 | 55 | 0.768657 |
d526a9f8b9f5196445d199e8eaced5a63b53525e | 322 | module Stall
module Shippable
extend ActiveSupport::Concern
included do
has_one :shipment, dependent: :destroy, inverse_of: :cart
accepts_nested_attributes_for :shipment
end
private
def items
super.tap do |items|
items << shipment if shipment
end
end
end
en... | 16.947368 | 63 | 0.658385 |
e223c5a635808befc82247304338c86697a3a1f3 | 280 | require 'ostruct'
module Rmega
def self.default_options
{
upload_timeout: 120,
api_request_timeout: 20,
api_url: 'https://eu.api.mega.co.nz/cs'
}
end
def self.options
@options ||= OpenStruct.new(default_options)
end
end
| 17.5 | 58 | 0.607143 |
1db3cc05ca36d34f99b15e8b0ce307756e572946 | 417 | # This file is generated by rake. Do not edit.
module Fcntl
FD_CLOEXEC = 1
F_DUPFD = 0
F_GETFD = 1
F_GETFL = 3
F_GETLK = 7
F_RDLCK = 1
F_SETFD = 2
F_SETFL = 4
F_SETLK = 8
F_SETLKW = 9
F_UNLCK = 2
F_WRLCK = 3
O_ACCMODE = 3
O_APPEND = 8
O_CREAT = 512
O_EXCL = 2048
O_NDELAY = 4
O_NOCTT... | 12.264706 | 46 | 0.613909 |
082b17f572d57d405f89150e998d0cd684ab3fb2 | 194 | class AddSubdomainToChannels < ActiveRecord::Migration
def change
add_column :channels, :subdomain, :string, allow_nil: false
add_index :channels, :subdomain, {unique: true}
end
end
| 27.714286 | 63 | 0.752577 |
62bd12a25faea18c9ae6de4e3efb6afaa2025cdc | 59 | # frozen_string_literal: true
json.extract! @handle, :url
| 14.75 | 29 | 0.762712 |
ff2b55f5cbe3cdf04fec261567eeae79cf3c0a3f | 1,581 | require "rails_helper"
RSpec.describe PdfConcatenator do
include PdfHelper
describe "#run" do
it "fills PDFs and concatenates the resulting files" do
form_one = double("form one",
fill?: true,
source_pdf_path: "spec/fixtures/test_fillable_pdf.pdf",
... | 41.605263 | 109 | 0.5895 |
11635f5754145bf506a01cdf14642bb8e831325c | 7,699 | =begin
#NSX-T Manager API
#VMware NSX-T Manager REST API
OpenAPI spec version: 2.5.1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.4.19
=end
require 'date'
module NSXT
# List of directory domain LDAP servers
class DirectoryLdapServerListResults
# Link to t... | 28.943609 | 107 | 0.60878 |
1c8dfa4cfb81e2b57f9c44d1524a3d3def67da54 | 6,586 | require 'zlib'
class TDLibTLTypeInfo
TLClass = Struct.new(:name, :comment) do
def to_s
name.to_s
end
def converter
"typeof(TLObjectConverter)"
end
end
Type = Struct.new(:name, :realname, :props, :type, :tl_class, :source, :comment) do
def to_s
name.to_s
end
def... | 23.862319 | 108 | 0.548588 |
3916008982df66ccc1fa2b57ce9a17d8e013543e | 505 | # 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::ApiManagement::Mgmt::V2018_06_01_preview
module Models
#
# Defines values for SubscriptionState
#
module SubscriptionState
... | 24.047619 | 70 | 0.683168 |
abfe123626d0130531a95ad0cfbbadcb6e73a75c | 1,422 | class Manage::LibraryDocumentsController < Manage::ManagementController
load_and_authorize_resource
before_action :get_posts, only: [:new, :edit]
before_action :get_library_section, only: [:new]
def show
end
def new
@library_document = @library_section.library_documents.build
end
def edit
end
... | 25.392857 | 104 | 0.755274 |
f82dff950316770726c8d655ba1a20d28b98a977 | 15,714 | #-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2017 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of ... | 26.499157 | 99 | 0.626702 |
183528e9861ea754d7e86f49fd61d3e13ad2f571 | 6,346 | #! /usr/bin/env ruby
require 'spec_helper'
provider_class = Puppet::Type.type(:package).provider(:yum)
describe provider_class do
include PuppetSpec::Fixtures
it_behaves_like 'RHEL package provider', provider_class, 'yum'
describe "when supplied the source param" do
let(:name) { 'baz' }
let(:resource)... | 51.177419 | 232 | 0.61913 |
6a007ba625a5ed63655d3e011b560aaf241b3226 | 4,271 | # Sample schema:
# create_table "users", :force => true do |t|
# t.column "login", :string, :limit => 40
# t.column "email", :string, :limit => 100
# t.column "crypted_password", :string, :limit => 40
# t.column "salt", :string, :limit => 40
# t.column "activation... | 32.356061 | 122 | 0.657926 |
217ec6efc1c1433515b5d03a8d85eb1f88f370f9 | 796 | require 'rails_helper'
describe 'ルーティング' do
example '職員トップページ' do
expect(get: 'http://baukis.example.com').to route_to(
host: 'baukis.example.com',
controller: 'staff/top',
action: 'index'
)
end
example '管理者ログインフォーム' do
expect(get: 'http://baukis.example.com/admin/login').to route_... | 22.742857 | 69 | 0.63191 |
330202bb624e5c1d05466867165210511b1f9e0c | 686 | class ProfileJSON < RSpec::Core::Formatters::JsonFormatter
RSpec::Core::Formatters.register self
def initialize(*args)
RSpec.configure{|c| c.add_formatter(:progress)}
super(*args)
end
def close(_notification)
collected_output = []
@output_hash[:examples].map do |ex|
collected_output << ... | 25.407407 | 80 | 0.641399 |
aca1d47fb6ae942fce7f2174684162fdc2ef46e1 | 3,784 | module Gameball
class Transaction
# include Gameball::Utils
def self.get_player_balance(playerId)
hashedBody = Gameball::Utils::hashBody(playerUniqueId: playerId)
body = { playerUniqueId: playerId,
hash: hashedBody }
res = Gameball::Utils::request("post", "/integrations/transa... | 37.84 | 105 | 0.657505 |
ffa89e855d8fbdbd8d776551f8fcc0aff151b8f0 | 18,964 | # encoding: utf-8
require 'spec_helper'
describe Grape::Validations::CoerceValidator do
subject do
Class.new(Grape::API)
end
def app
subject
end
describe 'coerce' do
module CoerceValidatorSpec
class User
include Virtus.model
attribute :id, Integer
attribute :name, ... | 30.3424 | 111 | 0.543398 |
1de1f137927d0a99ddb4b86b93e7580534b2b8c7 | 2,082 | require "active_support/notifications"
require "conekta"
require "conekta_event/engine" if defined?(Rails)
module ConektaEvent
class << self
attr_accessor :adapter, :backend, :event_retriever, :namespace, :private_signature
def configure(&block)
raise ArgumentError, "must provide a block" unless block... | 27.038961 | 86 | 0.670989 |
612e44f753d7b2aac5d657c207cb1a1766287278 | 814 | class Issue < ApplicationRecord
include MultiPageTool
belongs_to :journal
default_scope { order(published_at: :desc) }
def namespace
'journals'
end
def path
"/journals/#{journal.slug}/#{issue}"
end
def false_for_missing_methods
false
end
alias front_color_image_present? false_for_m... | 28.068966 | 73 | 0.837838 |
bb32673f35f548542a00f425229465a8894460bb | 376 | cask :v1 => 'omnipresence' do
version '1.3'
sha256 '2a58504aef5f7f24c74fb79ab1b59b667d83f3ba8b75b161a62de8617c089128'
url "http://downloads.omnigroup.com/software/MacOSX/10.10/OmniPresence-#{version}.dmg"
name 'OmniPresence'
homepage 'http://www.omnigroup.com/omnipresence'
license :commercial
app 'OmniP... | 26.857143 | 88 | 0.75266 |
ab765f14f476dda60fe9cdf91130716bfb3bff4c | 2,299 | class User < ApplicationRecord
has_many :microposts, dependent: :destroy
attr_accessor :remember_token, :activation_token, :reset_token
before_save :downcase_email
before_create :create_activation_digest
validates :name, presence: true, length: { maximum: 50 }
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.... | 27.698795 | 88 | 0.685515 |
e2e93055b17d1593ab044bb78d8cc4a6e86bd8fc | 5,518 | cask 'java' do
version '1.9,181'
sha256 '0755e848c061419313510a88508512b8d58ae9c79bd01d460e6b436dc13dfac1'
url "http://download.oracle.com/otn-pub/java/jdk/#{version.minor}+#{version.after_comma}/jdk-#{version.minor}_osx-x64_bin.dmg",
cookies: {
'oraclelicense' => 'accept-securebackup-cook... | 48.831858 | 249 | 0.574484 |
18c21e9d32cad913466a2ec2c68aec894350a6c8 | 797 | # frozen_string_literal: true
module ES
CONFIG = Rails.application.config_for(:elasticsearch).freeze
def self.client
Elasticsearch::Client.new(log: Rails.env.development?,
hosts: CONFIG[:hosts],
user: CONFIG[:user],
pass... | 29.518519 | 64 | 0.5734 |
bb9ed970609b140e4c842eb57e14a1e389b5b85a | 64 | class UserListMoviesController < ApplicationController
end
| 12.8 | 54 | 0.828125 |
7a54381ee6da3c8a458b6725b18d56b4947a8160 | 301 | # frozen_string_literal: true
FactoryBot.define do
factory :alliance do
id { Faker::Number.within(range: 99_000_000..100_000_000) }
esi_expires_at { 1.hour.from_now }
esi_last_modified_at { Time.zone.now }
name { Faker::Company.name }
ticker { Faker::Finance.ticker }
end
end
| 25.083333 | 63 | 0.707641 |
7a0e28c5ef89ddcae606c9efcc1b857aa7de51a3 | 1,499 | cask 'font-bungee' do
version '1.1.0'
sha256 'd012a9e6293201c3165feba64342d29c42bb4e67b1cc66e07509c12bab760a6f'
# github.com/djrrb/bungee was verified as official when first introduced to the cask
url "https://github.com/djrrb/bungee/releases/download/#{version}/Bungee-fonts.zip"
appcast 'https://github.com/... | 53.535714 | 88 | 0.817879 |
e91134239fd7d52351783212b8b02f3d960a099c | 193 | FactoryGirl.define do
factory :category, class: 'Categoryz3::Category' do
name { Faker::Name.name }
trait :child do
association :parent, factory: :category
end
end
end
| 16.083333 | 53 | 0.668394 |
abb9ceb076c3878d35dc10208518df397c9774ee | 931 | class Gel < Formula
desc "Modern gem manager"
homepage "https://gel.dev"
url "https://github.com/gel-rb/gel/archive/v0.2.0.tar.gz"
sha256 "7d69f745986c9c33272f080496aea53719d69d4f465993c740f432ef5f0a3bd3"
bottle do
cellar :any_skip_relocation
sha256 "ca4a4081014f2baab6285c44e1fddd6975cb33f22f76bddbc5... | 30.032258 | 93 | 0.707841 |
e966199fc86e04626c62c9b7c40aebe85aeb96f5 | 459 | java_version = input('java_version', description: 'Which version of java should be installed')
control 'Java is installed & linked correctly' do
impact 1.0
title 'Installed'
desc 'Java is installed & linked correctly'
describe command('java -version 2>&1') do
its('stdout') { should match java_version.to_s ... | 30.6 | 94 | 0.705882 |
384926aa429516ddb74eb411211fe69e6138b18c | 289 | class AdminEditUserPage < Page
def initialize
expect(page).to have_css '.edit_member_link.active'
super
end
def admin?
find('#user_admin').checked?
end
def set_admin
check 'Admin'
self
end
def save
click_on 'Save'
AdminUsersPage.new
end
end
| 13.136364 | 55 | 0.66436 |
1aa1e7ea45425ee30408783ad7eb7e65679860eb | 1,408 | # 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,... | 37.052632 | 102 | 0.752841 |
263eda349cb75eca0b8dab9b8050e7d81298e756 | 5,154 | require "active_support/core_ext/integer/time"
Rails.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
# Eager load code on boot. This eager loads most of Rails and
# your applica... | 44.817391 | 114 | 0.766395 |
bf3ec39e71557dc3665e2cb606a4d5949c4a0658 | 124 | class AddTitleToSubscriptions < ActiveRecord::Migration
def change
add_column :subscriptions, :title, :text
end
end
| 20.666667 | 55 | 0.774194 |
e2a4d780e5fdf9d53009068785b9f83472baa321 | 893 | # frozen_string_literal: true
require 'spec_helper'
describe Zoom::Actions::Roles do
let(:zc) { zoom_client }
let(:args) { { role_id: 2 } }
describe '#roles_members action' do
before :each do
stub_request(
:get,
zoom_url('/roles/2/members')
).to_return(body: json_response('roles... | 24.805556 | 109 | 0.641657 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.