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
080a9c97b96def9e42426e38060c43d2a1d554df
2,666
# Encoding: utf-8 # Cloud Foundry Java Buildpack # Copyright 2013 the original author or authors. # # 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/LICEN...
31.364706
120
0.746812
7a305cab29d65ac8e4961c8e0fa8c3b61495dd88
544
require 'lino' require_relative 'base' require_relative 'mixins/profile' require_relative 'mixins/environment' module RubyLeiningen module Commands class Uberjar < Base include Mixins::Profile include Mixins::Environment def configure_command(builder, opts) builder = super(builder, op...
21.76
73
0.705882
38153657403410c5f2662f19e734bd0ac06dd90b
122
class AddCalumnoToCitars < ActiveRecord::Migration[5.0] def change add_column :citars, :calumno, :integer end end
20.333333
55
0.745902
f7b35e76925469c4243024411d9355abe7a40729
4,945
require 'spec_helper' describe TodosFinder do describe '#execute' do let(:user) { create(:user) } let(:group) { create(:group) } let(:project) { create(:project, namespace: group) } let(:issue) { create(:issue, project: project) } let(:merge_request) { create(:merge_request, source_project: proje...
36.360294
111
0.608089
7a92ee34809cf40ec79b32a47574d238aa88892b
7,495
require "language/go" class Influxdb < Formula desc "Time series, events, and metrics database" homepage "https://influxdata.com/time-series-platform/influxdb/" url "https://github.com/influxdata/influxdb/archive/v0.10.1.tar.gz" sha256 "6a66373006a249cb6ab2a2f33b924694486ee07b1d9096c3f770376d0351b703" bottl...
32.586957
155
0.684323
e9cde285cd1839f634fb894b377e0cd94ec19daf
1,454
require 'spec_helper' RSpec.describe Idnow::RawResponse do let(:idnow_response) { Idnow::RawResponse.new(response) } let(:successful_raw_response) { 'was successful' } let(:failure_raw_response) do '{ "errors": [{ "cause": "SOMETHING...
25.508772
68
0.570839
d5fe28f350b3c8c46ead651b803682034e3cd86d
444
module Shared::UnionScope def self.included(base) base.send :extend, ClassMethods end module ClassMethods def union_scope(*scopes) id_column = "#{table_name}.id" if (sub_query = scopes.reject { |sc| sc.count == 0 } .map { |s| "(#{s.select(id_column).to_sql})" } .j...
22.2
58
0.560811
d5aa20c9a87787dbf89a83beaac5e4b2450cd9c3
41
module Talentlms VERSION = "1.0.3" end
10.25
19
0.682927
28dfc575047474b8e35a85766773b089a50329a0
428
class Smartsynchronize < Cask version '3.4' sha256 'f7d30bae37c835ea208ff60b5b99c2668e3406c06f1321862495a425a9389322' url "http://www.syntevo.com/download/smartsynchronize/smartsynchronize-macosx-#{version.gsub('.','_')}.dmg" homepage 'http://www.syntevo.com' license :unknown app "SmartSynchronize.app" ...
28.533333
109
0.778037
bfb64be10fc37c6cfb98049af6b7b02a51e0fe0c
2,147
# Interpolaciones de strings no solo con #{} class FastInterpolation attr_accessor :var def print p "Hola #@var" end end a = FastInterpolation.new a.var = "Manuel" a.print #------------------------------------------------ # rescue no necesitan begin class RescueEasy def blowup 1/0 rescue put...
15.786765
76
0.560782
6191968f9ff4673b9959f32614bf7facea83ea98
73
require_relative 'tasks/autoclean' require_relative 'tasks/seedregistry'
24.333333
37
0.863014
26193ecbd91f738217b502c3212a363c4fc9f556
33,624
require "kitchen" require_relative "azure_credentials" require "securerandom" require "azure_mgmt_resources" require "azure_mgmt_network" require "base64" require "sshkey" require "fileutils" require "erb" require "ostruct" require "json" require "faraday" module Kitchen module Driver # # Azurerm # c...
42.082603
682
0.676303
622eb53fc7145e1cab8f620afce6874afa54991c
4,435
# -*- indent-tabs-mode: nil; fill-column: 110 -*- require 'rspec' require "spec_helper" require 'chef_fixie' require 'chef_fixie/config' RSpec.describe ChefFixie::CheckOrgAssociations, "Association checker" do let (:test_org_name) { "ponyville"} let (:orgs) { ChefFixie::Sql::Orgs.new } let (:test_org) { orgs[tes...
31.453901
116
0.717024
8720e6adfbab2772928dfcd05e26c71dfd9bbd9e
255
class ApplicationController < ActionController::Base rescue_from DeviseLdapAuthenticatable::LdapException do |exception| render :text => exception, :status => 500 end protect_from_forgery with: :exception before_action :authenticate_user! end
31.875
69
0.796078
bb2ccb5bf80359a485f6f7d0c68eeab9b889267d
7,254
=begin #Datadog API V1 Collection #Collection of all Datadog Public endpoints. The version of the OpenAPI document: 1.0 Contact: support@datadoghq.com Generated by: https://openapi-generator.tech Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. This product...
30.478992
214
0.632203
bb785fed4f0556cad932c4f6ea004b29977971c1
349
module ActiveModel module Dirty def changes_attributes HashWithIndifferentAccess[changed.map { |attr| [attr, __send__(attr)] }] end def changes_attributes_as_json ca, json = changes_attributes, self.as_json json.each do |key, value| ca[key.to_s] = value if ca.key?(key) end...
20.529412
78
0.65043
5da5565401b5ac10c3f92b836f1835951309256d
1,042
# frozen_string_literal: true module Sequel::Plugins::AttrEncrypted::SimpleCrypt extend self require "base64" SEPARATOR = "$" def encrypt(string, key) return unless string.is_a?(String) && !string.empty? encryptor = new_cipher(key, &:encrypt) iv = encryptor.random_iv encrypted = encryptor.u...
22.170213
71
0.683301
5d2603e3b36cec66cd70f5c6eaaaa56c4f7f6195
2,505
require 'csv' require 'google/apis/civicinfo_v2' require 'erb' require 'pry-byebug' require 'date' def clean_zipcode(zipcode) zipcode.to_s.rjust(5, '0')[0..4] end def legislators_by_zipcode(zip) civic_info = Google::Apis::CivicinfoV2::CivicInfoService.new civic_info.key = 'AIzaSyClRzDqDh5MsXwnCWi0kOiiBivP6JsSyB...
24.80198
106
0.735329
01b8973b1feb8432f45375b8ac7a12f70a3132a4
3,148
# 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 #...
42.540541
126
0.728399
7957a7bfbc70f183858ccbb3a7367b51034842c7
752
# frozen_string_literal: true require_relative '../app/credentials' require_relative '../app/s3' require 'aws-sdk-s3' describe Credentials do it 'can get the AWS profile name' do allow(System).to receive(:log) profile_name = Credentials.profile_name expect(profile_name).is_a? String end context 'mi...
24.258065
64
0.706117
7ab805a30180b3e0ce0877b1ffa446a6af70a207
3,830
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Storage::Mgmt::V2018_02_01 # # The Azure Storage Management API. # class Operations include MsRestAzure # # Creates and i...
35.137615
161
0.679373
6a9e84227bde528b994ebeda4c23e26291a6d092
414
module Abilities class AuthorizedVendorAbility include CanCan::Ability def initialize(user, organization_ids=[]) #------------------------------------------------------------------------- # Vendors #------------------------------------------------------------------------- can :manage...
25.875
80
0.405797
b9743bf23c0004885dcd0c294ad04d23a947b2be
13,204
# # Copyright (C) 2010-2016 dtk contributors # # This file is part of the dtk project. # # 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 # # Unles...
30.494226
209
0.664647
f71e4a553db7a0f7dd89df925b260be201b6a19d
300
class CreateApplicationInterviewers < ActiveRecord::Migration def self.up create_table :application_interviewers do |t| t.integer :application_for_offering_id t.integer :person_id t.timestamps end end def self.down drop_table :application_interviewers end end
20
61
0.743333
61ed8b4af43218da5debcafd3b093fa9ae8ebfc1
2,417
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::DataFactory::Mgmt::V2018_06_01 module Models # # A copy activity source for web page table. # class WebSource < CopySource ...
26.855556
70
0.445594
3847aec3cda752a99fce5693bbfc6e551d08e7d7
378
class HomeController < ApplicationController def index end def contact_us end def menu @sections = Section.all @food_items = FoodItem.get_menu_by_params(params[:section], params[:orderby]) # if params[:section] # @food_items = Section.where(section_name: params[:section]).take.food_items #...
18.9
81
0.698413
79fdf14dc8f1fc4c3753922c889387ef1d382855
797
class ErrorsController < ApplicationController def not_found respond_to do |format| format.json { render json: { status: 404, error: 'Not Found' } } format.html { render(status: 404) } end end def unprocessable respond_to do |format| format.json { render json: { status: 422, error:...
23.441176
82
0.646173
e841dd80b675889630085b8632f6eb3dc16179c3
2,410
# frozen_string_literal: true require 'spec_helper' RSpec.describe Groups::Crm::OrganizationsController do let_it_be(:user) { create(:user) } shared_examples 'response with 404 status' do it 'returns 404' do subject expect(response).to have_gitlab_http_status(:not_found) end end shared_...
24.845361
88
0.656432
386efe23bd3bee40f61544e5b96537f2f8c82b6e
2,691
module Rack::Test::Assertions RESPONSE_CODES = { :ok => 200, :not_authorized => 401, :not_found => 404, :redirect => 302 } CONTENT_TYPES = { :json => "application/json;charset=utf-8", :html => "text/html;charset=utf-8" } def assert_body_contains(expected, messa...
28.935484
106
0.672241
799c33212077582eecb69af1c007001d1437eca9
3,111
module Matching class Engine attr :orderbook, :mode, :queue delegate :ask_orders, :bid_orders, to: :orderbook def initialize(market, options={}) @market = market @orderbook = OrderBookManager.new(market.id) # Engine is able to run in different mode: # dryrun: do the match, do...
26.589744
139
0.617486
014fc24cd8e14a15806e0a04a9758f7abb7a2f44
672
require 'fileutils' module MiqLdapToSssd class AuthTemplateFilesError < StandardError; end class AuthTemplateFiles TEMPLATE_DIR = "/var/www/miq/system/TEMPLATE".freeze ALT_TEMPLATE_DIR = "/opt/rh/cfme-appliance/TEMPLATE".freeze HTTPD_CONF_DIR = "/etc/httpd/conf.d".freeze PAM_CONF_DIR = "...
28
80
0.712798
e2f11e5093e8f0b5e0e9a19709b59d36e45c7fca
122
json.array!(@images) do |image| json.extract! image, :id, :url, :user_id json.url image_url(image, format: :json) end
24.4
42
0.688525
38323cbccbe7519e7b2c7497ea0544bf0dcbbe79
333
# # Cookbook Name:: application_rails # Recipe:: rails # include_recipe 'application_rails::clone' if node['application_rails']['git_integration'] # Install required gems include_recipe "application_rails::gems" # Configure and install app include_recipe "application_rails::install" # Start App Server #include_reci...
20.8125
89
0.783784
ac2293ede57a78dd81258f00bc74df2cde141eac
5,226
require 'aws-sdk-core' require 'keystore' timestamp = Time.now.strftime '%Y%m%d%H%M%S' ts_key = "testkey#{timestamp}" ts_val = "testvalue#{timestamp}" Given(/^test data to use$/) do @key = ts_key @value = ts_val end Given(/^a region to operate in$/) do @region = ENV['region'] raise if @region.nil? end Given...
35.55102
117
0.683506
4a7db09a7e7356052e865757d91e2eda2a76ce8b
1,134
# frozen_string_literal: true require 'rails_helper' RSpec.describe User do describe 'guests_without_bookmarks scope' do let!(:guest_user_with_bookmarks) { FactoryBot.create(:user, guest: true) } let!(:non_guest_user) { FactoryBot.create(:user, guest: false) } before do Bookmark.create(document: ...
30.648649
101
0.713404
7a8c7b06cc14693322fdd433fcabef8ba1fc8009
5,865
require 'benchmark' module RedisPrometheus class Middleware def initialize(app, options = {}) @app = app end def call(env) if env["PATH_INFO"] == "/metrics/#{ENV["REDIS_PROMETHEUS_TOKEN"]}" results(env) else trace(env) do @app.call(env) end end ...
38.585526
146
0.649446
e206f8438963d6900e43beb5088ec5a314ee77cc
556
class StateBuilder def self.build(state, &block) # If no block is passed in, raise an exception raise "You need a block to build!" unless block_given? StateBuilder.new(state, &block) end def initialize(state, &block) @state = state # Evaluate the contents of the block passed in within the c...
24.173913
102
0.708633
1ce049746221f6c9829c44e2e7d5234291ec242c
1,277
require 'spec_helper' describe "cms_copy_nodes", type: :feature, dbscope: :example do let(:site) { cms_site } let(:node) { create :cms_node } let(:index_path) { node_copy_path site.id, node.id } context 'run copy nodes' do let(:target_node_name) { unique_id } before do login_cms_user end ...
29.022727
93
0.686766
28326872fff59a2718ee2aefa27b5e10b644db29
751
module RestforceMock class Configuration attr_accessor :schema_file attr_writer :error_on_required attr_writer :required_exclusions attr_writer :raise_on_schema_missing attr_accessor :objects_for_schema attr_writer :objects_for_schema def error_on_required @error_on_required.nil? ?...
22.757576
70
0.721704
1128b0557bc6d8b99d88e2c9236d01148c7bfdec
2,054
require "rails_helper" # Our helper slug class so we can use the helper methods in our spec module SpecHelperClassesForViews class InsuredFamiliesHelperSlugForGroupSelectionTermination extend Insured::FamiliesHelper end end RSpec.describe "app/views/insured/group_selection/terminate_confirm.html.erb" do con...
47.767442
177
0.779942
18308f979bd49cd985fe00dba56c2a3dff3a57af
19
module Likeable end
9.5
15
0.894737
267f6e3e9a71934f57cf4d63980486c835982d36
13,578
# results.rb require_relative '../config/environment' require 'rails_helper' require 'test_utils' describe "Module #3 Summative: Implement Results Collection" do include Test_utils before :all do $continue = true end around :each do |example| if $continue $continue = false ...
42.564263
121
0.664089
1c1b85823d1cd4e7cbb52d75ae8bc87679b7a1c3
1,339
class Libgig < Formula desc "Library for Gigasampler and DLS (Downloadable Sounds) Level 1/2 files" homepage "https://www.linuxsampler.org/libgig/" url "https://download.linuxsampler.org/packages/libgig-4.2.0.tar.bz2" sha256 "16229a46138b101eb9eda042c66d2cd652b1b3c9925a7d9577d52f2282f745ff" bottle do cel...
32.658537
93
0.679612
bf88586e95928916338b3425cadca6d9bd1443f6
2,227
# frozen_string_literal: true # # @author Kivanio Barbosa require 'date' module Brcobranca # Métodos auxiliares de cálculos envolvendo Datas. module CalculoData # Calcula o número de dias corridos entre a <b>data base ("Fixada" em 07.10.1997)</b> e a <b>data de vencimento</b> desejada. # A partir de 22.0...
34.796875
129
0.670858
79fb6716ad60aa39b001fc179ff0ba24beac3df7
772
name 'firefox' maintainer 'Nghiem Ba Hieu' maintainer_email 'hi3unb@gmail.com' license 'Apache-2.0' description 'Installs/Configures firefox' long_description 'Installs/Configures firefox' version '0.1.1' chef_version '>= 12.1' if respond_to?(:chef_version) supports 'windows' # The `issues_url` points to the location...
33.565217
79
0.770725
e9de936bf095e4db4ff93f102dd6fce20edf0720
695
SpinningWheel.define do fabric name: 'transaction', class_name: 'SixSaferpay::Transaction' do type { 'PAYMENT' } status { 'AUTHORIZED' } id { 'K5OYS9Ad6Ex4rASU1IM1b3CEU8bb' } capture_id { 'ECthWpbv1SI6SAIdU2p6AIC1bppA' } date { '2011-09-23T14:57:23.023+02.00' } amount { SpinningWheel.create('a...
38.611111
71
0.713669
4af5de051c12f9b3f32a88934b67d47dc654fc36
822
require "./src/common/validators/validator_factory" require "./src/user_config/validators/aws_validator" require "./src/user_config/validators/azure_validator" require "./src/user_config/validators/newrelic_validator" require "./src/user_config/validators/git_validator" module UserConfig module Validators ...
29.357143
74
0.627737
38057703ef590ddf5105a6b8102eee21974a2d6d
397
module SfdcUpdatable extend ActiveSupport::Concern module ClassMethods def updater_klass "#{self.name}::Updater".constantize end def set_sfdc_updatable_attributes(exc) @none_queriable_attributes = exc end def set_sfdc_updatable_attributes @none_queriable_attributes || [] end def...
17.26087
41
0.730479
1c8d230977cf8d6aa4e60038800095c3796f756b
2,449
# frozen_string_literal: true require "active_record_doctor/detectors/base" module ActiveRecordDoctor module Detectors class MissingUniqueIndexes < Base # :nodoc: @description = "detect uniqueness validators not backed by a database constraint" @config = { ignore_models: { descript...
34.013889
140
0.628011
2802c0409002717eecf28eafbf53f998b1826d1f
424
cask 'simpholders' do version '3.0.10,2277' sha256 'edcfb7b1c78873755487640615960980f2c13ae56a565f67c55d30ad1657f134' url "https://simpholders.com/site/assets/files/#{version.after_comma}/simpholders_#{version.before_comma.dots_to_underscores}.dmg" appcast 'https://simpholders.com/releases/' name 'SimPholder...
30.285714
132
0.771226
f898b4087d38804d09c7a0e44b4f48c53614850b
1,195
class Backend::UsersController < Backend::ApplicationController before_action :set_user, only: [:edit, :update, :destroy] def index q = params[:q] p = params[:page] if !q.blank? @users = User.page(p).name_like(params[:q]) else @users = User.page(p) end end def new ...
20.964912
71
0.586611
1d27b3933eae016b7b01a488efa0c4b1a4151da9
1,519
# coding: utf-8 require File.expand_path('../lib/bosh_agent/version', __FILE__) version = Bosh::Agent::VERSION Gem::Specification.new do |s| s.name = 'bosh_agent' s.version = version s.summary = 'Agent for Cloud Foundry BOSH release engineering tool.' s.description = "This agent listens for ins...
39.973684
143
0.613562
0856e2602fa70c2bab1ea739d0f3d2b2dd2085e3
617
# 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, ...
38.5625
74
0.766613
ac3b613ccd66c813e1c542971457e32441df6a2e
3,079
# Copyright © 2011-2019 MUSC Foundation for Research Development~ # All rights reserved.~ # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:~ # 1. Redistributions of source code must retain the above copyright notice, this l...
47.369231
146
0.728158
8777444a1179d4f3533e881435b017861915a10c
93
require "health_check_rails/version" module HealthCheckRails # Your code goes here... end
15.5
36
0.784946
ed54882e7aa9e29614b0a84f90d6e29b7fe86697
5,246
# frozen_string_literal: true require 'set' module Sprockets # Internal: Utils, we didn't know where else to put it! Functions may # eventually be shuffled into more specific drawers. module Utils extend self # Internal: Check if object can safely be .dup'd. # # Similar to ActiveSupport #duplica...
25.970297
143
0.592451
034288af1db7c63cfa1fa9b91b28c4a80255dfda
1,534
module Crawler module Rails module Sites class EntriesController < ApplicationController def new @site = Site.find(params[:site_id]) @entry = @site.entries.build end def create @site = Site.find(params[:site_id]) @entry = @site.entries.build(e...
26.912281
76
0.525424
03004580e7f7a3d63204ee716d052ebbec9fb76b
2,601
class Gearman < Formula desc "Application framework to farm out work to other machines or processes" homepage "http://gearman.org/" url "https://github.com/gearman/gearmand/releases/download/1.1.19.1/gearmand-1.1.19.1.tar.gz" sha256 "8ea6e0d16a0c924e6a65caea8a7cd49d3840b9256d440d991de4266447166bfb" license "B...
30.6
104
0.658593
ac3cb4b20763d2956bcb8b01963e681459dd44ce
207
class CreateCities < ActiveRecord::Migration def change create_table :cities do |t| t.string :name, presence: true t.belongs_to :state, presence: true t.timestamps end end end
18.818182
44
0.671498
0159d84563e2fe70acab4ec57cb8af8b6a03ee24
54,162
# encoding: UTF-8 # 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. # # Note that this schema.rb definition is the authoritative sou...
41.567153
182
0.694768
33de41d5bb3f10238d88179996826f3690de1637
8,937
require 'test_helper' class AppiumLibCoreTest class DriverTest < Minitest::Test include AppiumLibCoreTest::Mock def setup @core ||= ::Appium::Core.for(Caps.android) end class ExampleDriver def initialize(opts) ::Appium::Core.for(opts) end end def test_no_caps ...
40.622727
113
0.588117
bf44dd2cfe877c85e932a4c484dd7cd3b37d00fb
916
# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::Rekognition module Errors extend Aws::Errors::DynamicErrors class HumanLoopQuotaExceeded...
22.341463
78
0.663755
acf8e116fc9c98d837356bf5a3ecae4ae1bddf89
76
require 'rubygems' require 'bundler/setup' require 'rspec' require 'glitter'
19
23
0.789474
4a1b4d9dfdd220cd59077be270cb777523377f98
750
require 'web_blocks/framework' require 'web_blocks/structure/tree/leaf_node' require 'web_blocks/structure/attribute/dependency' require 'web_blocks/structure/attribute/loose_dependency' module WebBlocks module Structure class RawFile < ::WebBlocks::Structure::Tree::LeafNode include WebBlocks::Framework ...
25
86
0.678667
e28b63b652becffc8363d2f6f0784bf812600e6b
62
module FFI module RadixTree VERSION = "0.4.0" end end
10.333333
21
0.645161
ffa3f7ca534a02f08adf9ffc0246f65e8da90512
6,156
require 'models/runtime/space' require 'models/runtime/app_model' require 'models/runtime/build_model' require 'models/runtime/route_mapping_model' require 'models/runtime/package_model' require 'models/runtime/droplet_model' require 'models/runtime/buildpack_lifecycle_data_model' require 'models/runtime/buildpack_lif...
45.940299
83
0.870045
1113fa94bd8b54e50c7f13166ffe559c9dacd35f
132
class Result < ActiveRecord::Base belongs_to :exam_sessions, :class_name => "ExamSessions", :foreign_key => "exam_session_id" end
33
93
0.765152
4aaa0ee685d069529b311b05d1e44c980f6e1cc5
119
class ChangeEndAtInErrands < ActiveRecord::Migration def change change_column :errands, :end_at, :date end end
19.833333
52
0.764706
38bb0ae6cd8d21bd2f41fb031d26171d47dc3537
563
class RemoveEditedAtEditedByFromDocument < ActiveRecord::Migration[5.2] def up remove_column :versioned_documents, :last_edited_at remove_reference :versioned_documents, :last_edited_by end def down add_column :versioned_documents, :last_edited_at, :datetime, ...
31.277778
73
0.648313
d578e39f231f4fffb3d6ad3bf12dc782fdb72f5c
77
class Favorite < ApplicationRecord belongs_to :user has_many :houses end
15.4
34
0.792208
038a6429a6c7d0d1b91e800843fa35ee571a876d
1,073
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'weather_judge/version' Gem::Specification.new do |spec| spec.name = "weather_judge" spec.version = WeatherJudge::VERSION spec.authors = ["Makoto Scott-Hinkle"] spec.e...
41.269231
125
0.662628
01510e256a936e8b18cde90a563f7d7da4deeaec
185
class BallotResponse < ActiveRecord::Base belongs_to :source has_and_belongs_to_many :referendums has_and_belongs_to_many :custom_ballots has_many :custom_notes, :as => :object end
26.428571
41
0.827027
61ca72bc4151779dd347a5af527aec6859ec5d5b
843
## SportDb::load_plugins def self.load_plugins @found ||= [] @loaded ||= {} @files ||= Gem.find_files( 'sportdb_plugin.rb' ) puts "#{@files.size} plugin files found:" @files.each do |file| puts " >#{file}<" end ## todo: extract version and name of gem? puts "normalize...
23.416667
90
0.533808
f8ccd450e05d6dcb27dc519b84957500f8456c1f
1,602
SuitRiot::Application.configure do # Settings specified here will take precedence over those in config/application.rb # The test environment is used exclusively to run your application's # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test...
41.076923
85
0.769663
d5ea920a4a40dfd9dd1aa6ceeb34adcd387092b1
1,258
# BioCatalogue: app/controllers/contact_controller.rb # # Copyright (c) 2008-2010, University of Manchester, The European Bioinformatics # Institute (EMBL-EBI) and the University of Southampton. # See license.txt for details. class ContactController < ApplicationController before_filter :disable_action_for_api ...
33.105263
144
0.683625
01cec29480a21ffee06188ae8a4881acc0aa324f
550
# frozen_string_literal: true module DocumentExporter class Thumbnail THUMBNAIL_RATIO = 1.25 def initialize(content) @content = content end def export pdf = ::MiniMagick::Image.read(@content) @width = pdf.pages[0][:width] / THUMBNAIL_RATIO @height = pdf.pages[0][:height] / T...
23.913043
117
0.636364
612cba0a93f46179bed1b82bf987badf0a467ef4
288
Rails.application.routes.draw do root 'missed_calls#index' post 'call/enqueue', to: 'call#enqueue' post 'call/incoming', to: 'call#incoming' post 'assignment', to: 'callback#assignment' post 'events', to: 'callback#events' post 'message/incoming', to: 'message#incoming' end
28.8
49
0.715278
7ab111e45ed682637f66d966f6832d97735d3bdd
443
# frozen-string-literal: true module Navigable class ObserverMap METHODS = { successfully: :on_success, successfully_created: :on_creation, failed_to_validate: :on_failure_to_validate, failed_to_find: :on_failure_to_find, failed_to_create: :on_failure_to_create, failed_to_upda...
26.058824
50
0.726862
5dcc73f2460249b214b90c72ac42a7dca7658b27
1,971
# encoding: UTF-8 # (c) Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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....
40.22449
80
0.664637
b9f575e0a2a087c9fa5236e28ca4e5c57718d4d4
319
module ActiveRecord # Returns the version of the currently loaded Active Record as a <tt>Gem::Version</tt> def self.gem_version Gem::Version.new VERSION::STRING end module VERSION MAJOR = 5 MINOR = 0 TINY = 7 PRE = "2" STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") end end
19.9375
88
0.642633
ab85ab9e3e442d5d8b30a74fbb98267e22f9ba27
5,657
module Rails module Paths # This object is an extended hash that behaves as root of the <tt>Rails::Paths</tt> system. # It allows you to collect information about how you want to structure your application # paths by a Hash like API. It requires you to give a physical path on initialization. # # ...
26.683962
95
0.540746
acfc358fbee1164c94c3ea3e847bbedb667076f1
52,805
# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::CloudTrail # @api private module ClientApi include Seahorse::Model AddTagsRequest = Sh...
70.500668
171
0.761708
d59b69c33f777f83902c431abfa3fb472aee43ec
2,407
class Pybind11 < Formula desc "Seamless operability between C++11 and Python" homepage "https://github.com/pybind/pybind11" url "https://github.com/pybind/pybind11/archive/v2.8.0.tar.gz" sha256 "9ca7770fc5453b10b00a4a2f99754d7a29af8952330be5f5602e7c2635fa3e79" license "BSD-3-Clause" bottle do sha256 ce...
35.397059
112
0.674283
8716f6639dc3e7159cafac27187ccd7c73c93cb9
160
require 'test_helper' class Api::V1::FitnessClassDetailsControllerTest < ActionDispatch::IntegrationTest # test "the truth" do # assert true # end end
20
82
0.75
1ad43d39d67c23798f211b719551f8d3dc200737
10,100
require 'reentrant_flock' require 'rubygems/util' module Geminabox class Server < Sinatra::Base enable :static, :methodoverride set :public_folder, Geminabox.public_folder set :views, Geminabox.views if Geminabox.rubygems_proxy use Proxy::Hostess else use Hostess end class ...
26.578947
124
0.608515
4aee1bb4120fb4bdb5eb88abf10315a3f8d8ee32
169
Rails.application.config.middleware.insert_before 0, Rack::Cors do allow do origins '*' resource '*', headers: :any, methods: %i[get post put delete] end end
28.166667
66
0.698225
38503df19f87d0c21cab09773fad8ac8c21d77f1
196
require 'test_helper' class TitsTest < Minitest::Test def test_that_it_has_a_version_number refute_nil ::Tits::VERSION end def test_it_does_something_useful assert false end end
16.333333
39
0.77551
ab7b41483e13a4a7aa8be90fb926258a12ca5c9a
656
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 Clean class Application < Rails::Application # Initialize configuration defaults for originally generated Rails ver...
32.8
82
0.76372
624b73b9046772f83f887356aa3ed76164486fe7
621
# Copyright (c) 2016, 2020, 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...
44.357143
245
0.742351
616cba85208403843b2107e8b168642ecfd0e148
155
# frozen_string_literal: true #\ --quiet require_relative 'app.rb' use Rack::ETag use Rack::ConditionalGet use Rack::Deflater run Sinatra::Application
12.916667
29
0.767742
3886665874e08997fa6790dede60cffe5f1f7898
8,607
require 'spec_helper' describe Lobot::Clippy do let(:working_path) { Dir.mktmpdir } let(:cli) { double(:cli).as_null_object } let(:clippy) { Lobot::Clippy.new } before { clippy.stub(:cli => cli) } around do |example| Dir.chdir(working_path) { example.run } end describe "#config" do it "creates...
28.69
107
0.65377
0864d2e5dc8acd5797b59d5ae38e9914cb7f213a
297
# WARNING ABOUT GENERATED CODE # # This file is generated. See the contributing guide for more information: # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md # # WARNING ABOUT GENERATED CODE module Aws::CodeDeploy module Errors extend Aws::Errors::DynamicErrors end end
19.8
74
0.760943
1df7e18289edc3501575ce046fd252cb1c385bd5
4,096
class Elasticsearch < Formula desc "Distributed search & analytics engine" homepage "https://www.elastic.co/products/elasticsearch" url "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.0.tar.gz" sha256 "effd922973e9f4fe25565e0a194a4b534c08b22849f03cb9fea13c311401e21b" head do url "...
31.267176
126
0.619385
4a9059c6853d4381cfa686a5d238d9b687273e13
2,071
require 'rails_helper' RSpec.describe Indicator, type: :model do context 'validations' do it 'should be invalid when subcategory not present' do expect( build(:indicator, subcategory: nil) ).to have(1).errors_on(:subcategory) end end context 'linked scenarios and models' do let(:...
28.763889
76
0.667793
91f91a6efd915841a68bef22ddd135cabcb0862e
2,665
class Nybooks::CommandLineInterface def run main_menu goodbye end def main_menu puts "Welcome to New York Times Best Seller Books:" puts "Please select item number below:" puts "1. Hardcover Fiction" puts "2. Hardcover NonFiction" puts "3. Print and E-Book Fiction...
30.632184
91
0.582739
d506b34811a726e2acd47634a1578fca34bc165c
5,221
# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Web::Mgmt::V2016_08_01 # # A service client - single point of access to the REST API. # class WebSiteManagementClient < MsRestAzure::A...
39.255639
154
0.690289
014582f86bc2a6232e2ed879e5e6da37b7841a24
392
class ApplicationController < ActionController::Base before_action :authenticate_user! before_action :configure_permitted_parameters, if: :devise_controller? protected def configure_permitted_parameters devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name]) devise_parameter_sanit...
32.666667
87
0.808673
f793a06845bd625611f864b664d7d361efb9dea6
12,599
# Copyright (c) 2015 Sqreen. All Rights Reserved. # Please refer to our terms for more information: https://www.sqreen.io/terms.html require 'ipaddr' require 'sqreen/events/remote_exception' require 'sqreen/callbacks' require 'sqreen/exception' require 'sqreen/log' require 'sqreen/frameworks/request_recorder' module ...
28.185682
146
0.590682
1d4009c21e6c41f629af5953a27c76a154b0f770
7,393
require 'spec_helper' describe "Koala::Facebook::RealtimeUpdates" do before :all do # get oauth data @oauth_data = $testing_data["oauth_test_data"] @app_id = @oauth_data["app_id"] @secret = @oauth_data["secret"] @callback_url = @oauth_data["callback_url"] @app_access_token = @oauth_data["app_...
39.962162
153
0.671446
3326ff9ef64e9fab7c3afb8d82dbd76c0c950644
2,405
class Scope::Domain < Scope::Parameterized matches 'domain/:id/:domain_scope' description "Grant access to perform API actions against a single domain and the contained applications." DOMAIN_SCOPES = { :view => 'Grant read-only access to a single domain.', :edit => 'Grant edit access to a single domain a...
34.357143
130
0.671102