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 |
|---|---|---|---|---|---|
3360baf3bcd462e27d9570c3acda69ea267471f3 | 3,175 | require_relative 'spec_helper'
describe 'Flush Agent' do
before do
init_client
@sling = SwaggerAemClient::SlingApi.new
# ensure agent doesn't exist prior to testing
# this deletion uses POST with operation=delete approach that works with
# both secured AEM (webdav bundle stopped) and unsecured A... | 34.139785 | 107 | 0.633386 |
b99b40d3a76482411e9e927c9dee6b275c3e0a5e | 591 | describe Motion::Option do
before do
@subject = Motion::Option.new
end
describe "#add" do
it "should add to the actions collection" do
@subject.add("ok") { "proc result" }
@subject.actions.count.should.equal(1)
@subject.actions.first.title.should.equal("ok")
@subject.actions.firs... | 25.695652 | 68 | 0.65313 |
182b4b5429c5538d5d3c18c20c65e55c0068868f | 340 | ###
# Copyright (c) 2015, Upnext Technologies Sp. z o.o.
# All rights reserved.
#
# This source code is licensed under the BSD 3-Clause License found in the
# LICENSE.txt file in the root directory of this source tree.
###
module S2sApi
module V1
class CouponImageSerializer < BaseSerializer
attributes :ur... | 21.25 | 74 | 0.714706 |
e204502ef9de57ef7f61507ccdc463b23d8ed02a | 14,860 | require_relative '../unit_helper'
describe Watir::Locators::Element::Matcher do
include LocatorSpecHelper
let(:query_scope) { @query_scope || browser }
let(:values_to_match) { @values_to_match || {} }
let(:matcher) { described_class.new(query_scope) }
describe '#match' do
context 'a label element' do
... | 40.271003 | 104 | 0.595222 |
6a9d732902bc0473c9ca6fae52542540464b747c | 606 | module NytSearch
class Article < Api
def self.search(options = {})
url = "#{@@config[:base_uri]}?q=#{options[:query]}&api-key=#{@@config[:api_key]}"
url += "&page=#{options[:page]}" if options[:page]
url += "&sort=#{options[:sort]}" if options[:sort]
url += "&begin_date=#{options[:begin_da... | 33.666667 | 87 | 0.579208 |
b9e40898065af4968e097dd30254fa3be784b9da | 385 | module CurrentTeamAndUser
module ICO
class Trigger < ::CurrentTeamAndUser::Base
def awaiting_dispatch
@team = @dts.approving_team
@user = @case.approver_assignments.for_team(@team).first.user
end
def responded
@team = @dts.approving_team
@user = @case.approver_as... | 24.0625 | 69 | 0.65974 |
6aeef8498d5aad4559f276c76c3575e472b37c06 | 536 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'arel/pg_json/build_info'
Gem::Specification.new do |spec|
spec.name = "arel_pg_json"
spec.homepage = ''
spec.require_paths = ['lib']
Arel::PgJson::BuildInfo.new.add_to_gems... | 28.210526 | 56 | 0.705224 |
26595d9954eb4d94d97107ed79e550c7c14a4e5d | 1,999 | Rails.application.routes.draw do
#devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks' }
devise_scope :user do
get 'sign_in', to: 'devise/sessions#new', as: :new_user_session
__send__ Devise... | 30.753846 | 102 | 0.666333 |
5dc99114ee53a58d5b6a795077ea01fbff52094b | 2,091 | require_relative "./visitor"
module MTS
# on separe le traitement a faire sur chaque node de la maniere dont les parcourir
# on type chaque node. Pour la plupart, il s'agit simplement du nom de leur classe.
# mais pour certaines nodes, un traitement est effectue
class BasicTyping < Visitor
def basic_type... | 15.840909 | 85 | 0.598278 |
e21f2a4b3965ac686ac0c9aa3287a78adfecc2b6 | 408 | module ScreeningList
class MbsData < Base
self.default_endpoint =
'https://www.treasury.gov/ofac/downloads/consolidated/consolidated.xml'
self.source_information_url =
'https://home.treasury.gov/policy-issues/financial-sanctions/consolidated-sanctions-list/non-sdn-menu-based-sanctions-list-ns-mbs-... | 37.090909 | 141 | 0.747549 |
f79cdbd480490f64e15c33cb5844b76524625a0d | 14,755 | #!/usr/bin/env ruby
gem 'minitest', '>= 5.0.0'
require 'minitest/reporters'
require 'minitest/autorun'
require_relative 'beer_song'
Minitest::Reporters.use!
# rubocop:disable Metrics/LineLength
class BeerSongTest < Minitest::Test
def test_the_first_verse
expected = "99 bottles of beer on the wall, 99 bottles of... | 38.324675 | 82 | 0.733921 |
6a0864b48f93745f8e59d9b08db65efa1f91f685 | 6,758 |
describe Kontena::LoadBalancers::Registrator do
before(:each) do
Celluloid.boot
allow(described_class).to receive(:gateway).and_return('172.72.42.1')
end
after(:each) { Celluloid.shutdown }
let(:subject) { described_class.new(false) }
let(:event) { double(:event, id: 'foobar', status: 'start') }
... | 41.460123 | 161 | 0.669281 |
01374270808b3ad1ab66201a696190ef2441eac8 | 2,845 | class Upscaledb < Formula
desc "Database for embedded devices"
homepage "https://upscaledb.com/"
url "http://files.upscaledb.com/dl/upscaledb-2.2.0.tar.gz"
mirror "https://dl.bintray.com/homebrew/mirror/upscaledb-2.2.0.tar.gz"
sha256 "7d0d1ace47847a0f95a9138637fcaaf78b897ef682053e405e2c0865ecfd253e"
revisio... | 30.591398 | 101 | 0.676977 |
d5e0d9eadbe8165d43a99600621fcee739564ea3 | 1,539 | require_relative 'const'
module DeepCover
class Node
class ModuleName < Node
has_child scope: [Node, nil]
has_child const_name: Symbol
def flow_completion_count
parent.execution_count
end
def execution_count
if scope
scope.flow_completion_count
el... | 23.676923 | 62 | 0.617934 |
013683e00484d4feda7267dd6c30e4d4678c50a4 | 467 | cask 'btcpayserver-vault' do
version '1.0.0'
sha256 '645a8454f73ccf5493802f0540d8d00ce87a55f8b32a8b9924fb0b2118f38111'
url "https://github.com/btcpayserver/BTCPayServer.Vault/releases/download/Vault%2Fv#{version}/BTCPayServerVault-osx-x64-#{version}.dmg"
appcast 'https://github.com/btcpayserver/BTCPayServer.Va... | 38.916667 | 137 | 0.798715 |
d52ee73c649458835f8123a009a3319242758112 | 1,792 | require 'test_helper'
require 'vcr_setup.rb'
class StoringMATExportPackageTest < ActiveSupport::TestCase
setup do
@cql_mat_export = File.new File.join('test', 'fixtures', 'CMS158_v5_4_Artifacts.zip')
end
test "Loading a MAT package, confirming the contents of the MAT package are viewable and stored correct... | 39.822222 | 192 | 0.664621 |
b9d42112a08d42e02b9dc9cfc601c4d98f9b58a2 | 284 | class TokyoMetro::Factory::Seed::Api::StationTimetable::Info::TrainTime::List < TokyoMetro::Factory::Seed::Api::MetaClass::List
include ::TokyoMetro::ClassNameLibrary::Api::StationTimetable
include ::TokyoMetro::Factory::Seed::Api::StationTimetable::Info::TrainTime::Common
end
| 40.571429 | 127 | 0.774648 |
031bebc8f2569d47230857348b4508ba7bf1e2a7 | 274 | require 'net/http'
require 'uri'
def is404(urlString)
url=URI.parse(urlString)
req = Net::HTTP::start(url.host,url.port) {|http|
http.get(url.path)
}
return req.code == "404"
end
def uriFromTest(path)
URI("http://localhost:3001/tests/"+path)
end
| 19.571429 | 52 | 0.645985 |
213f30fb3fca2ee1257ec834fe6bec6f0f30fe2d | 9,763 | status :published
satisfies_need "101003"
data_query = SmartAnswer::Calculators::MarriageAbroadDataQuery.new
reg_data_query = SmartAnswer::Calculators::RegistrationsDataQuery.new
translator_query = SmartAnswer::Calculators::TranslatorLinks.new
exclusions = %w(afghanistan cambodia central-african-republic chad comoros
... | 31.392283 | 186 | 0.768411 |
9182d31a24ceae11b71a0e1551874330a6ffaa82 | 860 | # This file will be loaded by config/basic early in a Boxen run. Use
# it to provide any custom code or behavior your Boxen setup requires.
# Change the prefix boxen is installed to.
# ENV['BOXEN_HOME'] = '/opt/boxen'
# Change the repo boxen will use.
ENV['BOXEN_REPO_NAME'] = 'gsamokovarov/my-boxen'
# Boxen binary p... | 33.076923 | 70 | 0.726744 |
617b48ee7f475fca3f31317b6cc0eeac3bb47581 | 215 | class Sponsors
class << self
def all
SponsorsData.values.map { |sponsor| OpenStruct.new(sponsor) }
end
def find(identifier)
OpenStruct.new(SponsorsData[identifier.to_s])
end
end
end
| 17.916667 | 67 | 0.669767 |
e24fdc5727c8ed67609c62f914d1886acedb3f27 | 3,258 | # frozen_string_literal: true
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 36.606742 | 102 | 0.586249 |
7afd24b81eff0d97e08cbf578ce5e2cc9169f95c | 163 | FactoryBot.define do
factory :archived_patient do
line { 'DC' }
created_by { FactoryBot.create(:user) }
initial_call_date { 400.days.ago }
end
end
| 20.375 | 43 | 0.687117 |
ff39a169547d32e3beb21ca996c2f3ce198d508f | 1,506 | # 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... | 39.631579 | 82 | 0.765604 |
e253899867d281c6ea276ec682b46d1ca9afc333 | 11,337 | require 'spec_helper'
describe 'php', type: :class do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
php_cli_package = case facts[:os]['name']
when 'Debian'
case facts[:os]['release']['major']
... | 42.620301 | 163 | 0.483373 |
795237bb7a512f500c21426eee652c148545757c | 1,614 | module Ubiquo::PagesHelper
def page_filters
if Ubiquo::Settings.context(:ubiquo_design).get(:page_string_filter_enabled)
filters_for 'Page' do |f|
f.text :caption => t('ubiquo.design.name')
end
end
end
def pages_list(collection, pages, options = {})
render(:partial => "shared/ubi... | 31.038462 | 80 | 0.522924 |
e9be626712d4ff538e615ad76d32789e01640e25 | 2,456 | require 'rails_helper'
describe Twilio::OutgoingMessageService do
subject(:outgoing_message_service) { described_class.new(message: message) }
let(:twilio_client) { instance_double(::Twilio::REST::Client) }
let(:messages_double) { instance_double('messages') }
let(:message_record_double) { instance_double('me... | 40.933333 | 119 | 0.707655 |
e298c25b61f02a780d8a615a2315aef5a56766d6 | 766 | Pod::Spec.new do |s|
s.name = "CombineCocoa"
s.version = "0.1.0"
s.summary = "CombineCocoa provided basic publisher bridges for UIControls in UIKit"
s.description = <<-DESC
Combine publisher bridges for Cocoa Controls (UIControl) in UIKit
DESC
s.homepage ... | 38.3 | 107 | 0.571802 |
79ee80089a80715f4a93cf7fa02065fe5594f54e | 13,771 | # Use this hook to configure devise mailer, warden hooks and so forth.
# Many of these configuration options can be set straight in your model.
Devise.setup do |config|
# The secret key used by Devise. Devise uses this key to generate
# random tokens. Changing this key will render invalid all existing
# confirmat... | 48.660777 | 150 | 0.750418 |
5da25dceadd29cbdf6670804242d3fdc9a10fa26 | 401 | # Sample code from Programing Ruby, page 353
def csv_from_row(op, row)
res = ""
until row.empty?
entry = row.shift.to_s
if /[,"]/ =~ entry
entry = entry.gsub(/"/, '""')
res << '"' << entry << '"'
else
res << entry
end
res << "," unless row.empty?
end
op << res << CRLF
end
... | 19.095238 | 49 | 0.553616 |
f78011b2505761f4e1bcb52105cbebf2fd5542e1 | 1,542 | #
# Author:: Adam Edwards (<adamed@getchef.com>)
#
# Copyright:: 2014, Chef Software, 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
#... | 24.870968 | 87 | 0.714008 |
bfe98a14d4f219d8fc779a25ce088e6ef4905fa7 | 264 | # frozen_string_literal: true
class Language < ApplicationRecord
include Iso639::Validator
belongs_to :link_instance
belongs_to :service, optional: true
belongs_to :location, optional: true
validates :language, iso639Code: true, length: { is: 2 }
end
| 22 | 58 | 0.765152 |
33e693ad521a4d6f930e5b870178d0f5f030c80a | 52 | json.partial! "payloads/payload", payload: @payload
| 26 | 51 | 0.769231 |
1d7b92cfbbf15615d4245da75511f69bbc09390f | 560 | class Geos < Formula
desc "GEOS - Geometry Engine, Open Source"
homepage "https://trac.osgeo.org/geos/"
url "https://download.osgeo.org/geos/geos-3.8.1.tar.bz2"
head do
url "https://github.com/OSGeo/geos.git"
depends_on "doxygen" => :build
end
depends_on "cmake" => :build
def install
mkdir ... | 23.333333 | 73 | 0.6375 |
ab87363c3b07f6b7f58d0776f9f708a6d11361ab | 909 | class SessionsController < ApplicationController
layout "login"
def new
@teacher = Teacher.new
end
def create
@teacher = Teacher.find_by(email: params[:teacher][:email])
if @teacher && @teacher.authenticate(params[:teacher][:password])
session[:teacher_id] = @teach... | 26.735294 | 77 | 0.623762 |
38166bb0e2f53e24ead83c0650284c919a772024 | 146 | require File.expand_path('../../../spec_helper', __FILE__)
describe "Array.try_convert" do
it "needs to be reviewed for spec completeness"
end
| 24.333333 | 58 | 0.739726 |
4ac7a2209b896cc5ba86b58e9b8a2ba4c390a3a9 | 3,016 | require 'rails_helper'
RSpec.describe 'posts/index', type: :view do
# rubocop:disable Metrics/BlockLength
before do
@user = User.create(
email: 'bob@example.com',
first_name: 'bob',
last_name: 'sinclair',
password: 'secret',
password_confirmation: 'secret'
)
@user.posts.c... | 24.322581 | 89 | 0.52122 |
7ae3d34ce6af09322f8b1e963a0caa4829e6634b | 1,123 | class ContentController < ApplicationController
def frontpage
@page = page_number(params[:page])
@posts = Post.find_frontpage(@page)
@show_next_link = (Post.find_frontpage(@page+1).length > 0)
respond_to do |f|
f.html
f.rss { render :layout => false }
end
end
def new
@page = page_numbe... | 20.053571 | 63 | 0.658949 |
879a91e2ad52bcbbd4a704106d2cc1e3caf287f1 | 410 |
if Rails.env.test?
Rake::Task['fixtures:csv_load:all'].execute
ActiveRecord::Base.connection.tables.each do |t|
ActiveRecord::Base.connection.reset_pk_sequence!(t)
end
end
BulkDiscount.destroy_all
bulk_discount1 = BulkDiscount.create(merchant_id: 1, percentage_discount: 20, quantity_threshold:5)
bulk_discou... | 34.166667 | 100 | 0.802439 |
1d7966a11edcd564c48610d04e2cc8bc9575d059 | 1,229 | # frozen_string_literal: true
module Gitlab
module Git
class Ref
include Gitlab::EncodingHelper
include Gitlab::Git::RuggedImpl::Ref
# Branch or tag name
# without "refs/tags|heads" prefix
attr_reader :name
# Target sha.
# Usually it is commit sha but in case
# w... | 26.717391 | 67 | 0.577705 |
4a17bee84eacbf55396cf832c15e62a434380c86 | 861 | require 'test_helper'
class Admin::DashboardControllerTest < ActionDispatch::IntegrationTest
include Devise::Test::IntegrationHelpers
setup do
end
test "should not get index if not admin" do
login_translator
get admin_dashboard_index_url
assert_redirected_to root_url
end
test "should get ind... | 23.916667 | 70 | 0.782811 |
d518a25cd8f2ae0ac00f7917c9721029c07f4dd2 | 359 | require 'formula'
class VertX < Formula
homepage 'http://vertx.io/'
url 'http://dl.bintray.com/vertx/downloads/vert.x-2.1RC2.tar.gz'
sha1 'c8f8f2e5c7fdcffd460a7c0be980cdcfa9867f33'
def install
rm_f Dir["bin/*.bat"]
libexec.install %w[bin client conf lib]
doc.install %w[api-docs]
bin.install_sy... | 23.933333 | 66 | 0.704735 |
e9cd2b175e69c845181bf3be56880a6ca6c77857 | 823 | class Task < ApplicationRecord
STATUS_WAITING = 'waiting'.freeze
STATUS_QUEUED = 'queued'.freeze
STATUS_ACTIVE = 'active'.freeze
STATUS_DONE = 'done'.freeze
STATUS_FAILED = 'failed'.freeze
STATUS_CANCELLED = 'cancelled'.freeze
belongs_to :resource, polymorphic: true, inverse_of: :tasks
def completed?
... | 22.243243 | 61 | 0.709599 |
62cbc87855b6a5229ba8401f6a0a5adc6b97d8ff | 7,295 | require "json"
require "pathname"
require "vagrant/plugin"
require "vagrant/plugin/manager"
require "vagrant/plugin/state_file"
require File.expand_path("../../../base", __FILE__)
describe Vagrant::Plugin::Manager do
include_context "unit"
let(:path) do
f = Tempfile.new("vagrant")
p = f.path
f.close... | 28.275194 | 75 | 0.629746 |
b9bcca249dc7d86621ed94c860156d54cfce1dcb | 209 | # frozen_string_literal: true
class ApplicationController < ActionController::Base
def welcome
@message = 'The dummy says hello!'
end
def remote_welcome
render plain: 'AJAX response'
end
end
| 17.416667 | 52 | 0.736842 |
87c2fd8840d90a660d1b153785e686220e7e3343 | 864 | module TransferWise
module TransferWiseObject
def self.included(base)
base.extend ClassMethods
end
def initialize()
@values = {}
end
def initialize_from(values)
add_methods(values.keys)
update_attributes(values)
self
end
def add_methods(keys)
self.in... | 18.782609 | 70 | 0.587963 |
615930810a584f2a54d8bc96f6450bf22172fea6 | 790 | # coding: utf-8
Gem::Specification.new do |spec|
spec.name = "minima"
spec.version = "2.1.1"
spec.authors = ["Joel Glovier"]
spec.email = ["jglovier@github.com"]
spec.summary = %q{A beautiful, minimal theme for Jekyll.}
spec.homepage = "https://github.com/jekyll/min... | 31.6 | 95 | 0.596203 |
79ce5015a2f8008d4db82817eeea6eec5ceb1a58 | 5,303 | require 'zbxapi'
class Host < ZabbixAPI_Base
action :create do
add_valid_params("1.3",
["host","port","status","useip",
"dns","ip","proxy_hostid",
"useipmi","ipmi_ip","ipmi_port", "ipmi_authtype",
"ipmi_privilege","ipmi_userna... | 22.662393 | 73 | 0.569112 |
08b1befca150f3f948b738668d1a86341ba8ba2a | 477 | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Ch... | 43.363636 | 111 | 0.702306 |
3896db82f78d94d30b26435e48b0c1dd004b0e7b | 932 | require_relative 'automated_init'
context 'Validating a given UUID' do
context 'A valid UUID is passed in' do
test 'Returns true' do
identifier = Identifier::UUID::Controls::Random.example
validated = Identifier::UUID.uuid?(identifier)
assert(validated == true)
end
end
context 'An inv... | 23.3 | 62 | 0.664163 |
031cdb24e9c812f6b527224b01f5ff93482cf80e | 5,448 | # Copyright (c) 2018-2019 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: MIT
# DO NOT MODIFY. THIS CODE IS GENERATED. CHANGES WILL BE OVERWRITTEN.
# vcenter - VMware vCenter Server provides a centralized platform for managing your VMware vSphere environments
require 'date'
module VSphereAutomation
... | 28.978723 | 111 | 0.620411 |
1887802b9e579fc705d0a8008bc70a0babf64eb2 | 82 | module ActiveRecord
module FindInOrderedBatches
VERSION = "0.0.1"
end
end
| 13.666667 | 29 | 0.731707 |
03b15d2cec7f19bc2ca34f6ce2d8fd50f49dbd2a | 9,671 | #-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2018 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.047826 | 102 | 0.71854 |
181604dd6fbecaee657d81b9df7f19ee62bfa0b8 | 795 | cask 'unity@2017.4.9f1' do
version '2017.4.9f1,6d84dfc57ccf'
sha256 :no_check
url "https://download.unity3d.com/download_unity/6d84dfc57ccf/MacEditorInstaller/Unity.pkg"
name 'Unity 2017.4.9f1'
homepage 'https://unity3d.com/unity/'
pkg 'Unity.pkg'
preflight do
if File.exist? "/Applications/Unity"
... | 26.5 | 93 | 0.68805 |
edd754b2cddbb61fd18491356fcc0ccc40f53193 | 642 | cask :v1 => 'haskell-platform' do
version '2014.2.0.0'
sha256 '62f39246ad95dd2aed6ece5138f6297f945d2b450f215d074820294310e0c48a'
url "http://www.haskell.org/platform/download/#{version}/Haskell%20Platform%20#{version}%2064bit.signed.pkg"
name 'Haskell Platform'
homepage 'http://www.haskell.org/platform/'
l... | 42.8 | 115 | 0.719626 |
ed1f7cd3db794ed8bb2799346ff21bab84d5a5ce | 803 | cask :v1 => 'flash-player-debugger' do
version '16.0.0.287'
sha256 '025f208c1a28ad4159c61b825713edf41e0bdfa87e7bb843109aa614d39577cb'
# macromedia.com is the official download host per the vendor homepage
url "https://fpdownload.macromedia.com/pub/flashplayer/updaters/#{version.to_i}/flashplayer_#{version.to_i... | 44.611111 | 123 | 0.713574 |
e8bb760f93ca7a730c6635816ea1854e285c6b6d | 2,978 | require_relative '../../spec_helper'
class WebappSearchPage < WebAppPage
def search_field_label_loc(label); {xpath: "//div[@id='searchfieldsTarget']//label[text()='#{label}']"} end
def results_table_header_loc(header); {xpath: "//table[@id='resultsListing']//th[contains(., '#{header}')]"} end
def berkeley_mappe... | 33.840909 | 121 | 0.707186 |
e982ed9d760fb406c8cef7f6d2c011a9e4c46ad7 | 158 | FactoryBot.define do
factory :user do
email { FFaker::Internet.email }
password { 'qwerty123' }
password_confirmation { 'qwerty123' }
end
end
| 19.75 | 41 | 0.683544 |
bfdd0bede6a539856bd7cd0c2932e7bcd461a376 | 333 | require 'csv'
namespace :import do
desc "Import Suburb Data"
task load_suburb_ref: :environment do
Suburb.destroy_all
CSV.foreach('./db/source-data/nsw_suburb_data_to_be_loaded.csv', headers: true) do |row|
Suburb.create(row.to_h)
end
puts "#{ Suburb.count } records added to the Suburbs tabl... | 25.615385 | 92 | 0.711712 |
26ffcbb90afbc5a41f327f24643e64e981d3ced4 | 3,192 | Rails.application.configure do
# Settings specified here will take precedence over those in
# config/application.rb.
# Configure the domains permitted to access coordinates API
config.allowed_cors_origin = proc { "https://allowed.test.website" }
# The test environment is used exclusively to run your applica... | 38 | 105 | 0.77005 |
f81a8294ae33cfe690f7834b3669c1ddd39b92c5 | 257 | require 'spec_helper'
RSpec.describe OneviewSDK::API800::Synergy::HypervisorManager, integration: true, type: UPDATE do
include_examples 'HypervisorManagerUpdateExample', 'integration api800 context' do
let(:current_client) { $client_800 }
end
end
| 32.125 | 97 | 0.789883 |
f8dfad1c82089734be91c995de702576ec9d2fca | 3,874 | #-- copyright
# OpenProject Costs 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.
#
# This program is distributed in the hope that it will be useful,
# but W... | 32.016529 | 101 | 0.722251 |
7a262b547fb31ca74b258ef109488b67f8b9fa92 | 395 | Rails.application.routes.draw do
namespace :api do
namespace :v1 do
post '/signin', to: "auth#create"
resources :users
resources :farmers
resources :prospects
resources :connects
resources :listings
resources :commodities
resources :prospects
resources :intere... | 21.944444 | 39 | 0.655696 |
6a0de1bec7bb5067e3eea452b724615d1420f07e | 1,373 | Kanban::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web ser... | 36.131579 | 84 | 0.780044 |
6147a0908d99cd59e793aba14bc33dcda573c33a | 58 | module GraphqlDevise
module ApplicationHelper
end
end
| 11.6 | 26 | 0.827586 |
7906a804a183d9e8a2b2e17cc30279cbbc9bb9a1 | 38 | module PgHero
VERSION = "2.8.0"
end
| 9.5 | 19 | 0.657895 |
bf6fc8fdecc7448a660eb4f0bb093b65db88d1a0 | 1,358 | class Libxxf86dga < Formula
desc "X.Org: XFree86-DGA X extension"
homepage "https://www.x.org/"
url "https://www.x.org/archive/individual/lib/libXxf86dga-1.1.5.tar.bz2"
sha256 "2b98bc5f506c6140d4eddd3990842d30f5dae733b64f198a504f07461bdb7203"
license "MIT"
bottle do
cellar :any
sha256 "15c9455a9f38... | 27.714286 | 94 | 0.696613 |
bfcff7bc2a01b0d9a62736af4df06d7f305ec4cd | 57 | class GpsLocationsController < ApplicationController
end
| 19 | 52 | 0.894737 |
e86d254afc5124a5f827881a504e3ee815fbb919 | 976 | require 'spec_helper'
require 'rails/generators/test_case'
require 'generators/zero_push/install_generator'
class ZeroPush::GeneratorTest < Rails::Generators::TestCase
destination File.expand_path('../tmp', __FILE__)
tests ZeroPush::InstallGenerator
test 'it copies the initializer' do
production_token = 'pro... | 40.666667 | 119 | 0.773566 |
0847f870986384d6ea52d9bbd89a5b7a9f914665 | 2,116 | # A record of installation of a Farmware.
# Useful for restoring a device after a re-flash.
class FarmwareInstallation < ApplicationRecord
belongs_to :device
validates :url, url: true
validates_uniqueness_of :url, { scope: :device }
validates_presence_of :device
# Prevent malice when fetching a farmware mani... | 34.129032 | 72 | 0.685255 |
1d806417d3c1447e351e967419592abe5f08b74c | 773 | class Definition
@@definitions = []
attr_reader(:definition, :part_of_speech, :id)
define_method(:initialize) do |info|
@definition = info.fetch(:definition)
@part_of_speech = info.fetch(:part_of_speech)
@id = @@definitions.length().+(1)
end
define_singleton_method(:all) do
@@definitions
... | 20.342105 | 49 | 0.677878 |
1a0281e5617d78c0df20177cc383b947ffed72d2 | 763 |
Pod::Spec.new do |s|
s.name = "DCURLRouter"
s.version = "0.81"
s.summary = "Use custom URL to change ViewController."
s.description = "Use custom URL to push and modal viewController. you can pop or dismiss several controller at the same time.you can modal a controller with a Navigation Co... | 28.259259 | 185 | 0.644823 |
b91748577749fa7bc66d722bc18501d538c13e96 | 19,708 | # frozen_string_literal: true
require 'json'
require 'logger'
require 'pathname'
require 'date'
require 'faraday'
require 'faraday_middleware'
require 'minitar'
require 'rake'
require 'rubygems'
require 'octokit'
module Travis
module Build
module RakeTasks
SHELLCHECK_VERSION = 'v0.5.0'
SHELLCHECK_U... | 30.042683 | 128 | 0.586107 |
61c0d606863dd9c3476675fd41311392015b0c44 | 1,185 | class ActionsController < ApplicationController
def index
@actions = current_user.actions.preload(:activity).ordered.limit(5)
@activities = current_activities.ordered
end
def create
activity = current_user.activities.find(params[:activity_id])
action = current_user.actions.new(activity: activity)... | 22.788462 | 71 | 0.69789 |
bf887892f931b8c503ee1e63c6d24790646e0824 | 197 | class CreateNotes < ActiveRecord::Migration[5.1]
def change
create_table :notes do |t|
t.string :title
t.text :body
t.integer :user_id
t.timestamps
end
end
end
| 16.416667 | 48 | 0.629442 |
4a006968ad71b597716667b55547e27824df7693 | 281 | #
# Copyright (c) 2017 and Confidential to Pegasystems Inc. All rights reserved.
#
Then (/^I am on Recurring bill page$/) do
@page = RecurringBillPage.new(self)
@page.check_elements
end
When (/^I choose No and tap Next$/) do
@page.pick_option_no
@page.tap_next
end
| 20.071429 | 80 | 0.701068 |
08a1ba3e8852b4c9ebd7d6c2a54b26d7c52896fb | 2,847 | # frozen_string_literal: true
require 'spec_helper'
require 'ace/fork_util'
# Integration level tests, to prove out functionality
RSpec.describe ACE::ForkUtil do
describe "#isolate" do
context "when everything works out" do
it 'returns the result' do
return_value = described_class.isolate do
... | 29.05102 | 109 | 0.616087 |
2649d05bc2959933c115b8cae175dfcf0d627daf | 575 | describe RspecFocusChecks do
context 'with old hash syntax', :focus => true do
describe 'focus on describe', :focus => true do
it 'alerts with focus on example too', :focus => true do
end
end
end
context 'with new hash syntax', focus: true do
describe 'focus on describe', focus: true do
... | 25 | 62 | 0.645217 |
e287c9a9fdace98188e85519bdf666b21ff7d2bc | 896 | =begin
#OEML - REST API
#This section will provide necessary information about the `CoinAPI OEML REST API` protocol. This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a>
The version of the OpenAPI document: v1
Contact: ... | 30.896552 | 244 | 0.754464 |
7993b8294ea97e9e0f49819339f096994ed93965 | 2,387 | require 'spec_helper'
RSpec.describe SigepWeb::RequestPlpServices do
subject(:request_plp_services) do
described_class.new(plp: plp, id_plp_client: id_plp_client, labels: labels)
end
let(:receiver) do
SigepWeb::Models::Receiver.new(
name: 'Destino Ltda', phone: '6212349644', address: 'Avenida Cent... | 32.256757 | 104 | 0.644323 |
87c9666761e1a8573a902268e71e38bbd99dd640 | 266 | class DropResourcesStartups < ActiveRecord::Migration[5.1]
def up
drop_table :resources_startups
end
def down
create_table :resources_startups do |t|
t.integer :resource_id, index: true
t.integer :startup_id, index: true
end
end
end
| 20.461538 | 58 | 0.710526 |
f8fdd93336da45f76f7caad88556e458045d57d8 | 225 | # This migration comes from shipit (originally 20210504200438)
class AddGithubUpdatedAtToCheckRuns < ActiveRecord::Migration[6.1]
def change
add_column :check_runs, :github_updated_at, :datetime, default: nil
end
end
| 32.142857 | 71 | 0.795556 |
39ad8944140dc7eed5292b455eba4ddebea12453 | 229 | # frozen_string_literal: true
module Netomox
module DSL
# Error for Netomox::DSL
class DSLError < StandardError; end
# Error when invalid argument in DSL
class DSLInvalidArgumentError < DSLError; end
end
end
| 20.818182 | 49 | 0.733624 |
26d036695583bbb0aa6cf9d684da236f0ea2fa0c | 1,630 | #
# Cookbook Name:: webapp
# Resource:: vhost_skel
#
# Author:: Fletcher Nichol <fnichol@nichol.ca>
#
# Copyright 2010, 2011, Fletcher Nichol
#
# 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
#... | 36.222222 | 74 | 0.693865 |
08f5f3382e8adbf340ad3f4397698d48fc8fc653 | 774 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'indicators/index', type: :view do
before do
assign(:indicators, [
Indicator.create!(
code: 'Code',
name: 'Name',
title: 'Title',
unit: 'Unit'
),
... | 24.967742 | 55 | 0.501292 |
794398ea8725663a0a2e01d064fe6504b2be1975 | 44 | module DockerTools
VERSION = "0.0.25"
end
| 11 | 20 | 0.704545 |
4a40e7af9cdb4cfc6fe23a7c27245749674f5e9e | 160 | require 'minitest/spec'
require 'minitest/autorun'
require 'push_package'
def fixture_path(*paths)
File.join(File.dirname(__FILE__), 'fixtures', *paths)
end
| 20 | 55 | 0.76875 |
21d72a2a3493ba5dd3326e6f05ce04cb90ef9ad4 | 998 | #
# Cookbook:: apache2
# Definition:: apache_mod
#
# Copyright:: 2008-2017, Chef Software, 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-... | 30.242424 | 77 | 0.719439 |
017dce19711948796ccdff702d8008d9f20f61ae | 1,196 | module ActsAsTaggableOn::Taggable
module Dirty
def self.included(base)
base.extend ActsAsTaggableOn::Taggable::Dirty::ClassMethods
base.initialize_acts_as_taggable_on_dirty
end
module ClassMethods
def initialize_acts_as_taggable_on_dirty
tag_types.map(&:to_s).each do |tags_type... | 32.324324 | 135 | 0.619565 |
6af8a3bff6899c7354494d345b86470b7a0d8065 | 1,376 | class Doctl < Formula
desc "Command-line tool for DigitalOcean"
homepage "https://github.com/digitalocean/doctl"
url "https://github.com/digitalocean/doctl/archive/v1.52.0.tar.gz"
sha256 "e4a0a08d5be545b9bb035ed377c0b7e7705e217bf55d4f4423d7dc8afb0a5819"
license "Apache-2.0"
head "https://github.com/digitalo... | 36.210526 | 102 | 0.730378 |
211c92551e938b016792b198c5e1efda368c4b70 | 265 | # frozen_string_literal: true
class AddInvitationCodeToPractice < ActiveRecord::Migration[5.0]
def self.up
change_table :practices do |t|
t.string :invitation_code
end
end
def self.down
remove_column :practices, :invitation_code
end
end
| 18.928571 | 64 | 0.735849 |
2818f1492f7e3061863efc0a96dcaa90b31b561d | 169 | require 'spec_helper'
describe Exponentiate do
it 'should compute the n-fold product of a function' do
expect( Exponentiate[:*.(2)].(2).(3) ).to eq(36)
end
end
| 21.125 | 57 | 0.686391 |
ac31f4a8ace0c49693595a35b284aa82c358d2fe | 1,246 |
# This file is automatically generated by puppet-swagger-generator and
# any manual changes are likely to be clobbered when the files
# are regenerated.
require_relative '../../puppet_x/puppetlabs/swagger/fuzzy_compare'
Puppet::Type.newtype(:kubernetes_supplemental_groups_strategy_options) do
@doc = "Supplement... | 25.958333 | 180 | 0.667737 |
039fcd4de53340599e1d726895cb47de1332435a | 238 | # frozen_string_literal: true
require "assert/factory"
module Factory
extend Assert::Factory
extend self
def name
"Joe"
end
def erb
"hello, <%= Factory.name %>!"
end
def erb_compiled
"hello, Joe!"
end
end
| 11.333333 | 33 | 0.647059 |
e271813ddf8e1074c5f18e4be986cb3e8602b240 | 705 | Pod::Spec.new do |s|
s.name = 'AWSLogs'
s.version = '2.24.0'
s.summary = 'Amazon Web Services SDK for iOS.'
s.description = 'The AWS SDK for iOS provides a library, code samples, and documentation for developers to build connected mobile applications using AWS.'
s.homepage = 'http://a... | 39.166667 | 157 | 0.608511 |
189348765f08339bee5c8fe01b101d10ab9ebe94 | 4,968 | # frozen_string_literal: true
RSpec.describe RuboCop::Cop::Style::StringConcatenation do
subject(:cop) { described_class.new }
it 'registers an offense and corrects for string concatenation' do
expect_offense(<<~RUBY)
email_with_name = user.name + ' <' + user.email + '>'
^^^^^^^^... | 30.666667 | 131 | 0.544082 |
38ddb46208db9033764180dc6aae170c4001c5fb | 378 | # frozen_string_literal: true
module Hyrax
module FormTerms
include Hyrax::Forms
# overrides Hyrax::Forms::WorkForm
# to display 'license' in the 'base-terms' div on the user dashboard "Add New Work" description
# by getting iterated over in hyrax/app/views/hyrax/base/_form_metadata.html.erb
def ... | 27 | 99 | 0.716931 |
28a990a9b93aa5e8cb6a0d3a0a77beddbdc4a283 | 61 | require "asset_bom_removal/rails/railtie" if defined?(Rails)
| 30.5 | 60 | 0.819672 |
612de5dea87a533981426c0ce618af76f958b207 | 1,790 | require 'test_helper'
describe 'DayFour' do
valid = <<~STR
ecl:gry pid:860033327 eyr:2020 hcl:#fffffd
byr:1937 iyr:2017 cid:147 hgt:183cm
STR
invalid = <<~STR
iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884
hcl:#cfa07d byr:1929
STR
invalid_better = <<~STR
eyr:1972 cid:100
hcl:#18171d ecl:amb hgt:170... | 24.861111 | 72 | 0.717877 |
1a518a31591fcad9079c6d37880d54966d6e7966 | 481 | module SpreeMenus
class Engine < Rails::Engine
require 'spree/core'
isolate_namespace Spree
engine_name 'spree_menus'
# use rspec for tests
config.generators do |g|
g.test_framework :rspec
end
def self.activate
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decora... | 22.904762 | 88 | 0.656965 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.