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 |
|---|---|---|---|---|---|
ed6ad94ede28ac5b48876fc224aa648636def829 | 3,791 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 41.206522 | 102 | 0.757848 |
39d26698667203f4ce1809ac551cf6b74d2c5e1f | 947 | # frozen_string_literal: true
module Git
module Cop
module Styles
class CommitBodyLineLength < Abstract
def self.defaults
{
enabled: true,
severity: :error,
length: 72
}
end
def valid?
commit.body_lines.all? { |line|... | 20.148936 | 86 | 0.517423 |
7a3a7ecf4b264e80ef6f7fcb0aac3379e7b375f6 | 137 | module Types
class EmailType < Types::BaseObject
field :email, String, null: true
field :purpose, String, null: true
end
end
| 19.571429 | 38 | 0.70073 |
b97323af0881d066abc0348ac21ec98936ec091f | 1,154 | require_relative '../spec_helper'
require 'json'
module JSONSpecs
class MyClass
def initialize(foo)
@foo = foo
end
def self.json_create(hash)
new(*hash['args'])
end
def to_json(*args)
{ 'json_class' => self.class.name, 'args' => [ @foo ] }.to_json(*args)
end
end
end
gua... | 26.227273 | 94 | 0.641248 |
034346beb5581c60192126aed2900473502e64e3 | 201 | File.open("../DigitalSynthVRA8N/constants.h", "r") do |input|
File.open("./constants.rb", "w") do |output|
input.each_line do |line|
output.puts line.chomp[16..-2]
end
end
end
| 25.125 | 62 | 0.606965 |
b9d58dc78a2c8ce2d4c0cfa76270381479d4ec52 | 1,211 | class Terragrunt < Formula
desc "Thin wrapper for Terraform e.g. for locking state."
homepage "https://github.com/gruntwork-io/terragrunt"
url "https://github.com/gruntwork-io/terragrunt/archive/v0.11.1.tar.gz"
sha256 "997276ea4c42d541b570f72a3e69bf2e889382b54f9c1cf38b337ec9ec0553f5"
head "https://github.com/... | 37.84375 | 92 | 0.748968 |
ed272d4776a3a585cb65cd15bf570c163db18417 | 1,059 | module TomatoShrieker
class EntryTest < TestCase
def setup
@entries = Entry.dataset.all.select(&:feed)
end
test '1レコード以上のエントリが存在するか' do
assert_predicate(@entries, :present?)
end
def test_feed
assert_kind_of(FeedSource, @entries.sample.feed) if @entries.present?
end
def... | 25.214286 | 75 | 0.670444 |
26786e961e8b770163c344d264ef40adfee4f6f9 | 7,635 | =begin
#Xero Files API
#These endpoints are specific to Xero Files API
Contact: api@xero.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.1
=end
require 'time'
require 'date'
module XeroRuby::Files
require 'bigdecimal'
class Folder
# The name of the folder
attr_accessor ... | 29.708171 | 201 | 0.61074 |
01bfae44a985b7474e03e9a1bf624b2fbfec5bcb | 3,942 | # -----------------------------------------------------------------------------
#
# Projtected geographic feature classes
#
# -----------------------------------------------------------------------------
module RGeo
module Geographic
class ProjectedPointImpl # :nodoc:
include Feature::Point
inc... | 23.60479 | 105 | 0.724252 |
f7fd1aa7039bb9b352f9cf2ec11c320c932ececf | 316 | module UsersHelper
# Returns the Gravatar for the given user.
def gravatar_for(user, size: 80)
gravatar_id = Digest::MD5::hexdigest(user.email.downcase)
gravatar_url = "https://secure.gravatar.com/avatar/#{gravatar_id}?=#{size}"
image_tag(gravatar_url, alt: user.name, class: "gravatar")
end
end
| 35.111111 | 79 | 0.718354 |
39524c9ffadeb206cd9252b0ab77df1b9231bd1c | 1,240 | #
# Copyright 2015, SUSE Linux GmbH
#
# 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 wr... | 22.142857 | 74 | 0.626613 |
ff5c32da6c53861141995942bd62b5cfaa6d09e0 | 729 | cask 'deco' do
version '0.7.1'
sha256 'cd9d9b553d9fcb706bacba94cbbf7ec80a77609f5505d485b2ebad7c16a8ffba'
# github.com/decosoftware/deco-ide/ was verified as official when first introduced to the cask
url "https://github.com/decosoftware/deco-ide/releases/download/v#{version}/Deco-#{version}.pkg"
appcast 'htt... | 34.714286 | 98 | 0.705075 |
e271fa8aee1b37843edf119304ce5414f1010dde | 12,178 | require 'spec_helper'
require 'support/release_helper'
module Bosh::Director
describe ReleaseJob do
describe 'update' do
subject(:release_job) { described_class.new(job_meta, release_model, release_dir, double(:logger).as_null_object) }
let(:release_dir) { Dir.mktmpdir }
after { FileUtils.rm_rf... | 40.729097 | 167 | 0.602151 |
b9db5267245018373dbda3b09848bb06f79ef8eb | 14,654 | # frozen_string_literal: true
require 'spec_helper'
require 'assets'
describe 'Assets' do
before(:all) { @subject = Assets.new }
subject { @subject }
def render(**needs)
subject.html('assets/app/app.rb', **needs)
end
describe '#html' do
it 'renders logged out' do
expect(render).to include('... | 37.192893 | 111 | 0.563873 |
086a5e76a93fe2cd49a4efde8e0ec8f543d40399 | 443 | class String
def underscore
self.gsub(/::/, '/').
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
gsub(/([a-z\d])([A-Z])/,'\1_\2').
tr("-", "_").
downcase
end
end
r = IO.read("TwitterUser.swift").split("\n").map do |line|
next line unless line.match(/^\s*let /)
# bits = line.split("_")
# [bits[0]] ... | 23.315789 | 58 | 0.523702 |
08ee60517d28bb0b2452e09e954080f76045268a | 308 | class CurrentRoundsController < ApplicationController
respond_to :json
# GET /current_rounds
# GET /current_rounds.json
def index
render json: {
current_round: Round.current_round,
current_round_deadline: Round.deadline,
current_round_status: Round.round_status
}
end
end
| 23.692308 | 53 | 0.74026 |
ff8f39a7892bd064faa50741eac34465ceea38ab | 280 | class AddDetailsToUser < ActiveRecord::Migration[5.2]
def change
add_column :users, :first_name, :string
add_column :users, :last_name, :string
add_column :users, :location, :string
add_column :users, :phone, :string
add_column :users, :bio, :text
end
end
| 28 | 53 | 0.703571 |
4a22534fa4c1e06a496e5fdf80abf75c5c121d73 | 555 | class AddIdToRights < ActiveRecord::Migration
def self.up
drop_table "user_projects"
create_table "user_projects", :force => true do |t|
t.integer "project_id", :limit => 11
t.integer "user_id", :limit => 11
t.boolean "project_admin"
end
end
def self.down
drop_tabl... | 27.75 | 70 | 0.607207 |
4a7105e40940c12316a4cc7065c0da2800517969 | 391 | #!/usr/bin/env ruby
file_path = File.expand_path("../day-05-input.txt", __FILE__)
input = File.read(file_path)
loop do
prev_length = input.length
input.gsub!(/([A-z])\1+/i) do |match|
chr = match[0]
pattern = chr.downcase + chr.upcase
match
.gsub(pattern, "")
.gsub(pattern.reverse, "... | 18.619048 | 61 | 0.634271 |
b9419887b57cf5cc4ec32753fb0798d10899e92f | 25,898 | # rtags regression test file (originally by David Powers as part of cfruby)
module Cfruby
module FileOps
# Class variable to control the behavior of FileOps.backup globally
@@backup = true
# Base class for all FileOperation specific exceptions
class FileOpsError < Cfruby::CfrubyError
end
# Raised... | 31.277778 | 137 | 0.657155 |
912e61168e0fd399ba6dab9c012569b16620dd18 | 12,513 | require 'spec_helper'
describe AnswersController do
describe "PATCH #accept" do
before { login_user }
context 'when not Question author' do
let(:question) { create(:question) }
let(:answer) { create(:answer, question: question) }
before { patch :accept, question_id: question, id: answer }... | 30.519512 | 95 | 0.607049 |
4a6a279caf3933fc2b3099a6738c7a89d2780ad1 | 265 | module ValidModelHashes
def valid_user_hash
{ :login => String.random(10),
:email => "#{String.random}@example.com",
:password => "sekret",
:password_confirmation => "sekret"
}
end
end
| 24.090909 | 64 | 0.501887 |
4a64800fda6218f75adee082d7a32e6e96a19484 | 11,583 | =begin
#SendinBlue API
#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/or... | 32.628169 | 839 | 0.623845 |
38983c23896f3b6b9a68be7a796fb2b87b23c85f | 137 | class AddUniqueToDeviceIdInFinders < ActiveRecord::Migration[5.0]
def change
add_index :finders, :device_id, unique: true
end
end
| 22.833333 | 65 | 0.773723 |
ed694f7591164a8a48704fffc4bcc765d09ca17f | 29 | require 'mws/reports/client'
| 14.5 | 28 | 0.793103 |
7aad03e3d1e71cb92a19f8fd483cdee5f6df50d5 | 14,997 | # -*- coding: binary -*-
require 'rex/post/meterpreter/packet_response_waiter'
require 'rex/logging'
require 'rex/exceptions'
module Rex
module Post
module Meterpreter
###
#
# Exception thrown when a request fails.
#
###
class RequestError < ArgumentError
def initialize(method, einfo, ecode=nil)
... | 26.637655 | 164 | 0.596186 |
e913a036f752a16c11194537abc6dce68346c4f8 | 5,804 | # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... | 37.205128 | 367 | 0.685734 |
399526a660f989217b9b31d872304daa5c2d1ebc | 225 | class Game < ActiveRecord::Base
belongs_to :category
self.primary_key = "sku"
validates :name, presence: true
validates :english_description, presence: true
validates :portuguese_description, presence: true
end
| 25 | 52 | 0.764444 |
ed62a600ab78ba9b3bd5963b12569ceccaf7b4b8 | 925 | Pod::Spec.new do |s|
s.name = 'CSS3ColorsSwift'
s.version = '1.1.5'
s.summary = 'A UIColor extension for Web Color.'
s.description = <<-DESC
CSS3ColorsSwift provides a UIColor extension with Web Color names.
DESC
s.homepage ... | 48.684211 | 107 | 0.593514 |
d506a765c90b6d0bc9601bc8bf43713935408bc4 | 1,836 | describe MiqDecorator do
context ".for" do
it "returns nil when a class doesn't have a decorator" do
class TestClassWithout1
end
expect(MiqDecorator.for(TestClassWithout1)).to eq(nil)
end
it "correctly decorates a class when a decorator exists" do
class TestClass2
end
... | 22.390244 | 95 | 0.654684 |
392c41120f6c19c4680a8237847f482e018348fc | 826 | # frozen_string_literal: true
module EE
module Gitlab
module Ci
module Parsers
extend ActiveSupport::Concern
class_methods do
def parsers
super.merge({
license_management: ::Gitlab::Ci::Parsers::LicenseCompliance::LicenseScanning,
licen... | 31.769231 | 94 | 0.59201 |
18d2fa8437a08816b489a7335f25a99afdfac42c | 529 | # A user who is assigned to a task
class TaskOwner < ActiveRecord::Base
belongs_to :user
belongs_to :task#, :touch => true
named_scope :unread, :conditions => { :unread => true }
# touch currently calls validations, which fail when creating from email, so update manually
# see https://rails.lighthouseapp.c... | 27.842105 | 110 | 0.746692 |
1a62349cfc24376d283c765aaec932fa8c992229 | 405 | require 'talltorp_foodie'
describe TalltorpFoodie::Foodie do
it "broccoli is gross" do
expect(TalltorpFoodie::Foodie.portray("Broccoli")).to eql("Gross!")
end
it "anything else is delicious" do
expect(TalltorpFoodie::Foodie.portray("Not Broccoli")).to eql("Delicious!")
end
it "pluralizes a word" do... | 27 | 79 | 0.723457 |
e9e855ebb2b2bfea79c380a6ffae0f9b1f9f9cd8 | 433 | #!/home/software/ruby-1.8.7/bin/ruby -w
require 'rvg/rvg'
rvg = Magick::RVG.new(200, 100) do |canvas|
canvas.background_fill = 'white'
canvas.rect(150, 50, 25, 25).round(6).
styles(:fill=>'none', :stroke=>'purple', :stroke_width=>10, :stroke_dasharray=>[10,5])
ca... | 33.307692 | 106 | 0.591224 |
61c2a09ced1ee8458599b48f640730843e1765c7 | 1,834 | require_relative "lib/shopify_cli/version"
Gem::Specification.new do |spec|
spec.name = "shopify-cli"
spec.version = ShopifyCLI::VERSION
spec.authors = ["Shopify"]
spec.email = ["dev-tools-education@shopify.com"]
spec.license = "MIT"
spec.summary = "Shopify CLI helps you build Shopify apps faster."
spec... | 39.869565 | 98 | 0.696838 |
28b0bd1d2db35545c3c0ae44407337521f967278 | 5,692 | # $Id: misc.rb 14 2008-03-02 05:42:30Z warchild $
#
# Copyright (c) 2008, Jon Hart
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copy... | 34.083832 | 101 | 0.601195 |
617b490fecd2253c74071cfb03225e5f26190ce6 | 70 | # -*- encoding : utf-8 -*-
module TntMercurio
VERSION = "1.0.0"
end
| 14 | 26 | 0.6 |
f7d92195112ab863459f18348aca476beb59ea13 | 3,909 | # 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 `rails
#... | 38.70297 | 126 | 0.718086 |
5d731191a884273b0b6bfbe3af81809d5598866c | 1,046 |
module NeverBounce; module API; module Request
describe JobsDelete do
include_dir_context __dir__
it_behaves_like "instantiatable"
describe ".response_klass" do
it { expect(described_class.response_klass).to eq Response::JobsDelete }
end
describe "#to_httparty" do
it "generally wor... | 32.6875 | 97 | 0.638623 |
79711b9910f57053f6b76a1010a6fd0c60fc5275 | 200 | require 'rails_helper'
RSpec.describe "events", type: :routing do
it "routes /upcoming to events#index" do
expect(get: "/upcoming").to route_to(controller: "events", action: "index")
end
end
| 25 | 79 | 0.71 |
33f3e6bec1b4ce411581f5d434d71f37b3a3679f | 664 | module Mulukhiya
class LineService < Ginseng::LineService
include Package
def initialize(params = {})
super rescue nil
@id = params[:id] || LineService.id
@token = (params[:token].decrypt rescue params[:token]) || LineService.token
end
def self.id
return config['/alert/line/t... | 22.133333 | 82 | 0.64759 |
5da295254d86de46499526b193984e3e113b24bb | 1,787 | 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_mailbox/engine"
require "action_text/en... | 35.74 | 84 | 0.752658 |
21b07440eb711a233e99911451576f40abce0886 | 98 | class DropClassmarks < ActiveRecord::Migration
def change
drop_table :classmarks
end
end
| 14 | 46 | 0.765306 |
33318c62642068665fc8871f1b74ac797d5bfa59 | 150 | class AddHasTodoToProject < ActiveRecord::Migration
def change
add_column :projects, :has_todo, :boolean, null: false, default: false
end
end
| 25 | 74 | 0.76 |
38a19314c22b0812759cdce0bd9ab751d7694a7b | 1,560 | module Intrigue
module Task
class ImportAwsIpv4Ranges < BaseTask
include Intrigue::Task::Web
def self.metadata
{
:name => "import/aws_ipv4_ranges",
:pretty_name => "Import AWS IPv4 Ranges",
:authors => ["jcran"],
:description => "This gathers the ranges from AWS.",
:references =>... | 26.440678 | 108 | 0.562821 |
6a13aa81cc4d85b14991143c31c35edd4bec9140 | 260 | module MiniMagick
##
# @return [Gem::Version]
#
def self.version
Gem::Version.new VERSION::STRING
end
module VERSION
MAJOR = 4
MINOR = 0
TINY = 2
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
end
end
| 14.444444 | 56 | 0.580769 |
915ba9735f5b5977afde0718a28dd4ff7e35c577 | 1,390 | # frozen_string_literal: true
class DeviseCreateUsers < ActiveRecord::Migration[6.0]
def change
create_table :users do |t|
## Database authenticatable
t.string :email, null: false, default: ''
t.string :encrypted_password, null: false, default: ''
## Recoverable
t.stri... | 31.590909 | 104 | 0.656115 |
b9fe12a53bc4d826dbffcccc0c38a765ce03e2ad | 3,112 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 40.415584 | 102 | 0.754499 |
877584dc02724c537d9fa8bdd3750fdd5bf49a58 | 2,549 | # frozen_string_literal: true
module DiscourseChat
module Provider
module ZulipProvider
PROVIDER_NAME = "zulip".freeze
PROVIDER_ENABLED_SETTING = :chat_integration_zulip_enabled
CHANNEL_PARAMETERS = [
{ key: "stream", unique: true, regex: '^\S+' },
... | 36.942029 | 200 | 0.58572 |
b92e18e394aa2b8164adca59f1aaa55a90f0906a | 1,148 | # frozen_string_literal: true
# desc "Explaining what the task does"
# task :covid_research do
# # Task goes here
# end
desc 'Rebuild encrypted-form.json when valid-intake-submission.json changes'
task rebuild_encrypted_fixture: :environment do
fixture_dir = CovidResearch::Engine.root.join('spec', 'fixtures', 'fi... | 37.032258 | 92 | 0.761324 |
f89014b314842c7d28afa5323a8978045477f42a | 1,011 | # wkhtml2pdf Ruby interface
# http://code.google.com/p/wkhtmltopdf/
require 'logger'
require 'digest/md5'
require 'open3'
class WickedPdf
def initialize(wkhtmltopdf_binary_path = nil)
@exe_path = wkhtmltopdf_binary_path
@exe_path ||= WICKED_PDF[:exe_path] unless WICKED_PDF.empty?
@exe_path ||= `which w... | 33.7 | 92 | 0.703264 |
bf7272556244eb750d9025685faa11ac89defa8d | 1,606 | class Pygobject3 < Formula
desc "GNOME Python bindings (based on GObject Introspection)"
homepage "https://wiki.gnome.org/Projects/PyGObject"
url "https://download.gnome.org/sources/pygobject/3.34/pygobject-3.34.0.tar.xz"
sha256 "87e2c9aa785f352ef111dcc5f63df9b85cf6e05e52ff04f803ffbebdacf5271a"
bottle do
... | 34.170213 | 94 | 0.697385 |
382afc775e89f2079384410adf7405fbd2289b4e | 1,004 | # encoding: utf-8
module SamlIdp
class IdpController < ActionController::Base
include SamlIdp::Controller
protect_from_forgery
if Rails.version.to_i < 4
before_filter :validate_saml_request
else
before_action :validate_saml_request
end
def new
render :template => "saml_idp... | 22.818182 | 72 | 0.639442 |
1c758ff7a971dcd2e63ea7b0231dee3721661bdd | 2,678 | require "spec_helper"
describe "AdminOperations" do
let(:admin) { rdkafka_config.producer }
describe "#create_topic and #delete_topic" do
context "when topic does not exist" do
before do
# Remove admin_new_topic if it already exists first
begin
admin.delete_topic("admin_new_top... | 33.061728 | 148 | 0.660194 |
183d3275367252ac3af5d5f16c4fa4a7fcb59779 | 2,569 | module Entrepot
#
# This module should not exist, in essence.
# As of moment of writing (April 2012), Virtus does not support circular dependencies for
# models, neither it supports an ability to lazily define or define a dependency via
# string or symbol. So either you pre-define a class (you remember good ... | 27.623656 | 102 | 0.60218 |
28fa98fdce75c0285afe2ef0c19873c9cd5ad67a | 1,094 | Pod::Spec.new do |s|
# pod lib lint --allow-warnings --verbose --skip-import-validation
s.name = "MXLogger"
s.version = "0.1.3.1"
s.summary = "MXLogger 客户端夸平台日志收集"
s.description = <<-DESC
MXLogger 客户端夸平台日志收集
DESC
s.homepage = "https://github.com... | 29.567568 | 105 | 0.597806 |
ff142976d8cb3e9eff217b8ab9b858d4df228f5b | 1,169 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'liquid/c/version'
Gem::Specification.new do |spec|
spec.name = "liquid-c"
spec.version = Liquid::C::VERSION
spec.authors = ["Justin Li", "Dylan Thacker-Smith"]
spec.e... | 40.310345 | 108 | 0.67408 |
ffcac86a3efe97b2f3e96c4d5b8e212b619f0a6f | 3,718 | # encoding: UTF-8
#
# Author:: Xabier de Zuazo (<xabier@zuazo.org>)
# Copyright:: Copyright (c) 2014 Onddo Labs, SL.
# 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 t... | 26.942029 | 79 | 0.656805 |
9145b57847947aa6c8151368a89270d64d4c74eb | 222 | require 'fog/core/collection'
require 'fog/libvirt/models/compute/nic'
module Fog
module Libvirt
class Compute
class Nics < Fog::Collection
model Fog::Libvirt::Compute::Nic
end
end
end
end
| 17.076923 | 40 | 0.675676 |
28172c5d868c2a8d16abe6727349902a38a0ac5d | 107 | # frozen_string_literal: true
module SolidusAdmin
class DashboardsController < BaseController
end
end
| 15.285714 | 45 | 0.82243 |
7a2b69561efd9083702969feb7f64ec8db094cc9 | 40,306 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = NormalRanking
include Msf::Exploit::Remote::HttpServer::HTML
include Msf::Exploit::RopDb
def initialize(info={})
s... | 33.283237 | 189 | 0.547909 |
1ad8b4e50cf65f362bf329f155b812f2408a5d2a | 563 | # frozen_string_literal: true
class StatementPresenter < SimpleDelegator
include Rails.application.routes.url_helpers
def self.wrap(statements)
statements.map { |statement| new(statement) }
end
def download_path
facility_account_statement_path(facility, account, id, format: :pdf)
end
def order_... | 18.766667 | 72 | 0.746004 |
91bd9726b79be38d7ed6d6d004090cf3cdfdb3a9 | 1,001 | # encoding: UTF-8
# frozen_string_literal: true
Bundler.require
Test::Unit::TestCase.test_order = :random
require "active_support/inflections"
require "active_support/core_ext/kernel/reporting"
require "securerandom"
require "openssl"
require "base64"
require "set"
ActiveSupport::Inflector.inflections do |inflect|
... | 19.627451 | 92 | 0.753247 |
1aab1358e9cb3426fa7b290ada5e7993ccc2a329 | 6,911 | require "language/node"
class Emscripten < Formula
desc "LLVM bytecode to JavaScript compiler"
homepage "https://emscripten.org/"
url "https://github.com/emscripten-core/emscripten/archive/2.0.32.tar.gz"
sha256 "c0ba34094ddf69ab7f24164c657a816d7256142a58f5e93aa74987d25945287b"
license all_of: [
"Apache-2... | 36.957219 | 123 | 0.67313 |
9184945d3188eacdfe8c548d16b21622e5cc91e8 | 1,301 | # -*- encoding: utf-8 -*-
require File.expand_path('../lib/rollbar/version', __FILE__)
Gem::Specification.new do |gem|
_is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby')
gem.authors = ['Rollbar, Inc.']
gem.email = ['support@rollbar.com']
gem.description =... | 43.366667 | 103 | 0.657187 |
283201ba95d6dfea6ad46e352836847c86a53ff0 | 6,729 | require 'spec_helper'
describe 'datadog_agent::integrations::elasticsearch' do
ALL_SUPPORTED_AGENTS.each do |agent_major_version|
context 'supported agents' do
let(:pre_condition) { "class {'::datadog_agent': agent_major_version => #{agent_major_version}}" }
conf_file = if agent_major_version == 5
... | 55.61157 | 114 | 0.575568 |
acf46839e32bcb5a06f86f4e42e4c43b35222f18 | 2,588 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require
require "help_tips"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
... | 43.133333 | 100 | 0.732998 |
ab7affca9052a4ad8b2b25a15b10a8066d21c747 | 14,876 | #encoding: utf-8
require 'spec_helper'
describe 'CLI' do
before do
`rm -rf #{folder}`
end
after do
`rm -rf #{folder}`
end
def folder
"/tmp/parallel_tests_tests"
end
def write(file, content)
path = "#{folder}/#{file}"
ensure_folder File.dirname(path)
File.open(path, 'w'){|f| f.... | 37.660759 | 225 | 0.627857 |
4a78b890ec7dc4d233bc80a45dc7646106220835 | 85 | require_relative "../support/job_buffer"
class ApplicationJob < ActiveJob::Base
end
| 17 | 40 | 0.8 |
010bc2f51de28424a71936471f611967d2a47ae1 | 1,019 | module Hippo_eyeDoc::TransactionSets
module HIPAA_276
class L2000B < Hippo_eyeDoc::TransactionSets::Base
loop_name 'L2000B' #Information Receiver Level
#Information Receiver Level
segment Hippo_eyeDoc::Segments::HL,
:name => 'Information Receiver Level',
... | 30.878788 | 64 | 0.42787 |
012762200dbfb477e44d1ff7b0bfb87a25b65f8c | 2,638 | class User < ApplicationRecord
include SimpleDiscussion::ForumUser
# Include default devise modules. Others available are:
# and :omniauthable
devise :invitable, :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable,
:confirmable, :lockable, :timeoutable, :tracka... | 20.936508 | 97 | 0.651251 |
91d620a91221baa7a39dac85eddb7e762077e083 | 87 | num = 987_298
if num.even?
puts 'Число четное'
else
puts 'Число нечетное'
end
| 10.875 | 25 | 0.666667 |
877a095f72780fa1eee41fae2452990c52c50c51 | 21,240 | # frozen-string-literal: true
module Sequel
module Plugins
# The many_through_many plugin allow you to create an association using multiple join tables.
# For example, assume the following associations:
#
# Artist.many_to_many :albums
# Album.many_to_many :tags
#
# The many_through_... | 48.493151 | 354 | 0.611535 |
03ce19708f67c72b0c0fb000b2ce15be7983e4a1 | 9,324 | #
# Copyright:: Copyright (c) Chef Software Inc.
# 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://www.apache.org/licenses/LICENSE-2.0
#
#... | 36.564706 | 180 | 0.605749 |
1a48057d6850b3167bd5e513f811a44b5b446a8f | 590 | cask 'gns3' do
# note: "3" is not a version number, but an intrinsic part of the product name
version '2.0.0'
sha256 'a1ca4e436cd2486e740dc6bf32804e20ba2356955975e6907b288e84540ce377'
# github.com/GNS3/gns3-gui was verified as official when first introduced to the cask
url "https://github.com/GNS3/gns3-gui/r... | 39.333333 | 90 | 0.754237 |
1a8e1e27485212dac5b2b1b37caaa6d0b23ec25d | 1,749 | class UsersController < ApplicationController
before_action :logged_in_user, only: [:index, :edit, :update, :destroy, :following, :followers]
before_action :correct_user, only: [:edit, :update]
before_action :admin_user, only: :destroy
def new
@user = User.new
end
def index
@users = User.pa... | 23.013158 | 97 | 0.632933 |
28de754be2ef638e81c4d0b5c263f91a6c556b89 | 262 | require_dependency "remedy/application_controller"
module Remedy
class FaqsController < ApplicationController
def index
end
def show
end
def edit
end
def create
end
def update
end
def destroy
end
end
end
| 10.916667 | 50 | 0.656489 |
79776f0d47496e9d2757f0d10943859ada3b9452 | 4,838 | require 'rails_helper'
describe LockboxPartners::SupportRequestsController do
let(:authorized_lockbox_partner) { create(:lockbox_partner, :active) }
let(:unauthorized_lockbox_partner) { create(:lockbox_partner, :active) }
let(:support_request) do
req = create(:support_request, :pending, lockbox_partner: aut... | 28.127907 | 103 | 0.657296 |
abb1c3749155cf22049abb5906369d9d0419c3c1 | 1,050 | # 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... | 29.166667 | 63 | 0.747619 |
3974a5cb2e4c5c6174a1aac34f41681089df4ab6 | 1,683 | # frozen_string_literal: true
require_relative 'question'
require_relative 'symbols'
module TTY
class Prompt
# A prompt responsible for multi line user input
#
# @api private
class Multiline < Question
HELP = '(Press CTRL-D or CTRL-Z to finish)'.freeze
def initialize(prompt, **options)
... | 23.375 | 76 | 0.556744 |
1844357c54013d8ba73debccd38ac1a0ea5c21b1 | 1,138 | namespace :amr_importer do
desc "Validate readings"
task :validate_amr_readings_by_school_group_name, [:school_group_name] => :environment do |_t, args|
puts DateTime.now.utc
total_amr_readings_before = AmrValidatedReading.count
puts "Total AMR Readings before: #{total_amr_readings_before}"
school_... | 47.416667 | 132 | 0.769772 |
ab4cc2fc11f1b8dff4448cd036470d1a211c6d72 | 259 | # == Schema Information
#
# Table name: teams
#
# id :integer not null, primary key
# name :string(32)
# leader_id :integer
#
class Legacy::Team < Legacy::Base
self.table_name = 'teams'
default_scope -> { order('name ASC') }
end
| 17.266667 | 52 | 0.606178 |
33d9657d33d5d9ecce809cee27db88d9c7900693 | 4,150 | require File.join(File.dirname(__FILE__), 'test_helper')
class DatetimeTest < Test::Unit::TestCase
context "A class which has included Pacecar" do
setup do
@class = User
end
context "for each date and datetime column" do
[:created_at, :rejected_at, :updated_at, :last_posted_on, :approved_at]... | 46.629213 | 117 | 0.579518 |
9153515b9032ef65c6e757b681dc09404d763d5f | 1,859 | # frozen_string_literal: true
haproxy_install 'package'
haproxy_config_global ''
haproxy_config_defaults '' do
hash_type 'consistent'
end
haproxy_listen 'admin' do
bind '0.0.0.0:1337'
mode 'http'
stats uri: '/',
realm: 'Haproxy-Statistics',
auth: 'user:pwd'
http_request [
'add-header X-... | 23.531646 | 60 | 0.669715 |
ab3d3dc5925cc85fe304754394ac682d632db312 | 1,030 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core/handler/reverse_tcp'
require 'msf/core/payload/windows/reverse_tcp'
module MetasploitModule
CachedSize = 314
include Msf::Payload::Stager
include Msf::Pay... | 23.409091 | 72 | 0.634951 |
216452ae20e12c2a7afeeebf5fad2298e9e8d814 | 5,534 | module NetSuite
module Records
class NonInventorySaleItem
include Support::Fields
include Support::RecordRefs
include Support::Records
include Support::Actions
include Namespaces::ListAcct
actions :get, :get_deleted, :get_list, :add, :delete, :search, :update, :upsert
f... | 33.337349 | 90 | 0.559812 |
ffbfce8a74ed07d845d84a756ac702f37d55b901 | 370 | module HealthSeven::V2_6
class Icd < ::HealthSeven::DataType
# Certification Patient Type
attribute :certification_patient_type, Is, position: "ICD.1"
# Certification Required
attribute :certification_required, Id, position: "ICD.2", require: true
# Date/Time Certification Required
attribute :date_time_cert... | 37 | 73 | 0.781081 |
037734f1b13064ded88b2dc2746ec44a415aad35 | 1,773 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::GitalyClient::BlobService do
let(:project) { create(:project, :repository) }
let(:storage_name) { project.repository_storage }
let(:relative_path) { project.disk_path + '.git' }
let(:repository) { project.repository }
let(:client) { ... | 29.065574 | 82 | 0.669487 |
87c3483a852c4027e00da5b8aef9733e8fd254ba | 2,194 | require "bigdecimal"
module FedexSMS
# TransactionField instances provide an interface to marshal/unmarshal individual fields of a
# FedEx Ship Manager Server transaction. Instances should be constructed with the specifications
# of the fields as defined in the FedEx Ship Manager Server Transaction and Coding Re... | 33.753846 | 98 | 0.680036 |
621ded682e0762fdd93e4df95fd6c700ca20e406 | 725 | # frozen_string_literal: true
Gem::Specification.new do |spec|
spec.name = "devportal"
spec.version = "0.1.06"
spec.authors = ["fraser milne"]
spec.email = ["fraser.milne@mimik.com"]
spec.summary = "theme for mimikgit.github.io/devportal"
spec.homepage = "https://gi... | 34.52381 | 132 | 0.642759 |
f7a09878f24a6d64d968b01a78bef7d2203e888e | 1,358 | #
#
# 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... | 27.714286 | 74 | 0.691458 |
2198f92ebd5142a9d3d6ac8de371bdcb27b4c6a5 | 1,058 | #!/usr/bin/ruby -w
# PART 13
# The shuffle method rearranges all the items of the array.
# Say you have a deck of cards. You shuffle them randomly.
# Note that there's always one possibility of not getting the
# deck shuffled at all!
# That said, [1, 2].shuffle can return either [2, 1] or [1, 2] itself!
[1, 2].shuffle... | 55.684211 | 110 | 0.385633 |
e987ff699cd4402d55f7d1948a3cb9d2690bbfd3 | 553 | require 'rails_helper'
RSpec.describe Bike, type: :model do
let(:user) {FactoryBot.create(:user)}
let(:bike) {FactoryBot.create(:bike, :user => user)}
it 'user after Factory valid with valid attributes' do
expect(user).to be_valid
end
it 'bike after Factory valid with valid attributes' do
expect(b... | 22.12 | 56 | 0.670886 |
019042e9cf0d5eab0f58631d402f5b60535c9c86 | 1,748 | class Pygtk < Formula
desc "GTK+ bindings for Python"
homepage "http://www.pygtk.org/"
url "https://download.gnome.org/sources/pygtk/2.24/pygtk-2.24.0.tar.bz2"
sha256 "cd1c1ea265bd63ff669e92a2d3c2a88eb26bcd9e5363e0f82c896e649f206912"
revision 1
bottle do
cellar :any
rebuild 2
sha256 "89f5d67621... | 39.727273 | 150 | 0.731693 |
627b09c3e377fa22f31cf5fe49cecaa720754291 | 1,050 | require 'boxzooka/inbound_request_item'
module Boxzooka
# Inbound data set is used to send notifications to our system of product inventory
# that you’re sending to Boxzooka.
# In practice, you must hit a CatalogRequest for all of the items listed here before the Inbound
# will be accepted.
class InboundReq... | 27.631579 | 98 | 0.719048 |
ffe389ef0eb339f7bb03593f33c0ab71b16f2a99 | 872 | # PLEASE DO NOT EDIT THIS CODE
# This code was generated using the UMPLE 1.31.1.5860.78bb27cc6 modeling language!
# NOTE: Ruby generator is experimental and is missing some features available in
# in other Umple generated languages like Java or PHP
module CruiseAttributesTest
require 'date'
require 'time'
class Const... | 18.166667 | 82 | 0.533257 |
e9d3dbe9db3e3e6c7b87a48218165186bf5eb420 | 1,993 | require 'rails_helper'
# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to test the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold
# ... | 38.326923 | 102 | 0.680381 |
f81ad0011ac4f15d0eb3243992550d68367ac0af | 351 | # Delineate the directory for SASS/SCSS files
sass_path = File.dirname(__FILE__);
# Delineate the CSS dir
css_path = File.join(sass_path, '..', 'css')
# Delineate the images dir
images_dir = File.join(sass_path, '..', 'img')
# Load the Sencha Touch framework
load File.join(sass_path, '..', 'css')
output_style = :compr... | 31.909091 | 46 | 0.729345 |
b919c01ce73ec6bc9d4a61f1b5caae646655c866 | 427 | class MiqRetireRequest < MiqRequest
# subclasses must set this
SOURCE_CLASS_NAME = nil
validates :request_state, :inclusion => { :in => %w(pending finished) + ACTIVE_STATES, :message => "should be pending, #{ACTIVE_STATES.join(", ")} or finished" }
validate :must_have_user
default_value_for(:source_id) {... | 30.5 | 163 | 0.725995 |
399209e8fe688d54aedd49fdff1a870dcda5cc6f | 112 | FactoryBot.define do
factory :user do
email { 'random@test.se' }
password { 'my-password' }
end
end
| 16 | 30 | 0.642857 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.