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
910a99a1aebb43d3d365952b6235cd90e4a1b845
1,999
# frozen_string_literal: true # 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 "Lice...
38.442308
115
0.687344
1a3674c0478307823dba8e3475257020531aba05
5,178
module Twitter class Client # Defines methods related to direct messages module DirectMessages # Returns the 20 most recent direct messages sent to the authenticating user # # @see https://dev.twitter.com/docs/api/1/get/direct_messages # @rate_limited Yes # @requires_authenticati...
58.179775
165
0.690614
bb7efc3275f7d5e50126ca60860e993f52322c07
996
cask "cocoapods" do version "1.5.2" sha256 "03aa37afb129d6ae515d3b9ee7a81c30ba91050131e2dfbb3683bdd2f05ac67a" # github.com/CocoaPods/CocoaPods-app/ was verified as official when first introduced to the cask url "https://github.com/CocoaPods/CocoaPods-app/releases/download/#{version}/CocoaPods.app-#{version}.ta...
38.307692
116
0.726908
915082176f5b13326509224048e0a1f8534bfca0
671
# DRUNKWATER TEMPLATE(add description and prototypes) # Question Title and Description on leetcode.com # Function Declaration and Function Prototypes on leetcode.com #53. Maximum Subarray #Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its...
35.315789
137
0.746647
2176844058b0ab9f2b6a81f20f4c073fac2a4a48
1,776
{ matrix_id: '2851', name: 'analytics', group: 'Precima', description: 'Precima/analytics: data analytics problem', author: 'C. Ugaz', editor: 'T. Davis', date: '2018', kind: 'data analytics problem', problem_2D_or_3D: '0', num_rows: '303813', num_cols: '303813', nonzeros...
42.285714
83
0.5625
2120870f11aa40613db9e90a76875338dffcf173
377
# === COPYRIGHT: # Copyright (c) North Carolina State University # Developed with funding for the National eXtension Initiative. # === LICENSE: # # see LICENSE file class CreateGroupNode < ActiveRecord::Base self.establish_connection :create self.table_name= 'field_data_group_audience' def created_at Tim...
22.176471
64
0.763926
21c2006a1f896dacaeaf7838470a20b944ee5ae3
2,714
# frozen_string_literal: true require 'yle_tf/action/verify_terraform_version' require 'yle_tf/config' require 'yle_tf/error' describe YleTf::Action::VerifyTerraformVersion do subject(:action) { described_class.new(app) } let(:app) { double('app', call: nil) } describe '#call' do before do stub_cons...
25.603774
92
0.56227
91a1ff3244ab38911eeafb0adfdb36c490cbab24
3,299
# -*- encoding: utf-8 -*- # stub: net-ldap 0.16.2 ruby lib Gem::Specification.new do |s| s.name = "net-ldap".freeze s.version = "0.16.2" s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version= s.require_paths = ["lib".freeze] s.authors = ["Francis Cianf...
67.326531
747
0.70385
91b5cc198e9e4b8cc8ec24027175014923e73680
209
FactoryBot.define do factory :product do title { Faker::Book.title } price { Faker::Number.decimal(l_digits: 2) } available_on { Faker::Date.between(from: 2.days.ago, to: Date.today) } end end
26.125
74
0.679426
ffffc7bbbd75ee001cc64ad5e4a687c733b83a0c
69
require "manageiq/content/engine" require "manageiq/content/version"
23
34
0.826087
01bf6ec81213ad0b5426c155a441d37697dcdb78
2,461
require 'test_helper' class AssayTypeReaderTest < ActiveSupport::TestCase test 'initialise' do reader = Seek::Ontologies::AssayTypeReader.instance refute_nil reader refute_nil reader.ontology assert reader.ontology.count > 500, 'should be over 500 statements' end test 'class hierarchy' do re...
38.453125
143
0.759447
61bf7384c6511c80442f1813256e9183bff94368
2,545
class Fontforge < Formula desc "Command-line outline and bitmap font editor/converter" homepage "https://fontforge.github.io" url "https://github.com/fontforge/fontforge/releases/download/20220308/fontforge-20220308.tar.xz" sha256 "01e4017f7a0ccecf436c74b8e1f6b374fc04a5283c1d68967996782e15618e59" license "GPL...
31.036585
149
0.709627
212b1b5c4e5e37bb0c7125c5293195fe2f331688
3,198
namespace :ds_tools do @ssh_user = ENV['SSH_USER'] || "root" @ssh_port = ENV['PORT'] || "22" @user = ENV['USERNAME'] || "admin" @group = ENV['GROUP'] || @user desc "Runs several initial server preparation tasks for Moonshine. Creates #{@user.capitalize} user as sudo. Changes root password." task :prepa...
25.380952
134
0.645091
18a8482a9d4e75ea17754f96d65d75ba1a2db423
144
require 'test_helper' class AttrFormatter::Test < ActiveSupport::TestCase test "truth" do assert_kind_of Module, AttrFormatter end end
18
51
0.770833
33c91f07474d492106f8558ae4f3800709d5dd4f
1,134
require './lib/jiraSOAP/version' Gem::Specification.new do |s| s.name = 'jiraSOAP' s.version = JIRA::VERSION s.summary = 'A Ruby client for the JIRA SOAP API' s.description = 'Written to run fast and work on Ruby 1.9 as well as MacRuby' s.authors = ['Mark Rada'] s.email = ['markrada26@gma...
35.4375
79
0.560847
6a8523cccd462b4c114c98c906c520e35b62708f
2,501
#!/usr/bin/ruby ####################################################################################################################### require 'yaml' require 'deep_merge' require 'pp' ###################################################################################################################### hiera_yaml_file ...
39.078125
119
0.455418
edbab507841e5e62bdc399ae064133ee6914b27b
1,602
# 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 #...
40.05
86
0.738452
0888af05e943177356325c1660dba9c429ea4538
2,476
# # Author:: Jimmy McCrory (<jimmy.mccrory@gmail.com>) # Copyright:: Copyright (c) 2014 Jimmy McCrory # 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 #...
30.567901
96
0.66357
f85069e712e05f1c12292d378cdf38e6be757405
2,234
# # Author:: Tim Hinderliter (<tim@opscode.com>) # Copyright:: Copyright (c) 2011 Opscode, 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 # # ...
26.595238
110
0.723814
e29e76d3e1a2fb04583cf202a38439459bd43441
74
# frozen_string_literal: true module Rabbit module Receiving end end
10.571429
29
0.783784
bb112b957f355aa759913fd0bce088cd81618e10
25,568
# frozen_string_literal: true require_relative 'meta' require_relative 'map' require_relative 'entities' require_relative '../base' require_relative '../company_price_up_to_face' module Engine module Game module G1840 class Game < Game::Base include_meta(G1840::Meta) include Map in...
31.722084
116
0.524171
1ce96c2c38c0698c38fe2f4c8d88946e9d76a985
14,851
require 'simple-spreadsheet-extractor' class DataFilesController < ApplicationController layout :get_layout include IndexPager include SysMODB::SpreadsheetExtractor include MimeTypesHelper include DotGenerator include Seek::AssetsCommon before_filter :find_assets, :only => [ :index ] before_filt...
34.377315
231
0.653963
e274d94047792a0db3c476593beb0e200449b4e6
4,316
# frozen_string_literal:true module SheepAst # TBD module Helper def patch_process(datastore) datastore.value(:_sheep_patch_file_HL)&.each do |file, pfile| return if datastore.find(:_sheep_patched_file_HL, file) res = '' process = false File.open(file) do |f| re...
25.844311
92
0.56835
8748d7863ede02cebba9b5a6ebd539df5a29142f
4,866
# encoding: utf-8 namespace :l10n do # flattens the yaml hash into 1 dimensional hash def flatten(hash, namespace=nil) flattened = {} namespace = namespace + '.' if namespace hash.each do |key, value| if value.class == Hash flattened.merge!(flatten(value, "#{namespace}#{key}")) els...
37.72093
371
0.660707
61ed2823883e17c13680a7d5771e1c0fdecc0b02
972
class BooksController < ApplicationController def index @books = Book.all end def list render :json => Book.all end def search render :json => Book.where('title like "%' + params[:keyword] + '%"') end def pending render :json => Book.where('status = "' + params[:status] + '"') end d...
24.3
100
0.631687
4a88f76fd0b12be1a7cd5c4b381a2a280d6e4d7a
3,443
# encoding: utf-8 # This file is distributed under Ting Yun's license terms. require File.expand_path(File.join(File.dirname(__FILE__),'..','test_helper')) require 'ting_yun/logger/startup_logger' require 'ting_yun/agent' require 'ting_yun/agent/agent' module TingYun class AgentTest < Minitest::Test include ...
31.87963
107
0.688644
ffa4882c457414a807448a910abbb6660be91a67
220
class CreateFriendships < ActiveRecord::Migration[6.0] def change create_table :friendships do |t| t.integer :user_id t.integer :friend_id t.boolean :confirm t.timestamps end end end
18.333333
54
0.668182
e8589140e20bd93f485990ad32d91d1294777a2d
87
require 'rails_helper' RSpec.describe SubscribersController, type: :controller do end
17.4
58
0.827586
ff03e0f7d8ca8c72889754172acf5053781ff766
10,536
# == Schema Information # # Table name: people # # id :string(22) not null, primary key # uuid :binary(16) not null # community_id :integer not null # created_at :datetime # updated_at ...
39.022222
110
0.584377
ac730202b866104fa451dc29864b1aecaad87491
7,609
# # Author:: Adam Jacob (<adam@chef.io>) # Copyright:: Copyright 2008-2016, 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 # # ...
40.908602
203
0.620975
d59b0a0aa3bdb185d907a1965ca7c505a238555e
3,513
module Locomotive module Render extend ActiveSupport::Concern module InstanceMethods protected def render_locomotive_page if request.fullpath =~ /^\/admin\// render :template => "/admin/errors/404", :layout => '/admin/layouts/box', :status => :not_found else ...
30.547826
138
0.574153
6111941a2e7a44315036ae81087eec351cd5cfeb
157
module Shortener::ActiveRecordExtension def has_shortened_urls has_many :shortened_urls, class_name: "::Shortener::ShortenedUrl", as: :owner end end
26.166667
81
0.783439
28eee56555c6d51039e7db2b2580574f5d403f33
5,560
require File.dirname(__FILE__) + '/spec_helper' describe Merb::Config do before do Merb::Config.setup end it "should be able to yield the configuration via #use" do res = nil Merb::Config.use {|c| res = c} res.should == Merb::Config.defaults end it "should be able to get a configuration key...
30.382514
95
0.646763
bb315f4e6036723e7137859b8f445d1849ccebf5
831
require 'tty-file' require 'pathname' class Templater attr_reader :templates def initialize() @templates = [] end def add_empty_directories(project_name) tree ={ "#{project_name}" => [ "01-discover" => [], "02-content" => [], ...
18.065217
74
0.535499
03593be8d7743b5b35ba74b14b4b3f433eb5b825
124
comment_regexp = /^\s*#/ p comment_regexp.match(" # Pure comment!") p comment_regexp.match(" x = 1 # Code plus comment!")
31
54
0.669355
e2b867aeee087c14ed7ae3e0845457c3213e26bd
1,315
=begin #Topological Inventory Ingress API #Topological Inventory Ingress API The version of the OpenAPI document: 0.0.2 Contact: support@redhat.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.2.1 =end require 'spec_helper' require 'json' require 'date' # Unit tests for TopologicalInve...
27.395833
104
0.765779
1c2cec40b3610edcfc38e1b0ac5949303390d1e6
180
$: << File.dirname(__FILE__) require 'helper' class TestLoading < Test::Unit::TestCase #def setup #end #def teardown #end def test_loading require 'wbem' end end
12.857143
40
0.672222
26a1f93a458f288a24588bea02e08fb737ddaa16
1,844
require 'thor' require 'user_config' module Recluse module CLI ## # Whitelist related commands. class Whitelist < Thor #:nodoc: all desc 'add profile pattern1 [pattern2] ...', 'add glob patterns to whitelist' def add(name, *patterns) uconf = UserConfig.new '.recluse' unless uc...
30.733333
89
0.561822
ff156c535bcd7a1ac986eb3779e1a585d39b67e5
1,451
module SimpleFormExtension module Inputs class DateTimeInput < SimpleForm::Inputs::DateTimeInput include SimpleFormExtension::Translations delegate :content_tag, to: :template def input(wrapper_options = nil) input_html_options[:class] << "form-control" input_html_options[:data...
29.612245
100
0.612681
61de318c88b116706fac13a422b09ba66f4cf030
301
# frozen_string_literal: true FactoryBot.define do factory :va526ez, class: 'SavedClaim::DisabilityCompensation::Form526AllClaim' do form { JSON.parse( File.read('spec/support/disability_compensation_form/all_claims_fe_submission.json') )['form526'].to_json } end end
25.083333
92
0.727575
339eb41ebb033c51f850229ace3ab4ee8102411d
2,027
# frozen_string_literal: true # == Schema Information # Schema version: 20110604174521 # # Table name: sources # # id :integer not null, primary key # title :string(255) # url :string(255) # imported_at :datetime # created_at :datetime # updated_at :datetime # # == Source # # A ...
24.719512
85
0.662062
4a014d6d425a1949abc24d930d690ab6c97ad868
713
require_relative "boot" require "rails/all" # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module TwittterRedesign class Application < Rails::Application # Initialize configuration defaults for originally generate...
31
79
0.740533
01b6f1c655abc68a671db6324df3228aaae9df97
441
# frozen_string_literal: true class CategoryGroupPolicy < ApplicationPolicy class Scope < Scope def resolve scope.where(user: user) end end def show? owner? end def create? user.present? end def new? user.present? end def update? owner? end def edit? owner? ...
11.307692
47
0.623583
e999e83157323018d612a04fd936fe14e4051150
9,592
# Copyright (c) 2018 Public Library of Science # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, pub...
36.196226
120
0.656902
7a85c71897949684fea63bd6a307a85e5790feb8
4,133
require "language/python" class Caveats extend Forwardable attr_reader :f def initialize(f) @f = f end def caveats caveats = [] begin build = f.build f.build = Tab.for_formula(f) s = f.caveats.to_s caveats << s.chomp + "\n" unless s.empty? ensure f.build = bui...
25.83125
103
0.627147
6ad32cf1d4d58188ea4f898d2d0bfdc2a337495b
249
class CreateRuleSets < ActiveRecord::Migration[5.2] def change create_table :rule_sets do |t| t.string :object_key t.string :name t.string :class_name t.boolean :rule_set_aware t.boolean :active end end end
20.75
51
0.662651
b97cfdedfefae124b07a27ce09b23be8ad3447d5
245
# frozen_string_literal: true module Spree class ReturnsCalculator < Calculator def compute(_return_item) raise NotImplementedError, "Please implement 'compute(return_item)' in your calculator: #{self.class.name}" end end end
24.5
113
0.755102
26a5ce96f9c1f6169ba60339f44965051a5b4caa
1,817
# frozen_string_literal: true require_relative '../test_harness' require_relative './orders_helper' require 'json' include PayPalCheckoutSdk::Orders describe OrdersPatchRequest do def build_request_body [ { "op": 'add', "path": "/purchase_units/@reference_id=='test_ref_id1'/description", ...
29.786885
80
0.679141
616e9b4eebad3019468d0df2951568ca4966af06
2,537
# frozen_string_literal: true # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
34.753425
87
0.677178
61362e7f767ea7e96a8c4e374e11c49f9c4a7398
7,516
# frozen_string_literal: true require 'spec_helper' RSpec.describe Brcobranca::Boleto::Banrisul do # :nodoc:[all] let(:valid_attributes) do { data_vencimento: Date.parse('2015-06-26'), valor: 1278.90, cedente: 'Kivanio Barbosa', documento_cedente: '12345678912', sacado: 'Claudio Po...
41.524862
118
0.735764
1cea64dea8806bed0cdcf8aec9d2a58c480e6977
415
require 'spec_helper' describe Almanac::Blog do it "should be possible to create a valid blog" do expect(create(:blog)).to eq(Almanac::Blog.first) end it "should not be possible to create a blog without a title" do build(:blog, title: "").should_not be_valid end it "should not be possible to create...
25.9375
65
0.701205
183eb063c75f4caa55aa7fec1bda37c3a4de9528
25,412
# # Copyright 2012 Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
27.442765
118
0.582874
ed31b14d03bbf7df2af4179d3ec5f09c51d8c563
305
# frozen_string_literal: true require_relative './binary_operator_base' module RpnCalc module Calculators module Operators # allows to substract second operand from first class DivisionOperator < BinaryOperatorBase def sign :/ end end end end end
17.941176
53
0.67541
e946306c907737a151f89e17e39bd0f12cb59092
695
class Api::Users::Communities::MutesController < ApplicationController before_action :set_user, only: [:index] before_action -> { authorize(Api::Users::Communities::MutesPolicy, @user) } def index query = CommunitiesQuery.new.with_user_muted(@user) communities = paginate( query, attributes: [...
25.740741
95
0.693525
26954ce2b91e400b1eac305cf90f5f4edc38c73a
568
cask "media-converter" do version "2.0.10" sha256 "d5a7db000e8106e5892daad84ee7dea82651aa9662df5b4c6da0b943afae03c1" # downloads.sourceforge.net/media-converter/ was verified as official when first introduced to the cask url "https://downloads.sourceforge.net/media-converter/media-converter/#{version}/media-co...
43.692308
115
0.792254
f83940e2c3d319f9233af89faf82d549db04d6a5
194
require 'spec_helper' describe Ripify do it 'has a version number' do expect(Ripify::VERSION).not_to be nil end it 'does something useful' do expect(false).to eq(true) end end
16.166667
41
0.701031
e9b3533943414257a39e82b619dd8f345ddcf7c4
3,087
# # Author:: Joshua Timberman (<joshua@opscode.com>) # Copyright:: Copyright (c) 2009 Opscode, 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 # #...
22.866667
75
0.514739
e9164bddc845c720b83dc6e7786a1197c6eadfa1
1,879
require 'fiddle' require 'fileutils' require 'tempfile' if RUBY_ENGINE != 'natalie' begin if STDOUT.tty? require 'readline' end rescue LoadError end end unless defined?(Readline) class Readline def self.readline(prompt, _) print(prompt) if !(line = gets) exit end ...
23.78481
95
0.574242
184001635e82ee6bd9541c7e4884a6163fd1bee9
4,384
require "spec_helper" describe Berkshelf::Lockfile do before do allow(subject).to receive(:filepath).and_return(fixture) if defined?(fixture) subject.parse end context "with an old 2.0 lockfile format" do let(:fixture) { fixtures_path.join("lockfiles/2.0.lock") } it "does not blow up" do ...
32.962406
81
0.645985
1166dd7522f5ca2033473eb5c551f05c8d8a0a4a
319
# frozen_string_literal: true namespace :start do desc 'Start dev server' task :development do exec 'foreman start -f Procfile.dev' end desc 'Start production server' task :production do exec 'NPM_CONFIG_PRODUCTION=true npm run postinstall && foreman start' end end task start: 'start:development'
22.785714
74
0.742947
d59b46d5f037872cd4a0e2f3d3a9fcb576a75601
193
require 'test_helper' class ReviewRequestsControllerTest < ActionDispatch::IntegrationTest test "should get index" do get new_review_request_url assert_response :success end end
17.545455
68
0.792746
7a11ef77e605f4bf1d23197fa6943111826e3a37
1,146
# Top level module for TZInfo. module TZInfo end require 'tzinfo/ruby_core_support' require 'tzinfo/offset_rationals' require 'tzinfo/time_or_datetime' require 'tzinfo/timezone_definition' require 'tzinfo/timezone_offset' require 'tzinfo/timezone_transition' require 'tzinfo/transition_rule' require 'tzinfo/annual_ru...
26.045455
47
0.847295
08460aa2bf002b23a70167f8f6c819d2e500139a
779
# frozen_string_literal: true require 'test_helper' class TranscodedStreamControllerTest < ActionDispatch::IntegrationTest setup do Setting.update(media_path: Rails.root.join('test', 'fixtures', 'files')) end test 'should get new stream for transcode format' do assert_login_access(url: new_transcoded_s...
27.821429
91
0.720154
1c46b150f6c6c1f1d498a77b91c93ed369563dc8
593
Pod::Spec.new do |s| s.name = 'AngleGradientLayer' s.version = '1.2.1' s.summary = 'Objective-C angle gradients for iOS.' s.homepage = 'https://github.com/paiv/AngleGradientLayer' s.screenshots = 'https://raw.github.com/paiv/AngleGradientLayer/master/screenshot.png' s.license = '...
39.533333
104
0.623946
39a0a3b8846ad4ed216ddf25cd4a7b997f3a179a
5,880
#Copyright:: Copyright (c) 2012-2014 Chef Software, Inc. # # All Rights Reserved # require "/opt/opscode/embedded/service/omnibus-ctl/open_source_chef12_upgrade" require 'optparse' require 'ostruct' add_command_under_category "upgrade", "general", "Upgrade your private chef installation.", 2 do # Since this is eva...
37.935484
312
0.67466
f7d348d06e0b55486d19b4dfa333854367e1530c
946
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
32.62069
74
0.733615
f7e4a3037bb12f6e1f6ed51c4119cbd702b5d89c
1,028
class DroperMailer < ActionMailer::Base helper :application default from: "Petit Kiwi <info@petitkiwi.be>" def monthly_report(droper, sales, revenues, year, month) @date = Date.parse("#{year}-#{month}-01") @sales = sales @revenues = revenues mail( to: droper.email, subject:...
30.235294
123
0.63716
e927dcc379b6000243923bbf58d2d2926820681a
4,117
class Cookiecutter < Formula include Language::Python::Virtualenv desc "Utility that creates projects from templates" homepage "https://github.com/audreyr/cookiecutter" url "https://github.com/audreyr/cookiecutter/archive/1.5.1.tar.gz" sha256 "a01addd59d8a572f850cf8210f1e98e4dc924bec6210010d4e23277ec4fa094b"...
45.744444
145
0.820015
188f306bf943777e376e3eb56d9cf16691440186
1,175
# frozen_string_literal: true # Copyright (c) 2008-2013 Michael Dvorkin and contributors. # # Fat Free CRM is freely distributable under the terms of MIT license. # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php #------------------------------------------------------------------------------...
28.658537
81
0.600851
4a80a26527ca606a8dfcc68ed1011410db29970e
173
class CreateEntries < ActiveRecord::Migration def change create_table :entries do |t| t.string :title t.string :body t.timestamps end end end
15.727273
45
0.653179
6adf2b11ac385be407595583e19e3746dd830c4a
7,225
require "test_helper" class ErrorsTest < MiniTest::Spec class AlbumForm < TestForm property :title validation do params { required(:title).filled } end property :artists, default: [] property :producer do property :name end property :hit do property :title valida...
31.969027
146
0.590865
bb1b981d66662f1c988ca2f2168b0de43026a82e
5,311
#!/usr/bin/env ruby $VERBOSE = true class TestFiles RANDOM_ASCII_FILE1 = 'test/data/generated/randomAscii1.txt' RANDOM_ASCII_FILE2 = 'test/data/generated/randomAscii2.txt' RANDOM_ASCII_FILE3 = 'test/data/generated/randomAscii3.txt' RANDOM_BINARY_FILE1 = 'test/data/generated/randomBinary1.bin' RANDOM_BINA...
33.613924
96
0.65675
1ccfa56d21df535b4ca7c58e62a2a0b0c9f4ed8f
74
# frozen_string_literal: true module Citywrapper VERSION = "1.0.0" end
12.333333
29
0.743243
ab036197a928511bf06dae12c979dec57cbe2d96
51
module Planify VERSION = [1, 0, 4].join(".") end
12.75
31
0.588235
33a937b5d71e4afbc8a7cdb4f3251443feffe194
11,589
# frozen_string_literal: true require "resource" require "metafiles" module DiskUsageExtension def disk_usage return @disk_usage if @disk_usage compute_disk_usage @disk_usage end def file_count return @file_count if @file_count compute_disk_usage @file_count end def abv out =...
23.894845
101
0.648201
1cfbbaafd842ae9a08cc684392ec563b94cc248e
8,776
class CheckSearch def initialize(options) # options include keywords, projects, tags, status options = JSON.parse(options) @options = options.clone @options['input'] = options.clone @options['team_id'] = Team.current.id unless Team.current.nil? # set sort options @options['sort'] ||= 'rec...
32.264706
181
0.636281
1a72d52034c5ec2dc954721aa3a03aa8bdca858f
2,879
require 'test_helper' module Nls module EndpointTest class TestTimeout < NlsTestCommon def test_timeout_with_wait skip_timeout_with_ASAN data = { timeout: 100, wait: 150 } expected_error = "NlsCancelCleanupOnTimeout : Request timeout after" ...
22.317829
78
0.608545
034d413a147ccca005d6bd79688c862d4b1f0f32
2,758
#!/usr/bin/ruby $:.unshift '../lib' require 'test/unit' require 'xmpp4r/callbacks' include Jabber class CallbacksTest < Test::Unit::TestCase def test_test1 called = 0 cb = Callback::new(5, "toto", Proc::new { called += 1 }) assert_equal(5, cb.priority) assert_equal("toto", cb.ref) cb.block.call...
21.215385
60
0.583756
1da14d9ea6c7faba1607b73fb430e971e5b7b2d5
1,153
cask :v1 => 'clamxav' do if MacOS.release <= :tiger version '2.2.1' sha256 'e075b21fe5154f31dcbde86e492531c87c67ab44ad75294d3063f32ae1e58278' elsif MacOS.release <= :leopard version '2.5.1' sha256 '02a7529c74d11724e2d0e8226ac83a0d3cfb599afb354d02f6609632d69d9eb1' else version '2.8.8' sha25...
29.564103
89
0.685169
f8621de7ec4f919e2e218c896eba48832d6dd79e
271
FactoryBot.define do factory :casa_org do sequence(:name) { |n| "CASA Org #{n}" } sequence(:display_name) { |n| "CASA Org #{n}" } address { "123 Main St"} footer_links { [["www.example.com", "First Link"], ["www.foobar.com", "Second Link"]] } end end
30.111111
91
0.601476
625285dc78aa4fd1e9eba9df45496e67954672d9
327
working_directory "/home/ubuntu/wangyu/dianwaimai" pid "/home/ubuntu/wangyu/dianwaimai" + "/tmp/pids/unicorn.pid" stderr_path "/home/ubuntu/wangyu/dianwaimai" + "/log/unicorn_error.log" stdout_path "/home/ubuntu/wangyu/dianwaimai" + "/log/unicorn_access.log" listen "/tmp/unicorn_call_lunch.sock" worker_processes 2 tim...
40.875
72
0.792049
e9049c7b04df752c3795f54d40acf179be0a2646
3,035
Rollbar.configure do |config| # Without configuration, Rollbar is enabled in all environments. # To disable in specific environments, set config.enabled=false. config.access_token = ENV['ROLLBAR_ACCESS_TOKEN'] unless Rails.env.production? config.enabled = false end # By default, Rollbar will try to c...
42.746479
97
0.733443
e836ecaf8b25036a37dd98252d1d700cb0aacb7d
2,000
cask 'mactex-no-gui' do version '20170524' sha256 '0caf76027c9e0534a0b636f2b880ace4a0463105a7ad5774ccacede761be8c2d' # mirror.ctan.org/systems/mac/mactex was verified as official when first introduced to the cask url "http://mirror.ctan.org/systems/mac/mactex/mactex-#{version}.pkg" appcast 'https://www.tug.o...
33.898305
97
0.4755
4ae3b75c473a689d088d5c2fd09dc45389dae9ab
1,433
class ImageUploader < CarrierWave::Uploader::Base # Include RMagick or MiniMagick support: # include CarrierWave::RMagick include CarrierWave::MiniMagick # Choose what kind of storage to use for this uploader: #storage :file storage :aws # Override the directory where uploaded files will be stored. #...
31.152174
112
0.7097
1855b8f298f4bdccfc1c952465248a1cb4983951
2,549
module ThinkingSphinx module ActiveRecord class SQLBuilder attr_reader :source def initialize(source) @source = source end def sql_query statement.to_relation.to_sql.gsub(/\n/, "\\\n") end def sql_query_range return nil if source.disable_range? ...
24.04717
97
0.635936
f8d8183e2a3905e3f10a89b952bd74448bcb2bdc
13,086
# Copyright (c) 2016, 2021, 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...
42.764706
245
0.698304
1c495563e85631c3ea4b839071fe37a30169b664
230
class AddColumnOrganizationalUnitsToLdapConfigs < ActiveRecord::Migration[6.0] def change change_table :ldap_configs do |t| t.string :organizational_unit_attribute t.string :organizational_unit end end end
25.555556
78
0.765217
4a0e5cdf80abcc75ba44c560841fb47c2cda742c
1,297
# Copyright (C) 2018-2019 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
28.195652
91
0.655359
edd0507ada90609cc286375f5bee08312534eed1
4,484
# Copyright (c) 2016, 2021, 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...
45.755102
245
0.843889
ed5a76833ccdef7e9fd8ed020c3349b890c8f29a
143
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_test_server_session'
35.75
81
0.811189
4a0471e65a817b5ad9ebf55bc8bacd6e1fcf1f74
2,165
=begin #DialMyCalls API #The DialMyCalls API OpenAPI spec version: 2.0.1 Contact: support@dialmycalls.com Generated by: https://github.com/swagger-api/swagger-codegen.git 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 ...
27.75641
103
0.733025
f7067fca15488870c630b8ff960119f966dcf90d
4,018
require 'ndr_import/table' require 'ndr_import/file/registry' require 'json' require 'pry' require 'csv' # folder = File.expand_path('../', __dir__) # $LOAD_PATH.unshift(folder) unless $LOAD_PATH.include?(folder) module Import module Colorectal module Core # Reads in pseudonymised BRCA data, then invokes...
38.634615
98
0.614485
3383ffb1e0fc6e25352b430b628218daf6a222bb
1,298
# tests the Near Real Time support in the :updates => true mode require 'test_helper' class NrtImmediate < Test::Unit::TestCase load_schema resque_available class User < ActiveRecord::Base elastic_index end def setup User.delete_all User.delete_index Escargot::LocalIndexing.create_inde...
22.77193
63
0.690293
f8bdf85309215b4d2b4013fcecd44d9ade3c305b
866
require "helper" require "digest/md5" class TestTextcaptcha < Test::Unit::TestCase def test_obtain response = Textcaptcha.obtain assert_equal false, response[:question].nil? assert_equal true, response[:question].length > 0 assert_equal 'Array', response[:answers].class.to_s assert_equal true, response[:an...
27.935484
74
0.750577
ffb6b8f748870491331d48015e3b6f8c6a5e3608
430
Capybara.javascript_driver = :webkit Capybara.asset_host = "http://localhost:3000" module CapybaraHelper def page! save_and_open_page end def screenshot! save_and_open_screenshot end def blur! page.find('body').click end end Capybara::Webkit.configure do |config| config.allow_url( %w(f...
15.925926
47
0.732558
abff597cbff545d15ae57a4d9af6bb4bf348f848
196
class AddDestroyByDateToOffering < ActiveRecord::Migration def self.up add_column :offerings, :destroy_by, :string end def self.down remove_column :offerings, :destroy_by end end
19.6
58
0.755102
bfc5df08fede2cfca2ceaff6135a055dc841513d
1,624
require 'rails_helper' describe CampaignListener do let(:listener) { described_class.instance } let(:account) { create(:account) } let(:inbox) { create(:inbox, account: account) } let(:contact) { create(:contact, account: account, identifier: '123') } let(:contact_inbox) { create(:contact_inbox, contact: cont...
39.609756
142
0.691502
0149d3cb6ea62b3e1390e583c86a03db7e00fc50
238
class CreateComments < ActiveRecord::Migration[6.0] def change create_table :comments do |t| t.string :username t.text :body t.references :post, null: false, foreign_key: true t.timestamps end end end
19.833333
56
0.659664
1d9e6c2d0bcebeee16f0d481ff265e12384a94bd
615
cask 'texworks' do version '0.6.3,201903161730:a2470ca' sha256 '618d16f4bf915e3d73d354263fa4b557dbb165d6868b414ecc47973ddc92a986' # github.com/TeXworks/texworks was verified as official when first introduced to the cask url "https://github.com/TeXworks/texworks/releases/download/release-#{version.before_comma}...
41
198
0.782114
1cc29d3410661be9c928b2e7ebf5b95e0a8eee97
2,043
require 'yaml' require 'json' require 'yaml/store' module Braid class Config class PathAlreadyInUse < BraidError def message "path already in use: #{super}" end end class MirrorDoesNotExist < BraidError def message "mirror does not exist: #{super}" end end ...
21.061856
73
0.586882