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 |
|---|---|---|---|---|---|
1defb255f68b122cdf745a51e3d3acccb5c5725a | 1,381 | module TestHelpers
module Events
class Alb < Base
self.event = {
"requestContext" => {
"elb" => {
"targetGroupArn" => "arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup/myawesomelambda-1rndy3u8psl2j/3f1bcbeec09c9050"}
},
"httpMethod" => "GET",... | 39.457143 | 145 | 0.553222 |
e249b51807a4246fbf12d92eb71ca1c8145b1141 | 428 | module Cmor::Partners
class CategoriesController < Cmor::Core::Backend::ResourcesController::Base
include Rao::ResourcesController::ActsAsListConcern
include Rao::ResourcesController::ActsAsPublishedConcern
def self.resource_class
Cmor::Partners::Category
end
private
def permitted_par... | 26.75 | 86 | 0.740654 |
6a28d837b79be83a45e1992ace729c1336cb3335 | 617 | # Copyright (c) 2009-2012 VMware, Inc.
require 'bosh_agent'
module Bosh::Agent
class UnknownInfrastructure < StandardError; end
class Infrastructure
def initialize(infrastructure_name)
@name = infrastructure_name
infrastructure = File.join(File.dirname(__FILE__), 'infrastructure', "#{infrastructu... | 23.730769 | 103 | 0.713128 |
79a5017468fcb63bc8b5fe37588e1e73418489c2 | 1,897 | class Fish < Formula
desc "User-friendly command-line shell for UNIX-like operating systems"
homepage "https://fishshell.com"
url "https://github.com/fish-shell/fish-shell/releases/download/3.0.2/fish-3.0.2.tar.gz"
sha256 "14728ccc6b8e053d01526ebbd0822ca4eb0235e6487e832ec1d0d22f1395430e"
bottle do
root_u... | 31.616667 | 94 | 0.721139 |
62442967037065d2dae5046238daaa343c37f155 | 3,567 | # frozen_string_literal: false
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules a... | 34.631068 | 154 | 0.634987 |
08fff1cc02112da6d4aa790bfb83ff3dcbc36261 | 897 |
require 'appl_work'
require 'db_admin_ms'
namespace :lib do
desc "launch regular work task"
task :run => :environment do
pc = ApplWork.new
#pc.parse_genes
#pc.select_genes
#pc.parse_gene_seqs
#pc.parse_gene_seqs_info
#pc.retrieve_naseq
#pc.ortho_run
#pc.msa_run
pc.blo_run
... | 16.017857 | 59 | 0.630992 |
1178169433b9cad325266ab670e8b28cd15511c6 | 5,248 | # frozen_string_literal: true
# typed: strict
module Redcord::Attribute
extend T::Sig
extend T::Helpers
# We implicitly determine what should be a range index on Redis based on Ruby
# type.
RangeIndexType = T.type_alias {
T.any(
Float,
Integer,
NilClass,
Numeric,
Time,
... | 29.483146 | 103 | 0.659489 |
6266b2ecb01afa9f20732a6bfd64374cdef3b5df | 191 | # This migration comes from shipit (originally 20180202220850)
class AddAbortedByToTasks < ActiveRecord::Migration[5.1]
def change
add_column :tasks, :aborted_by_id, :integer
end
end
| 27.285714 | 62 | 0.780105 |
4a40f4e8c2a5db3f75a780d9dc16c8595a0098ee | 979 | module Draper
# Provides access to helper methods - both Rails built-in helpers, and those
# defined in your application.
class HelperProxy
# @overload initialize(view_context)
def initialize(view_context = nil)
view_context ||= current_view_context # backwards compatibility
@view_context = ... | 25.102564 | 125 | 0.693565 |
ed1a7dae982b4a15e26bd867fb0d19f342774c9a | 14,509 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 34.793765 | 124 | 0.74023 |
7a70d3a6caed0605fcd10222d8586b05d4a2c06a | 515 | require './config/environment'
class ApplicationController < Sinatra::Base
configure do
set :public_folder, 'public'
set :views, 'app/views'
enable :sessions
set :session_secret, 'problems'
end
helpers do
def logged_in?
!!session[:user_id]
end
def current_user
User.fi... | 16.09375 | 50 | 0.63301 |
61b5ba7e53f0bce145d75ddd748ea8d6a4125743 | 3,245 | class DutyExpressionFormatter
class << self
def prettify(float)
TradeTariffBackend.number_formatter.number_with_precision(
float,
minimum_decimal_points: 2,
precision: 4,
strip_insignificant_zeros: true
)
end
def format(opts = {})
duty_expression_id = opt... | 38.630952 | 113 | 0.598767 |
f8b9326afceee7355cf76f4ec5b790f432c95ee7 | 89 | class SessionsController < Devise::SessionsController
def destroy
super
end
end | 12.714286 | 53 | 0.764045 |
2186ce8172fbf8058715b388e657a99d188c71db | 120 | require 'serverspec'
include Serverspec::Helper::Exec
include Serverspec::Helper::DetectOS
RSpec.configure do |c|
end
| 15 | 36 | 0.791667 |
33fdb030dfc538e96c5f089fad724513eb4acd98 | 45,658 | # frozen_string_literal: true
# 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, ... | 41.319457 | 162 | 0.562596 |
f897fde92f93df9d7d6f5138d584c09fe8ddc785 | 213 | module BurnPlan
module InvestmentStrategy
class InvestmentStrategy
def initialize
end
def create_investments(portfolio, year)
raise NotImplementedError
end
end
end
end
| 16.384615 | 45 | 0.690141 |
39578669135ab0c707f6873348544093850c3b65 | 3,639 | # frozen_string_literal: true
module Faraday
# Base class for all Faraday adapters. Adapters are
# responsible for fulfilling a Faraday request.
class Adapter
extend MiddlewareRegistry
extend DependencyLoader
CONTENT_LENGTH = 'Content-Length'
register_middleware File.expand_path('adapter', __di... | 31.37069 | 80 | 0.595493 |
bb5e1e17bceb3a9a3af3c29412b3fed60a86c2f2 | 615 | module Capybara
module Features
def self.included(base)
base.instance_eval do
alias :background :before
alias :scenario :it
alias :xscenario :xit
alias :given :let
alias :given! :let!
alias :feature :describe
end
end
end
end
def self.feature(*arg... | 21.964286 | 73 | 0.655285 |
08a6f49ea89e0a0416f3a5860e1f04f5aeee23a2 | 462 | # frozen_string_literal: true
Rails.application.routes.draw do
root to: 'entities#index'
resources :entities, only: %i[show index]
resources :variables, only: %i[show index] do
resources :scenarios, only: %i[index]
end
resources :scenarios, only: %i[show index]
resources :parameters, only: %i[show inde... | 33 | 101 | 0.71645 |
8723c33e7d3c22b94c117de31c29794296f96060 | 4,946 | require 'puppet-strings/yard/handlers/helpers'
require 'puppet-strings/yard/handlers/ruby/base'
require 'puppet-strings/yard/code_objects'
require 'puppet-strings/yard/util'
# Implements the handler for Puppet providers written in Ruby.
class PuppetStrings::Yard::Handlers::Ruby::ProviderHandler < PuppetStrings::Yard::... | 43.008696 | 186 | 0.681156 |
1aef670d6341a84594874362433c40d0b94c3f04 | 4,325 | # Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
# stub: madowu 0.0.7 ruby lib
Gem::Specification.new do |s|
s.name = "madowu"
s.version = "0.0.7"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.r... | 33.015267 | 105 | 0.635607 |
f80a5e1d9be9ce9d5292d5bb4c042f29b5cf0219 | 7,579 | # knife-block - a plugin to enable the use of multiple knife configuration files
# to allow interaction with multiple knife servers in an easy and consistent manner
#
# Based on a bash script by Kristian Van Der Vliet (vanders@liqwyd.com)
#
# Copyright (c) Matthew Macdonald-Wallace / Green and Secure IT Limited 2012
#
... | 30.684211 | 121 | 0.656155 |
e2ee59a0c21b34ee355856a4124438e58545b860 | 11,424 | ##
# The Version class processes string versions into comparable
# values. A version string should normally be a series of numbers
# separated by periods. Each part (digits separated by periods) is
# considered its own number, and these are used for sorting. So for
# instance, 3.10 sorts higher than 3.2 because ten is ... | 31.128065 | 92 | 0.660627 |
ab96b19f20b012b1e97f268b63902fb4dc485e22 | 6,170 | class Travis < Formula
desc "Command-line client for Travis CI"
homepage "https://github.com/travis-ci/travis.rb/"
url "https://github.com/travis-ci/travis.rb/archive/v1.10.0.tar.gz"
sha256 "b63991faebbd5da0e92bf1547775b69a0dbed01dd57e8b469d23a2a7bd79da43"
license "MIT"
bottle do
cellar :any
sha256... | 33.532609 | 95 | 0.753323 |
e29c294b6d1a7cf7325a85eb99aea4525dfc48b1 | 816 | # -*- encoding: utf-8 -*-
# stub: tilt 2.0.1 ruby lib
Gem::Specification.new do |s|
s.name = "tilt"
s.version = "2.0.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Ryan Tomayko"]
s.date = "2014-03-21"
s.d... | 34 | 105 | 0.661765 |
879f1d9c84949a81a67cb0338c48218aceaf482c | 1,903 | class DropRecalls < ActiveRecord::Migration
def up
drop_table :auto_recalls
drop_table :food_recalls
drop_table :recall_details
drop_table :recalls
end
def down
create_table "recalls", :force => true do |t|
t.string "recall_number", :limit => 10
t.integer "y2k"
t.date ... | 31.716667 | 91 | 0.603258 |
6155e4bf7f96d75be6b6f992e1407df7eb60e041 | 591 | # frozen_string_literal: true
Gem::Specification.new do |spec|
spec.name = "tech-radar"
spec.version = "0.1.0"
spec.authors = ["Loic57"]
spec.email = ["l.sciampagna@live.fr"]
spec.summary = "tech-radar !!!"
spec.homepage = "https://agilepartner.github.io/tech-radar/... | 32.833333 | 132 | 0.610829 |
ab4a45c52c51e2fd10eb337f013e24700b7c5086 | 2,654 | # frozen_string_literal: true
require "dependabot/dependency_file"
module Dependabot
module FileUpdaters
class VendorUpdater
def initialize(repo_contents_path:, vendor_dir:)
@repo_contents_path = repo_contents_path
@vendor_dir = vendor_dir
end
# Returns changed files in the ve... | 34.025641 | 111 | 0.619442 |
7a23c3aec244b2b7c3cd15d8f7462e2cba96c410 | 2,006 | require 'spec_helper'
describe 'cmake.vim#cache' do
before(:each) do
cmake.create_new_project
cmake.configure_project
end
describe '#read' do
it 'reads a known variable from the CMake cache' do
value = validate_response "echo cmake#cache#read('CMAKE_CXX_COMPILER')"
expect(value).to_not m... | 34 | 80 | 0.648554 |
e28055ed4a0407250da20e203f5d334c62014327 | 1,878 | Pod::Spec.new do |s|
s.name = 'GiniVision'
s.version = '4.8.3-gym'
s.summary = 'Computer Vision Library for scanning documents.'
s.description = <<-DESC
Gini provides an information extraction system for analyzing documents (e. g. invoices or
contracts), specifically informat... | 39.125 | 121 | 0.665602 |
b928e9879b6b85c02b5d2dd75b9c8881fa126cde | 254 | module HealthSeven::V2_7
class Aui < ::HealthSeven::DataType
# Authorization Number
attribute :authorization_number, St, position: "AUI.1"
# Date
attribute :date, Dt, position: "AUI.2"
# Source
attribute :source, St, position: "AUI.3"
end
end | 25.4 | 56 | 0.716535 |
f778769ab39aa1bbfe788b2636915101d1ce7be6 | 2,877 | # Declaração das variáveis de controle
result = ''
confirm_birth = 'n'
confirm_current_date = 'n'
loop do
# Mensagens iniciais ao usuário
puts " "
puts "Selecione uma das seguintes opções:"
puts "1 - Descobrir idade de uma pessoa"
puts "0 - Sair"
print 'Opção: '
# Entrada de dados para op... | 34.25 | 112 | 0.589155 |
e2357be32bec7a78a0f7b61dad126c19057227fe | 906 | # frozen_string_literal: true
module RuboCop
module Cop
module Layout
# This cop checks for space after `!`.
#
# @example
# # bad
# ! something
#
# # good
# !something
class SpaceAfterNot < Cop
include RangeHelp
MSG = 'Do not leave sp... | 22.097561 | 78 | 0.545254 |
281f82cbdc832987d4f4b254853bc306807aeec5 | 548 | class HoshinsSweeper < ActionController::Caching::Sweeper
include Hobo::Controller::Cache
observe Hoshin
def after_create(hoshin)
if Rails.configuration.action_controller.perform_caching
##expire_swept_caches_for(hoshin)
end
end
def after_update(hoshin)
if Rails.configuration.action_... | 22.833333 | 60 | 0.759124 |
87c96803c3ad37513790d280b68a6253eaa72229 | 4,537 | # frozen_string_literal: true
require 'spec_helper'
describe Gitlab::Auth::RequestAuthenticator do
let(:env) do
{
'rack.input' => '',
'REQUEST_METHOD' => 'GET'
}
end
let(:request) { ActionDispatch::Request.new(env) }
subject { described_class.new(request) }
describe '#user' do
let!... | 31.289655 | 132 | 0.706855 |
e8e9450150a9a21ad21960092c268444e804311c | 479 | require 'test_helper'
class RelationshipsControllerTest < ActionDispatch::IntegrationTest
test "create should require logedin user" do
assert_no_difference 'Relationship.count' do
post relationships_path
end
assert_redirected_to login_url
end
test "destroy should require logged in user" d... | 23.95 | 67 | 0.762004 |
2804f7d441c8ab474758fb20c54346e427010722 | 5,607 | # frozen_string_literal: true
module AnyCache::Adapters
# @api private
# @since 0.3.0
class ActiveSupportDalliStore < Basic
class << self
# @param driver [Object]
# @retunr [Boolean]
#
# @api private
# @since 0.3.0
def supported_driver?(driver)
AnyCache::Drivers::A... | 25.03125 | 90 | 0.590155 |
015b55c0bab5fca8ad8f10038d05b47baf4e5312 | 904 | module FastlyCTL
class CLI < Thor
desc "skeleton NAME", "Create a skeleton VCL file with the current boilerplate."
method_option :service, :aliases => ["--s"]
def skeleton(name="main")
id = FastlyCTL::Utils.parse_directory unless options[:service]
id ||= options[:service]
abort "Could no... | 36.16 | 126 | 0.65708 |
ffcddf97364ff9d4410cbd9f07f5a98f11b6e8b2 | 1,370 | module Frontapp
class Client
module Tags
def tags(params = {})
list("tags", params)
end
# Parameters
# Name Type Description
# ---------------------------
# tag_id string Id of the requested tag
# ---------------------------
def get_tag(tag_id)
... | 29.782609 | 97 | 0.434307 |
18381f2868bc42bd9e173a0dfecb8077ada61924 | 59 | Faker::UniqueGenerator.clear
Fabricate.times(100, :review)
| 19.666667 | 29 | 0.813559 |
91332085e1e4c7c0dd1f58e4929aec899c8e8a5b | 2,564 | module Pickle
module Email
# return the deliveries array, optionally selected by the passed fields
def emails(fields = nil)
@emails = ActionMailer::Base.deliveries.select {|m| email_has_fields?(m, fields)}
end
def email(ref, fields = nil)
(match = ref.match(/^#{capture_index_in_email}$/))... | 32.871795 | 119 | 0.649766 |
e2f1d52c276fa0ae80245dcc1d4d660af48e7f1e | 165 | require 'rails_helper'
describe 'authors/new.html.erb', type: :view do
before { assign(:author, build(:author_factory)) }
it_behaves_like 'renderable view'
end
| 23.571429 | 52 | 0.745455 |
03e4fdbc198a4b1a27c6e06e23aa49a69d58aab0 | 1,754 | class Id3ed < Formula
desc "ID3 tag editor for MP3 files"
homepage "http://code.fluffytapeworm.com/projects/id3ed"
url "http://code.fluffytapeworm.com/projects/id3ed/id3ed-1.10.4.tar.gz"
sha256 "56f26dfde7b6357c5ad22644c2a379f25fce82a200264b5d4ce62f2468d8431b"
license "GPL-2.0"
bottle do
sha256 cellar:... | 50.114286 | 122 | 0.721209 |
1af723adac7b8d81d46028ec2ad3a9acf8fef151 | 676 | # encoding: UTF-8
require 'minitest/autorun'
require 'minitest/reporters'
MiniTest::Reporters.use! MiniTest::Reporters::RubyMineReporter.new
require '../src/expert_system'
require '../src/fact_table'
require '../src/fuzzy_fact_table'
require '../src/rule'
require '../src/fuzzy_rule'
require '../src/result_value'
requir... | 26 | 66 | 0.724852 |
b9e9173ad94ee8667b56d9e700784baad11bd6a0 | 1,152 | def standard_dependencies
gem 'yard'
gem 'ffi'
group :development, :testing do
gem 'jruby-openssl', platforms: :jruby
gem 'json', platforms: :jruby
# Explicitly specify each rspec dependency so that we can use
# rspec-mocks-diag instead of rspec-mocks
#gem 'rspec', '~> 3.0'
gem 'rspec-cor... | 24 | 65 | 0.617188 |
213c4a208ca7a17e9b7a63c3bdd499b42abe2467 | 185 | class CreateFlights < ActiveRecord::Migration[6.0]
def change
create_table :flights do |t|
t.integer :beer_id
t.integer :order_id
t.timestamps
end
end
end | 18.5 | 50 | 0.664865 |
f715607d04c45ae3be18f791a0a3f1c63d3ba7da | 1,141 | require 'spec_helper'
require 'timecop'
RSpec.describe Que::Scheduler::SchedulerJobArgs do
it 'should prepare default args' do
Timecop.freeze do
mock_db_time_now
args = described_class.build(nil)
expect(args.last_run_time).to eq(Time.zone.now)
expect(args.as_time).to eq(Time.zone.now)
... | 25.931818 | 67 | 0.660824 |
26b516466878528ec584e8b6210c6088779ab850 | 90 | FactoryGirl.define do
factory :column do
name "MyString"
document nil
end
end
| 12.857143 | 21 | 0.7 |
38570c1513b04bf825ef760cbf7a568f8598d4d5 | 78 | class Story < ApplicationRecord
has_many :sections, dependent: :destroy
end
| 19.5 | 41 | 0.794872 |
619157e511e7ecf48fb5257db92c84f4e9461c05 | 1,415 | require 'shrine'
Shrine.plugin :activerecord
Shrine.plugin :cached_attachment_data # for forms
Shrine.plugin :upload_endpoint
Shrine.plugin :presign_endpoint
Shrine.plugin :restore_cached_data
Shrine.plugin :determine_mime_type
# On precompile, the ENV vars for AWS are not set
return if ARGV.join.include?('assets:pre... | 32.159091 | 83 | 0.720848 |
e98eca75dae7b7cdeaa85b13bad9f5fe34c4aeaa | 103 | module TestEngine
class TestController < ApplicationController
def index
end
end
end | 14.714286 | 46 | 0.708738 |
bf0d4cae74919134a755b56ccbb7025571f92857 | 1,803 | class Nest < Formula
desc "Neural Simulation Tool (NEST) with Python3 bindings (PyNEST)"
homepage "https://www.nest-simulator.org/"
url "https://github.com/nest/nest-simulator/archive/v3.3.tar.gz"
sha256 "179462b966cc61f5785d2fee770bc36f86745598ace9cd97dd620622b62043ed"
license "GPL-2.0-or-later"
revision 1... | 29.557377 | 89 | 0.698281 |
115401cf3d9fbad92fdcdadaa2e654e9cb964f89 | 157 | my_array = [3, 4, 8, 7, 1, 6, 5, 9, 2]
# Call the sort! method on my_array below.
# my_array should then equal [1, 2, 3, 4, 5, 6, 7, 8, 9].
my_array.sort!
| 22.428571 | 57 | 0.592357 |
1d1a3a4b5f8ca7ad0f026d291db01ab53d1e429e | 2,661 | require 'rails_helper'
RSpec.describe Admin::ArchiveController, type: :controller, admin: true do
let(:petition) do
FactoryBot.create(:completed_petition)
end
describe "not logged in" do
describe "PATCH /admin/petitions/:petition_id/archive" do
it "redirects to the login page" do
patch :up... | 35.013158 | 115 | 0.651635 |
4add9c90cccf51c29bea8226a20182ef41ef4f07 | 1,890 | # The MIT License (MIT)
# Copyright (c) 2018 Mike DeAngelo Looker Data Sciences, Inc.
# 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 r... | 37.058824 | 84 | 0.734392 |
ab8d3540342293ea3b8e7daf4f27c473b6de4fa6 | 3,899 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use... | 33.612069 | 146 | 0.660939 |
2182c12632c5b391b4cd6655da80a486d0526756 | 4,184 | #! /usr/bin/env ruby
# frozen_string_literal: true
#
# check-azurerm-route-tables-usage
#
# DESCRIPTION:
# This plugin checks the number of Route Tables allocated and available in a Region in Azure.
# Warning and Critical Percentage thresholds may be set as needed.
#
# OUTPUT:
# plain-text
#
# PLATFORMS:
# Lin... | 34.01626 | 108 | 0.625478 |
eda1cafd65e46ab12223d4f3945dd4c73b4495a8 | 989 | require 'spec_helper'
describe ProjectPolicy, models: true do
let(:project) { create(:empty_project, :public) }
let(:guest) { create(:user) }
let(:reporter) { create(:user) }
let(:dev) { create(:user) }
let(:master) { create(:user) }
let(:owner) { create(:user) }
let(:admin) { create(:admin) }
let(:us... | 26.72973 | 77 | 0.672396 |
1a8fb53b273e068fa40c98c1b9f18ad23b71eda5 | 1,641 | # 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::Storage::Mgmt::V2019_04_01
module Models
#
# Result of the request to list Storage operations. It contains a list of
# operation... | 28.293103 | 78 | 0.522852 |
eda2aadd04a3746346867811b9d207ad7aa6bc9e | 208 | class CreateStaticPermissions < ActiveRecord::Migration
def change
create_table :static_permissions do |t|
t.integer :permission_type
t.integer :target
t.timestamps
end
end
end
| 18.909091 | 55 | 0.711538 |
1a11dbca9b81d33bf0cad471263cc97deb1adcd9 | 33 | module ProgressReportsHelper
end
| 11 | 28 | 0.909091 |
e8933d300d777326ec492b7338078af65b7d7d58 | 597 | # frozen_string_literal: true
class Rpush320AddApnsP8 < ActiveRecord::VERSION::MAJOR >= 5 ? ActiveRecord::Migration[5.0] : ActiveRecord::Migration
def self.up
add_column :rpush_apps, :apn_key, :string, null: true
add_column :rpush_apps, :apn_key_id, :string, null: true
add_column :rpush_apps, :team_id, :... | 33.166667 | 116 | 0.735343 |
ab31830baa3e08ea455a48f800d565a869ae327a | 1,671 | namespace :report do
desc 'Output titles and work ids of possible duplicates'
task :report_duplicate_titles_and_work_ids_by_collection_id, [:collectionid, :output_file] => :environment do |t,args|
if args.count < 1
puts 'Usage: bundle exec rake report:report_duplicate_titles_and_work_ids_by_collection_id... | 34.8125 | 149 | 0.646918 |
91dab11fab86e066433e6fe4f7ca11565eaba0c2 | 2,075 | #! /usr/bin/env ruby
#
# metrics-curl
#
# DESCRIPTION:
# Simple wrapper around curl for getting timing stats from the various phases
# of connecting to an HTTP/HTTPS server.
#
# OUTPUT:
# metric data
#
# PLATFORMS:
# Linux
#
# DEPENDENCIES:
# gem: sensu-plugin
# gem: socket
#
# USAGE:
# #YELLOW
#
# NOTE... | 28.040541 | 126 | 0.653012 |
d511abb3566d1f6c82719fcfba3856d5b9d5d503 | 645 | Pod::Spec.new do |s|
s.name = "AMSlideOutController"
s.version = "1.1.1"
s.summary = "SlideOut Navigation Controller for iOS. Fully customizable."
s.homepage = "https://github.com/andreamazz/SlideOutNavigation"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { ... | 43 | 103 | 0.604651 |
e9036c23427633dcc4e62785b8f36bb0f2564d08 | 10,080 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Geo, :geo, :request_store do
using RSpec::Parameterized::TableSyntax
include ::EE::GeoHelpers
let_it_be(:primary_node) { create(:geo_node, :primary) }
let_it_be(:secondary_node) { create(:geo_node) }
shared_examples 'a Geo cached... | 28.156425 | 101 | 0.673313 |
abd8314be7131e02f2631679294c975ad3809521 | 132 | FactoryGirl.define do
factory :part_line_item, class: 'Spree::PartLineItem' do
line_item
variant
quantity 1
end
end
| 16.5 | 58 | 0.719697 |
e86a37f934033b0779d9ce886d301edace06b300 | 3,382 | FactoryBot.define do
factory :lesson do
lesson_name 'テスト講義'
to_create do |instance|
instance.save validate: false
end
trait :with_result do
after(:create) do |lesson|
lesson.results = []
lesson.results << FactoryBot.create(:result, lesson_id: lesson.id)
end
end
... | 26.217054 | 132 | 0.623596 |
287247e27a0c0b7a3e8ce8aeff9cc487734f4b44 | 417 | class YARD::Handlers::C::MixinHandler < YARD::Handlers::C::Base
MATCH = /rb_include_module\s*\(\s*(\w+?),\s*(\w+?)\s*\)/
handles MATCH
statement_class BodyStatement
process do
statement.source.scan(MATCH) do |klass_var, mixin_var|
namespace = namespace_for_variable(klass_var)
ensure_loaded!(nam... | 29.785714 | 70 | 0.702638 |
08769752e3ca4a7f06345e1582d190c8dbad78e6 | 5,850 | require "rubygems"
require "thread"
require "bugsnag/version"
require "bugsnag/configuration"
require "bugsnag/meta_data"
require "bugsnag/report"
require "bugsnag/cleaner"
require "bugsnag/helpers"
require "bugsnag/session_tracker"
require "bugsnag/delivery"
require "bugsnag/delivery/synchronous"
require "bugsnag/de... | 34.821429 | 143 | 0.708718 |
6a9b9cd95fab610b870bad976fa2eb86e04d302d | 1,081 | # frozen_string_literal: true
require_relative "test_helper"
require "httpx/plugins/proxy"
class ProxyTest < Minitest::Test
include HTTPX
def test_parameters
params = parameters(username: "user", password: "pass")
assert params == parameters(username: "user", password: "pass")
assert params != parame... | 29.216216 | 78 | 0.707678 |
bfbbf3b485c9deb8fdc91ab4a105c8054dd17012 | 1,244 | class I2p < Formula
desc "Anonymous overlay network - a network within a network"
homepage "https://geti2p.net"
url "https://download.i2p2.de/releases/0.9.50/i2pinstall_0.9.50.jar"
mirror "https://launchpad.net/i2p/trunk/0.9.50/+download/i2pinstall_0.9.50.jar"
sha256 "34902d2a7e678fda9261d489ab315661bd2915b9d... | 36.588235 | 103 | 0.676849 |
39de5d0e2c2c92975d37193b82108c2590c24a76 | 535 | Pod::Spec.new do |s|
s.name = 'DAKeyboardControl'
s.version = '0.0.1'
s.platform = :ios
s.license = 'MIT'
s.summary = 'Easily add keyboard awareness and scrolling dismissal.'
s.homepage = 'https://github.com/danielamitay/DAKeyboardControl'
s.author = { 'Daniel Amitay' => 'hello@danielamitay.com' ... | 41.153846 | 137 | 0.68972 |
f7ab6f14e2c9ec4ceeacfd1011c2d83a13b05d8c | 278 | class RecipeSerializer
include JSONAPI::Serializer
attributes :name, :ingredients, :instructions, :image_url, :user_id, :created_at, :updated_at, :comments
belongs_to :user, serializer: UserSerializer
# has_many :comments
# has_many :users, through: :comments
end
| 30.888889 | 106 | 0.758993 |
18a1a3552825a63be03e04a751ab39492191e948 | 732 | Pod::Spec.new do |s|
s.name = "HPLChatViewController"
s.version = "0.0.2"
s.summary = "HPLChatViewController is for making sms like views on iOS. It is a fork of https://github.com/AlexBarinov/UIBubbleTableView."
s.homepage = "https://github.com/huffpostlabs/HPLChatViewController"
s.li... | 36.6 | 145 | 0.625683 |
f8ac5d8e443b279e21acd0a998ae2f34e1101ee3 | 211 | require "application_system_test_case"
class ObjectivesTest < ApplicationSystemTestCase
# test "visiting the index" do
# visit objectives_url
#
# assert_selector "h1", text: "Objective"
# end
end
| 21.1 | 48 | 0.739336 |
288c4657088eaf257d8c21beafb340c2bfb4c754 | 657 | class SaltController < ApplicationController
# http_basic_authenticate_with name: "preview", password: "", only: :render_html
before_action :authenticate_full_site_password, only: [:render_html]
def render_html
if Rails.env.development? && request.fullpath =~ /.html$/
render plain: "Template not foun... | 29.863636 | 89 | 0.694064 |
ac5a3142ab438d654dc5ce1a618254aa47f87faa | 810 | cask 'origin' do
version '10.5.30.15625'
sha256 'd679a1635957edcc677b4f00f9a6d3fb236b1af8d401306999085b3e1c8cfeab'
# origin-a.akamaihd.net was verified as official when first introduced to the cask
url 'https://origin-a.akamaihd.net/Origin-Client-Download/origin/mac/live/Origin.dmg'
appcast 'https://api1.ori... | 38.571429 | 114 | 0.676543 |
915f51461c8eb77e475fc95132f7745f2bcb20cc | 139 | require 'test_helper'
class WhatContactsControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end
| 17.375 | 61 | 0.741007 |
b9bf9ae1caffafa96d7f159529c61c9d2279e3d7 | 638 | module Rao
module Api
module ResourcesController::DestroyAllActionConcern
extend ActiveSupport::Concern
included do
if respond_to?(:before_action)
before_action :load_and_destroy_collection, only: [:destroy_all]
else
before_filter :load_and_destroy_collection, only... | 23.62963 | 74 | 0.65674 |
e9226d2e1891ffa42f7667eba6256074b0a0ef22 | 682 | # frozen_string_literal: true
module Userable
extend ActiveSupport::Concern
included do
def remove_users(id: nil, jwt: nil)
result = Maremma.get user_url
Array.wrap(result.body["data"]).each do |user|
url = ENV["VOLPINO_URL"] + "/users/" + user.fetch("id")
data = {
"data"... | 24.357143 | 73 | 0.532258 |
797f8589365b74c4f1a9cbb15c2da03721ac0ccc | 1,110 | require_relative 'alerty/version'
require_relative 'alerty/error'
require_relative 'alerty/config'
require_relative 'alerty/command'
require_relative 'alerty/logger'
require_relative 'alerty/cli'
require_relative 'alerty/string_util'
require_relative 'alerty/plugin_factory'
class Alerty
def self.logger
@logger |... | 30.833333 | 104 | 0.703604 |
bb98eca3d96f0ac7bdf90d161e87906a7346337e | 780 | # This has to be a separate type to enable collecting
Puppet::Type.newtype(:database_user) do
@doc = "Manage a database user. This includes management of users password as well as priveleges"
ensurable
newparam(:name, :namevar=>true) do
desc "The name of the user. This uses the 'username@hostname' or userna... | 32.5 | 99 | 0.687179 |
33ee49eba6048b12f443d9afc1e8ca33ba4ba7bb | 395 | class YearsController < ApplicationController
get '/years' do
if Year.all.empty?
Scraper.year_scraper
end
erb :'years/index'
end
get '/years/:year' do
@year = Year.find_by(:value => params[:year])
#SHOULD REFACTOR BELOW
if @year.shows.empty?
... | 18.809524 | 49 | 0.55443 |
39d35df2def558a6bc171c859056d6734f14e566 | 1,419 | module Support
class InteractionsController < ApplicationController
before_action :safe_interaction, only: :new
def index; end
def show
@interaction = InteractionPresenter.new(current_case.interactions.find(params[:id]))
end
def new
@interaction = InteractionPresenter.new(current_ca... | 31.533333 | 126 | 0.701903 |
4a0cc73e654988449faa1be59a3993062971a353 | 581 | include SnipeIT::API
class Status
def initialize(url, token, status_label)
@status_label = status_label
endpoint = Endpoint.new(url, token, 'statuslabels', search: status_label)
@status = Get.new(endpoint)
end
class DoesNotExistError < StandardError
end
def current_value
if @status.response... | 20.034483 | 96 | 0.690189 |
1109181bb5d5df471c5d460d104b6d364b95ef7a | 730 | class SorceryActivityLogging < ActiveRecord::Migration
def self.up
add_column :accounts, :last_login_at, :datetime, :default => nil
add_column :accounts, :last_logout_at, :datetime, :default => nil
add_column :accounts, :last_activity_at, :datetime, :default => nil
add_column :accounts, :last_... | 38.421053 | 79 | 0.736986 |
4a6aa9dd5cc56494b83e06d14795256eeb625641 | 207 | class User < ActiveRecord::Base
has_secure_password
has_many :villagers
validates :name, presence: true
validates :password_digest, presence: true
validates :email, uniqueness: true
end | 25.875 | 46 | 0.73913 |
26496ec9764f26a938e915e5bf4c2c16194e7556 | 806 | # encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-compute::api-os-compute' do
describe 'redhat' do
let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) }
let(:node) { runner.node }
let(:chef_run) { runner.converge(described_recipe) }
include_context 'compute_stubs'
include_exampl... | 27.793103 | 62 | 0.730769 |
38d58d69e7db2b4164a8f1d343ae245a011025f2 | 974 | # DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#108. Convert Sorted Array to Binary Search Tree
#Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
#For t... | 32.466667 | 158 | 0.688912 |
39eb81a72729b75436e325c504ed20985180cc48 | 205 | class AddFieldsToUser < ActiveRecord::Migration
def change
add_column :users, :name, :string
add_column :users, :perm_admin, :boolean
add_column :users, :perm_create_talk, :boolean
end
end
| 25.625 | 50 | 0.736585 |
f87d811ec8971acd13f20a0e0027910e3d5fc511 | 1,619 | # app/models/registration.rb
# Model for events registrations
class Registration < ActiveRecord::Base
# extends ...................................................................
# includes ..................................................................
# security (i.e. attr_accessible) ......................... | 36.795455 | 79 | 0.399629 |
e97a28effb2dc70032565f578c83d1980aeec5fa | 1,812 | require 'spec_helper'
require 'rack/test'
require 'bosh/director/api/controllers/errands_controller'
module Bosh::Director
describe Api::Controllers::ErrandsController do
include Rack::Test::Methods
subject(:app) { described_class } # "app" is a Rack::Test hook
before { Api::ResourceManager.stub(:new) ... | 27.454545 | 74 | 0.602649 |
bfe283872bf7db081b921bc1b041a2bbb778df96 | 1,681 | # encoding: utf-8
require 'spec_helper'
module Rubocop
module Cop
module Style
describe RedundantBegin do
let(:cop) { RedundantBegin.new }
it 'reports an offence for def with redundant begin block' do
src = ['def func',
' begin',
' ala',
... | 26.265625 | 70 | 0.395003 |
38b29ea992b1c36a2ab5f19e09ebef25326fa15e | 3,130 | module Selenium
module WebDriver
module Firefox
class Binary
def initialize
ENV['MOZ_NO_REMOTE'] = '1' # able to launch multiple instances
check_binary_exists
end
def create_base_profile(name)
execute("-CreateProfile", name)
status = nil
... | 28.981481 | 125 | 0.544089 |
b9ce261d92ebf496dca1daccdcf24c269da0da73 | 736 | class Api::V1::CollectionsController < ApplicationController
def index
collections = Collection.all
render json: CollectionSerializer.new(collections)
end
def create
collection = Collection.new(collection_params)
if collection.save
render json: CollectionSerializer.... | 22.30303 | 102 | 0.675272 |
6a4cb12977a926576c5165c425e613fdb423206b | 8,878 | # typed: false
require 'spec_helper'
require 'datadog/statsd'
require 'ddtrace'
require 'benchmark/ips'
unless PlatformHelpers.jruby?
require 'benchmark/memory'
require 'memory_profiler'
end
require 'fileutils'
require 'json'
RSpec.shared_context 'benchmark' do
# When applicable, runs the test subject for dif... | 28.731392 | 118 | 0.660059 |
1de12c9c56df6d61b56aa651c1a03e6a90debc4b | 2,222 | # frozen_string_literal: true
require 'spec_helper'
describe 'is_integer' do
it { is_expected.not_to eq(nil) }
it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
it { is_expected.to run.with_params(1, 2).and_raise_error(Puppet::ParseError, %r{wrong number ... | 45.346939 | 113 | 0.721872 |
08a914a59163024ea77f935418ee94b78f7ba03c | 447 | class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
has_many :audiences
validates :first_name, :presenc... | 31.928571 | 62 | 0.733781 |
613f5d90f53d5a61672dce1f5a5a2bb354cf5aa4 | 8,847 | require 'hanami/utils'
module Hanami
# Registered components
#
# @since 0.9.0
# @api private
#
# @see Hanami::Components
module Components # rubocop:disable Metrics/ModuleLength
# Require the entire project
#
# @since 0.9.0
# @api private
register 'all' do
requires 'model', 'app... | 24.106267 | 106 | 0.59896 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.