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 |
|---|---|---|---|---|---|
4a20b017e64545ae18b6ca68eadd0421b81398d3 | 78 | # frozen_string_literal: true
class SubItem < Item
embedded_in :parent
end
| 13 | 29 | 0.782051 |
9139f2d6500c06312d631bffa2fcf53203d456cb | 98,226 | # 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::Cosmosdb::Mgmt::V2020_06_01_preview
#
# MongoDBResources
#
class MongoDBResources
include MsRestAzure
#
# Creates and ini... | 57.543058 | 239 | 0.724452 |
ff00db3e35a01164d3621ff2961d289bf2480e8a | 590 | # encoding: UTF-8
Gem::Specification.new do |s|
s.name = 'openproject-openid_connect'
s.version = '1.0.0'
s.authors = 'OpenProject GmbH'
s.email = 'info@openproject.com'
s.summary = 'OpenProject OpenID Connect'
s.description = 'Adds OmniAuth OpenID Connect strategy providers to Ope... | 32.777778 | 83 | 0.666102 |
62d173014e566634789d48834ef270319bee256f | 491 | # frozen_string_literal: true
module MasterfilesApp
CommoditySchema = Dry::Schema.Params do
optional(:id).filled(:integer)
required(:commodity_group_id).filled(:integer)
required(:code).filled(Types::StrippedString)
required(:description).filled(Types::StrippedString)
required(:hs_code).filled(Ty... | 32.733333 | 56 | 0.749491 |
917d3e6e9a9e3c3de7b682ac9b0fc38a91e98227 | 1,132 | Pod::Spec.new do |s|
s.name = 'Rex'
s.module_name = 'Rex'
s.version = '0.10.0'
s.summary = 'ReactiveCocoa Extensions'
s.description = <<-DESC
Extensions for ReactiveCocoa that may not fit in the core framework.
DESC
s.homepage = 'https://github... | 33.294118 | 149 | 0.621025 |
7ac71dd97e98800592c90c7c26c9c66fa1d9c3a5 | 2,014 | #
# Be sure to run `pod lib lint JJGuisoWebP.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'JJGuiso... | 35.333333 | 108 | 0.642006 |
873ef3117381a0ae86d484d1324f670434d0de8c | 19,826 | # frozen_string_literal: true
# Copyright 2020 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... | 48.004843 | 162 | 0.598255 |
1107a8c9a5b8283dd0e592d4c38a59f7a85bb7dc | 939 | # Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.37931 | 74 | 0.731629 |
912120a3ae9a38fee13c2b4b63f253d7fc1f9164 | 4,125 | module Backburner
module Queue
def self.included(base)
base.instance_variable_set(:@queue_name, nil)
base.instance_variable_set(:@queue_priority, nil)
base.instance_variable_set(:@queue_respond_timeout, nil)
base.instance_variable_set(:@queue_max_job_retries, nil)
base.instance_varia... | 28.253425 | 123 | 0.606303 |
5d848fd0107f26872c734f69d93f54742e7e7912 | 406 | # frozen_string_literal: true
require "factory_bot"
FactoryBot.define do
factory :alchemy_site, class: "Alchemy::Site" do
name { "A Site" }
host { "domain.com" }
trait :default do
public { true }
name { Alchemy::Config.get(:default_site)["name"] }
host { Alchemy::Config.get(:default_... | 18.454545 | 57 | 0.618227 |
ff0fdfc6fdc22ddb4cd9d4cef82f7bf14adbd259 | 102 | class TrainsController < ApplicationController
def show
render template: "trains/index"
end
end
| 12.75 | 46 | 0.784314 |
08abf5d31ec7a6f3722c4566e50be1c220225b49 | 188 | require 'spec_helper_acceptance'
describe 'cis_hardening_network class' do
context 'default parameters' do
it 'behaves idempotently' do
idempotent_apply(pp)
end
end
end
| 18.8 | 41 | 0.75 |
28114ebed4e62f3f81995f04a3b5822d65a1540e | 251 | class CreateTrades < ActiveRecord::Migration[6.0]
def change
create_table :trades do |t|
t.text :coin_name
t.decimal :current_price
t.integer :quantity
t.integer :user_id
t.timestamps null: false
end
end
end
| 19.307692 | 49 | 0.657371 |
edcf9b00d1f3aced60264a3ac9e28451341e7bba | 949 | #
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint device_kit.podspec' to validate before publishing.
#
Pod::Spec.new do |s|
s.name = 'device_kit'
s.version = '0.1.1'
s.summary = 'Flutter plugin for Device.'
s.description ... | 33.892857 | 105 | 0.591149 |
874cbc02a45ae0d950f1b5fb1894fbc24961de89 | 23,034 | require 'net/ssh/loggable'
require 'net/ssh/ruby_compat'
require 'net/ssh/connection/channel'
require 'net/ssh/connection/constants'
require 'net/ssh/service/forward'
module Net; module SSH; module Connection
# A session class representing the connection service running on top of
# the SSH transport layer. It man... | 38.262458 | 198 | 0.654815 |
ac64d70c7d82998044b6eaabeb097e82567f42d0 | 1,560 | cask "miniconda" do
arch = Hardware::CPU.intel? ? "x86_64" : "arm64"
version "py39_4.12.0"
if Hardware::CPU.intel?
sha256 "007bae6f18dc7b6f2ca6209b5a0c9bd2f283154152f82becf787aac709a51633"
else
sha256 "4bd112168cc33f8a4a60d3ef7e72b52a85972d588cd065be803eb21d73b625ef"
end
url "https://repo.anaconda... | 30 | 84 | 0.669872 |
d5207420c93593205ddf5c44143d505d13834635 | 4,339 | require "spec_helper"
describe "bundle install across platforms" do
it "maintains the same lockfile if all gems are compatible across platforms" do
lockfile <<-G
GEM
remote: file:#{gem_repo1}/
specs:
rack (0.9.1)
PLATFORMS
#{not_local}
DEPENDENCIES
ra... | 22.481865 | 95 | 0.628255 |
ab8f0fd210665ecc6bd3921d66218b927b470975 | 1,594 | Pod::Spec.new do |s|
s.name = "RxSwift"
s.version = "5.0.2"
s.summary = "RxSwift is a Swift implementation of Reactive Extensions"
s.description = <<-DESC
This is a Swift port of [ReactiveX.io](https://github.com/ReactiveX)
Like the original [Rx](https://github.com/Reactive-e... | 39.85 | 177 | 0.644918 |
33a85f5abde99d316e4cd5a0b165988f34c3f752 | 371 | # frozen_string_literal: true
module Nonnative
class Service
def initialize(service)
@service = service
@timeout = Nonnative::Timeout.new(service.timeout)
end
def name
service.name
end
protected
attr_reader :service, :timeout
def wait_start
sleep 0.1
end
... | 13.740741 | 56 | 0.633423 |
181beec32aeecaae9c2cae1cf219f1a4bd684550 | 1,250 | # frozen_string_literal: true
ActiveAdmin.register Author do
permit_params :name,
:email,
:age,
:avatar,
profile_attributes: %i[id description _destroy],
posts_attributes: %i[id title description]
index do
selectable_column
id... | 21.551724 | 110 | 0.5896 |
1d0921a66a59733a03260ddea844ecbe1ce25b7f | 1,463 | control 'VCSA-70-000070' do
title 'The vCenter Server must prohibit password reuse for a minimum of five generations.'
desc "
Password complexity, or strength, is a measure of the effectiveness of a password in resisting attempts at guessing and brute-force attacks.
To meet password policy requirements, p... | 40.638889 | 229 | 0.710868 |
085779603658f44f0ba8942c7710664c22582334 | 53,172 | require 'abstract_unit'
require 'active_support/core_ext/hash'
require 'bigdecimal'
require 'active_support/core_ext/string/access'
require 'active_support/ordered_hash'
require 'active_support/core_ext/object/conversions'
require 'active_support/core_ext/object/deep_dup'
require 'active_support/inflections'
class Has... | 35.542781 | 173 | 0.675807 |
bf614653ed72fb883639a555146f33f59bd86830 | 177 | module Waistband
module Errors
class IndexExists < StandardError; end
class IndexNotFound < StandardError; end
class NoSearchHits < StandardError; end
end
end
| 17.7 | 44 | 0.745763 |
18d8192a3b0371c8250a554cdfb81acc63ab5775 | 7,851 | module Assertions
def assert_customer_response(customer)
assert customer.id
assert_equal customer.name, 'Jose da Silva'
assert_equal customer.document_number, '84931126235'
assert_equal customer.email, 'pagarmetestruby@mailinator.com'
assert_equal customer.ge... | 39.255 | 90 | 0.745383 |
f81e79eaa2e423fcd835dfa79ab43ee36b924e8f | 1,665 | # encoding: utf-8
require 'spec_helper_min'
module Carto
describe 'Default cartography' do
let(:production_default_cartography) do
{
"simple" => {
"point" => {
"fill" => {
"size" => {
"fixed" => 7
},
"color" => {
... | 22.808219 | 84 | 0.325526 |
794fd6805ff0a24dd29f68d98090346bea1efd9e | 3,994 | class Redis
# simple enhancement of Redis::Store
class Store < self
# Implements Compare-And-Swap (or as Redis says Compare-And-Save)
# on top of Redis::Store using Redis::Store::watch. It is designated for simple values, not redis-lists/hashes etc
module Cas
# Single CAS
#
# Trys t... | 36.981481 | 151 | 0.599399 |
62a2d13a040cb166f9282bf8a976a11dd2c0dfdd | 2,732 | # 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.
#
# This file is the source Rails uses to define your schema when running `bin/rai... | 44.064516 | 126 | 0.735359 |
3818fae2f5a44f06c82b5d33d341a56998460dc9 | 310 | module Admin::SellerVersion::Contract
class Assign < Reform::Form
include Forms::ValidationHelper
model :seller_application
property :assigned_to_id
validation :default, inherit: true do
required(:assigned_to_id).filled(:int?, in_list?: ->{ User.admin.map(&:id) })
end
end
end
| 22.142857 | 83 | 0.7 |
f80e45e218cac7593bc03ee91eb0d54fe3809b32 | 9,161 | module FortuneTeller
class Benchmark
def self.run(context = {})
create_sim.simulate(**default_context.merge(context))
end
def self.default_context
{
growth_rates: {
# these should match the holdings your retirement accounts have:
stocks: [1.06],
bon... | 24.107895 | 194 | 0.534112 |
1dc6af82a8d47cef51844ed7dc6b91531b9a5fe3 | 1,646 | require 'test_helper'
class UsersControllerTest < ActionDispatch::IntegrationTest
def setup
@user = users(:michael)
@other_user = users(:archer)
end
test "should redirect index when not logged in" do
get users_path
assert_redirected_to login_url
end
test "should get new" do
get si... | 26.548387 | 95 | 0.641555 |
d5d6ddea4bd03d3bc11b8c3c9078b83640b4c151 | 7,438 | #
# Cookbook Name:: yum
# Resource:: repository
#
# Author:: Sean OMeara <someara@getchef.com>
# Copyright 2013, Chef
#
# 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... | 70.169811 | 129 | 0.683383 |
ac6910fed8a5c271c846694c0a18747bf411bca3 | 16,438 | require 'spec_helper'
require 'json'
describe Hyperkit::Client do
describe "module configuration" do
before do
Hyperkit.configure do |config|
Hyperkit::Configurable.keys.each do |key|
config.send("#{key}=", "Some #{key}")
end
end
end
it "inherits the module config... | 31.132576 | 104 | 0.592895 |
abf23650068de43d093b5c4fabab1982e19d3fac | 97 | require 'mina/appsignal/support'
require 'mina/appsignal/tasks'
require 'mina/appsignal/version'
| 24.25 | 32 | 0.814433 |
18557afcb991a991be226e278361ef0ff29f4518 | 1,921 | # frozen_string_literal: true
module Ci
module PipelineEditorHelper
include ChecksCollaboration
def can_view_pipeline_editor?(project)
can_collaborate_with_project?(project)
end
def js_pipeline_editor_data(project)
initial_branch = params[:branch_name]
latest_commit = project.repo... | 45.738095 | 156 | 0.698594 |
4a133a3ca145679200304792ac5961a699d42093 | 1,269 | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 35.25 | 84 | 0.747833 |
9129f545078948d74036da159580d8ddd4a163d5 | 378 | require 'rails_helper'
feature 'Update tax status' do
background do
create(:organization)
login_super_admin
visit '/admin/organizations/parent-agency'
end
scenario 'with tax status' do
fill_in 'organization_tax_status', with: '501(c)(3)'
click_button 'Save changes'
expect(find_field('org... | 23.625 | 73 | 0.719577 |
873e3f73bb7af87f1e3e99892b336cea49ace7d9 | 607 | module LanguageServer
module Protocol
module Interface
class LinkedEditingRangeOptions
def initialize(work_done_progress: nil)
@attributes = {}
@attributes[:workDoneProgress] = work_done_progress if work_done_progress
@attributes.freeze
end
# @return ... | 19.580645 | 83 | 0.601318 |
ac6e84363ad04c34599a85ce6f6fa04ec305cb25 | 245 | require 'test_helper'
class ActivitiesControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
end
test "should get show" do
get :show
assert_response :success
end
end
| 16.333333 | 59 | 0.726531 |
e259207c8251cf468c6a743c284a962d114ae9a8 | 1,084 | require_relative 'boot'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "action_cable/eng... | 31.882353 | 82 | 0.77952 |
d51376098458d13bc9ef73e47e0b3f8343b954dc | 834 | cask "wondershare-uniconverter" do
version "12.5.2.6"
sha256 :no_check
url "https://download.wondershare.com/cbs_down/video-converter-ultimate-mac_full735.dmg"
name "UniConverter"
desc "Video editing software"
homepage "https://videoconverter.wondershare.com/"
app "Wondershare UniConverter.app"
zap t... | 39.714286 | 161 | 0.772182 |
91bf2dce48ccab67641b2434147df91c79bf8844 | 2,301 | =begin
CHIEF transformer do not handle TAMT (measure type) and RVTT (measure type description)
record types, so we created these records manually.
2019-01-10_KBT009(19010).txt:2
"TAMT ","09/01/2019:10:37:00","I","487","EX","EXF",null,null,"09/01/2019:10:36:00",
2018-12-28_KBT009(18362).txt:4987
"RVTT ","2... | 37.721311 | 179 | 0.564537 |
08c5c7346ffa7fe2d4e69467e44036d4046575df | 6,271 | require 'date'
require_relative '../../lib/params_ready/value/validator.rb'
require_relative '../test_helper'
module ParamsReady
module Value
class ConstraintTest < MiniTest::Test
def test_range_constraint_works_with_numbers
c = Constraint.instance(1..3)
assert(c.valid?(1))
assert(c... | 29.861905 | 90 | 0.57742 |
11311815efa5331a69a14c7e7bfa0342883e8e79 | 3,512 | class Api::V1::AssetEventsController < Api::ApiController
before_action :set_asset_event, only: [:show, :update, :destroy]
before_action :set_asset, only: [:create]
before_action :set_event_type, only: [:create]
def show
if @typed_event
render status: 200, json: json_response(:success, data: @type... | 36.206186 | 137 | 0.70074 |
081f55e38471e878066660ee7efc603ece555c22 | 839 | ##
## stream_stage.rb
## Login : <lta@still>
## Started on Wed Sep 4 19:35:50 2013 Lta Akr
## $Id$
##
## Author(s):
## - Lta Akr <>
##
## Copyright (C) 2013 Lta Akr
module ActiveVlc::Stage
class Stream < Base
dump_childs { @chain }
def initialize
super :sout
@chain = []
end
def <<(st... | 19.068182 | 87 | 0.585221 |
03db15e10498386c066d153eb2b0d0bab8241560 | 860 | class Scamper < Formula
desc "Advanced traceroute and network measurement utility"
homepage "https://www.caida.org/tools/measurement/scamper/"
url "https://www.caida.org/tools/measurement/scamper/code/scamper-cvs-20161204a.tar.gz"
sha256 "78eeabed8a4161a2238d02dac4c4361c9fb78f53d52fd8dd4bdb27434b512038"
bott... | 37.391304 | 92 | 0.753488 |
039f2bdf137b15dea0bfcfd8b0da69c65e37851f | 2,138 | require 'spec_helper'
describe 'fake' do
let :title do
'foo'
end
it { should be_valid_type }
describe 'tests of the types' do
{
:parameters =>
{:baddies => ['one', 'two'], :goodies => ['three', 'four']},
:properties =>
{:baddies => ['five', 'fix'], :goodies => ['seven', ... | 23.755556 | 71 | 0.566885 |
e81475589a0aa4c378844677e650f9a4723ed74b | 2,284 | require File.dirname(__FILE__) + '/../spec/spec_helper'
require File.dirname(__FILE__) + '/log_watcher_advanced'
describe LogWatcherAdvanced do
it "should execute for the first time with no file scan" do
last_run, memory, options = Time.now-3*60, {}, {}
plugin = LogWatcherAdvanced.new(last_run, memory, op... | 36.83871 | 103 | 0.672067 |
bf08c15139356237d9b872ae87a9bb5a89f2c614 | 3,009 | # frozen_string_literal: true
# class that create school rooms
class SchoolRoomsController < ApplicationController
before_action :logged_in?
before_action :authenticate_coordinator?, except: [:index]
def new
@school_room = SchoolRoom.new
@all_courses = Course.all
end
def create
@school_room = S... | 26.628319 | 83 | 0.684945 |
1afbc542933870c388497cdb4ca1ba402c5ee828 | 1,791 | # -*- ruby -*-
# encoding: utf-8
require File.expand_path("lib/google/cloud/functions/v1/version", __dir__)
Gem::Specification.new do |gem|
gem.name = "google-cloud-functions-v1"
gem.version = Google::Cloud::Functions::V1::VERSION
gem.authors = ["Google LLC"]
gem.email = "googlea... | 45.923077 | 325 | 0.670017 |
ac7c9cdf88246696f98712c83658d0564d4b3139 | 157 | # frozen_string_literal: true
module SauceBindings
class SessionNotStartedError < RuntimeError; end
class InvalidPlatformError < RuntimeError; end
end
| 19.625 | 50 | 0.821656 |
87776d33e2d237319ea342fe4a795f227b4aaa08 | 704 | # frozen_string_literal: true
require 'uploadcare'
module Uploadcare
module Param
# This header is added to track libraries using Uploadcare API
class UserAgent
# Generate header from Gem's config
#
# @example Uploadcare::Param::UserAgent.call
# UploadcareRuby/3.0.0-dev/Pubkey_(Rub... | 32 | 100 | 0.698864 |
18ce6672d148038dc1e1aadbdabd66c0adec62da | 493 | # frozen_string_literal: true
module Types
module Notes
class DiffPositionInputType < DiffPositionBaseInputType
graphql_name 'DiffPositionInput'
argument :old_line, GraphQL::Types::Int, required: false,
description: copy_field_description(Types::Notes::DiffPositionType, :old_line)
... | 32.866667 | 93 | 0.726166 |
87558d3b2d5c4b5ee84ad3912c129b04c1256b56 | 599 | # frozen_string_literal: true
module LedgerSync
module Domains
class Operation
class Resource
include LedgerSync::Domains::Operation::Mixin
def resource_class
@resource_class ||= inferred_resource_class
end
private
def inferred_resource_class
n... | 23.038462 | 75 | 0.632721 |
f800911ccc97fb8d7c0d8bb3bc2982930c4eabb4 | 1,703 | require 'cucumber/formatter/pretty'
module Cucumber
module Cli
class LanguageHelpFormatter < Formatter::Pretty
INCOMPLETE = %{
The Cucumber grammar has evolved since this translation was written.
Please help us complete the translation by translating the missing words in
#{Cucumber::LANGUAGE_FILE}
Then c... | 28.864407 | 114 | 0.62478 |
6a797744b39b5ba420a04161cecbaa77df15a899 | 472 | class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :invitable,
:recoverable, :rememberable, :validatable
enum role: [
:admin,
:operator
]
has_many :f... | 26.222222 | 71 | 0.726695 |
ed4e641d91af3d93b682629b0642f3f1ea60e42a | 42 | class BatchEvent < ActiveRecord::Base
end
| 14 | 37 | 0.809524 |
4ab664bd13b4bc53499f1befcea8ccb544590f8e | 45 | module FrozenRecord
VERSION = '0.16.0'
end
| 11.25 | 20 | 0.711111 |
f8414252cecf77c22b6f22e24a04eed01d6a6ee7 | 2,522 | # -*- encoding: utf-8 -*-
# stub: logstash-input-http 3.0.5 ruby lib
Gem::Specification.new do |s|
s.name = "logstash-input-http"
s.version = "3.0.5"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.metadata = { "logstash_group" => "input", "logstash_pl... | 45.854545 | 201 | 0.626883 |
18c70de5bf6621e1768c3adbc1cd5f308f157163 | 317 | # frozen_string_literal: true
class RemoveDefaultsFromCardSetsColumns < ActiveRecord::Migration[5.2]
def change
change_column_default(:card_sets, :name, from: '', to: nil)
change_column_default(:card_sets, :slug, from: '', to: nil)
change_column_default(:card_sets, :code, from: '', to: nil)
end
end
| 31.7 | 70 | 0.725552 |
1c39c58dd978904541a5c8210db7ddac6f0c40ca | 295 | # frozen_string_literal: true
class SorceryCore < ActiveRecord::Migration[4.2]
def change
create_table :users do |t|
t.string :email, null: false
t.string :crypted_password
t.string :salt
t.timestamps
end
add_index :users, :email, unique: true
end
end
| 18.4375 | 48 | 0.667797 |
ab0e6db4c4656442131e96034a0e833b8a4ad796 | 2,415 | # frozen_string_literal: true
module HealthQuest
module Resource
##
# A service object for isolating dependencies from the resource controller.
#
# @!attribute session_service
# @return [HealthQuest::Lighthouse::Session]
# @!attribute user
# @return [User]
# @!attribute query
... | 28.081395 | 94 | 0.601656 |
014797b1a23c5ee601532f27adc1c1ca20aa15a8 | 127 | class RemoveUserIdFromRating < ActiveRecord::Migration
def change
remove_column :ratings, :user_id, :reference
end
end
| 21.166667 | 54 | 0.779528 |
91dbc33bb52051cc8792c06877116565590e7f88 | 1,168 | module Fog
module OpenStack
class Metric
class Real
def get_resource_metric_measures(resource_id, metric_name, options = {})
request(
:expects => 200,
:method => 'GET',
:path => "resource/generic/#{resource_id}/metric/#{metric_name}/measures",
... | 24.851064 | 91 | 0.385274 |
87708e8a11e0bed5b3a9487db41943bcfe89cf3f | 133 | class AddUserToRsvp < ActiveRecord::Migration
def change
add_reference :rsvps, :user, index: true, foreign_key: true
end
end
| 22.166667 | 63 | 0.75188 |
1df2e264d138160336a846397ef86e1ce5ced46c | 3,772 | # frozen_string_literal: true
require "set"
require "active_support/core_ext/module/attribute_accessors"
require "active_support/dependencies/interlock"
module ActiveSupport # :nodoc:
module Dependencies # :nodoc:
require_relative "dependencies/require_dependency"
extend self
UNBOUND_METHOD_MODULE_NAM... | 33.380531 | 86 | 0.711559 |
f7a706c8daa58c7f133f419bf2094b5b2b0d78f0 | 2,439 | class Service::FogBugz < Service::Base
title 'FogBugz'
string :project_url, :placeholder => "https://yourproject.fogbugz.com",
:label => 'URL to your FogBugz project:'
string :api_token, :placeholder => 'API Token',
:label => 'Your FogBugz API Token.'
page 'API Token', [:project_url, :api_to... | 27.404494 | 124 | 0.653137 |
1df1392d247d8ff1d7bc445e79cfc4963a6af3ae | 1,318 | #
#
# 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 n... | 32.146341 | 62 | 0.707891 |
ac44aff963c82c98fe4784102d9bc35399cd1c86 | 512 | require 'object_protocol/satisfiable_message_sequence_expectation_base'
class ObjectProtocol
class SatisfiableOrderedMessageSequenceExpectation < SatisfiableMessageSequenceExpectationBase
def attempt_to_apply_sent_message(sent_message)
return if satisfied?
next_unsatisfied_expectation = satisfiable_... | 25.6 | 96 | 0.810547 |
1c9095beca3eadf5b42170c4d6baafc89dd55435 | 5,477 | # module Importers::Mhc
# class ConversionEmployerUpdate < ConversionEmployer
#
# def initialize(opts = {})
# super(opts)
# end
#
# # covered scenarios
# # if broker is hired/terminated, then updated_at column in employer_profile model is changed.
# # if office locations is updated, then upd... | 38.300699 | 140 | 0.646157 |
e8c6ec4ceb58ca90f03f1a0211b205dfb2085941 | 1,670 | # frozen_string_literal: true
RSpec.describe GemComet::VersionHistory do
let(:instance) { described_class.new }
let(:git_tag_result) do
<<~RESULT
v0.1.0 2019-07-15
v0.1.1 2019-10-13
v0.2.0 2019-10-14
v0.3.0 2019-10-19
RESULT
end
before do
allow(instance).to receive(:git_ta... | 24.202899 | 95 | 0.635928 |
7a47dde5984ca5510e84f4f03513170bbdd2d607 | 1,514 | require 'test_helper'
class Pd::RegionalPartnerProgramManagerTest < ActiveSupport::TestCase
test 'pd_workshops association' do
partner_organizer = create :workshop_organizer
regional_partner_program_manager = create :regional_partner_program_manager, program_manager: partner_organizer
non_partner_organiz... | 40.918919 | 122 | 0.830911 |
1a2f44bad2caf6f21741f7c2e635c36d05dcee02 | 470 | require 'formula'
class Libechonest < Formula
homepage 'https://projects.kde.org/projects/playground/libs/libechonest'
url 'http://files.lfranchi.com/libechonest-2.2.0.tar.bz2'
sha1 'fec281d9288c2a4fabd2dd275f1a508dd6d1bc5c'
depends_on 'cmake' => :build
depends_on 'qt'
depends_on 'qjson'
conflicts_with... | 24.736842 | 74 | 0.729787 |
03f9f3fa56e8b83c77ec239a91ad97905ca65f76 | 15,008 | #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
#
# Copyright (c) 2016, Electric Power Research Institute (EPRI)
# All rights reserved.
#
# OpenADR ("this software") is licensed under BSD 3-Clause license.
#
# Redistribution and use in source and binary forms, with or without m... | 68.218182 | 206 | 0.634928 |
ed59dd63cbc4c6effe33d3b1b25aa357fc7bb591 | 1,654 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe GroupsController, type: :controller do
describe 'GET' do
it 'redirects if not authenticated' do
get :index
expect(response).to have_http_status(:redirect)
end
it 'gets to index of groups if authenticated' do
sign_in c... | 25.060606 | 62 | 0.655381 |
1da764f40bbde4d481c8aedc30d8cd5be11969eb | 313 | class Order < ApplicationRecord
has_many :order_items
before_save :set_subtotal
def subtotal
order_items.collect{|order_item| order_item.valid? ? order_item.unit_price*order_item.quantity : 0}.sum
end
private
def set_subtotal
self[:subtotal] = subtotal
end
end
| 15.65 | 111 | 0.690096 |
91dd6589dd87e4ee2df9a70ab5bde4aa451d1372 | 780 | module Barometer
module Query
module Service
class WeatherId
class Api < Utils::Api
def url
'http://wxdata.weather.com/wxdata/search/search'
end
def params
{ where: format_query }
end
def unwrap_nodes
['search']
... | 21.666667 | 70 | 0.502564 |
384ab902b786979d33d2d488099d22e1f9873e2e | 181 | FactoryGirl.define do
factory :ecm_cms_page_content_block, class: Ecm::Cms::Page::ContentBlock do
body 'Content block body'
ecm_cms_content_box
ecm_cms_page
end
end
| 22.625 | 77 | 0.762431 |
6a5e3f1d0298bfe45911f4adfea7ef7c880643c0 | 110 | class AddIndexOnOnestopIds < ActiveRecord::Migration
def change
add_index :stops, :onestop_id
end
end
| 18.333333 | 52 | 0.772727 |
f7dde5edf5668b7ccc3e4b90cd5521f3634cf614 | 782 | require 'test_helper'
module Moderator
module Post
class QueuesControllerTest < ActionController::TestCase
context "The moderator post queues controller" do
setup do
@admin = FactoryGirl.create(:admin_user)
CurrentUser.user = @admin
CurrentUser.ip_addr = "127.0.0.1"
... | 24.4375 | 64 | 0.560102 |
acc8e1dd854c79b8dcbf4f0b1a34cc2ac4804b4a | 1,253 | require_relative '../../../automated_init'
context "Output" do
context "Debug Level" do
context "Context" do
output = Output::Levels::Debug.new
output.writer.enable_styling!
control_fixture = Controls::Fixture.example(output)
control_fixture.instance_exec do
context "Outer Cont... | 22.375 | 80 | 0.551476 |
1a8fdc1d35f789bc91a0f9823de31faa9ca2eab5 | 590 | #!/usr/bin/env ruby
# frozen_string_literal: true
require 'thor'
require "#{ROOT_DIR}/lib/framework/logging/logger.rb"
Facter::Log.output(STDERR)
require "#{ROOT_DIR}/lib/facter"
require "#{ROOT_DIR}/lib/framework/cli/cli"
Facter::OptionsValidator.validate(ARGV)
ARGV.unshift(Facter::Cli.default_task) unless
Facter:... | 29.5 | 91 | 0.757627 |
9195ae87701031522a6d7bffd1792f85fbb2231e | 1,277 | require 'oregano'
class Benchmarker
def initialize(target, size)
@size = size
@direction = ENV['SER_DIRECTION'] == 'generate' ? :generate : :parse
@format = ENV['SER_FORMAT'] == 'pson' ? :pson : :json
puts "Benchmarker #{@direction} #{@format}"
end
def setup
end
def generate
path = Fil... | 25.54 | 80 | 0.593579 |
0394cd20125d880b8a31b82623902204b74f9596 | 3,984 | # A ProcessingJob is the point of control for
# initiating and checking on CloudCrowd::Jobs.
class ProcessingJob < ActiveRecord::Base
#include DC::Status
belongs_to :account
belongs_to :document
validates :cloud_crowd_id, :presence=>true
#validates :action, :presence => true
attr_accessor :remote_job
... | 30.646154 | 107 | 0.681727 |
87d4bc0b982298d38f155d61b78f1bda1e18be1a | 309 | class NeighborhoodServices::VacancyData::Filters::OpenThreeEleven
def initialize(three_eleven_data)
@three_eleven_data = three_eleven_data.dup
end
def filtered_data
@three_eleven_data
.select { |three_eleven_violation|
three_eleven_violation['status'] == 'OPEN'
}
end
end
| 23.769231 | 65 | 0.734628 |
918ce5e531e5f1077c20066cd9930bf3f0ddd05d | 376 | require 'spec_helper'
describe Scanner::Token do
it "is the right type of token" do
@token = Scanner::Token.new(:token_symbol, "content", 0, 0)
@token.is?(:token_symbol).should be true
end
it "is not the wrong type of token" do
@token = Scanner::Token.new(:token_symbol, "content", 0, 0)
@token.... | 22.117647 | 63 | 0.680851 |
1a57d4d2a8b218e58720af187085f4bbcb3b9d0c | 6,069 | require 'thread'
require 'time'
require 'segment_io/analytics/defaults'
require 'segment_io/analytics/logging'
require 'segment_io/analytics/utils'
require 'segment_io/analytics/worker'
module SegmentIO
class Analytics
class Client
include SegmentIO::Analytics::Utils
include SegmentIO::Analytics::Lo... | 30.044554 | 81 | 0.610479 |
e974172e83acbab6a07bbfa4fbde6a1d92bfee9c | 309 | module ActiveBookings
module Serializer
class << self
def load(string)
if string.present?
IceCube::Schedule.from_yaml(string)
end
end
def dump(object)
if object.is_a? IceCube::Schedule
object.to_yaml
end
end
end
end
end
| 17.166667 | 45 | 0.572816 |
797bed610225c116b9851034c68c7dda305dfe84 | 557 |
#package "epel-release"
execute 'centos_disable_iptables' do
cwd "/tmp"
command "service iptables stop"
end
#bash "centos_alias_php" do
# user "root"
# cwd "/tmp"
# code <<-EOT
# echo "alias php='/usr/local/bin/php'" >> /root/.bashrc
# EOT
# not_if "grep /root/.bashrc /usr/local/bin/php... | 20.62963 | 76 | 0.612208 |
ac5f8f54076a51ff0f5c987cf413f259fba746bd | 13,528 | ##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'rex'
class Metasploit3 < Msf::Exploit::Local
Rank = AverageRanking
include Msf::Post::Windows::Priv
include Msf::Post::Windows::Process
def init... | 39.440233 | 185 | 0.606446 |
e24fd5568b5bef11ea0137cb6614ad360e41ce3b | 701 | require 'rails_helper'
RSpec.feature 'Users can sign in' do
let!(:user) { FactoryGirl.create(:user) }
scenario 'with valid credentials' do
visit '/'
click_link 'Sign in'
fill_in 'Email', with: user.email
fill_in 'Password', with: 'password'
click_button 'Sign in'
expect(page).to have_cont... | 24.172414 | 66 | 0.677603 |
d51fe958ac7abf0ea4c1efd7b243869b50e240c7 | 1,965 | Dummy::Application.routes.draw do
ActiveAdmin.routes(self)
devise_for :admin_users, ActiveAdmin::Devise.config
Ecm::Courses::Routing.routes(self)
root :to => "ecm::courses::course_categories#index"
# The priority is based upon order of creation:
# first created -> highest priority.
# Sample of regul... | 29.772727 | 91 | 0.664631 |
4a7b24647be4daac1bff6465b2dabeef379bd70c | 3,049 | # Copyright 2011, Dell
#
# 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, software
... | 34.258427 | 95 | 0.663824 |
d5ea62fe86b8402e2487fb512ff7222b357c1aa8 | 337 | # Force shared connections between threads - really, really import to keeping
# the database clean
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
ActiveRecord::Base.shared_connection = ActiveRecord:... | 28.083333 | 77 | 0.79822 |
ffdcf97b1dc6ba8b1afb6eeda6cc6ea97663603b | 3,006 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class MetasploitModule < Msf::Exploit::Remote
Rank = AverageRanking
include Msf::Exploit::Remote::HttpClient
def initialize(info = {})
super(update_in... | 38.538462 | 94 | 0.52994 |
28054e3a1d9cd8287f1ea5b1af5220d549188ed6 | 880 | # coding: utf-8
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'java-properties/version'
Gem::Specification.new do |spec|
spec.name = "java-properties"
spec.version = JavaProperties::VERSION.dup
spec.authors = ["Jona... | 38.26087 | 77 | 0.667045 |
21bc5de738c2a126c2a2ad242184b9309788d12f | 1,750 | require 'spec_helper'
class RailtieSpec < Less::Rails::Spec
describe 'config' do
it 'must have a less ordered hash' do
dummy_config.less.must_be_instance_of ActiveSupport::OrderedOptions
end
it 'must have an array for paths' do
dummy_config.less.paths.must_be_kind_of Array
en... | 31.25 | 89 | 0.713714 |
61d008be658bf0d9112633040388c179ace9a769 | 1,615 | #
# Be sure to run `pod lib lint MyLibrary.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'MyLibrary... | 37.55814 | 101 | 0.636533 |
4a575526a9a6aba2e25d25d887af3ee0e4505959 | 97 | class ProjectResourceEmail < ActiveRecord::Base
belongs_to :project
belongs_to :resource
end
| 19.4 | 47 | 0.814433 |
1a9da5bee153df3423bc8bd8eaa4263fba60e93c | 1,046 | class Libzip < Formula
desc "C library for reading, creating, and modifying zip archives"
homepage "http://www.nih.at/libzip/"
url "http://www.nih.at/libzip/libzip-0.11.2.tar.gz"
sha256 "83db1fb43a961ff7d1d1b50e1c6bea09c67e6af867686d1fc92ecb7dc6cf98d5"
bottle do
cellar :any
revision 2
sha1 "71425... | 30.764706 | 85 | 0.643403 |
d5045781bc52f4ec8cb29f291706236ff7a065fe | 1,318 | class GstLibav < Formula
desc "GStreamer plugins for Libav (a fork of FFmpeg)"
homepage "https://gstreamer.freedesktop.org/"
url "https://gstreamer.freedesktop.org/src/gst-libav/gst-libav-1.18.1.tar.xz"
sha256 "39a717bc2613efbbba19df3cf5cacff0987471fc8281ba2c5dcdeaded79c2ed8"
license "LGPL-2.1-or-later"
rev... | 31.380952 | 93 | 0.707132 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.