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 |
|---|---|---|---|---|---|
ac4ac537a8ac14fceac4c675f2ef3d0de2c168ea | 15,966 | # Gitaly note: JV: two sets of straightforward RPC's. 1 Hard RPC: fork_repository.
# SSH key operations are not part of Gitaly so will never be migrated.
require 'securerandom'
module Gitlab
class Shell
GITLAB_SHELL_ENV_VARS = %w(GIT_TERMINAL_PROMPT).freeze
Error = Class.new(StandardError)
KeyAdder = ... | 31.995992 | 156 | 0.65746 |
28e9f80e01cebb8672de28c8e3d8c74f48871834 | 435 | module Factory
class ProducePlanJob < ApplicationJob
def perform
SceneAutomatic.all.each do |scene_automatic|
(Date.today .. Date.today + scene_automatic.advance_days).each do |produce_on|
produce_plan = ProducePlan.find_or_create_by(scene_id: scene_automatic.scene_id, organ_id: scene_aut... | 29 | 150 | 0.71954 |
f81c2f0b0be0c8b6cfd9337a5d73a7848c4daff0 | 573 | # frozen_string_literal: true
require 'rails'
module RailsMasterKeyKmsDecrypter
module WithKmsEncryptedConfiguration
def encrypted(path, key_path: 'config/master.key', env_key: 'RAILS_MASTER_KEY')
RailsMasterKeyKmsDecrypter::KmsEncryptedConfiguration.new(
config_path: Rails.root.join(path),
... | 27.285714 | 83 | 0.73822 |
38b8d920fc11be67f7f7b6293858ca118a09c488 | 1,296 | require 'cinch'
require 'vpsfree-irc-bot/api'
require 'vpsfree-irc-bot/command'
require 'vpsfree-irc-bot/helpers'
module VpsFree::Irc::Bot
class Cluster
include Cinch::Plugin
include Command
include Helpers
include Api
command :status do
desc 'show cluster status'
end
def cmd_... | 25.411765 | 90 | 0.532407 |
1c43f3603f5860d751ebea217f090a90d305f065 | 7,198 | #
# Cookbook Name:: mysql
# Recipe:: default
#
# Copyright 2008-2011, Opscode, 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
#
# Unle... | 27.473282 | 93 | 0.70339 |
08180ac3350d32b80b50632fb22354e1ed88fd13 | 996 | # frozen_string_literal: true
class AddValidRangeForLeaveTime < ActiveRecord::Migration[5.0]
def change
remove_column :leave_times, :year, :integer
add_column :leave_times, :effective_date, :date
add_column :leave_times, :expiration_date, :date
LeaveTime.all.each do |leave_time|
leave_time.upd... | 33.2 | 88 | 0.682731 |
61e78178b0f88134754af1cd90859ba528b697cb | 5,016 | class Libtensorflow < Formula
desc "C interface for Google's OS library for Machine Intelligence"
homepage "https://www.tensorflow.org/"
url "https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.6.2.tar.gz"
sha256 "e68c1d346fc3d529653530ca346b2c62f5b31bd4fcca7ffc9c65bb39ab2f6ed3"
license "Apache-2.0"... | 36.347826 | 112 | 0.689992 |
6152936158ec9a83fa939b42a30a9793aef0eed8 | 126 | class SilenceSidekiqLogging
def call(_worker, _job, _queue, &block)
ActiveRecord::Base.logger.silence(&block)
end
end
| 21 | 45 | 0.753968 |
bf580aaf98987631b4e154995872d512e64a1ed2 | 36,980 | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
puts "Creating sports"
football = Sport.create :title => "Football"
Sport.create :title => "Cricket", :uses_scores => ... | 46.109726 | 295 | 0.729989 |
e230338d188d57c13aa919c575477d3a88c2fa01 | 764 | class SessionsController < ApplicationController
def new
end
def create
user = User.find_by(email: params[:session][:email].downcase)
if user && user.authenticate(params[:session][:password])
if user.activated?
log_in user
params[:session][:remember_me] == '1' ? remember(... | 25.466667 | 78 | 0.617801 |
614c8ef637b758c92c72397f005dc911d0387608 | 4,592 | class OpensslAT11 < Formula
desc "Cryptography and SSL/TLS Toolkit"
homepage "https://openssl.org/"
url "https://www.openssl.org/source/openssl-1.1.1a.tar.gz"
mirror "https://dl.bintray.com/homebrew/mirror/openssl@1.1--1.1.1a.tar.gz"
mirror "https://www.mirrorservice.org/sites/ftp.openssl.org/source/openssl-1... | 35.053435 | 145 | 0.697517 |
e9b8e17cda786719aec83e1c604163e9b9a8c23f | 2,640 | # 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::EventGrid::V2018_01_01
module Models
#
# Schema of the Data property of an EventGridEvent for a
# Microsoft.Media.JobStateChange... | 30.697674 | 78 | 0.512121 |
bb6f1fea71f20e6ecea0ffcda0bedc7e80919f3c | 2,078 | class SiteController < ApplicationController
before_filter :authenticate_user!
def index
today = Time.zone.now
@dates = {
"Today" => today.strftime("%Y-%m-%d"),
"Tomorrow" => (today + (3600 * 24)).strftime("%Y-%m-%d"),
"Day After Tomorrow" => (today + (3600 * 24 * 2)).strftime("%Y-%m-%d"... | 26.303797 | 184 | 0.646776 |
2193a698272038d93de301ab4ea6431f14a2bb22 | 659 | # frozen_string_literal: true
class RemoveForeignKeysFromCiTestCaseFailures < ActiveRecord::Migration[6.1]
include Gitlab::Database::MigrationHelpers
TABLE_NAME = :ci_test_case_failures
disable_ddl_transaction!
def up
with_lock_retries do
remove_foreign_key_if_exists(TABLE_NAME, column: :build_id)... | 26.36 | 102 | 0.77997 |
ace7e0b14976430d875ac6b99fc7899b51f96f06 | 964 | require 'vertx-mail/mail_client'
# Start a local STMP server, remove this line if you want to use your own server.
# It just prints the sent message to the console
Java::IoVertxExampleMail::LocalSmtpServer.start(2528)
mailConfig = {
'hostname' => "localhost",
'port' => 2528
}
mailClient = VertxMail::MailClient.cre... | 26.777778 | 81 | 0.654564 |
035d035b37c53b6c989bd88779aec4d3574cae51 | 564 | class RolesController < ApplicationController
inherit_resources
def create
create! do |format|
format.html { redirect_to(roles_url) }
end
end
def update
update! do |format|
format.html { redirect_to(roles_url) }
end
end
def delete
delete! do |format|
format.html { re... | 15.243243 | 45 | 0.661348 |
e9ce629cd8d1ca5bcabf5da15d0a62c40dd7abdc | 296 | class NavicatForSqlite < Cask
url 'http://download.navicat.com/download/navicat110_sqlite_en.dmg'
homepage 'http://www.navicat.com/products/navicat-for-sqlite'
version '11.0.16'
sha256 '583ec1190deaf83a3c3e0d6e6199d80a9089d7b04f6241d88bf5b70871e7a5e6'
link 'Navicat for SQLite.app'
end
| 37 | 75 | 0.804054 |
28c5ec188dadb5cfc3eb698e195fbc63eea6bb40 | 93 | module Heroku; end
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/heroku')
require 'client'
| 15.5 | 54 | 0.741935 |
79997ebb74c7a1c835858b24e0285e51b0c3e5e0 | 151 | class AssociationBetweenDecksAndGames < ActiveRecord::Migration
def change
change_table :decks do |t|
t.belongs_to :game
end
end
end
| 18.875 | 63 | 0.728477 |
793a526d1678724cb02b49cc847bdce5e1f0b97c | 3,016 | require 'sequel_postgresql_triggers'
Sequel.migration do
up do
extension :pg_triggers
create_table(:packing_methods, ignore_index_errors: true) do
primary_key :id
String :packing_method_code, null: false
String :description
Decimal :actual_count_reduction_factor, null: false
Tru... | 37.234568 | 171 | 0.726127 |
e8d2ef2d7f07b1dd2ddd7926e8d3b815f94cf30c | 287 | shared_context 'JSON response' do
let(:json_response) { JSON.parse(response.body) }
end
RSpec.configure do |config|
config.include_context 'JSON response', type: :controller
config.include_context 'JSON response', type: :request
config.include_context 'JSON response', :api
end
| 28.7 | 59 | 0.766551 |
5d730c80245cb7171952cfd241aa3274349d2b26 | 781 | cask 'whatsapp' do
version '0.2.8082'
sha256 'ed3ed0b2c43e5bf0210b306e02e24876ac6b3b1b6375b66c7f6c996364517efd'
url "https://web.whatsapp.com/desktop/mac/files/release-#{version}.zip"
appcast 'https://web.whatsapp.com/desktop/mac/releases?platform=darwin&arch=x64',
checkpoint: '319878f0507aec8f162ee3... | 33.956522 | 88 | 0.679898 |
f7ef711f6dd47ba75ec512ba93c946f7866ea9fd | 1,807 | class Being
def initialize(specialty=nil)
@specialty=specialty
end
def to_s
"(object_id = #{object_id})\n"+"(#{self.class}):".ljust(12)+to_s4Being+(@specialty ? "\n"+" "*12+@specialty : "")
end
def to_s4Being
"I am a collection of cooperative molecules with a talent for self-preservation."
end
e... | 25.450704 | 117 | 0.715551 |
1a9d7aed6c3b6341e050cb64fd674f253269c08f | 365 | RSpec::Matchers.define :be_valid do
match do |actual|
actual.valid?
end
failure_message_for_should do |actual|
"expected that #{actual} would be valid (errors: #{actual.errors.full_messages.inspect})"
end
failure_message_for_should_not do |actual|
"expected that #{actual} would not be valid"
e... | 21.470588 | 93 | 0.715068 |
7a03b9d7ded70f59ec61f89440973ae1b7846822 | 6,368 | require 'roby/test/expect_execution'
module Roby
module Test
# Handlers for minitest-based tests
#
# They mainly "tune" the default minitest behaviour to match some of the
# Roby idioms as e.g. using pretty-print to format exception messages
module MinitestHelpers
... | 38.131737 | 118 | 0.433417 |
7911392ef19944f4c2510d92da57c6994389dd54 | 1,725 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe MergeRequests::BaseService do
include ProjectForksHelper
let_it_be(:project) { create(:project, :repository) }
let(:title) { 'Awesome merge_request' }
let(:params) do
{
title: title,
description: 'please fix',
source_br... | 28.278689 | 137 | 0.682319 |
383c50d3700adfb29c61c02bc955963e8cb028fc | 169 | module Varnish
LIBVARNISHAPI = [
'libvarnishapi.1', # Mac OS X
'libvarnishapi.so.1' # Debian / Ubuntu
]
end
require 'varnish/vsm'
require 'varnish/vsl'
| 16.9 | 43 | 0.656805 |
214a00d6b565b30661aa0a4f16d68e5dc06e1102 | 109 | require 'spec_helper'
module KeplerProcessor
describe IndexDupRemover do
pending "write it"
end
end
| 13.625 | 29 | 0.770642 |
334676103c4401a5b2b3e32a8ebcd6a4ab7c953b | 7,575 | # frozen_string_literal: true
require_relative '../command'
require 'httparty'
require 'csv'
require 'covid'
module Covid
module Commands
class Update < Covid::Command
COVID_CONFIRMED_PATH = "https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time... | 32.234043 | 175 | 0.555248 |
b91798b383c8d7ea5277cb837562d98fb5a9e497 | 193 | class Author
include Elastictastic::EmbeddedDocument
field :id, :type => 'integer'
field :name
field :email, :index => 'not_analyzed'
validates :name, :exclusion => %w(INVALID)
end
| 19.3 | 44 | 0.694301 |
ed77f1efdbddefff8aeb9b98dc6a8deca296a74a | 862 | require 'rails_helper'
describe 'articles/feedback_rss_feed.rss.builder', type: :view do
let!(:blog) { build_stubbed :blog }
describe 'with feedback consisting of one trackback and one comment' do
let(:article) { stub_full_article }
let(:trackback) { build(:trackback, article: article) }
let(:comment)... | 29.724138 | 86 | 0.691415 |
7abf430148eccd197528acb4d5b7eee543b84946 | 432 | #
# Cookbook:: Subread
# Recipe:: default
#
# Copyright:: 2019, Eagle Genomics Ltd, All Rights Reserved.
include_recipe 'tar'
tar_extract node['Subread']['url'] do
target_dir node['Subread']['install_path']
creates node['Subread']['dir']
end
magic_shell_environment 'PATH' do
filename 'star'
value "$PATH:#{no... | 19.636364 | 60 | 0.712963 |
ed6df4fb27db7e064380c8b90a24b4f184e2cd05 | 128 | class UntestedKlass
def initialize
raise 'This class is used for checking that untouched files are not tracked'
end
end
| 21.333333 | 80 | 0.773438 |
3310aaadd085af21733ba65fff11b1649514fc03 | 1,711 | class Platypus < Formula
desc "Create macOS applications from {Perl,Ruby,sh,Python} scripts"
homepage "https://sveinbjorn.org/platypus"
url "https://sveinbjorn.org/files/software/platypus/platypus5.3.src.zip"
sha256 "b5b707d4f664ab6f60eed545d49a7d38da7557ce8268cc4791886eee7b3ca571"
head "https://github.com/sv... | 33.54902 | 93 | 0.704267 |
1a79cd9228c0bf30bb9dd0b23614132240653ea7 | 10,177 | ##
# This code was generated by
# \ / _ _ _| _ _
# | (_)\/(_)(_|\/| |(/_ v1.0.0
# / /
#
# frozen_string_literal: true
require 'spec_helper.rb'
describe 'Member' do
it "can fetch" do
@holodeck.mock(Twilio::Response.new(500, ''))
expect {
@client.ip_messaging.v2.services('ISXXXXXX... | 39.599222 | 184 | 0.625626 |
1a25588d882cdcfb78e09d37e337041d2cea9032 | 263 | class VueDemoController < ApplicationController
layout 'vue_demo'
def bar
render vue: 'bar' # same as `render html: vue_entry('bar'), layout: true`
end
def baz
render html: vue_entry('foo') # same as `render vue: 'foo', layout: false`
end
end
| 21.916667 | 78 | 0.680608 |
26e871ae86d1be08c659bf74c7158d88d5386613 | 198 | # frozen_string_literal: true
class Fan
include Mongoid::Document
include Mongoid::Timestamps
field :name, type: String
has_and_belongs_to_many :teams
validates_presence_of(:name)
end
| 15.230769 | 32 | 0.777778 |
edd82099e92e0bd9863b0908685168cfcea3f5ab | 22,115 | # -*- coding: binary -*-
module Msf
module Serializer
# This class formats information in a plain-text format that
# is meant to be displayed on a console or some other non-GUI
# medium.
class ReadableText
#Default number of characters to wrap at.
DefaultColumnWrap = 70
#Default number of characters to indent.
... | 29.291391 | 127 | 0.594709 |
62ab9069d936baa0cd738effddefdc973dfd5f14 | 373 | module SpaceshipMissionSimulator
class ValidateEventData
include Interactor
def call
return true if correct_event_data?
msg = 'should provide proper event format ([state, gravity])'
context.fail! message: msg
end
private
def correct_event_data?
context.raw_data.is_a?(Ar... | 19.631579 | 67 | 0.689008 |
38627a1c39ec70c0b06f8eb245ba3d405fa80afd | 10,658 | # typed: false
require 'datadog/core/configuration/agent_settings_resolver'
require 'datadog/core/configuration/settings'
RSpec.describe Datadog::Core::Configuration::AgentSettingsResolver do
around { |example| ClimateControl.modify(default_environment.merge(environment)) { example.run } }
let(:default_environmen... | 29.441989 | 119 | 0.640739 |
18517b07ca97cd3450b6c6c158be5bf7a9f89879 | 13,360 | require 'spec_helper'
require 'pry'
describe ApplicationController do
describe "Homepage" do
it 'loads the homepage' do
get '/'
expect(last_response.status).to eq(200)
expect(last_response.body).to include("Welcome to Fwitter")
end
end
describe "Signup Page" do
it 'loads the sign... | 33.151365 | 122 | 0.591018 |
283f8c3b7648104dfea44941fbe77f3fab7a141c | 1,850 | # -*- encoding: utf-8 -*-
$:.push File.expand_path('../lib', __FILE__)
require 'casino/version'
Gem::Specification.new do |s|
s.name = 'casino'
s.version = CASino::VERSION
s.authors = ['Nils Caspar', 'Raffael Schmid', 'Samuel Sieg']
s.email = ['ncaspar@me.com', 'raffael@yux.ch', 'samuel.si... | 41.111111 | 83 | 0.662703 |
1af0792a33c3bc32b0ebf2ef6c909699930ff602 | 524 | actions :auto_attach
attribute :mount_point, :kind_of => String
attribute :disk_count, :kind_of => Integer
attribute :disk_size, :kind_of => Integer
attribute :level, :default => 10
attribute :filesystem, :default => "ext4"
attribute :filesystem_options, :default => "rw,noa... | 40.307692 | 73 | 0.637405 |
79c4e9be664545b4241177dfa30a1ab3faac981d | 2,120 | module ApiStub
module Models
module DNS
# Mock class for Record Set
class RecordSet
def self.create_record_set_obj(dns_client)
record_set = '{
"id" : "/subscriptions/########-####-####-####-############/resourceGroups/fog-test-rg/providers/Microsoft.Network/dnszones/fog-t... | 36.551724 | 177 | 0.477358 |
bf2dca53278eeb4a99d9965b390748d8506feee7 | 272 | require 'test_helper'
class CityTest < ActiveSupport::TestCase
should validate_presence_of(:name)
should validate_uniqueness_of(:name).scoped_to(:country_id)
should_not validate_uniqueness_of(:name)
should belong_to(:country)
should have_many(:athletes)
end
| 20.923077 | 61 | 0.797794 |
18d4ae3ac96df8fde06d01d54aaa1bc72e59f26f | 1,654 | class TeamMembersController < ProjectResourceController
# Authorize
before_filter :authorize_read_project!
before_filter :authorize_admin_project!, except: [:index, :show]
def index
@teams = UserTeam.scoped
end
def show
@user_project_relation = project.users_projects.find_by_user_id(member)
@e... | 25.446154 | 75 | 0.732164 |
d536d21df1036aa3c15fa6ae8c2c040de90a6bcd | 213 | # frozen_string_literal: true
# config/routes.rb
Rails.application.routes.draw do
devise_for :users
get 'favorites/update'
resources :comics
get 'comics', to: 'comics#index'
root to: 'comics#index'
end
| 19.363636 | 34 | 0.737089 |
b9e12f2e8b7b6470d13dd97551b55c44a17152cc | 1,102 | require "language/node"
class GatsbyCli < Formula
desc "Gatsby command-line interface"
homepage "https://www.gatsbyjs.org/docs/gatsby-cli/"
url "https://registry.npmjs.org/gatsby-cli/-/gatsby-cli-2.12.49.tgz"
sha256 "5cc34948df99e3bf81fcfdd59c8b74ee181855923ff70db718f773c4cd0a89ad"
bottle do
sha256 "265... | 36.733333 | 103 | 0.767695 |
268ada5074b40abe2334e5967d605a64d259fb09 | 218 | require "#{Rails.root}/lib/scraper/recipes_scraper.rb"
namespace :scrape do
task :category, ['category_id'] => :environment do |task, args|
CategoryScraper.scrape_category(args['category_id'])
end
end
| 27.25 | 67 | 0.711009 |
87b33ab9e7beb7d37e057ef0a90d7762986c81ee | 173 | class CreatePredictionModels < ActiveRecord::Migration[5.1]
def change
create_table :prediction_models do |t|
t.binary :dump_data, null: false
end
end
end
| 21.625 | 59 | 0.722543 |
e975a1f5a95fc50e9055dd2c6effddc010420d06 | 1,966 | require 'test_helper'
class UsersLoginTest < ActionDispatch::IntegrationTest
def setup
@user = users(:michael)
end
test "login with invalid information" do
get login_path
assert_template 'sessions/new'
post login_path, params: { session: { email: "", password: "" } }
assert_template 'sessio... | 28.085714 | 69 | 0.673449 |
d53675fa95b770ee15613b47973cc21085959e17 | 326 | module VCAP::CloudController
module InternalApi
def configure(config)
@config = config
end
module_function :configure
def credentials
[
@config.get(:internal_api, :auth_user),
@config.get(:internal_api, :auth_password),
]
end
module_function :credentials
en... | 19.176471 | 51 | 0.650307 |
e9420ef99115ca4dcc325340ba95bdb0ae688a7b | 25,604 | require "helper"
require "inspec/resource"
require "inspec/resources/service"
require "hashie"
describe "Inspec::Resources::Service" do
let(:runlevels) { { 0 => false, 1 => false, 2 => true, 3 => true, 4 => true, 5 => true, 6 => false } }
# windows
it "verify service parsing" do
resource = MockLoader.new(:w... | 44.919298 | 245 | 0.702546 |
e93e4e0a54c3c10c5b36a1acfa61695c41a9fcb5 | 479 | class ChangeUserDataValueType < ActiveRecord::Migration[5.0]
def up
change_column :user_data, :value, :jsonb, using: 'value::jsonb'
execute <<-SQL.gsub(/\s+/, ' ')
UPDATE user_data
SET value = jsonb_build_object(
'kind',
'effort',
'totalPoint',
value
)
W... | 23.95 | 67 | 0.605428 |
abac18fc83cb0c5bcf5023b128e4de1984753157 | 14,361 | # 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... | 37.692913 | 191 | 0.716036 |
5d247b927a819a00906abcc5107730e9f2564071 | 3,749 | # frozen_string_literal: true
require 'rails_helper'
require_relative '../support/iam_session_helper'
require_relative '../support/matchers/json_schema_matcher'
RSpec.describe 'maintenance windows', type: :request do
include JsonSchemaMatchers
describe 'GET /v0/maintenance_windows' do
context 'when no mainten... | 34.081818 | 110 | 0.55108 |
03ad4a3ee34bc6a2ebc41a64fd16839fda8ac1af | 4,367 | #!/usr/bin/env ruby
# Encoding: utf-8
#
# Copyright 2018 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 ... | 32.834586 | 81 | 0.711472 |
e2080a5323702a9cfed41a458ebf79bac6d6148c | 189 | require 'helper'
class TestOmgtex < MiniTest::Unit::TestCase
def test_something_for_real
flunk "hey buddy, you should probably rename this file and start testing for real"
end
end
| 23.625 | 86 | 0.772487 |
1d88333125d44ab1cbcdfa68ae6cea2066f6d43f | 144 | # frozen_string_literal: true
FactoryBot.define do
factory :cart do
account
factory :cart_with_user do
user
end
end
end
| 12 | 30 | 0.6875 |
030e896eb243dabaae6627fd10f9807e9a857a3c | 8,987 | # encoding: utf-8
require "logstash/filters/base"
require "logstash/namespace"
require "tempfile"
require "lru_redux"
# The GeoIP filter adds information about the geographical location of IP addresses,
# based on data from the Maxmind database.
#
# Starting with version 1.3.0 of Logstash, a `[geoip][location]` field ... | 40.665158 | 168 | 0.703906 |
ed9ed7acc4420688c20fc8b681dcec7a870c543a | 740 | require 'spec_helper_acceptance'
describe 'chrony class:' do
context 'default parameters' do
# Using puppet_apply as a helper
it 'runs successfully' do
pp = "class { 'chrony': }"
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
expect(apply_manifest(pp,... | 25.517241 | 75 | 0.608108 |
f8ffc5b154f4fa7c1ec4ce220a0d621172016b92 | 2,374 | # -*- encoding: utf-8 -*-
# stub: awesome_print 1.8.0 ruby lib
Gem::Specification.new do |s|
s.name = "awesome_print".freeze
s.version = "1.8.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Micha... | 45.653846 | 160 | 0.662595 |
e29844fe99211848c510564aad9abac85eaad9ff | 238 | # encoding: utf-8
begin
require 'active_record'
puts "active_record gem found, running ActiveRecord specs \e[32m#{'✔'}\e[0m"
rescue LoadError
puts "active_record gem not found, not running ActiveRecord specs \e[31m#{'✖'}\e[0m"
end
| 26.444444 | 86 | 0.726891 |
6a24035dae24173ee2202d53232c0dd15f40c7f0 | 1,059 | class HerokuToolbelt < Formula
desc "Everything you need to get started with Heroku"
homepage "https://toolbelt.heroku.com/other"
url "https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client-3.41.4.tgz"
sha256 "47f43d7292128234d1412005cc751a45218219e60a1b99081086dc33f682cf5a"
head "https://gith... | 34.16129 | 147 | 0.723324 |
f747eb0345429f0c2c07bbdb7f4809445690e14a | 422 | ActiveAdmin.register HtmlPage do
# See permitted parameters documentation:
# https://github.com/activeadmin/activeadmin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters
#
# permit_params :list, :of, :attributes, :on, :model
#
# or
#
# permit_params do
# permitted = [:permitted, :attributes]
#... | 26.375 | 118 | 0.734597 |
5d1a79a17e701c91be574acf2f16f711993f3c25 | 1,250 | class Kind < Formula
desc "Run local Kubernetes cluster in Docker"
homepage "https://kind.sigs.k8s.io/"
url "https://github.com/kubernetes-sigs/kind/archive/v0.6.0.tar.gz"
sha256 "966b5c9817850f958acf14496349276a8df6d6609adfdc41633a8b7bc73d5e5d"
head "https://github.com/kubernetes-sigs/kind.git"
bottle do
... | 34.722222 | 93 | 0.7464 |
79aa0aab3953cd23ae8a08f3cbd662aa6e77d092 | 585 | class CacheSectionArticlesCount < ActiveRecord::Migration
class AssignedSection < ActiveRecord::Base
belongs_to :section
end
class Section < ActiveRecord::Base; end
def self.up
add_column "sections", "articles_count", :integer, :default => 0
say_with_time "Update Section articles_count values..." do... | 30.789474 | 84 | 0.700855 |
08fae7f4a7d4941bd371a1919de30fee5cec8712 | 1,448 | # ISO <<Abstract>> ProcessStep
# 19115-2 writer output in XML
# History:
# Stan Smith 2019-09-25 original script.
require_relative 'class_liProcessStep'
require_relative 'class_leProcessStep'
module ADIWG
module Mdtranslator
module Writers
module Iso19115_2
class ProcessStep
... | 27.846154 | 77 | 0.54558 |
91192706e081e3148d4522131eefa42ab6c545f4 | 538 | class Sshpass < Formula
homepage "https://sourceforge.net/projects/sshpass/"
url "https://sourceforge.net/projects/sshpass/files/sshpass/1.09/sshpass-1.09.tar.gz"
sha256 "71746e5e057ffe9b00b44ac40453bf47091930cba96bbea8dc48717dedc49fb7"
def install
system "./configure", "--disable-debug",
... | 29.888889 | 87 | 0.622677 |
abcf9831ec6b80bc05e22ae56da5262c2ed23a0f | 1,537 | require 'fog/core/model'
module Fog
module AWS
class Compute
class Image < Fog::Model
identity :id, :aliases => 'imageId'
attribute :architecture
attribute :block_device_mapping, :aliases => 'blockDeviceMapping'
attribute :description
attribut... | 34.931818 | 118 | 0.56799 |
e234e9bcaa565915c999a5e55a7a301c81f30729 | 673 | module Stripe
class Subscription < APIResource
include Stripe::APIOperations::Update
include Stripe::APIOperations::Delete
def url
"#{Customer.url}/#{CGI.escape(customer)}/subscriptions/#{CGI.escape(id)}"
end
def self.retrieve(id, opts=nil)
raise NotImplementedError.new("Subscription... | 25.884615 | 176 | 0.695394 |
edbfae711339cdc8c0d1368755bb736b30ee1389 | 2,615 | require_relative 'utils/formatting'
require_relative 'utils/position'
module PDEX
class NPPESPractitioner
include Formatting
include Position
attr_reader :raw_data
def initialize(raw_data)
@raw_data = raw_data.freeze
end
def npi
@npi ||= raw_data['NPI']
end
def name
... | 26.683673 | 99 | 0.639388 |
d5d0a82890a97206d5b44257f8e2e774c3ec645b | 9,496 | ##
# This code was generated by
# \ / _ _ _| _ _
# | (_)\/(_)(_|\/| |(/_ v1.0.0
# / /
#
# frozen_string_literal: true
require 'spec_helper.rb'
describe 'Service' do
it "can fetch" do
@holodeck.mock(Twilio::Response.new(500, ''))
expect {
@client.ip_messaging.v1.services('ISXXXXX... | 31.759197 | 94 | 0.572662 |
b9cb3bc93cfd5784b4238c68d81cd05788bbd1c6 | 1,664 | # frozen_string_literal: true
module Mutant
class Mutator
class Node
class Block < self
handle(:block)
children :send, :arguments, :body
private
# Emit mutations
#
# @return [undefined]
def dispatch
emit_singletons
emit(send) unl... | 22.186667 | 72 | 0.554688 |
6a29e26a741fdbbdfabe390941a6e37bfbac0439 | 977 | class AccountsController < ApplicationController
before_action :authenticate_account!
before_action :set_account, only: [:profile]
def index
following_ids = Follower.where(follower_id: current_account.id).map(&:following_id)
following_ids << current_account.id
@posts = Post.includes(:account).where(... | 25.710526 | 87 | 0.731832 |
39413bb977225fe6fff2ff130935e7197a4baf34 | 1,086 | 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.941176 | 82 | 0.779926 |
6198b705415815c377e5d4d84cdf984c872971bf | 737 | cask 'webstorm-eap' do
version '144.2925.4'
sha256 'fa100e8b91553484df066839b27a9b8740448557bcc155f6829db8d5e5c3d8fb'
url "https://download.jetbrains.com/webstorm/WebStorm-EAP-#{version}.dmg"
name 'WebStorm'
homepage 'https://confluence.jetbrains.com/display/WI/WebStorm+EAP'
license :commercial
app 'Web... | 33.5 | 75 | 0.647218 |
4aade15cc7e4d7d05c45e135c82e523d28b5cea4 | 556 | class PurchasedOrderMonitor < ApplicationMonitor
self.report_class = Spree::OrderReport
def relation
Spree::Order.complete
end
def groupers
%i[completed_at]
end
def aggregators
%i[total]
end
def dimensions
{
completed_at: { min: period.min, max: period.max }
}
end
def ... | 13.238095 | 80 | 0.638489 |
91a4b1acb8486146960259ed6a06df2be1373869 | 10,041 | #
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# Homebrew doesn't support specifying anything more recent than 'nehalem',
# but nehalem is 19x slower than sandybrdige ... | 35.480565 | 125 | 0.710387 |
08198242bf56619368c583a9e2f524ac6b7f75fe | 869 | class Azcopy < Formula
desc "Azure Storage data transfer utility"
homepage "https://github.com/Azure/azure-storage-azcopy"
url "https://github.com/Azure/azure-storage-azcopy/archive/10.3.4.tar.gz"
sha256 "3a0a1450889af252ef251ae5bc86a145f3f77922d316947d7a90088fd1427619"
bottle do
cellar :any_skip_relocat... | 36.208333 | 154 | 0.783659 |
1d22acd7b9b736631f46291e09df9ac13cdf4e88 | 1,183 | class Txr < Formula
desc "Original, new programming language for convenient data munging"
homepage "https://www.nongnu.org/txr/"
url "http://www.kylheku.com/cgit/txr/snapshot/txr-265.tar.bz2"
sha256 "5dac8fa64350efe5abd3e9f618db2fcfeee1718db329cfd27b29bd61f113605d"
license "BSD-2-Clause"
livecheck do
u... | 33.8 | 106 | 0.723584 |
e2da89c90ef2107eb447eaec6021ebc78c82757d | 3,170 | # 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... | 45.942029 | 142 | 0.65142 |
915bb409b3a409f357f435a056bc093df6abf9f6 | 1,209 | # frozen_string_literal: true
module SolidusSubscriptions
module ChurnBuster
class Client
BASE_API_URL = 'https://api.churnbuster.io/v1'
attr_reader :account_id, :api_key
def initialize(account_id:, api_key:)
@account_id = account_id
@api_key = api_key
end
def rep... | 24.673469 | 93 | 0.629446 |
5da20c2bf72a658b181dd4a35bc2c3b62d524a90 | 54,792 | #--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++
require 'rubygems/version'
require 'rubygems/requirement'
require 'rubygems/platform'
require "rubygems/deprecate"
# :stopdoc:
class Date; end # for ruby_code if date.rb wasn't requi... | 25.615708 | 131 | 0.636115 |
edfe6a255f13667be8e0db48879c0e7ada8e225c | 3,839 | module Cms::NodeFilter::ListView
extend ActiveSupport::Concern
include Cms::NodeFilter::View
include Cms::PublicFilter::Node
included do
before_action :accept_cors_request, only: [:rss]
before_action :prepend_current_view_path, only: [:generate]
helper Cms::ListHelper
end
private
def prepen... | 27.421429 | 118 | 0.660589 |
62a3325a642ada8e75a4bbefe6bee548d3701cf1 | 2,208 | require 'digest'
module Locomotive
module PageContentHelper
def sections_content(model, sections, definitions)
source = model.respond_to?(:title) ? :page : :site
content = model.sections_content || {}
(sections[:top] + sections[:bottom]).each do |attributes|
next if attributes[:sourc... | 28.675325 | 101 | 0.558877 |
f7b3e2449bf93cf7b3a7692863c1b277cdf6b59d | 4,869 |
require 'json'
require 'chef/azure/heartbeat'
require 'chef/azure/status'
require 'chef/config'
module ChefAzure
module Shared
def find_highest_extension_version(extension_root)
#Get the latest version extension root. Required in case of extension update
highest_version_extension = ""
... | 33.8125 | 157 | 0.61984 |
4a73658e02043e14ec299e105b65b725341e110b | 1,106 | require 'spec_helper'
describe 'ssh_authorized_keys' do
context 'supported operating systems' do
['Debian', 'RedHat'].each do |osfamily|
describe "ssh_authorized_keys class without any parameters on #{osfamily}" do
let(:params) {{ }}
let(:facts) {{
:osfamily => osfamily,
}... | 32.529412 | 117 | 0.658228 |
2899e8881cfc50321f5d2def7a12dd045a688ade | 317 | #
# Cookbook Name:: basehttploadbalancer
# Attributes:: default
#
# Copyright 2016, ONS
#
# All rights reserved - Do Not Redistribute
#
default['basehttploadbalancer']['balancing_method'] = 'least_conn'
default['basehttploadbalancer']['cluster_name'] = ''
default['basehttploadbalancer']['origin_servers'] = []
| 26.416667 | 66 | 0.731861 |
91d7b22dcb41acb19eee051d1aa90a08ad63d1cd | 3,715 | # frozen_string_literal: true
describe API::V2::CoinMarketCap::Orderbook, type: :request do
describe 'GET /api/v2/coinmarketcap/orderbook/:market_pair' do
before do
create_list(:order_bid, 5, :btcusd)
create_list(:order_bid, 5, :btcusd, price: 2)
create_list(:order_ask, 5, :btcusd)
create... | 37.525253 | 97 | 0.60646 |
08a742787d82154341ee92fcead3ea4131f0658f | 1,117 | require 'spec_helper'
describe TaxonConcept do
context "Caretta caretta CMS" do
include_context "Caretta caretta CMS"
context "LISTING" do
describe :cms_listing do
context "for family Cheloniidae" do
specify { @family.cms_listing.should == 'I/II' }
end
context "for sp... | 25.386364 | 59 | 0.600716 |
4acd622362930c890e95d5a75f7858c0c04752bf | 132 | json.array!(@comments) do |comment|
json.extract! comment, :id, :user_id, :com
json.url comment_url(comment, format: :json)
end
| 26.4 | 46 | 0.712121 |
5d5e0edd4a51e1fac2ea85997306986a0c91d1ed | 2,042 | # 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::Network::Mgmt::V2018_07_01
module Models
#
# Response for ListRoutesTable associated with the Express Route Circuits
# API.
... | 29.171429 | 83 | 0.529383 |
1da8aa546f1081db484de1543168071ae9c2053f | 2,402 | require 'spec_helper'
module Gamification
describe RewardsController do
routes { Gamification::Engine.routes }
describe "POST 'create'" do
context 'with an invalid checksum' do
let(:article) { create :article }
let(:subject) { create :user }
before do
create :gamific... | 27.609195 | 103 | 0.574521 |
39d70cf9416b6ee62bd10f7aac3c551becf44510 | 258 | class CreateAlcscores < ActiveRecord::Migration[5.1]
def change
create_table :alcscores do |t|
t.integer :code
t.integer :maleco
t.integer :femaleco
t.references :alcohol, foreign_key: true
t.timestamps
end
end
end
| 19.846154 | 52 | 0.662791 |
18a165e39a9889c5b2d1920410268da14892b01a | 414 | # frozen_string_literal: true
# Environment update contract
class Environment::UpdateContract < Dry::Validation::Contract
params do
required(:id).filled(:str?)
required(:environment).schema do
optional(:description).filled(:str?)
optional(:cookbook_versions).each(:hash?)
optional(:override_... | 27.6 | 61 | 0.714976 |
1ab77917b138079281b3a380062efe0947c79d40 | 2,608 | # encoding: utf-8
module QyWechatApi
module Api
class User < Base
# 创建成员
# userid 是 员工UserID。对应管理端的帐号,企业内必须唯一。长度为1~64个字符
# name 是 成员名称。长度为1~64个字符
# department 否 成员所属部门id列表。注意,每个部门的直属员工上限为1000个
# position 否 职位信息。长度为0~64个字符
# mobile 否 手机号码。企业内必须唯一,mobile/weixinid/email三者不能... | 26.886598 | 67 | 0.610813 |
f75443740de1b2d3c580c794d2a6ed1519a3bb03 | 5,995 | # frozen_string_literal: true
require 'test_helper'
class RssFeedTest < ActiveSupport::TestCase
before { Feedjira.logger.stubs(:warn) }
it 'should validate RSS feed' do
rss_feed = build(:rss_feed, url: 'invalid_url')
rss_feed.wont_be :valid?
rss_feed.errors.messages[:url].first.must_equal 'Invalid UR... | 38.429487 | 115 | 0.698249 |
7a09e0e10483ff2f31d650a16f3f36ec73cfb092 | 12,192 | # Copyright (c) 2014 National ICT Australia Limited (NICTA).
# This software may be used and distributed solely under the terms of the MIT license (License).
# You should find a copy of the License in LICENSE.TXT or at http://opensource.org/licenses/MIT.
# By downloading or using this software you accept the terms and ... | 34.055866 | 117 | 0.582677 |
1107c85fa04f0dfbcf414dfa95454ee02d5d97b5 | 911 | require 'rails_helper'
RSpec.describe 'Studio', type: :model do
it 'gets created with valid params' do
expect do
Studio.create(city: 'Seattle', address: 'Studio1')
end.to change(Studio.all, :count).by(1)
end
it 'gets not created with blank city input' do
expect do
Studio.create(city: '',... | 26.794118 | 56 | 0.652031 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.