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
e930d78cc613ca865ef70610d174daa83d717f8c
882
# frozen_string_literal: true # Container for Vox components. module Vox # Default ETF adapter for vox's gateway component. module ETF # @!parse [ruby] # # Encode an object to an ETF term. This method accepts, `Integer`, `Float`, # # `String`, `Symbol`, `Hash`, `Array`, `nil`, `true`, and `false` o...
32.666667
83
0.608844
d5466b287a55d10fd7221af882addc9083d24cfa
368
# Preview all emails at http://localhost:3000/rails/mailers/contact class ContactPreview < ActionMailer::Preview def automatic_answer_preview ContactMailer.automatic_answer(Contact.first) end def manual_answer(contact, answer, subject_answer, admin) ContactMailer.manual_answer(Contact.first, 'Body...
28.307692
88
0.771739
f8ee4c8ff07c5d01f9219db3aa5d9bd2930042cb
3,398
# Static Loader contains constants, basic data types and other types required for the system # to boot. # module Puppet::Pops module Loader class StaticLoader < Loader BUILTIN_TYPE_NAMES = %w{ Component Exec File Filebucket Group Node Notify Package Resourc...
25.742424
155
0.704532
e829b1e432a55acca1107d93bcefa53eda1274ed
2,777
## # This file is part of the Metasploit Framework and may be subject to # redistribution and commercial restrictions. Please see the Metasploit # Framework web site for more information on licensing and terms of use. # http://metasploit.com/framework/ ## require 'msf/core' require 'rex' require 'msf/core/post/window...
28.336735
88
0.624415
1adce33f851796597ddc0b54b513fa04644f2b71
1,903
# # Be sure to run `pod lib lint Verifiedly.podspec' to ensure this is a # valid spec before submitting. # # Any lines starting with a # are optional, but their use is encouraged # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'Verified...
38.836735
135
0.676301
1ae1b487bfbf6a4f48d41dfcc13a75533fb3b1b0
306
cask 'dd-utility' do version '1.11' sha256 '1c33a998b7c9b7a9fa59222d2e7cc0410f0cec85650e8647308c33ee0af1e956' url "https://github.com/thefanclub/dd-utility/raw/master/DMG/ddUtility-#{version}.dmg" name 'dd Utility' homepage 'https://github.com/thefanclub/dd-utility' app 'dd Utility.app' end
27.818182
88
0.764706
8724b4a778a072de34ba215c4648da05ef7a4b26
1,023
require 'simp/cli/config/items/action/warn_client_yum_config_action' require_relative '../spec_helper' describe Simp::Cli::Config::Item::WarnClientYumConfigAction do before :each do @ci = Simp::Cli::Config::Item::WarnClientYumConfigAction.new @ci.silent = true # uncomment out this line to see log mess...
31.96875
71
0.72825
03f811d25347d8f01be6700021721fb713ac9d66
1,471
# # Cookbook Name:: iptables-ng # Recipe:: install # # Copyright 2013, Chris Aumann # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any l...
28.288462
72
0.721958
181a2d37ae4d49c4a095aa8c05da4f8112e712f6
308
module Types class OpinionType < Types::BaseObject field :id, ID, null: false field :text, String, null: true field :author_id, Integer, null: true field :created_at, GraphQL::Types::ISO8601DateTime, null: false field :updated_at, GraphQL::Types::ISO8601DateTime, null: false end end
30.8
67
0.714286
ac02239a14f8e9a7c4315852050a114bd8bf0aca
6,863
module Kontena # The observable value is nil when initialized, and Observers will wait for it to become ready. # Once the observable is first updated, then Observers will return/yield the initial value. # When the observable is later updated, Observers will return/yield the updated value. # If the observable al...
32.372642
127
0.658458
08dccf7030ba78b5f4cd523068e8de88dc5bffe4
6,936
=begin #Xero Accounting API #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 =end require 'time' require 'date' module WorkflowMaxRuby::Accounting require...
31.103139
223
0.632209
5d7d06c84903db173ea00ad3945f1f4a758d5b54
540
module RunnersHelper def runner_status_icon(runner) unless runner.contacted_at return content_tag :i, nil, class: "fa fa-warning-sign", title: "New runner. Has not connected yet" end status = if runner.active? runner.contacted_at > 3.hour.ago ? :online : :offline ...
25.714286
98
0.635185
2867fa6725c1b97a7c016eb39476817f0fca1e24
623
# -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = 'evt-dependency' s.version = '2.1.0.0' s.summary = 'Declare dependencies that have null object or substitute default values' s.description = ' ' s.authors = ['The Eventide Project'] s.email = 'opensource@eventide-project.org' s.homepage = '...
28.318182
87
0.680578
628c11f11bbe9f78c27a0621341e6c0ffb6ace0c
1,373
class Pygments < Formula include Language::Python::Virtualenv desc "Generic syntax highlighter" homepage "https://pygments.org/" url "https://files.pythonhosted.org/packages/e1/86/8059180e8217299079d8719c6e23d674aadaba0b1939e25e0cc15dcf075b/Pygments-2.7.4.tar.gz" sha256 "df49d09b498e83c1a73128295860250b0b7ed...
35.205128
136
0.766934
1c9603a5cb7a85e69290f19e3389cd125781453f
2,620
class Song attr_accessor :url def self.find(id) self.new(id: id).tap { |song| song.document } end def initialize(kwargs = {}) @id = kwargs.delete(:id) @artist = kwargs.delete(:artist) @title = kwargs.delete(:title) self.url = "songs/#{@id}" end def response document["response"]["...
20
74
0.575954
2124c723186d01eaa19f240d6860313a01300ca0
768
provides :varnish_repo, platform_family: 'debian' property :major_version, Float, equal_to: [2.1, 3.0, 4.0, 4.1, 5, 6.0], default: lazy { node['varnish']['major_version'] } property :fetch_gpg_key, [TrueClass, FalseClass], default: true action :configure do # packagecloud repos omit dot from major version major_v...
42.666667
122
0.739583
3933d7d0ea717ce263aad8b85f8ba7725bac4e38
3,526
class Admin::StatisticsAnnouncementsController < Admin::BaseController before_action :find_statistics_announcement, only: %i[show edit update cancel publish_cancellation cancel_reason] before_action :redirect_to_show_if_cancelled, only: %i[cancel publish_cancellation] helper_method :unlinked_announcements_count, ...
32.348624
167
0.77198
08f89868f555a12111e710ed3ab3b6a62a5fc539
194
describe OrderRepositoryMemory do let(:repo) { described_class.new } it '.save' do order = instance_double('Order') repo.save(order) expect(repo.orders.size).to eq(1) end end
19.4
37
0.685567
79cae906eef3948b9c1cad007b18f038417bb065
1,793
#-- # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. # All rights reserved. # See LICENSE.txt for permissions. #++ class Gem::Ext::Builder def self.class_name name =~ /Ext::(.*)Builder/ $1.downcase end def self.make(dest_path, results) unless File.exist? 'Makefile' then r...
26.367647
104
0.62744
e25f3c3898e4b3f2373bdb8c49cf7b12fcdf39fb
340
gem 'paper_trail', '~> 2' after_bundler do generate "paper_trail:install" end __END__ name: Paper Trail description: Plugin for tracking changes to your models' data. Good for auditing or versioning. category: persistence exclusive: activerecord_versioning tags: [activerecord_versioning] # TODO eycloud partner ...
20
95
0.797059
911df921b0af48f315cbd5a2199794e8172b5863
4,449
require 'rails_helper' # require './app/models/parsers/xml/reports/policy_link_type' module Parsers::Xml::Reports describe PolicyLinkType do let(:namespace) { 'http://openhbx.org/api/terms/1.0' } let(:policy_xml) { "<n1:policy xmlns:n1=\"#{namespace}\">\"#{policy_id}#{enrollees}#{employer}\"</n1:policy>" } ...
34.757813
115
0.598337
87dfd43a14d8e9a0cbaa847fb607e60d27a937c4
1,251
require 'pry' class TasksController < ApplicationController get '/tasks' do @tasks = Task.all erb :"/tasks/index" end get '/tasks/new' do @categories = Category.all erb :'/tasks/new' end post '/tasks/new' do if params[:name] == "" || params[:summary] == "" redirect '/tasks/new' ...
23.166667
110
0.601119
26b3b43ff321f5d26c2ae7c1b451b14bee04630a
2,082
# -*- encoding: utf-8 -*- require 'spec_helper' describe "Humanize" do require_relative 'tests' after(:each) do Humanize.reset_config end TESTS.each do |num, human| it "#{num} is #{human}" do expect(num.humanize).to eql(human) end end describe 'locale option' do it 'uses default ...
23.393258
82
0.621998
e8f073a1e596287bd59a1fc63890c69c110feec4
1,085
class Lxc < Formula desc "CLI client for interacting with LXD" homepage "https://linuxcontainers.org" url "https://linuxcontainers.org/downloads/lxd/lxd-4.8.tar.gz" sha256 "de4f096c71448ceb358c0d0d63e34d17ea8e49c15eb9d4f8af5030ce0535337f" license "Apache-2.0" livecheck do url "https://linuxcontainers.o...
31
94
0.730876
f79ea288b4270fc7fa7790398df4994aad58868a
1,159
# -*- coding: utf-8 -*- # usage: ruby checkfix#.rb [file] # ------------------- # Author:: Jean-Michel Bruel (mailto:jbruel@gmail.com) # Copyright:: Copyright (c) 2020 JMB # License:: Distributes under the same terms as Ruby # ------------------- README = ARGV[0] ? ARGV[0] : "../README.adoc" fixNb = __FILE__.s...
26.340909
75
0.529767
0883f9d2445f2faad2c71744a50212c04e51123a
132
# frozen_string_literal: true Rails.application.routes.draw do devise_for :users resources :players root 'players#index' end
16.5
32
0.780303
2854120f1d5994a00b97f382bc7cdab46b6be1c5
516
h_shirts = ['Brad','Joe','Tristan','Tom', 'Matt', 'Jim', 'David', 'Myron'] normal_shirts = ['Dylan', 'Sonju', 'Kate', 'Isaac', 'Chris', 'Eric'] h_shirts.pop normal_shirts.pop h_shirts.push('James') normal_shirts.push('Angie') h_shirts.each do |i| puts i end normal_shirts.each do |i| puts i end class Hawaii...
16.645161
74
0.643411
bf008262573915febb1303cd2957f2f5ea9aa148
98,008
require 'spec_helper' module VCAP::CloudController RSpec.describe VCAP::CloudController::AppsController do let(:admin_user) { User.make } let(:non_admin_user) { User.make } let(:app_event_repository) { Repositories::AppEventRepository.new } before do set_current_user(non_admin_user) Cloud...
37.782575
161
0.603247
7971b3090f5143b62056cf82339631d2ac6fa3f3
339
class ContactsController < ApplicationController def new @contact = Contact.new end def create @contact = Contact.new(contact_params) if @contact.valid? @contact.save else render action: 'new' end end private def contact_params params.require(:contact).permit(:email, :...
16.142857
53
0.672566
1ad6f8a3cf2c3a52c2303e3a6ac6ec01748df7a8
35,106
describe :kernel_sprintf, shared: true do describe "integer formats" do it "converts argument into Integer with to_int" do obj = Object.new def obj.to_i; 10; end def obj.to_int; 10; end obj.should_receive(:to_int).and_return(10) @method.call("%b", obj).should == "1010" end ...
39.093541
111
0.507919
f784792878e718a142bb7948ee97c21aad538789
3,024
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # Purpose # # Shows how to configure cross-origin resource sharing (CORS) rules for an # Amazon Simple Storage Service (Amazon S3) bucket. # snippet-start:[ruby.example_code.s3.helper.BucketCorsWrapper] require ...
32.869565
101
0.72123
ac9e08c5f90736c40b644fab0b0031bbd613b46b
1,103
module SpreeAffiliateLinks module Generators class InstallGenerator < Rails::Generators::Base def add_javascripts append_file 'app/assets/javascripts/store/all.js', "//= require store/spree_affiliate_links\n" append_file 'app/assets/javascripts/admin/all.js', "//= require admin/spree_affili...
36.766667
145
0.650952
39734f91226b9be7c93a8135bb18397c2c0d27f2
947
require "piston/commands/base" module Piston module Commands class Convert < Piston::Commands::Base attr_reader :options def run(targets) targets = Array.new unless targets wc = Piston::Svn::WorkingCopy.new(Dir.pwd) importer = Piston::Commands::Import.new(options) ret...
28.69697
99
0.630412
117270a3d1604794eeaaaee01bfd5f7f37771153
41,449
# frozen_string_literal: true require 'spec_helper' EXT_PREFIXES = %w[ext ex x xt # :].freeze describe PhonyRails do it 'should not pollute the global namespace with a Country class' do should_not be_const_defined 'Country' end describe 'phony_format String extension' do describe 'the phony_formatted m...
44.377944
163
0.670487
9194e293902cfce4fddd9307814a6afed21c2e4d
7,348
# This cannot take advantage of our relative requires, since this file is a # dependency of `rspec/mocks/argument_list_matcher.rb`. See comment there for # details. require 'rspec/support/matcher_definition' module RSpec module Mocks # ArgumentMatchers are placeholders that you can include in message # expec...
25.964664
88
0.578797
79ec17ccd0ee4e4f1f0880e2e1475c856814590d
4,329
require 'spec_helper' require 'messages/builds_list_message' module VCAP::CloudController RSpec.describe BuildsListMessage do describe '.from_params' do let(:params) do { 'states' => 'state1,state2', 'app_guids' => 'appguid1,appguid2', 'package_guids' => 'packagegui...
34.91129
114
0.613768
210817e886878ae712ed6e9b587cfbe8c40c6a97
105
module ToWa class DeniedOperator < StandardError end class DeniedColumn < StandardError end end
13.125
38
0.771429
ff49d318f46f43dbce2b290c5f2d93d345cbab90
1,458
# encoding: utf-8 # # Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "Li...
34.714286
84
0.680384
7996a3f4d51790d84ca19f95859370d04f169152
10,396
class LlvmAT8 < Formula desc "Next-gen compiler infrastructure" homepage "https://llvm.org/" url "https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/llvm-8.0.1.src.tar.xz" sha256 "44787a6d02f7140f145e2250d56c9f849334e11f9ae379827510ed72f12b75e7" license "NCSA" revision 3 bottle do s...
38.64684
115
0.661216
18b9b8609b5566f798c9354049ccf0460c0cc223
6,627
require_relative 'functional_api' require 'test/unit/assertions' require 'mocha/setup' module OpenShift module Runtime end end class OpenShift::Runtime::DeploymentTester include Test::Unit::Assertions include OpenShift::Runtime::NodeLogger DEFAULT_TITLE = "Welcome to OpenShift" CHANGED_TITLE = "...
33.984615
146
0.722197
617f31f36e9090e2028afdbbce52c341f2ca18ba
347
require 'test_helper' class TemplateMailerTest < ActionMailer::TestCase tests TemplateMailer def test_message @expected.subject = 'TemplateMailer#message' @expected.body = read_fixture('message') @expected.date = Time.now assert_equal @expected.encoded, TemplateMailer.create_message(@expecte...
24.785714
89
0.752161
f7950c50205b3af8541d37461cafe482229dd05f
646
# frozen_string_literal: true require 'rails_helper' RSpec.describe ProvisionedSubjectsController, type: :routing do def action(name, opts) opts.merge(controller: 'provisioned_subjects', action: name, provider_id: '1') end context 'get /providers/:id/provisioned_subjects/:id/edit' do sub...
30.761905
67
0.69195
21ad6b1ce7dbb7959a469fd39d9d7b0e971d6154
20,137
#-- copyright # OpenProject is a project management system. # Copyright (C) 2012-2017 the OpenProject Foundation (OPF) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. # # OpenProject is a fork of ChiliProject, which is a fork of ...
39.253411
164
0.657446
38c1f96bbb3e2c90fbd3ad621e6ca7afb44aca38
553
# frozen_string_literal: true RSpec.shared_context 'integration config' do let(:config) do config_file_name = File.expand_path('config.yml', __dir__) return {} unless File.exist?(config_file_name) YAML.safe_load(File.read(config_file_name)) end let(:ssh_host) { config['ssh']['host'] } let(:ssh_us...
27.65
65
0.703436
e9971118a3344cce501b02cb97bb2e31b660fcaf
469
class CreateMeritActions < ActiveRecord::Migration def self.up create_table :merit_actions do |t| t.integer :user_id t.string :action_method t.integer :action_value t.boolean :had_errors, default: false t.string :target_model t.integer :target_id t.text :target_da...
19.541667
50
0.667377
1d2b724a5e5d51acf5ea7ed3bb2244af0169ed55
2,136
FactoryBot.define do factory :user, aliases: [:author, :assignee, :recipient, :owner, :resource_owner] do email { generate(:email) } name { generate(:name) } username { generate(:username) } password "12345678" confirmed_at { Time.now } confirmation_token { nil } can_create_group true ...
23.217391
90
0.63015
5d4d5325f6012e36d40bd9d14086d8d7b2dbdc22
334
# frozen_string_literal: true control 'noop_imported_node' do describe import_node('nodeC', 'dry-source') do it { should exist } its('city') { should eq 'Brooklyn' } its('building') { should eq 'Big' } its('categories') { should eq %w(Servers Dev) } its('assets') { should eq('vendorPhone' => '311'...
30.363636
55
0.640719
9162776e60858d5acd4ed0e6232fbadc0b39a8cf
1,147
require 'json' package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) Pod::Spec.new do |s| s.name = 'RNBackgroundGeolocation' s.version = package['version'] s.summary = package['description'] s.description = <<-DESC Cross-platform background geol...
42.481481
132
0.637315
1a1f8a415c667caa2c8c7911e0d31fe60c108ab0
2,912
# == Synopsis # # Simple BibApp citation model # # == Author # # Eric Larson (using Liam's CSL Citation example) # # == Copyright # # Copyright (c) 2008, Eric Larson. # Licensed under the same terms as Ruby - see http://www.ruby-lang.org/en/LICENSE.txt. # # module Bibapp # ---------- Classes ----------- ...
21.411765
87
0.596497
f72ac4011c88d2903ee505f8d305235427bf12e9
59
class CategoryRecommendationPolicy < ApplicationPolicy end
19.666667
54
0.898305
6accbd89a28b24980a3434a7474ed8e0647d740b
3,591
# frozen_string_literal: true require 'bundler/setup' require 'action_view' require 'action_controller' require 'active_model' require 'active_support/core_ext' # Thanks to Justin French for formtastic spec module FoundationRailsSpecHelper include ActionView::Helpers::FormHelper include ActionView::Helpers::FormOp...
28.728
80
0.715121
28fa11b7a7999ba218e321d82007a93bff3dce1a
2,495
class Freediameter < Formula desc "Open source Diameter (Authentication) protocol implementation" homepage "http://www.freediameter.net" url "http://www.freediameter.net/hg/freeDiameter/archive/1.2.1.tar.gz" sha256 "bd7f105542e9903e776aa006c6931c1f5d3d477cb59af33a9162422efa477097" head "http://www.freediamete...
28.033708
115
0.676152
f70585796ea801f248a74dc14d69dbce8c60f028
638
require "figaro/cli/task" module Figaro class CLI < Thor class AptibleSet < Task def run system(configuration, command) end private def command "aptible config:set #{vars} #{for_app} #{for_remote}" end def for_app options[:app] ? "--app=#{options[:ap...
18.764706
70
0.520376
877d273531ca233c9937c35366acee7548ff7efd
136
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_pres_session'
34
74
0.801471
b92d67a6e6a7c983717ac8e1700510f41acb432d
340
require 'settings' module AIProject # Now it will be with PRECISION class Location attr_reader :x, :y def initialize(x, y) @x = x @y = y end def x=(value) @x = value.round(Settings::PRECISION) end def y=(value) @y = value.round(Settings::PRECISION) ...
17
44
0.552941
393b0d6698e87abe63ce87653483d05a691659be
3,158
require "open-uri" NEW_RELEASE_TEMPLATE = " NEW RELEASE: ============= Image URL: %{image_url} Version: %{version} Platform: %{platform} Channel: %{channel} " OLD_RELEASE_TEMPLATE = " NOT SAVING %{platform} %{version} (%{channel}) " namespace :releases do module ReleaseTask def self.download_metadata(tag_...
30.07619
92
0.659278
08a8b4ac248b8e597d374f31a0da55676ee3f0d7
141
require 'rails_helper' RSpec.describe Train::Type::Note::Info, type: :model do pending "add some examples to (or delete) #{__FILE__}" end
23.5
56
0.730496
6221d6fb45fb7973a11cdfb06d4c07a741b8cf43
3,681
# frozen_string_literal: true require 'spec_helper' describe Gitlab::RepositorySetCache, :clean_gitlab_redis_cache do let_it_be(:project) { create(:project) } let(:repository) { project.repository } let(:namespace) { "#{repository.full_path}:#{project.id}" } let(:cache) { described_class.new(repository) } ...
25.040816
89
0.625645
2691326e861ff7774adc0c64c6f25c740a8b82fc
1,897
# frozen_string_literal: true module Capybara module RSpecMatcherProxies def all(*args, &block) if defined?(::RSpec::Matchers::BuiltIn::All) && args.first.respond_to?(:matches?) ::RSpec::Matchers::BuiltIn::All.new(*args) else find_all(*args, &block) end end def within(*...
24.012658
127
0.642594
f77546e9ee5833586c2dbbacf44e64ad9d1c00cb
813
Pod::Spec.new do |s| s.name = "SLAppPay" s.version = "1.0.0" s.swift_version = "5.0" s.summary = "支付" s.description = "微信支付,支付宝支付" s.homepage = "https://github.com/2NU71AN9/SLAppPay" #项目主页,不是git地址 s.license = { :type => "MIT", :file => "LICENSE" } #开源协议 s.author = { "...
35.347826
116
0.597786
3306cab9424f79042b43b71dcfe5924e2bede649
1,435
# typed: false require 'ddtrace/contrib/analytics' require 'ddtrace/contrib/action_cable/event' module Datadog module Contrib module ActionCable module Events # Defines instrumentation for 'broadcast.action_cable' event. # # A single 'broadcast' event will trigger as many 'transmit'...
28.137255
93
0.616028
1c54dcec82e45865f001a7be54b7a25f79bcb007
5,442
# Copyright (c) 2018-2019 VMware, Inc. All Rights Reserved. # SPDX-License-Identifier: MIT # DO NOT MODIFY. THIS CODE IS GENERATED. CHANGES WILL BE OVERWRITTEN. # vcenter - VMware vCenter Server provides a centralized platform for managing your VMware vSphere environments require 'date' module VSphereAutomation ...
28.946809
111
0.619993
79509bb0239645670b43719700985b068b496f2b
1,511
# encoding: utf-8 #--- # @author hweng@ucsd.edu #--- class SessionsController < ApplicationController def new if Rails.configuration.shibboleth redirect_to shibboleth_path else redirect_to developer_path end end def developer find_or_create_user('developer') end def shibboleth ...
26.982143
318
0.718068
6a1d6b18b48364ed02ad6b707fc1f376deb2a66e
461
Gem::Specification.new do |gem| gem.name = "vpmframe" gem.version = "0.10.0" gem.authors = ["Chris Van Patten"] gem.email = ["info@vanpattenmedia.com"] gem.description = "vpmframe Ruby tools" gem.summary = "General vpmframe Ruby utilities and requirements" gem.homepag...
32.928571
72
0.618221
4a22bd6f342a8200e136a9ad2657e5e95c9fc210
2,011
require 'spec_helper' require Rails.root.join('db', 'migrate', '20180201110056_add_foreign_keys_to_todos.rb') describe AddForeignKeysToTodos, :migration do let(:todos) { table(:todos) } let(:project) { create(:project) } let(:user) { create(:user) } context 'add foreign key on user_id' do let!(:todo_with...
30.469697
87
0.664843
26b1fa325015368a4516acc9128d4dcb984a6fe8
1,298
Dummy::Application.configure do # Settings specified here will take precedence over those in config/application.rb # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development # since you don't have to restart the web serv...
39.333333
109
0.781972
335135696ef899c28c4a5541770b6d378ec30b7f
5,538
# frozen_string_literal: true require 'spec_helper' describe Gitlab::Gfm::ReferenceRewriter do let_it_be(:group) { create(:group) } let_it_be(:user) { create(:user) } let(:new_project) { create(:project, name: 'new-project', group: group) } let(:old_project) { create(:project, name: 'old-project', group: gro...
30.428571
101
0.59191
1a8a0ea5b44915d8c87ec70e4278e6b4d53efc3b
499
require 'formula' class Coccinelle < Formula homepage 'http://coccinelle.lip6.fr/' url 'http://coccinelle.lip6.fr/distrib/coccinelle-1.0.0-rc17.tgz' sha1 '5c13e521578e20d3805f571dc86931cbd8d63ccd' depends_on "objective-caml" def install system "./configure", "--disable-dependency-tracking", ...
26.263158
67
0.593186
4a65c978e5c36da4fc8a2cd05d5ab4355b240732
755
class Profiles::EmailsController < ApplicationController layout "profile" def index @primary = current_user.email @emails = current_user.emails end def create @email = current_user.emails.new(email_params) flash[:alert] = @email.errors.full_messages.first unless @email.save redirect_to p...
20.972222
72
0.724503
62e8ef6f11aad2b39b6f3ae856e465762edd6851
643
module Arel module Nodes class And < Arel::Nodes::Node attr_reader :children def initialize children, right = nil super() unless Array === children warn "(#{caller.first}) AND nodes should be created with a list" children = [children, right] end @ch...
18.371429
74
0.534992
3362b194772991f37c7bb37d3449cabc096edf3d
359
class CreateParties < ActiveRecord::Migration[5.2] def change create_table :parties do |t| t.string :title t.text :description t.references :comuna, foreign_key: true t.string :address t.integer :cost t.boolean :search, :default => true t.boolean :ended, :default => false...
22.4375
50
0.635097
79df4dba539ff97be2e6f44d57614073ae1f665c
83
require 'test_helper' class InstrumentsDatasetsTest < ActiveSupport::TestCase end
16.6
55
0.843373
ab6a6992725304c543e153645fb348f4005dd723
294
module TD::Types # A chat was blocked or unblocked. # # @attr chat_id [Integer] Chat identifier. # @attr is_blocked [Boolean] New value of is_blocked. class Update::ChatIsBlocked < Update attribute :chat_id, TD::Types::Integer attribute :is_blocked, TD::Types::Bool end end
26.727273
55
0.707483
330a01b66f6d0cdccf434d4d78d0a9d71a0587ba
1,503
class Proxytunnel < Formula desc "Create TCP tunnels through HTTPS proxies" homepage "https://github.com/proxytunnel/proxytunnel" url "https://github.com/proxytunnel/proxytunnel/archive/v1.10.20210604.tar.gz" sha256 "47b7ef7acd36881744db233837e7e6be3ad38e45dc49d2488934882fa2c591c3" license "GPL-2.0-or-later" ...
46.96875
123
0.726547
3927d435a5482a3e6df1c7897228b8a466c5830c
137
require "test_helper" class BooksControllerTest < ActionDispatch::IntegrationTest # test "the truth" do # assert true # end end
17.125
59
0.737226
6adfb2ca2f1d2abf57b93be5853815c30e0da267
27,707
# 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...
49.565295
164
0.572671
7a6ea5c32311e7d347bef0ff5bb992373c61eedf
2,543
module IOStreams module Zip class Reader < IOStreams::Reader # Read from a zip file or stream, decompressing the contents as it is read # The input stream from the first file found in the zip file is passed # to the supplied block. # # Parameters: # entry_file_name: [String] ...
32.189873
106
0.575698
6235b8dfe825d9a0209c7088682e44322a421d14
241
# encoding: UTF-8 require 'spec_helper' describe Outcome, type: :model do context "validations" do it { should validate_presence_of :title } end context "associations" do it { should have_many :review_decisions } end end
18.538462
45
0.713693
33a323748ac9c16b5b76603cfdd18071aad81eac
251
class AddTypeToContentProviders < ActiveRecord::Migration[4.2] def change add_column :content_providers, :content_provider_type, :string, :default => 'Organisation' ContentProvider.update_all(content_provider_type: 'Organisation') end end
35.857143
94
0.792829
38625b05a64909240a60468ae5be2d7f68b09b03
2,475
# Actions for QingGroups # All requests in this controller are AJAX based. class QingGroupsController < ApplicationController include Parameters # authorization via cancan load_and_authorize_resource before_action :prepare_qing_group, only: [:create] before_action :validate_destroy, only: [:destroy] afte...
28.77907
107
0.726465
7aa115f790f6752028d820c3a3b914357af0fa20
260
class AlterTableAddresses < ActiveRecord::Migration def change remove_column :addresses, :state remove_column :addresses, :user_id change_column :addresses, :city, 'integer USING CAST(city AS integer)' rename_column :addresses, :city, :city_id end end
28.888889
71
0.784615
18ead8e97d12a97a583dda5a7237ceea9e76444f
912
class FixCanarsieLorimerMyrtle < ActiveRecord::Migration[5.2] def change canarsieln = LineDirection.joins(:line).find_by(lines: {name: "Canarsie (Lorimer Street—Myrtle Avenue)"}, direction: 1) canarsieln.first_stop = "L16N" # DeKalb Av canarsieln.first_branch_stop = "L17N" canarsieln.first_alternate_b...
41.454545
123
0.735746
33d076ee7eedac0825593efe717a5f8b56ae5c81
1,945
class OptionButton < Button def initialize(source = nil) init_source source init_inner_control_vars end def current_godot_object "OptionButton" end def selected @source.selected end def selected=(v) @source.selected = v end def align @source.align end def align=(v) ...
15.436508
47
0.698715
6160524eb38ba998863ec40e0521aec06c2b016f
23,686
require "abstract_unit" Category = Struct.new(:id, :name) class FormCollectionsHelperTest < ActionView::TestCase def assert_no_select(selector, value = nil) assert_select(selector, text: value, count: 0) end def with_collection_radio_buttons(*args, &block) @output_buffer = collection_radio_buttons(*arg...
46.261719
180
0.718906
e972cb44df5fefc9441a14a256a18a577d5447bf
42
module Api::LocationsControllerHelper end
14
37
0.880952
39124707bdc48aa5935445763d9257a1093b0b85
210
class CreateBuildings < ActiveRecord::Migration[6.0] def change create_table :buildings do |t| t.string :name t.string :address t.integer :owner_id t.timestamps end end end
17.5
52
0.652381
39008f982c46a1bb8284c70f366ba3a3510e4245
644
require 'did_you_mean/spell_checkers/name_error_checkers/class_name_checker' require 'did_you_mean/spell_checkers/name_error_checkers/variable_name_checker' module DidYouMean module NameErrorCheckers def self.included(*) raise "Do not include this module since it overrides Class.new method." end d...
29.272727
99
0.743789
f79b022f31b77a8e31dc7cec0657fe257dd3aa97
7,651
## # Copyright 2012 Twitter, 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 wri...
42.270718
131
0.707228
91667c8eef7b84729600d06fc04e7f2d2b5ccdf2
522
module Cronis::Lecture13 class Task11 def sort(array) (1..array.size - 2).each do |i| prev_val, next_val = array[i - 1], array[i + 1] is_top = array[i] >= prev_val && array[i] >= next_val is_down = array[i] <= prev_val && array[i] <= next_val if !is_top && !is_down ...
20.88
62
0.515326
4ac9f5d7783d786991e01553ad39a1e3552488d2
375
require "bundler/setup" require "can_render_markdown" RSpec.configure do |config| # Enable flags like --only-failures and --next-failure config.example_status_persistence_file_path = ".rspec_status" # Disable RSpec exposing methods globally on `Module` and `main` config.disable_monkey_patching! config.expe...
25
66
0.76
ed56ebd63afe5864d92e3d08c6dd34106d824e63
911
# # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. # Run `pod lib lint background_sms.podspec' to validate before publishing. # Pod::Spec.new do |s| s.name = 'background_sms' s.version = '0.0.1' s.summary = 'A new flutter plugin project.' s.descr...
37.958333
104
0.599341
286c2e217eef9b906fbdd75be5a6aee382171873
2,533
ActiveAdmin.register Bio do # See permitted parameters documentation: # https://github.com/gregbell/active_admin/blob/master/docs/2-resource-customization.md#setting-up-strong-parameters # permit_params :bio, :user, :title, :name, :info, :admin_user_id, :admin_user, :image, :twitter, :email, :w...
31.6625
176
0.663245
5dedae03c74870340b4c341f6af5600a5c1c41f9
45
module HashValidator VERSION = '1.0.0' end
11.25
20
0.711111
01a25533eb16598442a14d91de6b4345c1e35956
1,023
module Fog module Compute class DigitalOcean class Real def list_images(options = {}) request( :expects => [200], :method => 'GET', :path => 'images' ) end end class Mock def list_images response = ...
22.23913
45
0.346041
ac325fed4047a1a03a9a7c0059d4b6c8a5c4f8d5
2,813
class Mpich < Formula desc "Implementation of the MPI Message Passing Interface standard" homepage "https://www.mpich.org/" url "https://www.mpich.org/static/downloads/3.2.1/mpich-3.2.1.tar.gz" mirror "https://fossies.org/linux/misc/mpich-3.2.1.tar.gz" sha256 "5db53bf2edfaa2238eb6a0a5bc3d2c2ccbfbb1badd79b664a...
31.965909
93
0.644152
1a917e58ec4190226fe269ca68cfbfb05c8f44cb
3,898
class Erlang < Formula desc "Programming language for highly scalable real-time systems" homepage "https://www.erlang.org/" # Download tarball from GitHub; it is served faster than the official tarball. url "https://github.com/erlang/otp/archive/OTP-21.0.tar.gz" sha256 "5a2d8e33c39a78a2dcc0c39bf9d2dfdf2974f0f...
35.117117
104
0.691124
3913648083e59f3ac02007e817d2d8b034796f15
4,198
require "spec_helper" describe DailyViolationEmailWorker do let(:user1) { create(:user) } let(:user2) { create(:user) } let(:user3) { create(:user) } let(:advocate1) { create(:user, :advocate) } let(:advocate2) { create(:user, :admin) } let(:advocate3) { create(:user, :advocate) } let(:sensor1) { creat...
42.836735
106
0.669843
62a44899a05296a8898702ec60904c2c2591aaf0
1,537
module Cryptoexchange::Exchanges module Indoex module Services class Market < Cryptoexchange::Services::Market class << self def supports_individual_ticker_query? false end end def fetch output = super(ticker_url) adapt_all(output)...
31.367347
83
0.536109
2129c40c733a8a8be22b4403f75c716b7e5cc09f
181
class Hotel attr_accessor :name, :info @@all = [] def initialize(name, info) @name = name @info = info @@all << self end def self.all @@all end end
10.055556
28
0.552486
4a7df9db5ca9d45ad45293308fa6214b5f422f4d
2,770
# 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...
41.969697
156
0.688087