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 |
|---|---|---|---|---|---|
1d691c24cb4e0fa9f4e9cf35bba7b9e700b6ad31 | 1,903 | # Plug in a druid, fetch the IIIF manifest, find the images, print the labels via Google Cloud Vision API
# https://cloud.google.com/vision/
# Setup:
# gem install faraday
# gem install iiif_google_cv
# gem install google-cloud # see https://github.com/googleapis/google-cloud-ruby
# You then need to have a valid .j... | 28.402985 | 155 | 0.726747 |
bfa9036881a02b7fe585e4ea254a631054b53bd8 | 3,488 | class MentorshipsController < EventBasedController
# GET /mentorships
# GET /mentorships.json
def index
@mentorships = policy_scope(@event.mentorships)
@mentorships = @mentorships.includes(:shift).includes(:mentee)
@mentorships = order_by_params @mentorships
respond_to do |format|
format.ht... | 28.590164 | 119 | 0.680333 |
113de555f977cab34d1b747ec94e0810ec21401b | 184 | require 'sinatra'
require "sinatra/json"
require "sinatra/activerecord"
require_relative 'models/world'
get '/' do
end
get '/worlds/' do
json(World.all.select(:id, :name))
end
| 13.142857 | 36 | 0.711957 |
628204a82bbd6aa7c87adaf4693dd384e929c8fa | 2,272 | cask "docker" do
if MacOS.version <= :el_capitan
version "18.06.1-ce-mac73,26764"
sha256 "3429eac38cf0d198039ad6e1adce0016f642cdb914a34c67ce40f069cdb047a5"
else
version "3.0.4,51218"
sha256 "5c389dd9842e2f5027b8c073e80495f43c01b72e2ac48e98151d1429675e7f93"
end
url "https://desktop.docker.com/ma... | 33.910448 | 80 | 0.683979 |
ed15810906f1ca5fe5b4711dfc9df818d883ea92 | 4,280 | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | 23.646409 | 78 | 0.639953 |
6271584d02c1f143776a27dd90f445d2c37478e9 | 156 | # Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
SocialAuth::Application.initialize!
| 26 | 52 | 0.794872 |
8750368047e747c352fbd27c2767f2c03a45e227 | 99 | class FanaticPluser
extend Rusby::Core
rusby!
def plusplus(number)
number + 1
end
end
| 11 | 22 | 0.686869 |
d5f55621cceb9e0cf467b052f1ec9c728f527cb8 | 36,571 | require 'test_helper'
describe BrNfe::Product::Operation::NfeConsultaProtocolo do
subject { FactoryGirl.build(:product_operation_nfe_consulta_protocolo) }
describe '#aliases' do
it { must_have_alias_attribute :chNFe, :chave_nfe }
end
describe 'Validations' do
it { must validate_presence_of(:chave_nfe) }
it... | 46.351077 | 151 | 0.755954 |
62453be1ed9cce94973f1115c01e942058ffe58e | 3,331 | # Puppet provider for mysql
class Puppet::Provider::Mysql < Puppet::Provider
# Without initvars commands won't work.
initvars
# Make sure we find mysql commands on CentOS and FreeBSD
ENV['PATH'] = ENV['PATH'] + ':/usr/libexec:/usr/local/libexec:/usr/local/bin'
# rubocop:disable Style/HashSyntax
commands :... | 30.281818 | 116 | 0.643651 |
3985e1e33de083d665681bceae4fbe09f755dfa2 | 140 | require "new_gem/version"
module NewGem
class Error < StandardError; end
def self.testName
"this is a succesful test"
end
end
| 14 | 34 | 0.714286 |
9164f2ef905ae9500e9e186a0b9c4f30909bb1e6 | 78 | json.array! @players do |player|
json.partial!('player', player: player)
end | 26 | 41 | 0.717949 |
215786f30ea6cd99e4837a3dbd2ff27f9924dbb9 | 637 | describe "Helpers" do
describe 'Helpers#current_user' do
it "returns the current user" do
@user1 = User.create(:username => "skittles123", :password => "iluvskittles", :balance => 1000)
session = {
:user_id => 1
}
expect(Helpers.current_user(session)).to be_an_instance_of(User)... | 23.592593 | 101 | 0.615385 |
7a78f04bff0669d6886c3774f307b95874a16510 | 1,071 | # Copyright (C) 2011 Rocky Bernstein <rockyb@rubyforge.net>
require 'rubygems'; require 'require_relative'
require_relative '../command'
require_relative '../load_cmds'
class Trepan::Command::CompleteCommand < Trepan::Command
unless defined?(HELP)
NAME = File.basename(__FILE__, '.rb')
HELP = <<-HELP... | 26.775 | 80 | 0.659197 |
915a455f8ef025843c7a4144c24900d4716eb51d | 1,166 | #
# 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
#
# Unless required by applicable law or agreed to in... | 26.5 | 91 | 0.759005 |
f70fd22e66e1133103a0f2d28cea1a779c4cf5e5 | 14,160 | =begin
#Custom Workflow Actions
#Create custom workflow actions
The version of the OpenAPI document: v4
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.1
=end
require 'date'
module Hubspot
module Automation
module Actions
class FieldTypeDefinition
# The input field ... | 42.017804 | 979 | 0.598658 |
ffe0130f576a42a74ce963c0cd1edfcb6016337f | 1,028 | test_name 'FM-3804 - C94728 - Plug-in Sync Module from Master with Prerequisites Satisfied on Agent'
step 'install IBM_Installation_Manager dependencies:'
['puppet-archive', 'puppetlabs-stdlib', 'puppetlabs-concat'].each do |dep|
on(master, puppet("module install #{dep}"))
end
step 'Install dsestero/download_uncomp... | 44.695652 | 100 | 0.764591 |
18083a58587ffe5b25ca3e1d4bdbd84cec689ba2 | 10,633 | # encoding: utf-8
require "test_helper"
class TestRooOpenOffice < Minitest::Test
def test_openoffice_download_uri_and_zipped
port = 12_345
file = "rata.ods.zip"
start_local_server(file, port) do
url = "#{local_server(port)}/#{file}"
workbook = roo_class.new(url, packed: :zip)
assert_in... | 36.665517 | 113 | 0.645914 |
1d93308080b9e151f62f456f82e61f914b5ba2ea | 124 | module Rcommerce
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
end
end
| 20.666667 | 54 | 0.806452 |
26bf4800dc487dba5ffe58a4e190deff8a095770 | 3,005 | #-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2015 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 ... | 34.54023 | 96 | 0.699168 |
aca3e3dfcf872abf051a49f12d070df0f06962cd | 6,710 | #-- 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... | 33.55 | 122 | 0.671386 |
28946520b63ff789ba37284493b94394c3e066cb | 67 | module Wordpress
class APICallException < StandardError; end
end
| 16.75 | 45 | 0.820896 |
e81e119ab6e16fc00cbe46d82bd2f55091f7bca8 | 348 | class CreateGeolocations < ActiveRecord::Migration
def self.up
create_table :geolocations do |t|
t.integer :zip
t.string :state_code
t.string :state
t.string :city
t.float :longitude
t.float :latitude
t.timestamps
end
end
def self.down
drop_ta... | 15.818182 | 50 | 0.62069 |
b96c18f46a483444e14188419b680f258923d7a5 | 7,270 | # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
require 'date'
require_relative 'attach_volume_details'
# rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
module OCI
# AttachParavirtualizedVolumeDetails model.
class Core::Models::AttachParavirtualizedVolumeDetail... | 39.945055 | 223 | 0.692022 |
e9ae6eab91792ce474ae05a2d6b27b2083422c46 | 13,493 | require 'test_helper'
class BootstrapCheckboxTest < ActionView::TestCase
include BootstrapForm::Helper
def setup
setup_test_fixture
end
test "check_box is wrapped correctly" do
expected = %{<div class="checkbox"><label for="user_terms"><input name="user[terms]" type="hidden" value="0" /><input id="us... | 93.055172 | 550 | 0.706811 |
217029341cef72ba8e802c8c8c6cd84c4e80d4a6 | 120 | class BuildController < ApplicationController
layout "build"
def about
end
def garage
end
end
| 10 | 45 | 0.65 |
f8153c9f3da424200fbde52b2ea525d889bcce15 | 2,036 | require 'spec_helper'
RSpec.describe Circuitry::CLI do
subject { described_class }
describe '#provision' do
before do
allow(Circuitry::Provisioning::QueueCreator).to receive(:find_or_create).and_return(queue)
allow(Circuitry::Provisioning::TopicCreator).to receive(:find_or_create).and_return(topic... | 34.508475 | 168 | 0.700884 |
1a3bcb2ee7b9d3bfaf56bf6f9408cb7e4771220a | 851 | module Selenium
module WebDriver
module IPhone
class Bridge < Remote::Bridge
DEFAULT_URL = "http://#{Platform.localhost}:3001/hub/"
def initialize(opts = {})
remote_opts = {
:url => opts.fetch(:url, DEFAULT_URL),
:desired_capabilities => o... | 23.638889 | 85 | 0.542891 |
e8b5b29349bf429503e7ec34635000b795205bf7 | 2,593 | cask "stm32cubemx" do
module Utils
def self.cubemx_app_path
"/Applications/STMicroelectronics/STM32CubeMX.app"
end
def self.usr_local_bin_file
"/usr/local/bin/stm32cubemx"
end
def self.cubemx_script_file
"#{cubemx_app_path}/Contents/MacOs/stm32cubemx.sh"
end
end
versio... | 36.521127 | 114 | 0.693405 |
017b28a2a73ccdfce99531bba08001a88f008f12 | 329 | namespace :db do
desc "Describe all the tables in the database by reading the table comments"
task :comments => :environment do
ActiveRecord::Base.connection.tables.sort.each do |table_name|
comment = ActiveRecord::Base.connection.table_comment(table_name)
puts "#{table_name} - #{comment}"
end
... | 32.9 | 78 | 0.723404 |
7a5d30999f352cecd6c14a552322f950615d2d8c | 1,259 | # frozen_string_literal: true
require 'bundler/setup'
# require 'simplecov'
# SimpleCov.start
require 'minitest/pride'
require 'minitest/autorun'
require_relative 'helpers/memcached'
ENV['SASL_CONF_PATH'] = "#{File.dirname(__FILE__)}/sasl/memcached.conf"
require 'dalli'
require 'logger'
require 'ostruct'
require 'se... | 21.706897 | 103 | 0.676728 |
1122b93dd7cabea3ae67b2c075b6c31beb64f606 | 405 | cask 'lastfm' do
version '2.1.37'
sha256 'dc46e58111f8555fc0b1d6d2bd11e8fd4e4c45c6c7e953d106e07be8d6d8b448'
url "https://cdn.last.fm/client/Mac/Last.fm-#{version}.zip"
appcast 'https://cdn.last.fm/client/Mac/updates.xml',
checkpoint: '7a9b0239c6af0128a3eff20c46c3893cee1f3a57786f6c2fca8a8df8e8993280'
... | 31.153846 | 88 | 0.750617 |
7aec0284cee69118ffb820439131a03be2b850b4 | 47,697 | # 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... | 52.070961 | 132 | 0.567813 |
08224f489964748613441ff9ca0cd499aea5856f | 3,989 | require 'spec_helper'
require_relative './shared_context'
describe Fog::Network::OpenStack do
before :all do
openstack_vcr = OpenStackVCR.new(
:vcr_directory => 'spec/fixtures/openstack/network',
:service_class => Fog::Network::OpenStack,
:project_scoped => true
)
@service = ... | 35.936937 | 102 | 0.634495 |
398660271ca2ba9e018027faf10365b4576db775 | 1,127 | require 'test_helper'
class PostsControllerTest < ActionController::TestCase
setup do
@post = posts(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:posts)
end
test "should get new" do
get :new
assert_response :success
end
test "s... | 22.54 | 128 | 0.682343 |
33724f6734d7411ed9e134c2cbc6fef00099e515 | 522 | module VagrantPlugins
module DockerProvisioner
module Cap
module Debian
module DockerInstall
def self.docker_install(machine)
machine.communicate.tap do |comm|
comm.sudo("apt-get update -qq -y")
comm.sudo("apt-get install -qq -y --force-yes curl")
... | 27.473684 | 67 | 0.549808 |
3985bee01c2ac90098a04f3e4e0d36e4b25c0f49 | 2,363 | # encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative sou... | 32.369863 | 86 | 0.669911 |
bfdc9417c895fefee17121f70398c84dbbd842b7 | 1,482 | # frozen_string_literal: true
require_relative "lib/punchfiller/version"
Gem::Specification.new do |spec|
spec.name = "punchfiller"
spec.version = Punchfiller::VERSION
spec.authors = ["Jorge Junior"]
spec.email = ["jorgedjr21@gmail.com"]
spec.summary = "Write a short summ... | 39 | 88 | 0.678138 |
b9f6892f6df2b90a330bc39c2ad02f8e6fde644e | 606 | require 'io/console'
require 'colorize'
require 'yaml'
require_relative './util/cursorable'
require_relative './util/display'
require_relative './board/board'
require_relative './board/evaluator'
require_relative './pieces/piece'
require_relative './pieces/sliding_piece'
require_relative './pieces/queen'
require_relat... | 30.3 | 44 | 0.80363 |
e8622385f7f46fa2b2ea824dedaec71e9e2f263d | 7,850 | RSpec.describe 'FloatingIp API' do
include Spec::Support::SupportsHelper
describe 'GET /api/floating_ips' do
it 'lists all cloud subnets with an appropriate role' do
floating_ip = FactoryBot.create(:floating_ip)
api_basic_authorize collection_action_identifier(:floating_ips, :read, :get)
get(a... | 37.203791 | 154 | 0.685223 |
e9df4677089bff9599f9347f7d59b9688f21847d | 1,550 | module SessionsHelper
# Logs in the given user.
def log_in(user)
session[:user_id] = user.id
end
# Remembers a user in a persistent session.
def remember(user)
user.remember
cookies.permanent.signed[:user_id] = user.id
cookies.permanent[:remember_token] = user.remember_token
end
#... | 24.21875 | 73 | 0.685161 |
e85bec563ce8e7bba7303ba9312b8fdb0e1651c4 | 276 | module HashExt
module Traverse
def self.traverse(hash, &block)
hash.inject({}) do |h,(k,v)|
if Hash === v
v = traverse(v,&block)
end
nk, nv = block.call(k,v)
h[nk] = nv unless nk.nil?
h
end
end
end
end
| 18.4 | 35 | 0.48913 |
6154cb16ddeecd732ff2e04ec94d76de6721e3d5 | 691 | #
# Cookbook Name:: nova
# Recipe:: xen
#
# Copyright 2010, Opscode, Inc.
# Copyright 2011, Dell, 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/L... | 31.409091 | 74 | 0.738061 |
081bbc011a5094958d1cda2ce3b7ae83b0bef03c | 704 | # typed: false
require "spec_helper"
describe ParamsCleaner do
describe "#cleaned" do
it "makes an array of a array-like hash" do
params = { "foo" => { "0" => "bar", "1" => "baz" } }
cleaned = ParamsCleaner.new(params).cleaned
expect(cleaned).to eql("foo" => %w(bar baz))
end
it "leav... | 22.709677 | 62 | 0.588068 |
33dc907c4229057c6a9513c5e3c75e034ae959da | 7,880 | require 'open3'
require 'puppet/version'
require 'spec_helper'
require 'tempfile'
RSpec.describe 'exercising a device provider' do
let(:common_args) { '--verbose --trace --strict=error --modulepath spec/fixtures' }
let(:default_type_values) do
'string="meep" boolean=true integer=15 float=1.23 ensure=present va... | 46.904762 | 194 | 0.668909 |
e2b2084924ec14246056ae4000dfa323065db167 | 1,466 | require 'travis/build/git/clone'
require 'travis/build/git/ssh_key'
require 'travis/build/git/submodules'
require 'travis/build/git/tarball'
module Travis
module Build
class Git
DEFAULTS = {
git: { depth: 50, submodules: true, strategy: 'clone' }
}
attr_reader :sh, :data
def ini... | 18.794872 | 63 | 0.545703 |
ffe6fcdc53c89c1ebd2bc3352ee3a6b00262ff12 | 2,567 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Redis::Mgmt::V2018_03_01
module Models
#
# The resource model definition for a ARM tracked top level resource
#
class TrackedResource < Resour... | 27.902174 | 72 | 0.439813 |
91f6bad4d1a9a2a345d90d4c21baf89c04aa8a09 | 750 | module Spree
class SolidusVariantOptionsSettings < Spree::Preferences::Configuration
preference :allow_select_outofstock, :boolean, :default => false
preference :default_instock, :boolean, :default => false
preference :main_option_type_id, :integer, :default => 1
preference :main_option_type_label, :s... | 62.5 | 110 | 0.733333 |
91714aa54904f58ed6012aec7bc9dacd5259eef3 | 236 | class AddNameToUser < ActiveRecord::Migration[5.2]
def change
add_column :users, :first_name, :string
add_column :users, :last_name, :string
add_column :users, :class, :integer
add_column :users, :bio, :text
end
end
| 26.222222 | 50 | 0.70339 |
f70d6dc5dd2ca5c906ab30d79ff30dd1f68445fe | 1,150 | require "stub_constant/version"
class StubConstant
def self.module(full_name)
new(full_name).stub_with { Module.new }
end
def self.klass(full_name)
new(full_name).stub_with { Class.new }
end
def self.value(full_name, value)
new(full_name).stub_with { value }
end
def initialize(full_name)
... | 23.469388 | 72 | 0.622609 |
f753d76bd2283f768fd5d5e9a8af95abae8fae1a | 834 | asterisk_user = node['asterisk']['user']
asterisk_group = node['asterisk']['group']
user asterisk_user do
system true
end
group asterisk_group do
system true
end
include_recipe "asterisk::#{node['asterisk']['install_method']}"
service "asterisk" do
supports :restart => true, :reload => true, :status => :true,... | 23.828571 | 80 | 0.690647 |
1d28b846618c0ae349b3df872ca5c21602aeca86 | 1,984 | #!/usr/bin/env ruby
require 'rubygems'
require 'activesupport'
require 'actionmailer'
RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + '/..')
class Commit
def self.parse(full_log)
full_log.split(/^commit /).map do |log|
log.blank? ? nil : new("commit #{log}")
end.compact
end
att... | 21.106383 | 117 | 0.565524 |
d565ab1a0a02cfe54750bcb2a6fdfa9d7cc4cb77 | 77 | json.partial! 'users/user', user: @user
# Example:
# { "username": "mike" } | 19.25 | 39 | 0.61039 |
e9b7633bc6e70d7f25816f394af4422ee0cfa1ba | 425 | class AddReleaseInfosToMedium < ActiveRecord::Migration[6.0]
def up
add_column :media, :released_at, :datetime
add_column :media, :release_date, :datetime
Medium.where(released: ['all', 'users', 'subscribers']).each do |m|
m.update_columns(released_at: m.created_at)
end
end
def down
re... | 26.5625 | 71 | 0.708235 |
5dc89717f36fb07bb983bd3b9a6bc21410474934 | 411 | module Ebanx
module Command
class Direct < Command
def initialize(params)
@params = params
@request_method = :post
@request_action = 'direct'
@response_type = :json
@request_body = true
end
def validate
validate_presence :operation
... | 20.55 | 36 | 0.586375 |
33ef2c93b656a2680838d7468e2f306ba6811f11 | 8,292 | module MoSQL
class Streamer
include MoSQL::Logging
BATCH = 1000
attr_reader :options, :tailer
NEW_KEYS = [:options, :tailer, :mongo, :sql, :schema]
def initialize(opts)
NEW_KEYS.each do |parm|
unless opts.key?(parm)
raise ArgumentError.new("Required argument `#{parm}' n... | 28.494845 | 114 | 0.561867 |
6a4674ad150c1fac7dd27e1561858a5d5af68346 | 483 | # frozen_string_literal: true
module AwsSdkCodeGenerator
module Views
module Features
class StepDefinitions < View
# @param [Hash] options
# @option options [required, Service] :service
def initialize(options)
service = options.fetch(:service)
@var_name = servic... | 21 | 54 | 0.63354 |
5d18aabffb35f0a300cb82515162023dc58f7223 | 1,195 | module Spree
module ProductsHelper
def product_bullet_point(product)
#product.bullet_point.to_s.tr("\n","|").split('|').map{|x| tag_li(x) }.join
content_tag :ul, class: '' do
result = product.bullet_point.to_s.tr("\n","|").split('|').map do |point|
css_class = ""
... | 25.425532 | 85 | 0.478661 |
6a1c5b2169abb21991c63247fcbfa233e060a1bf | 3,199 | require File.join(File.dirname(__FILE__), '../test_helper')
class SessionsControllerTest < ActionController::TestCase
def setup
login_as(:nari)
SessionsController.class_eval do
def authenticate(identity_url = "")
after_autenticate(true, params[:openid_url], "OK", "nickname" => "hoge")
end... | 30.179245 | 99 | 0.667396 |
1c6fb011012bb422b476599039db9078a035afa5 | 854 | # frozen_string_literal: true
module Gitlab
module Graphql
class Variables
Invalid = Class.new(Gitlab::Graphql::StandardGraphqlError)
def initialize(param)
@param = param
end
def to_h
ensure_hash(@param)
end
private
# Handle form data, JSON body, or a... | 21.35 | 67 | 0.58548 |
d5f3d02911415c20da6694c778ac44f0c057e379 | 3,207 | require 'spec_helper'
require 'scrape_driver'
require 'reading_scraper'
describe ReadingScraper do
before do
skip "unused"
end
let(:twine) { create(:twine) }
describe "#get_reading" do
let(:scraper) { double('scraper') }
let(:twine_login_url) { "https://twine.cc/login?next=%2F" }
let(:tempera... | 36.443182 | 98 | 0.611475 |
4a7f73b65151f2dd3cb45ad7c94553520daf9beb | 11,582 | #see the URL below for information on how to write OpenStudio measures
# http://nrel.github.io/OpenStudio-user-documentation/measures/measure_writing_guide/
#see the URL below for information on using life cycle cost objects in OpenStudio
# http://nrel.github.io/OpenStudio-user-documentation/next_steps/life_cycle_cost... | 43.70566 | 203 | 0.756346 |
39fa6f65b5cea1980052c22ffde70d725534550d | 40 | class WatchList < ApplicationRecord
end
| 13.333333 | 35 | 0.85 |
382141b89f91aaf510839e750d62492178bea8bb | 811 | require "websocket/driver"
module ActionCable
module Connection
# Wrap the real socket to minimize the externally-presented API
class WebSocket
def initialize(env, event_target, event_loop, protocols: ActionCable::INTERNAL[:protocols])
@websocket = ::WebSocket::Driver.websocket?(env) ? ClientSo... | 20.275 | 123 | 0.638718 |
f89719587141a5625e2a4d4e4dd12163b08eecf8 | 2,719 | # frozen_string_literal: true
class AssignmentRepo < ApplicationRecord
update_index("assignment_repo#assignment_repo") { self }
# TODO: remove this enum (dead code)
enum configuration_state: %i[not_configured configuring configured]
belongs_to :assignment
belongs_to :repo_access, optional: true
belongs_t... | 29.879121 | 110 | 0.755057 |
bbbaf09caaa9e1c66b265e9ba853c4c6cdeed438 | 395 | class FixStudentExerciseAssignmentExerciseIndexUniqueness < ActiveRecord::Migration
def up
add_index :student_exercises, [:assignment_exercise_id, :student_assignment_id], :unique => true, :name => "index_student_exercises_on_assignment_exercise_scoped"
end
def down
remove_index :student_exercises, ... | 39.5 | 170 | 0.810127 |
62de4d832d2f3508481682b74a28c9a07d075a04 | 267 | module Ruy
module Conditions
# Expects that at least one of the sub-conditions is be satisfied.
class Any < CompoundCondition
def call(ctx)
conditions.any? do |condition|
condition.call(ctx)
end
end
end
end
end
| 17.8 | 70 | 0.625468 |
181edeefd65622195022a6d01c329c868572e853 | 192 | class CreateTableReport < ActiveRecord::Migration[5.1]
def change
create_table :reports do |t|
t.string :date
t.integer :no_of_profiles
t.timestamps
end
end
end
| 17.454545 | 54 | 0.671875 |
e9e3486c543df1979ad1f4b5c0270b6789e6a68e | 122 | require 'spree_core'
require 'spree_experience_marketplace/engine'
require 'stripe'
require 'spree_experience_drop_ship'
| 20.333333 | 45 | 0.852459 |
1d51fcb71cc2b40d1f08c76f8a4c1253980da413 | 9,306 | # frozen_string_literal: true
require 'spec_helper'
require 'et_azure_insights/adapters/rack'
require 'et_azure_insights'
require 'rack/mock'
RSpec.describe EtAzureInsights::Adapters::Rack do
include_context 'fake client'
let(:fake_app_response) { [200, {}, 'app-body'] }
let(:fake_app) { spy('Rack app', call: fa... | 43.083333 | 164 | 0.702557 |
7984c6b377869594f5993266e503b3bf46728ce2 | 1,129 | cask "microsoft-teams" do
version "1.4.00.29477"
sha256 "eef61e062ffcd9f843cffd41064ef0e73fa4e9da35245ec23c49452aead55075"
url "https://statics.teams.cdn.office.net/production-osx/#{version}/Teams_osx.pkg",
verified: "statics.teams.cdn.office.net"
name "Microsoft Teams"
desc "Meet, chat, call, and coll... | 32.257143 | 85 | 0.723649 |
1a9fe69ec58c031bab114898678bd82406ac7232 | 1,241 | # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = 'c21e'
s.version = '2.0.0'
s.authors = ["Aslak Hellesøy"]
s.description = 'Run cross-platform executables'
s.summary = "#{s.name}-#{s.version}"
s.email = 'cukes@googlegroups.com'
s.homepage = "https://github.com/c... | 36.5 | 104 | 0.560032 |
1ceefbf470accc2beb263125b654d614dd93e0cb | 628 | # frozen_string_literal: true
require 'geocoder/lookups/baidu'
require 'geocoder/results/baidu_ip'
module Geocoder
module Lookup
class BaiduIp < Baidu
def name
'Baidu IP'
end
private # ---------------------------------------------------------------
def base_query_url(_query)
... | 19.030303 | 79 | 0.525478 |
2192b0529d678dc62b69352a28e9ac1da253b7c4 | 3,746 | require 'spec_helper'
describe Spree::Price, type: :model do
describe 'searchable columns' do
subject { described_class.whitelisted_ransackable_attributes }
it 'allows searching by variant_id' do
expect(subject).to include("variant_id")
end
end
describe 'validations' do
let(:variant) { stu... | 28.378788 | 124 | 0.627336 |
281c54a0d0dd153d7bc3a05bb79d8ec540a9e511 | 1,400 | module OpenActive
module Models
module Schema
class MusicGroup < ::OpenActive::Models::Schema::PerformingGroup
# @!attribute type
# @return [String]
def type
"schema:MusicGroup"
end
# @return [OpenActive::Models::Schema::MusicAlbum]
define_property ... | 30.434783 | 99 | 0.583571 |
287952fa3f83856a6824e7277798a6b0492f7994 | 1,362 | require 'rails_helper'
describe TimeMachine do
let!(:commodity1) { create :commodity, validity_start_date: Time.now.ago(1.day),
validity_end_date: Time.now.in(1.day) }
let!(:commodity2) { create :commodity, validity_start_date: Time.now.ago(20.days),
... | 33.219512 | 84 | 0.632159 |
083dd7ef85ef7d2df75b4778428de7626ade416b | 135 | module Gowk
module VERSION #:nodoc:
MAJOR = 0
MINOR = 0
TINY = 1
STRING = [MAJOR, MINOR, TINY].join('.')
end
end
| 13.5 | 43 | 0.555556 |
79a234b276339942875b0cf97eb285fa978894f1 | 1,670 | class Lighthouse < Formula
desc "Rust Ethereum 2.0 Client"
homepage "https://github.com/sigp/lighthouse"
url "https://github.com/sigp/lighthouse/archive/refs/tags/v2.1.2.tar.gz"
sha256 "53db198ceba81229ec2a7b44e48e20cb211c178d5026c4856636ef97ce5b5834"
license "Apache-2.0"
bottle do
sha256 cellar: :any_... | 38.837209 | 123 | 0.758683 |
abf6bf01f7dc00532b9c7de0d020a2a444ab6981 | 1,623 | # encoding: utf-8
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# /spec/fixtures/responses/whois.cmc.iq/status_available.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#
require 'spec_helper'
require 'whois... | 21.355263 | 74 | 0.663586 |
e9de2ca50dba9739c71fba2d27cbced09b739b10 | 1,311 | # Copyright 2015-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not
# use this file except in compliance with the License. A copy of the License is
# located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 33.615385 | 81 | 0.754386 |
bf256b1eb9684cb5563842e0720f0170bb554e2d | 813 | require_relative '../core'
require_relative '../errors'
module Erlen; module Schema
# This class represents a derived attribute defined in a Schema class. An
# attribute keeps track of its name, type, and a attribute specific block to
# derive the value.
class DerivedAttribute
# The name of the attribute
... | 25.40625 | 78 | 0.698647 |
bbafda7fb3a3cca1ddf6af26e2119073b70fc8a5 | 175 | # frozen_string_literal: true
FactoryBot.define do
factory :drink do
sequence(:name) { |n| "drink_#{n}" }
quantity_stock { 3 }
maker
organization
end
end
| 15.909091 | 40 | 0.657143 |
e8796f3319cc6322ed5b61f35e61922d6233f7ee | 848 | # frozen_string_literal: ture
require "test_helper"
module Graphql
module Voyager
module Rails
class ConfigTest < ActiveSupport::TestCase
class MockViewContext
def form_authenticity_token
"abc-123"
end
end
setup do
@config = Graphql::Voyag... | 25.69697 | 97 | 0.625 |
21800cbbc14d97f438e91fd9baebe42f14455c38 | 3,564 | require 'chef'
#require 'pp'
class Rack_awareness
class By_switch
def initialize(node)
@node=node
@rr_counter=0
@switch_list = self.get_switch_list()
@switch_list = self.switch_to_zone() if @switch_list.size != 0
end
def get_switch_list()
switch_list=Hash.new()
#... | 32.697248 | 101 | 0.547419 |
1d5b91bd08e707412d0489429dd520ff1b73550e | 102 | module RCRM
class Sources < Collection
def default_fields
[Source.new]
end
end
end
| 11.333333 | 28 | 0.656863 |
03b4ebf83e4dada89ff97beb4c68034043b615cb | 2,764 | module Departure
# Executes the given command returning it's status and errors
class Command
COMMAND_NOT_FOUND = 127
# Constructor
#
# @param command_line [String]
# @param error_log_path [String]
# @param logger [#write_no_newline]
def initialize(command_line, error_log_path, logger)
... | 28.494845 | 89 | 0.667873 |
7aa31780b53c99c7ac7ec54d8c1c94f070910fb1 | 264 | Refinery::Core.configure do |config|
# Register extra javascript for backend
config.register_javascript "refinery/news/news.js"
config.register_javascript "refinery/page-image-picker.js"
config.register_stylesheet "refinery/page-image-picker.css"
end
| 33 | 62 | 0.791667 |
39fce255992c9971e1ccb1153abb7edf249fc29e | 2,098 | license = <<-EOF
Copyright (c) 2011, Tony Million.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and t... | 61.705882 | 755 | 0.749762 |
280255f875388cd9356a48807393cf1b56260e75 | 1,060 | module WinFFI
module Comctl32
buffer = [
:LISTVIEW_CLASSES, 0x00000001, # listview, header
:TREEVIEW_CLASSES, 0x00000002, # treeview, tooltips
:BAR_CLASSES, 0x00000004, # toolbar, statusbar, track
:TAB_CLASSES, 0x00000008, # tab, tooltips
:UPDOWN_CLASS, ... | 44.166667 | 96 | 0.641509 |
33e2baf9e72c346b705f2cc8933a626cecf5eab1 | 417 | cask "font-commissioner" do
version :latest
sha256 :no_check
url "https://github.com/google/fonts/raw/master/ofl/commissioner/Commissioner%5Bslnt%2Cwght%5D.ttf",
verified: "github.com/google/fonts/"
name "Commissioner"
desc "Low-contrast humanist sans-serif font with almost classical proportions"
hom... | 32.076923 | 102 | 0.760192 |
f74b26d7185b84630424ff01f3ac0412a4f7674a | 39 | module Version
VERSION = '0.2.0'
end
| 9.75 | 19 | 0.666667 |
91042a62a139d8b69e1f0f0eee12777f60009a87 | 1,544 | # Copyright (C) 2018 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
#
# Unless required by applicable law or agreed to in writi... | 28.072727 | 91 | 0.639896 |
0804865aa6681d0402d79cbb2aade5eaa8e7a466 | 221 | class Apikitchen < Cask
url 'https://s3.amazonaws.com/envolto-static/ApiKitchen_0.1.dmg'
homepage 'http://apikitchen.com/'
version '0.1'
sha1 '682a2a6d670af612bac57e641f282f76ad65a325'
link 'ApiKitchen.app'
end
| 27.625 | 66 | 0.760181 |
3997777eaab6989224c7f50d18cc3edcd139f54d | 1,368 | module Fog
module Compute
class Ecloud
class Real
basic_request :get_catalog
end
class Mock
def get_catalog(catalog_uri)
catalog_uri = ensure_unparsed(catalog_uri)
xml = nil
if catalog = mock_data.catalog_from_href(catalog_uri)
builder... | 30.4 | 99 | 0.434942 |
91ce6b8198c7b2d3a5b59830e6b2118f1a39ceaf | 6,388 |
# generated from template-files/ios/ExpoKit.podspec
folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'
folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
folly_version = '2020.01.13.00'
boost_compiler_flags = '-Wno-documentation'
Pod::Spec.new do |s|
s.name = "ABI40... | 44.361111 | 238 | 0.650595 |
33c9cb90f9824b32db8b183f23fdc1013dc8a0ed | 40,770 | # encoding: UTF-8
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
module ICU
class Tournament
describe Krause do
def check_player(num, first, last, other={})
p = @t.player(num)
expect(p.first_name).to eq(first)
expect(p.last_name).to eq(last)
[:gender, :ti... | 49.478155 | 179 | 0.495193 |
0163f56c42e946df1adf6e8394b2a5f06365b1dd | 98 | FactoryGirl.define do
factory :requests_refund, :class => 'Requests::Refund' do
end
end
| 14 | 59 | 0.693878 |
21d88a1d99aa9b9dea14a50dd5dee955b1774fa9 | 38,093 | #
# Rest API Request Tests - Services specs
#
# - Create service /api/services/ action "create"
#
# - Edit service /api/services/:id action "edit"
# - Edit service via PUT /api/services/:id PUT
# - Edit service via PATCH /api/services/:id PATCH
# - Edit multipl... | 37.790675 | 132 | 0.621532 |
084dcb6895222ed7bb71a97e5d1d520bb0ec52f7 | 1,128 | cask "netnewswire-beta" do
version "6.1b3"
sha256 "dfd6bcad17e7f379b8efc1a73de5c3b3890d6f52784cf95f2f0d0b8411fe26cd"
url "https://github.com/brentsimmons/NetNewsWire/releases/download/mac-#{version}/NetNewsWire#{version}.zip",
verified: "github.com/brentsimmons/NetNewsWire/"
name "NetNewsWire"
desc "Fr... | 34.181818 | 111 | 0.735816 |
03a5d50befdac1cea51ef4eb0c555aa485d3880a | 2,149 | module Recurly
class BillingInfo < Resource
BANK_ACCOUNT_ATTRIBUTES = %w(name_on_account account_type last_four routing_number).freeze
CREDIT_CARD_ATTRIBUTES = %w(number verification_value card_type year month first_six last_four).freeze
AMAZON_ATTRIBUTES = %w(amazon_billing_agreement_id).freeze
PAYPA... | 31.144928 | 106 | 0.683108 |
bf9bd862e2f5c2645b0947aa0cf5b884b9e2e75c | 2,246 | # 28a8cfadda13f496447dae5b5a346be1
# Generated: 2008-09-22 16:25:10
################################################################################
# require File.dirname(__FILE__) + '/../../spec_helper'
# require File.dirname(__FILE__) + '/fixtures/classes'
#
# describe "Array#shift" do
# it "removes and returns t... | 26.738095 | 80 | 0.58504 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.