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 |
|---|---|---|---|---|---|
d56dbe3761e7e9c2df7767650986b92b07cccd5e | 867 | require "#{File.dirname(__FILE__)}/../../../test_helper"
include_fixture_resources
PoolParty::Resource.define_resource_methods
class ApacheTest < Test::Unit::TestCase
def setup
clear!
@pool = pool :apache_test_pool do
cloud :httpd do
apache do
port 8080
end
end
end
... | 24.771429 | 130 | 0.681661 |
e9f207b5f972d13918bbea3df71d70383b8d9795 | 5,572 | require 'arel_extensions/nodes'
require 'arel_extensions/nodes/function'
require 'arel_extensions/nodes/concat'
require 'arel_extensions/nodes/cast'
require 'arel_extensions/nodes/date_diff'
require 'arel_extensions/nodes/duration'
require 'arel_extensions/nodes/wday'
require 'arel_extensions/nodes/union'
require 'are... | 40.086331 | 122 | 0.599246 |
f86ce111ac3ec1289ca9c7f993b0dba7e4f858df | 391 | if ((bounty? =~ /^You have made contact with the child/)||(Society.task =~ /You have been tasked to find and rescue an official who was captured/))
mynpc = GameObj.npcs.find { |npc| npc.noun =~ /child|official/ }
else
mynpc = nil
end
move 'south'
if Room.current == Room[11153]
50.times { break if GameObj.npcs.any... | 35.545455 | 147 | 0.672634 |
1d416e8b0c65fd030b474db1aa6d3520965ae179 | 3,399 | # frozen_string_literal: true
class FilteringTableController < BaseController
SORTABLE_KEYS = %i[first_name last_name birth_date].freeze
DATA_ITEMS = [
{ is_active: true, birth_date: Date.iso8601('1981-01-01'), first_name: 'Dickerson', last_name: 'Macdonald' },
{ is_active: false, birth_date: Date.iso8601(... | 36.945652 | 122 | 0.6599 |
edd08da937e388ee2b1a12b09591d2b6e44c4c6d | 620 | class Transactions::Transaction
include Mongoid::Document
include Mongoid::Timestamps
field :transaction_date, type: Date
field :submitted_at, type: Time, default: ->{ TimeKeeper.datetime_of_record }
field :description, type: String
# Transaction summary attributes here
belongs_to :sender_party,... | 24.8 | 81 | 0.719355 |
6200db3769cbd92c3941ac1529a5d3632bdec104 | 327 | require 'helper'
describe "!" do
before do
@t = pry_tester
end
it 'should correctly clear the input buffer ' do
eval_str = unindent(<<-STR)
def hello
puts :bing
STR
@t.process_command '!', eval_str
@t.last_output.should =~ /Input buffer cleared!/
eval_str.should == ''
e... | 16.35 | 52 | 0.614679 |
62d97de62429bf9bc2d8318a24ec7d1ff0eb13f8 | 574 | atom_feed(
language: 'de-DE',
root_url: body_feed_url(body: @body),
url: feed_url_with_current_page(@papers)
) do |feed|
paginated_feed(feed, @papers)
if !Rails.configuration.x.push_hubs.blank?
Rails.configuration.x.push_hubs.each do |hub|
feed.link rel: 'hub', href: hub
end
end
feed.title ... | 30.210526 | 72 | 0.696864 |
7a8307520a30d9d7194eb8816199716126ca1c46 | 804 | require 'dotenv/load'
class Api::V1::AuthController < ApplicationController
skip_before_action :authorized, only: [:create]
def create
@user = User.find_by(email: user_login_params[:email].downcase)
if @user && @user.authenticate(user_login_params[:password])
token = encode_token({ user_id: @user.... | 26.8 | 85 | 0.675373 |
87c6ce7c43b09a0f388edecb4da48bc649d0d357 | 4,830 | require 'rubygems'
require 'capybara/rspec'
require 'support/request_helpers'
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which wil... | 42.743363 | 129 | 0.744928 |
d53fc968e2a27d030fda17d61ed82d5709cb9a03 | 13,164 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Releases::CreateService do
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
let(:tag_name) { project.repository.tag_names.first }
let(:tag_sha) { project.repository.find_tag(tag_name).dereferenced_target.sha }
let... | 34.192208 | 113 | 0.654664 |
793c2d4b5cf41dc5502d5b119fc64d3cad21a6af | 72 | # frozen_string_literal: true
module Flagsmith
VERSION = '3.0.1'
end
| 12 | 29 | 0.736111 |
26ce5016e66dd7f5f123370ca20bd38261107b4a | 1,048 | module Nokogiri
module HTML
module SAX
class PushParser
# The Nokogiri::HTML::SAX::Document on which the PushParser will be
# operating
attr_accessor :document
def initialize(doc = HTML::SAX::Document.new, file_name = nil, encoding = 'UTF-8')
@docu... | 28.324324 | 90 | 0.575382 |
bf9a7a76af1e1efd24fa510cb53a7594c4de166c | 1,719 | # Configure Rails Environment
ENV["RAILS_ENV"] = "test"
require 'simplecov' if ENV["COVERAGE"]
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require 'rspec/rails'
require 'factory_girl'
require 'spree/testing_support/url_helpers'
require 'database_cleaner'
# Requires supporting ruby files wit... | 29.135593 | 90 | 0.752182 |
624650350f85007bbfd3afcf0e536e56083b8ea4 | 914 | cask 'ascension' do
version '3.0.0'
sha256 'b21598b455878b997a08c88ef1c800eef2ad648ca672228db90ece0754d5e492'
url "https://github.com/ansilove/Ascension/releases/download/v#{version}/Ascension_v#{version}.zip"
appcast 'https://github.com/ansilove/Ascension/releases.atom',
checkpoint: '1f169b668cf5d56... | 41.545455 | 157 | 0.706783 |
f8971f577c962a5124487efc6e68f728fa6c7783 | 77 | # frozen_string_literal: true
module Derp
def three
'Three'
end
end
| 9.625 | 29 | 0.701299 |
ab8bc1ee9c54bad43e073787b777acc582d18e5e | 2,415 | class BuildsController < ApplicationController
layout 'default'
caches_page :drop_down
def show
render :text => 'Project not specified', :status => 404 and return unless params[:project]
@project = Projects.find(params[:project])
render :text => "Project #{params[:project].inspect} not found", :sta... | 32.2 | 110 | 0.631884 |
2681c339ad67743c5717d74b7a0ad2dd35be4044 | 247 | module Infor
module REST
class ServerError < StandardError; end
class RequestError < StandardError
attr_reader :code
def initialize(message, code=nil);
super message
@code = code
end
end
end
end
| 16.466667 | 42 | 0.635628 |
395fc9495e7deb466aa04aa551f6caf547114cfb | 313 | environment 'production'
daemonize true
pidfile '/home/akira/lament-rails/shared/tmp/pids/puma.pid'
state_path '/home/akira/lament-rails/shared/tmp/pids/puma.state'
threads 2, 4
bind 'unix:///home/akira/lament-rails/shared/tmp/sockets/puma.sock'
on_worker_boot do
ActiveRecord::Base.establish_connection
end
| 24.076923 | 67 | 0.795527 |
03213e7a1ac5909e4fc3d8298629d2aafb6460f6 | 1,841 | # 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... | 39.170213 | 138 | 0.713743 |
3303b8385582e2b75897430cc110a34ef2ea5912 | 134 | class AddTitleToSpreeAddresses < ActiveRecord::Migration[5.2]
def change
add_column :spree_addresses, :title, :string
end
end
| 22.333333 | 61 | 0.768657 |
abb1234a3c38556f18a378a29461d356889fc98e | 266 | inp = File.readlines("input.txt").collect do |line|
line.chomp.to_i
end
sums = (inp.size - 2).times.collect do |c|
inp[c..c + 2].sum
end
increases = (sums.size - 1).times.collect do |c|
if sums[c] < sums[c + 1]
1
else
0
end
end.sum
puts increases
| 16.625 | 51 | 0.62406 |
33f2b8dc9b70fa3c786a9f5b79c86c84a863303b | 1,237 | require 'active_support/concern'
require 'active_support/callbacks'
module ActiveSupport
module Testing
# Adds support for +setup+ and +teardown+ callbacks.
# These callbacks serve as a replacement to overwriting the
# <tt>#setup</tt> and <tt>#teardown</tt> methods of your TestCase.
#
# class E... | 24.254902 | 70 | 0.590946 |
b988835091806c4a8780e26a489e746f177be0e5 | 2,054 | #snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.]
#snippet-sourceauthor:[Doug-AWS]
#snippet-sourcedescription:[Gives read access, by email address, to an S3 bucket.]
#snippet-keyword:[Amazon Simple Storage Service]
#snippet-keyword:[get_bucket_acl method]
#snippet-keyword:[put... | 26 | 88 | 0.686465 |
ff1d0a365fb1ecd37b3f5586d297e3f19e13edc3 | 1,157 | class Px < Formula
include Language::Python::Virtualenv
desc "Ps and top for human beings (px / ptop)"
homepage "https://github.com/walles/px"
url "https://github.com/walles/px.git",
tag: "3.0.0",
revision: "0d4cee0070587acf85a5e64fd60c60ea98f4035a"
license "MIT"
bottle do
root_url "h... | 32.138889 | 145 | 0.757995 |
f7de93cc35357976d08edda052cf9931acdb2410 | 938 | # -*- encoding: utf-8 -*-
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
Gem::Specification.new do |gem|
gem.name = "mctop"
gem.version = "0.0.4"
gem.authors = ["Marcus Barczak"]
gem.email = ["marcus@etsy.com"]
gem.description ... | 44.666667 | 252 | 0.664179 |
6a541e3c8e2c135c48cc46775099ca1062d821fb | 2,333 | class Goffice < Formula
desc "Gnumeric spreadsheet program"
homepage "https://developer.gnome.org/goffice/"
url "https://download.gnome.org/sources/goffice/0.10/goffice-0.10.45.tar.xz"
sha256 "702ba567e9ec0bbdd9b1a8161cd24648b4868d57a6cb89128f13c125f6f31947"
revision 2
bottle do
sha256 "73f03c21d7a54de... | 31.958904 | 109 | 0.638663 |
218707a300c68eb557e262ed6b1f749cb9518b1b | 3,767 | # frozen_string_literal: true
require "spec_helper"
describe EveOnline::ESI::MarketGroup do
let(:options) { {id: 618} }
subject { described_class.new(options) }
specify { expect(subject).to be_a(EveOnline::ESI::Base) }
specify { expect(described_class::API_PATH).to eq("/v1/markets/groups/%<market_group_id>... | 26.716312 | 115 | 0.671887 |
e28fdb1d63a00972d9beee17b714b09b33790a70 | 49 | class ContentDisposition
VERSION = "1.0.0"
end
| 12.25 | 24 | 0.734694 |
33cf23c68bbfe3575423cf9d2568742e2421c804 | 725 | require File.expand_path('../../../../spec_helper', __FILE__)
require File.expand_path('../../fixtures/classes', __FILE__)
require File.expand_path('../shared/basic', __FILE__)
require File.expand_path('../shared/integer', __FILE__)
describe "String#unpack with format 'V'" do
it_behaves_like :string_unpack_basic, 'V... | 38.157895 | 61 | 0.777931 |
ff8d736f552ab7c783ea3e67318c18130f1d7b96 | 455 | require 'spec_helper'
describe Valvat::Checksum::GR do
%w(EL123456783 EL094543092 EL998219694).each do |valid_vat|
it "returns true on valid VAT #{valid_vat}" do
expect(Valvat::Checksum.validate(valid_vat)).to eql(true)
end
invalid_vat = "#{valid_vat[0..-3]}#{valid_vat[-1]}#{valid_vat[-2]}"
i... | 30.333333 | 71 | 0.692308 |
f7b2d0bfa09bc65d59883511e485a57cbb7e87ea | 3,192 | =begin
#OpenAPI Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.0.0-SNAPSHOT
=end
require 'spe... | 29.555556 | 157 | 0.721178 |
d5763965d4622f3dd162a72f621b62c4f3624e24 | 2,148 | module Neo4j
module Core
module CypherTranslator
# Cypher Helper
def escape_value(value)
if value.is_a?(String) || value.is_a?(Symbol)
"'#{escape_quotes(sanitize_escape_sequences(value.to_s))}'"
else
value
end
end
# Like escape_value but it does... | 27.896104 | 105 | 0.590317 |
e25cab458846700ab59e99ffcfd2a023c059b3da | 553 | module Jobly
module Commands
class ServerCmd < Base
summary "Start the server"
usage "jobly server [--port NUMBER]"
usage "jobly server (-h|--help)"
option "-p --port NUMBER", "Set the port number [default: 3000]"
def run
port = args['--port']
say "Starting server"
... | 24.043478 | 93 | 0.584087 |
d53ad7fe804167dc173fdb4fa473779ea5672f99 | 2,084 | require 'one_gadget/gadget'
# https://gitlab.com/libcdb/libcdb/blob/master/libc/libc0.3-2.19-18/lib/i386-gnu/libc-2.19.so
#
# Intel 80386
#
# GNU C Library (Debian GLIBC 2.19-18) stable release version 2.19, by Roland McGrath et al.
# Copyright (C) 2014 Free Software Foundation, Inc.
# This is free software; see the ... | 52.1 | 158 | 0.588772 |
33f35c9080d27e8650cce81d0be0d1a231ae8ce3 | 310 | #
# Helper - Logs
#
require 'kumogata/template/helper'
def _logs_metric_filter_transformations(args)
trans = args[:transformations] || []
array = []
trans.each do |tran|
array << _{
MetricName tran[:name]
MetricNamespace tran[:ns]
MetricValue tran[:value]
}
end
array
end
| 16.315789 | 45 | 0.648387 |
3871a4a36c6328c73c59992de90a0dfbffbad841 | 180 | class AddVideoFieldsToProduct < ActiveRecord::Migration[5.0]
def change
add_column :products, :video_url_1, :string
add_column :products, :video_url_2, :string
end
end
| 25.714286 | 60 | 0.755556 |
260608798038aa2e13d0cfd2eb3353b5c8ec336f | 3,284 | # frozen_string_literal: true
require 'spec_helper'
require 'timecop'
RSpec.describe Child, type: :model do
let(:partition_provider) { create :partition_provider }
let(:proxy) { create :proxy, partition_provider_guid: partition_provider.guid }
let(:child) { create :child, proxy: proxy }
it 'requires a proxy'... | 31.27619 | 105 | 0.699452 |
79ffb88529d61125db5be3579e7e845a6d1a06f6 | 1,596 | require 'test_helper'
class FollowingTest < ActionDispatch::IntegrationTest
def setup
@user = users(:michael)
@other = users(:archer)
log_in_as(@user)
end
test "following page" do
get following_user_path(@user)
assert_not @user.following.empty?
assert_match @user.following.count.to_s, re... | 28.5 | 77 | 0.705514 |
1ded2525841d9a1b34d01df874872178e5da59ed | 252 | module Barebones
module TextFormatHelpers
def spaces(num_spaces)
"\s" * num_spaces
end
def replace_regex_in_file(file, regex, replacement)
gsub_file file, regex do |match|
replacement
end
end
end
end | 16.8 | 55 | 0.646825 |
2875aa8e71885f9cb27f914599082b2458c3eee7 | 4,439 | require "ostruct"
require_relative "ext_kernel"
require_relative "iis_app_pool_root"
require_relative "iis_app_pool_cpu"
require_relative "iis_app_pool_process_model"
require_relative "iis_app_pool_recycling"
require_relative "iis_app_pool_periodic_restart"
require_relative "iis_app_pool_failure"
module OO
class II... | 29.397351 | 119 | 0.661636 |
87e5dca01fd9dd55f0a59527273e58d2d5fdb4c6 | 358 | class ExpireBuildArtifactsWorker
include ApplicationWorker
include CronjobQueue
def perform
Rails.logger.info 'Scheduling removal of build artifacts'
build_ids = Ci::Build.with_expired_artifacts.pluck(:id)
build_ids = build_ids.map { |build_id| [build_id] }
ExpireBuildInstanceArtifactsWorker.bu... | 25.571429 | 68 | 0.784916 |
1891880f380a6ec280c412f21290ae0eb3287b6b | 2,732 | class Caddy < Formula
desc "Powerful, enterprise-ready, open source web server with automatic HTTPS"
homepage "https://caddyserver.com/"
url "https://github.com/caddyserver/caddy/archive/v2.2.3.tar.gz"
sha256 "7994a9e61d4204cf10816aa9f3ebab4b9ae4a2d64a6f1ec1fe8a38b376e19494"
license "Apache-2.0"
head "https... | 31.045455 | 108 | 0.638726 |
f7d995fc9bb066a035bf6e62f2f305985a06bcf5 | 3,191 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Patent, type: :model do
let :valid_attr do
{
name: 'Modificação operacional de condutivimetro para medida analógica direta',
summary: 'foo bar baz baz bar baz',
classification: {
primary: {
cip: 'G - Física',... | 30.682692 | 426 | 0.652773 |
01ffc1f1c1719315fca6699ed517020ce20bc688 | 765 | Ученые обнаружили животное, которое может жить в течение 500 лет
Международная Группа биологов пришла к выводу о том, что самым длинным живым позвоночным является гренландский акула, которая может жить примерно в 500 лет, RT Reports.
Ученые проводили радиокарбон анализ глазных линз 28 Гренландии.
Самая крупная акула, д... | 85 | 168 | 0.827451 |
9156c4ca8431fa37955b51883ef779d3cfb114cc | 470 | require File.expand_path('../helper', __FILE__)
class GroupTalentTest < Service::TestCase
def setup
@stubs = Faraday::Adapter::Test::Stubs.new
end
def test_push
url = "/github/receive_push/abc"
@stubs.post url do |env|
assert_equal "payload=%22payload%22", env[:body]
[200, {}, '']
en... | 19.583333 | 54 | 0.634043 |
212d543ae627d30263355011508ef7cc1a86ae37 | 156 | require 'rubygems'
gem 'Mxx_ru', '>= 1.3.0'
require 'mxx_ru/cpp'
MxxRu::Cpp::exe_target {
target 'unit.test.at_scope_exit'
cpp_source 'main.cpp'
}
| 12 | 34 | 0.673077 |
79bdcfe0797357b516bb44fb3238ee4b477c3fe6 | 105 | module Plato
class GPIO
def self.pin(port, pno)
(port << 5) | (pno & 0x1f)
end
end
end
| 13.125 | 32 | 0.552381 |
61690439d2dace78df453a4336a9ffdc1499a213 | 187 | class CreateContractors < ActiveRecord::Migration[5.0]
def change
create_table :contractors do |t|
t.string :name
t.string :address
t.timestamps
end
end
end
| 18.7 | 54 | 0.668449 |
6adb4a6d6f2155f66df860c0aaabeff768b5ebc7 | 9,402 | class Localstack < Formula
include Language::Python::Virtualenv
desc "Fully functional local AWS cloud stack"
homepage "https://github.com/localstack/localstack"
url "https://files.pythonhosted.org/packages/03/66/2ebcaf60ce6da7e282d42756b84e7a2709a82f970d67e261048267fc47db/localstack-0.14.1.3.tar.gz"
sha256 ... | 47.725888 | 147 | 0.823123 |
5d1c34bc14478d3b1c730f9e4b0d4e33a8ab8f79 | 342 | # frozen_string_literal: true
module ApiMe
module Generators
class InstallGenerator < Rails::Generators::Base
def run_generators
# Install Pundit
run 'rails g pundit:install'
# Add Pundit rpsec helpers
prepend_to_file 'spec/spec_helper.rb', "require 'pundit/rspec'\n"
... | 21.375 | 73 | 0.666667 |
26eb303cc1ea4e91f5454c8a4ddd83c0cfb5d3e1 | 995 | require 'test_helper'
class StaticPagesControllerTest < ActionDispatch::IntegrationTest
test "should get home" do
get root_path #static_pages_home_url
assert_response :success
assert_select "title", "Ruby on Rails Tutorial Sample App"
end
test "should get help" do
get help_path #static_pages... | 27.638889 | 73 | 0.730653 |
7ac524f27af6053a5967528ae8fb0ae4d3bcaf37 | 47 | json.extract!(
wechat_user,
:id,
:name
)
| 7.833333 | 14 | 0.595745 |
e9994d6d9207f24ccca9b26911c24aeb7c63a588 | 126 | FactoryBot.define do
factory :product do
name { Faker::Lorem.word }
description { Faker::Lorem.paragraph }
end
end | 21 | 42 | 0.698413 |
3904fe7a0b329e81b2e0a57f0d06cda413604bc5 | 1,379 | class String
define_method('game_router') do |test_word, replacement_word, transformation, match_type|
if match_type == "whole-word"
self.whole_word(test_word, replacement_word, transformation)
elsif match_type == "partial-word"
self.partial_word(test_word, replacement_word, transformation)
en... | 38.305556 | 147 | 0.638869 |
1871e34a0946af1a25064d2ae3796ca3720b027a | 221 | class ContainerPerformance < MetricRollup
default_scope { where "resource_type = 'Container' and resource_id IS NOT NULL" }
belongs_to :container_node, :foreign_key => :resource_id, :class_name => Container.name
end
| 36.833333 | 89 | 0.778281 |
f84006854bfbd5c756f68911357ce2c1dd6e9122 | 5,870 | require "devise"
require "devise_saml_authenticatable/version"
require "devise_saml_authenticatable/exception"
require "devise_saml_authenticatable/logger"
require "devise_saml_authenticatable/routes"
require "devise_saml_authenticatable/saml_config"
require "devise_saml_authenticatable/default_attribute_map_resolver"... | 39.395973 | 114 | 0.792504 |
e9fcb79fc46767885dcb77d78754ce5bc9b961ee | 186 | class RemoveDirectiveIdFromCycles < ActiveRecord::Migration
def up
remove_column :cycles, :directive_id
end
def down
add_column :cycles, :directive_id, :integer
end
end
| 18.6 | 59 | 0.752688 |
08a0ab69d6c624bade20f4577b684e0a044e8ffc | 160 | RemoteDatabaseCleanerHomeRails.configure do |config|
config.skip_before_filter = [:authenticate, :another_authentication]
config.strategy = :truncation
end
| 32 | 70 | 0.825 |
91c59c4bda8e9ae949196221d0157d2a03a65321 | 1,636 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe ForkNamespaceEntity do
include Gitlab::Routing.url_helpers
include ProjectForksHelper
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) }
let_it_be(:namespace) { create(:group, :with_avatar, description: 'test') }
... | 25.968254 | 147 | 0.72555 |
e9cf6fa2c718c3dcc34b0225b14712cf3942a4c6 | 967 | # frozen_string_literal: true
module RuboCop
module Cop
module Rails
# This cop checks that jobs subclass ApplicationJob with Rails 5.0.
#
# @example
#
# # good
# class Rails5Job < ApplicationJob
# # ...
# end
#
# # bad
# class Rails4Job <... | 23.585366 | 73 | 0.584281 |
037de8e9369eca26383d10267d4598b8781fd09b | 1,670 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Checks::SnippetCheck do
include_context 'change access checks context'
let_it_be(:snippet) { create(:personal_snippet, :repository) }
let(:user_access) { Gitlab::UserAccessSnippet.new(user, snippet: snippet) }
let(:default_branch) { ... | 30.925926 | 128 | 0.680838 |
1c5c70e9ddf36bab69d8950f1dd8cef64ac7f009 | 64,755 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::EventGrid::Mgmt::V2019_06_01
#
# Azure EventGrid Management Client
#
class Topics
include MsRestAzure
#
# Creates and initializes a new ins... | 45 | 227 | 0.700085 |
e9f0dacad6b2ea448530ab536d1925ea71849a42 | 3,649 | #
# Author:: Hongli Lai (hongli@phusion.nl)
# Copyright:: Copyright 2009-2016, Phusion
# License:: Apache License, Version 2.0
#
# 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://w... | 33.787037 | 100 | 0.617978 |
4a03ec8bbc2af516417bb2300863bcee142602cd | 2,597 | # This software is public domain. No rights are reserved. See LICENSE for more information.
class Paramsync
class CLI
class PushCommand
class << self
def run(args)
Paramsync::CLI.configure
STDOUT.sync = true
Paramsync.config.sync_targets.each do |target|
d... | 30.197674 | 105 | 0.448209 |
bbd37fa925ce05c5eb3f238f26b9c20506b380e3 | 2,315 |
###
# This Ruby source file was generated by test-to-ruby.xsl
# and is a derived work from the source document.
# The source document contained the following notice:
=begin
Copyright (c) 2001 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en Automa... | 29.679487 | 113 | 0.704536 |
082f79f93685b0e327412eb523d24e97211b6dc7 | 966 | class BinutilsSparc < Formula
homepage "http://www.gnu.org/software/binutils/binutils.html"
url "http://ftpmirror.gnu.org/binutils/binutils-2.25.tar.gz"
mirror "http://ftp.gnu.org/gnu/binutils/binutils-2.25.tar.gz"
sha256 "cccf377168b41a52a76f46df18feb8f7285654b3c1bd69fc8265cb0fc6902f2d"
# No --default-names... | 34.5 | 75 | 0.567288 |
28a088d51987523bcceb21a4de993c4caaae4f76 | 1,143 | # frozen_string_literal: true
module Gitlab
module Insights
module Reducers
# #reduce returns a hash { period => { label1: issuable_count } }, e.g.
# {
# 'January 2019' => {
# 'Manage' => 2,
# 'Plan' => 3,
# 'undefined' => 1
# },
# '... | 27.214286 | 98 | 0.506562 |
1ac88e63436ed4c4f6d79e420c392d0b34636197 | 5,849 | #
# Cookbook:: apache2
# Recipe:: default
#
# Copyright:: 2008-2017, Chef Software, Inc.
# Copyright:: 2014-2015, Alexander van Zoest
#
# 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
#
# h... | 28.531707 | 253 | 0.686442 |
7ad22916f7fbdb764d70ce6ed5d2d6d936e02ccb | 1,821 | =begin
#Ory APIs
#Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers.
The version of the OpenAPI document: v0.0.1-alpha.187
Contact: support@ory.sh
Generated by: https://openapi-generator.tech
... | 31.947368 | 177 | 0.726524 |
793d1f593d8ffeccfb678c2cf90f57a76d7a1e4f | 82 | class Project < ApplicationRecord
belongs_to :member
end
| 9.111111 | 33 | 0.585366 |
4a751b65671481648aee4c9eb2783b4298ae819d | 357 | # frozen_string_literal: true
require 'openscap_parser_2/tailorings'
module OpenscapParser
# A class to represent a tailoring XmlFile
class TailoringFile < XmlFile
include OpenscapParser::Tailorings
def valid?
return true if @parsed_xml.root.name == 'Tailoring' && namespaces.keys.include?('xmlns:xc... | 21 | 100 | 0.731092 |
e90678766ed3b01adce00bb6c2e6edf5491fc611 | 1,395 | class Libuninameslist < Formula
desc "Library of Unicode names and annotation data"
homepage "https://github.com/fontforge/libuninameslist"
url "https://github.com/fontforge/libuninameslist/releases/download/20180701/libuninameslist-dist-20180701.tar.gz"
sha256 "8aed97d0bc872d893d8bf642a14e49958b0613136e1bfe2a4... | 30.326087 | 116 | 0.710394 |
d52194f688b9e444b8bdd3ce6a6452ea800f8851 | 3,598 | module Gitlab
module Ci
class Trace
# This was inspired from: http://stackoverflow.com/a/10219411/1520132
class Stream
BUFFER_SIZE = 4096
LIMIT_SIZE = 500.kilobytes
attr_reader :stream
delegate :close, :tell, :seek, :size, :path, :truncate, to: :stream, allow_nil: tru... | 24.813793 | 92 | 0.541968 |
1113b5dbd5a91dbb698613f2d3d7b0d8543ce6a0 | 821 | require "spec_helper"
describe TableCloth::Extensions::Actions::Column do
let(:view_context) { ActionView::Base.new }
let(:dummy_model) { FactoryGirl.build(:dummy_model) }
let(:action_collection) { TableCloth::Extensions::Actions::ActionCollection.new }
subject { described_class.new(:actions, collection: acti... | 35.695652 | 83 | 0.725944 |
018949c065bb1a0a179be0c9d7c2f0096440ccc9 | 1,670 | class PasswordResetsController < ApplicationController
before_action :get_user, only: [:edit, :update]
before_action :valid_user, only: [:edit, :update]
before_action :check_expiration, only: [:edit, :update] # Case (1)
def new
end
def create
@user = User.find_by(email: params[:passwo... | 25.692308 | 73 | 0.608383 |
5dbaad06f2ad9625c2eb9043be0f282c78cba5c2 | 1,298 | class Vmtouch < Formula
desc "Portable file system cache diagnostics and control"
homepage "https://hoytech.com/vmtouch/"
url "https://github.com/hoytech/vmtouch/archive/v1.3.1.tar.gz"
sha256 "d57b7b3ae1146c4516429ab7d6db6f2122401db814ddd9cdaad10980e9c8428c"
head "https://github.com/hoytech/vmtouch.git"
bo... | 40.5625 | 111 | 0.791988 |
e82350fa81679f3b53a00003cbdd566e71102b46 | 797 | # frozen_string_literal: true
module Gitlab
module Geo
module LogCursor
module Events
class CacheInvalidationEvent
include BaseEvent
def process
result = expire_cache_for_event_key
log_cache_invalidation_event(result)
end
private
... | 20.435897 | 51 | 0.542033 |
e96017ba64d629679646463461f9d47a98cbc632 | 329 | require 'rails_helper'
RSpec.describe Api::V1::Data::HistoricalEmissions::GasesController, type: :controller do
include_context 'historical emissions records'
describe 'GET index' do
it 'renders gases' do
get :index
expect(@response).to match_response_schema('historical_emissions_gases')
end
... | 25.307692 | 88 | 0.74772 |
1127abe58faf892c7eb6c6de4422ad32eba3b315 | 1,309 | module Admin
class ReferralsController < BaseController
load_and_authorize_resource
before_filter :find_plan, only: %w(edit update destroy active)
def index
@referral_plans = Referral.all
end
def new
@referral = Referral.new
end
def create
@referral = Referral.new(ref... | 18.7 | 66 | 0.601986 |
0318196cceeaef9c98eb28abca044c536a3fb74d | 4,472 | # encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
require 'net/http'
module NewRelic
module Agent
module Utilization
class Vendor
class << self
def vendor_name vendor... | 28.303797 | 110 | 0.568873 |
1dbd76cfc01a230b8c23323e67fee862d7f41de0 | 307 | # frozen_string_literal: true
require 'hexlet_code/version'
require 'hexlet_code/tag'
module HexletCode
class Error < StandardError; end
def self.form_for(_entry, url: '')
url = url.strip
url_attr = url.empty? ? '#' : url
"<form action=\"#{url_attr}\" method=\"post\"></form>"
end
end
| 19.1875 | 58 | 0.667752 |
4a30720f370e70add679c858d1214e10bf9c406c | 4,499 | #! /usr/bin/env ruby
require 'spec_helper'
require 'puppet/util'
describe Puppet::Type.type(:exec).provider(:pwsh) do
# Override the run value so we can test the super call
# There is no real good way to do this otherwise, previously we were
# testing Puppet internals that changed in 3.4.0 and made the specs
#... | 38.127119 | 133 | 0.670371 |
acdae067ae79c144b49c06c214b0ea281b88ce88 | 1,758 | #
# Be sure to run `pod lib lint FrameworkExample.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'Fra... | 40.883721 | 143 | 0.657565 |
79d95860dc03d46a49731fd4798b19112c3e91c3 | 4,513 | describe MangoPay::Configuration do
it 'fails when calling with wrong client credentials' do
expect {
c = MangoPay.configuration
c.client_id = 'test_asd'
c.client_apiKey = '00000'
MangoPay::User.fetch()
}.to raise_error { |err|
expect(err).to be_a MangoPay::ResponseError
... | 29.690789 | 104 | 0.652338 |
617c0f88a8908542f4a5539c92aca353beec2292 | 2,238 | require 'spec_helper'
RSpec.describe Gitlab::Favicon, :request_store do
describe '.main' do
it 'defaults to favicon.png' do
stub_rails_env('production')
expect(described_class.main).to match_asset_path '/assets/favicon.png'
end
it 'has blue favicon for development', unless: Gitlab.ee? do
... | 31.971429 | 95 | 0.697498 |
f815145d159339a9369b4bed80acfa8e7682f1fe | 425 | module Ibanity
module IsabelConnect
class IntradayTransaction < Ibanity::BaseResource
def self.list(account_id:, access_token:, headers: nil, **query_params)
uri = Ibanity.isabel_connect_api_schema["account"]["intradayTransactions"].sub("{accountId}", account_id)
list_by_uri(uri: uri, query_... | 38.636364 | 113 | 0.738824 |
4a2b27932b78f06d2e8cb319c23b820ca87b1c9b | 646 | require 'spec_helper'
require File.dirname(__FILE__) + '/../../lib/alephant/renderer/i18n/json'
describe Alephant::Renderer::I18n::Json do
let(:template_path) { File.join(File.dirname(__FILE__), 'fixtures') }
let(:locale) { 'en' }
let(:namespace) { 'my_namespace' }
subject { described_class.new(locale, namesp... | 26.916667 | 73 | 0.650155 |
1a38d119ddabec7c6d00484823fa9ae6230a0ee9 | 124 | require 'test_helper'
class Idg::Test < ActiveSupport::TestCase
test "truth" do
assert_kind_of Module, Idg
end
end
| 15.5 | 41 | 0.733871 |
79621ff028003292eee80e640aad4886f0238433 | 7,155 | require 'spec_helper'
describe 'stepped into mariadb_test_custom::server on debian-jessie' do
let(:debian_jessie_custom_run) do
ChefSpec::SoloRunner.new(
step_into: 'mariadb_service',
platform: 'debian',
version: 'jessie/sid'
) do |node|
node.set['mariadb']['service_name'] = 'debian... | 39.313187 | 327 | 0.685535 |
e2ddbf80e4c54a55f457dbdd0491f91ee9d2296f | 412 | class ApplicationController < ActionController::Base
respond_to :html
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_action :authenticate_login!
layout :layout_by_resource
protected
def layout_by_resou... | 21.684211 | 56 | 0.742718 |
f88fb74f8ad57c9bde288d0035c0c1fe0bd04d56 | 8,383 | # frozen_string_literal: true
describe StuckVirtualHearingsChecker, :postgres do
let(:hearing_day) { create(:hearing_day, scheduled_for: Time.zone.today + 2.weeks) }
it "reports to correct slack channel" do
subject.call
expect(subject.slack_channel).to eq("#appeals-tango")
end
context "there are no ... | 39.356808 | 116 | 0.695574 |
2117f39b8f3acda64d3d2072fd43f1d53142bbf5 | 523 | # This class holds methods about a doc.
class MethodDoc
attr_accessor :scope, :content, :request, :response, :code
def initialize(type)
@scope = type
@variables = []
@content = ""
@code = ""
@request = ""
@response = ""
end
def add_variable(name, value)
if name == "param"
... | 15.848485 | 60 | 0.548757 |
799c8221ed5acd02923855a31e09b898898937c4 | 455 | class Contact::Filter::ContactType < Contact::Filter::Base
def execute_query(contacts, filters)
case filters[:contact_type]
when 'person'
contacts.people
when 'company'
contacts.companies
end
end
def title
_('Type')
end
def parent
_('Contact Details')
end
def type
... | 16.851852 | 80 | 0.626374 |
d527cc90d9790f76a5b8e6d6daa92e9abba15750 | 568 | ## Newthought tag will render anything in the tag with small caps
## Usage {% newthought Your text string here} will render a span
## YOUR TEXT STRING HERE (sort of, you know, small caps) if you are using the tufte.css file
module Jekyll
class RenderNewThoughtTag < Liquid::Tag
require "shellwords"
def initiali... | 24.695652 | 92 | 0.705986 |
215af12554e785f6cac6df4fe6d2ef9f2d6700e0 | 172 | require 'test_helper'
class StateTest < ActiveSupport::TestCase
test "fixtures are valid" do
State.find_each do |o|
assert o.valid?
end
end
end
| 13.230769 | 41 | 0.656977 |
bffd77177731373f79ff6c7448a4748f45a0d74a | 173 | # This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run RorXmlYamlCodeExecution::Application
| 34.6 | 67 | 0.791908 |
e274597c3600e45315e4022797ca8324075d0763 | 1,025 | cask 'typora' do
version '0.9.9.12.5'
sha256 '0fb77e602b29d74b82b1b0c895c33cee176cc3947dfbc616f027932f616f5566'
url 'https://typora.io/download/Typora.dmg'
appcast 'https://www.typora.io/download/dev_update.xml',
checkpoint: '3d8ab4698cc2608bdfa38eeed4cfc71d2dd5f2a88a1ac3bc9898cf1a3e3ad4c7'
name 'T... | 39.423077 | 149 | 0.680976 |
1c38f6d41bee93180e12d2316f8d69175cd4caf0 | 184 | module ApiHelper
def format_date(attribute)
attribute.to_date if attribute.present?
end
def format_datetime(attribute)
attribute.iso8601 if attribute.present?
end
end
| 18.4 | 43 | 0.771739 |
e2a3bce10e3e6ea09d69a96feefff2903a542939 | 201 | class CreateAttendanceSheets < ActiveRecord::Migration
def change
create_table :attendance_sheets do |t|
t.date :sheet_date
t.integer :cohort_id
t.timestamps
end
end
end
| 18.272727 | 54 | 0.701493 |
03caea4b619c2c813444154e1e39937029f69515 | 3,453 | # frozen_string_literal: true
module AcaEntities
module Serializers
module Xml
module Medicaid
module Atp
# Include XML element and type definitions.
class Person
include HappyMapper
tag 'Person'
namespace 'hix-core'
attribute :i... | 46.662162 | 146 | 0.6351 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.