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
e8b427f570eba599dadb0f959b5927b0fce0499c
511
class AddHomeTimeZoneToEventGroups < ActiveRecord::Migration[5.2] def up add_column :event_groups, :home_time_zone, :string execute <<-SQL.squish UPDATE event_groups SET home_time_zone = (SELECT events.home_time_zone FROM events ...
28.388889
79
0.585127
ed21023cd8a6c252ee913a0f9f2feaf03c3e7d35
4,438
# Copyright (c) 2015 AppNeta, Inc. # All rights reserved. require 'rubygems' require 'bundler/setup' require "minitest/spec" require "minitest/autorun" require "minitest/reporters" require "minitest/debugger" if ENV['DEBUG'] require "sinatra" ENV["RACK_ENV"] = "test" ENV["TRACEVIEW_GEM_TEST"] = "true" ENV["TRACEVIEW_...
21.033175
80
0.719243
1104cda77ffc1281e4943374082f88ca24d11e22
5,638
module BaseDelayedPaperclipTest def setup super DelayedPaperclip.options[:url_with_processing] = true reset_dummy end def test_normal_paperclip_functioning reset_dummy :with_processed => false Paperclip::Attachment.any_instance.expects(:post_process) dummy = Dummy.new(:image => File.open(...
37.337748
96
0.734126
39ef817d5d278cb4afcd6704e689dcf987dedf3e
974
lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'll/wk/api/version' Gem::Specification.new do |spec| spec.name = 'll_wk_api' spec.version = LL::WK::API::VERSION spec.authors = ['Matt Mofrad'] spec.email = ['m.mofrad@livelin...
34.785714
74
0.645791
28ed07e79990fbfeb14508e724d1e30599a0b99f
169
module Quickbooks module Model class NameValue < BaseModel xml_accessor :name, :from => "Name" xml_accessor :value, :from => "Value" end end end
18.777778
43
0.64497
33fb5b2240e0e98ef579538d64696876d7bdde0a
3,704
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web serve...
41.617978
108
0.734071
18f85165d39b773371664ed14cdd35716a231c5a
243
class CreateArtists < ActiveRecord::Migration def change create_table :artists do |t| t.string :name t.integer :spotify_id t.integer :spotify_popularity t.string :spotify_url t.timestamps end end end
18.692308
45
0.670782
ed6ad8fe77e4d8a11e274be9e4f6cbdece08905a
1,777
require 'uri' module Yoda class Server # Denotes workspace folder in LSP. # @see: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_workspaceFolders class Workspace # @return [FileStore] attr_reader :file_store # @return [String] ...
24.013514
129
0.609454
bb021148faa37a25867bf606dd9ee37e39f0aaf0
264
module OpenActive module Models module Schema class MedicalProcedureType < ::OpenActive::JsonLdModel # @!attribute type # @return [String] def type "schema:MedicalProcedureType" end end end end end
18.857143
60
0.602273
267cc33955dcf513facdbd3271aec48b350e60c6
239
class CreateTasks < ActiveRecord::Migration[6.0] def change create_table :tasks do |t| t.datetime :due_date t.string :description t.integer :user_id t.integer :project_id t.timestamps end end end
18.384615
48
0.65272
e2dc000f88e1cecad4109d46c5497ef857d6538c
285
FactoryBot.define do # Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them. # # Example adding this to your spec_helper will load these Factories for use: # require 'spree_refer_by_qrcode/factories' end
40.714286
130
0.792982
bf23ebcee81b6a61f13dea149e5bfe86b6bd18bf
66
class Command < ActiveRecord::Base belongs_to :device_group end
16.5
34
0.80303
1cb0dfaedc39426c1be25f20a86994399ac5934d
1,412
class Weechat < Formula desc "Extensible IRC client" homepage "https://www.weechat.org" url "https://weechat.org/files/src/weechat-2.7.tar.xz" sha256 "56fc42a4afece57bc27f95a2d155815a5e6472f32535add4c0ab4ce3b5e399e7" head "https://github.com/weechat/weechat.git" bottle do sha256 "6b1633f4e5f572c6358094...
27.686275
93
0.704674
79dec442818be6f4be60d91f36ee52aa7f03de27
495
require 'spec_helper' feature 'Projects > Members > Member leaves project', feature: true do let(:user) { create(:user) } let(:project) { create(:project) } background do project.team << [user, :developer] login_as(user) visit namespace_project_path(project.namespace, project) end scenario 'use...
24.75
70
0.715152
7932b78441ee2b927902bf5697f0d54589226955
490
class Micropost < ApplicationRecord belongs_to :user default_scope -> { order(created_at: :desc) } mount_uploader :picture, PictureUploader validates :user_id, presence: true validates :content, presence: true, length: { maximum: 140 } validate :picture_size private # Validate...
25.789474
55
0.671429
ede01fafcaf9273e4cc5a156b82a3ec235e9416d
4,310
Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web serve...
40.660377
102
0.742923
28a5c878d4d38a7454cd5063f08e17cca4762989
18,101
require 'securerandom' module Dynflow # rubocop:disable Metrics/ClassLength # TODO extract planning logic to an extra class ExecutionPlanner class ExecutionPlan < Serializable # a fallback object representing a plan with some corrupted data, # preventing to load the whole plan properly, this can be used...
32.614414
108
0.597591
2855f6835f9c0b182658499115261bab85cd736c
1,484
lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "this_day_in_history/version" Gem::Specification.new do |spec| spec.name = "this_day_in_history" spec.version = ThisDayInHistory::VERSION spec.authors = ["Jeremiah Lutes"] spec.email...
40.108108
96
0.673854
1a0d315310831b2f4109afe39ceecfd07dd9f31d
5,528
#-- copyright # OpenProject is an open source project management software. # Copyright (C) 2012-2021 the OpenProject GmbH # # 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 ...
31.409091
115
0.681802
5dd44e4091a91b657b3c90523ee25eaf334ef49b
1,255
module Hoox # Public: A hook to tokenize tab symbols before hook delegation class TabHideHook < Hoox::Hook def initialize # The token to substitite for tabs @tab_subst="~!~ " end # Substiute tabs for tokens def preprocess(arg) if arg[/\t/] arg.gsub!( /\t/, @tab_subst ) ...
21.637931
65
0.58008
2145d085fa6405792d83ae5bf38717a2aaa5ce94
851
require 'test_helper' class AnnouncementClearerTest < ActiveSupport::TestCase test '#clear! any associated announcement from the search index' do announcement = create(:statistics_announcement) statistics = create(:published_statistics, statistics_announcement: announcement) Whitehall::SearchIndex...
37
91
0.777908
33d24cfa4d8ce212bf6b95b3153b643a44969b8c
1,415
# frozen_string_literal: true lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'guard/kibit/version' Gem::Specification.new do |spec| spec.name = 'guard-kibit' spec.version = GuardKibitVersion.to_s spec.authors = ['Eric Musgrove'] spe...
40.428571
91
0.646643
38855f2e85aed6c0fde33e276c00ab6faea16f24
1,446
# frozen_string_literal: true module Renalware log "Adding Medication Routes" do module RR ORAL = 1 TOPICAL = 2 INHALATION = 3 INJECTION = 4 INTRAPERITONEAL = 5 OTHER = 9 end MRoute = Medications::MedicationRoute MRoute.transaction do MRoute.find_or_create_b...
45.1875
98
0.67704
1138cf6149da96c102380ec640bd8cbf7fe0c449
18,123
# frozen_string_literal: true require "commands" require "extend/cachable" require "readall" require "description_cache_store" # A {Tap} is used to extend the formulae provided by Homebrew core. # Usually, it's synced with a remote git repository. And it's likely # a GitHub repository with the name of `user/homebrew-...
24.894231
118
0.663742
e917c194be879eeb315cc076088eb5b5e69895d0
270
class Api::ItemSerializer include FastJsonapi::ObjectSerializer belongs_to :category has_many :materials attributes :name, :price, :description, :adjustable, :recycled, :image, :customizable, :status, :created_at, :updated_at, :size, :category, :materials end
30
152
0.762963
e2f274c0665e4063140bdd63eb1ef0920a74c4ba
794
module Octopress module Filters if defined?(Jekyll::Hooks) Jekyll::Hooks.register :site, :post_read do |site| Octopress::Filters.site = site end Jekyll::Hooks.register :post, :pre_render do |post, payload| excerpted = post.content.match(post.site.config['excerpt_separato...
23.352941
79
0.605793
7a926afe4889a410982c43efa4c8ee135434a9e9
175
Before("@personalizeevents") do @service = Aws::PersonalizeEvents::Resource.new @client = @service.client end After("@personalizeevents") do # shared cleanup logic end
19.444444
49
0.742857
b9c5762bddd856362ffe73ef7f0396148f96afac
1,248
Rails.application.config.middleware.use Warden::Manager do |manager| manager.default_strategies :password_form end Warden::Strategies.add(:password_form) do def authenticate! auth = AuthenticationService.new(params) if auth.authenticated? success! auth.user else fail! "Invalid email or pas...
20.129032
68
0.654647
5d6f4d48545e7348e8efde9cb62224bdf27eb2a3
1,488
class Libmpeg2 < Formula desc "Library to decode mpeg-2 and mpeg-1 video streams" homepage "https://libmpeg2.sourceforge.io/" url "https://libmpeg2.sourceforge.io/files/libmpeg2-0.5.1.tar.gz" sha256 "dee22e893cb5fc2b2b6ebd60b88478ab8556cb3b93f9a0d7ce8f3b61851871d4" license "GPL-2.0-or-later" livecheck do ...
36.292683
106
0.709677
33e17c24f979a85a1418783e948e8d0bee7832b5
1,599
# # Be sure to run `pod lib lint MobDevLib.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 http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| s.name = 'MobDevLib'...
33.3125
109
0.632896
21472bd4ecf3435489582cbdea07482c0ce69b61
864
module ServiceAPIUserAuthentication include ActionController::HttpAuthentication::Token::ControllerMethods extend ActiveSupport::Concern included do before_action :verify_token! end def verify_token! unless authorized? render_error( name: 'Unauthorized', message: 'Please provid...
27
117
0.721065
ac31c90e8f254be218fb3d527143e6d9806dd78c
1,765
class SS::Migration20160225000000 def change change_sys change_cms change_gws end def change_sys Sys::Role.where(permissions: 'edit_sys_users').each do |item| permissions = item.permissions %w( edit_sys_groups edit_sys_roles ).each do |name| permissions <...
26.742424
66
0.675354
bbfaa52906ff0c96f0b2e4a0201daf59a5a25468
10,065
require_relative "../errors" require_relative "../helpers" module VagrantPlugins module Ansible module Provisioner # This class is a base class where the common functionality shared between # both Ansible provisioners are stored. # This is **not an actual provisioner**. # Instead, {Host}...
37.696629
115
0.594933
110cc32020e69ef10fb2927dfcb21b89a6d5f5b3
292
name "docker" maintainer "OpenStreetMap Administrators" maintainer_email "admins@openstreetmap.org" license "Apache-2.0" description "Installs and configures the docker daemon" version "1.0.0" supports "ubuntu" depends "apt"
29.2
61
0.619863
1d8a47f79db20b07304bb6ca3059d3447ab4ea54
756
Pod::Spec.new do |spec| spec.name = "DeviceIDSdk" spec.version = "1.1" spec.summary = "DeviceIDSdk is the client for create device id." spec.homepage = "https://github.com/webeyemob/DeviceIDSdk" spec.license = { :type => 'MIT', :file => "LICENSE" } spec.author = "taurusx" ...
50.4
107
0.640212
e2c04254ed83014fcfede92c49e7b076be8634f9
1,742
# frozen_string_literal: true require 'spec_helper' RSpec.describe Mutations::Clusters::Agents::Create do include GraphqlHelpers subject(:mutation) { described_class.new(object: nil, context: context, field: nil) } let(:project) { create(:project, :public, :repository) } let(:user) { create(:user) } let(:...
32.867925
136
0.675086
f7e130c0289ea49c8f325074f6272c82bf34e6e8
3,257
require 'formula' class Luarocks < Formula homepage 'http://luarocks.org' head 'https://github.com/keplerproject/luarocks.git' url 'http://luarocks.org/releases/luarocks-2.1.2.tar.gz' sha1 '406253d15c9d50bb0d09efa9807fb2ddd31cba9d' option 'with-luajit', 'Use LuaJIT instead of the stock Lua' option 'with-l...
31.317308
108
0.662266
9132818926c03ee249fc749b147d67952158428b
1,994
require "test_helper" class UsersSignupTest < ActionDispatch::IntegrationTest # test "the truth" do # assert true # end test "invalid signup information" do get signup_path # post(が失敗するので)後にUser.countが不変であることをテストする assert_no_difference 'User.count' do post users_path, params: { user: { nam...
33.79661
78
0.615848
08649d7ff724d197f15c646fe96cc3e7beafd8f3
3,942
module Viewpoint::EWS::Types class Task include Viewpoint::EWS include Viewpoint::EWS::Types include Viewpoint::EWS::Types::Item TASK_KEY_PATHS = { complete?: [:is_complete, :text], recurring?: [:is_recurring, :text], start_date: [:start_date, :text], ...
34.884956
121
0.600203
08026a517c437f9db83bb650ac97ebcfa2f2f4ec
1,180
# # Copyright 2015-2017, Noah Kantrowitz # # 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 w...
28.095238
74
0.694915
1db7026f52905be74d253e34ff92f8b16adf3ab4
391
cask "cursorsense" do version "2.1.2" sha256 "393168677f5958ffef36fdf010db84fc3144a34f450497f6a04f176129ef8651" url "https://plentycom.jp/ctrl/files_cs/CursorSense#{version}.dmg" appcast "https://plentycom.jp/en/cursorsense/download.php" name "CursorSense" homepage "https://plentycom.jp/en/cursorsense/" ...
27.928571
75
0.764706
215c3202439f386123591a4ad83c7056a64c9f16
10,628
require "spec_helper" describe Mongoid::Persistable::Settable do describe "#set" do context "when the document is a root document" do shared_examples_for "a settable root document" do it "sets the normal field to the new value" do expect(person.title).to eq("kaiser") end ...
25.671498
129
0.574802
d5dee454b295a36bc3f9d49404a34ab50ca98202
63
module Jekyll module Compose VERSION = "0.1.1" end end
10.5
21
0.650794
8744d21b82f62a3bec7a85dedb805c419d075a21
133
# frozen_string_literal: true require_relative '../../services/processing_service' service = ProcessingService.new service.process
19
52
0.81203
39e9482c729b6f8c9dd0dc7a399f81a4824d62bd
148
class CoursesController < ApplicationController skip_before_action :require_user def index @courses = Course.all end def new end end
14.8
47
0.756757
7a9c61cb30e4febc22ba2ff557b39f4a3745ce5a
992
# frozen_string_literal: true module V0 module Profile class PermissionsController < ApplicationController include Vet360::Writeable before_action { authorize :vet360, :access? } after_action :invalidate_cache def create write_to_vet360_and_render_transaction!( 'permis...
19.84
55
0.575605
339956b2e48f9ff5163aaed47365980eae891436
837
require 'simple_form_extension/version' require 'redactor-rails' require 'selectize-rails' require 'simple_form' module SimpleFormExtension extend ActiveSupport::Autoload eager_autoload do autoload :Translations autoload :ResourceNameHelper autoload :Components autoload :Inputs end # Allows o...
28.862069
82
0.789725
1afa0fbff108bae649a6f4bacf79afcd83f41e28
2,940
## # This module requires Metasploit: http://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## require 'msf/core' class MetasploitModule < Msf::Post include Msf::Post::File include Msf::Post::Linux::Priv include Msf::Post::Linux::System include Msf::Auxiliary::Repor...
26.017699
79
0.563946
39a987179c40844a5c6705ce03015fb0711142a8
1,879
require 'formula' class DrupalCodeSniffer < Formula homepage 'https://drupal.org/project/coder' version '7.x-2.2' url "http://ftp.drupal.org/files/projects/coder-#{version}.tar.gz" head 'http://git.drupal.org/project/coder.git', :branch => '7.x-2.x' sha1 '9d3591f1035c9b0cd2d406d83a9071f94b826e09' option '...
26.464789
91
0.702501
7a15793805cf2319f29af19a2fd9a01706c06563
1,925
require 'omniauth-google-oauth2' require 'adwords_api' module OmniAuth module Strategies class GoogleAdwordsOauth2 < OmniAuth::Strategies::GoogleOauth2 option :name, 'google_adwords_oauth2' option :skip_friends, true option :authorize_options, [:access_type, :hd, :login_hint, :prompt, :reque...
32.083333
156
0.64
1a7b71b8f0ab7360ee1d2e2dc6c923f15ab84e38
1,789
#!/usr/bin/env ruby $: << File.dirname(__FILE__)+'/../../lib' require 'boot' require 'goliath' require 'rack/abstract_format' require 'yajl/json_gem' # # Wait the amount of time given by the 'delay' parameter before responding (default 2.5, max 15.0). # # Handles multiple parallel requests: # # $ ./app/rack/sleepy_...
31.946429
144
0.606484
911109e7ed576632ec1454b467b8a5eeb679fb7c
829
# Configure Rails Environment ENV["RAILS_ENV"] = "test" require_relative "../test/dummy/config/environment" require "rails/test_help" Dir["#{File.dirname(__FILE__)}/system/**/*.rb"].each { |f| require f } # Filter out the backtrace from minitest while preserving the one from other libraries. Minitest.backtrace_filte...
37.681818
93
0.788902
e2e5dd386f21a491f75e1e139148ff731ed95389
620
# frozen_string_literal: true module Ci class PipelineBridgeStatusService < ::BaseService def execute(pipeline) return unless pipeline.bridge_triggered? begin pipeline.source_bridge.inherit_status_from_downstream!(pipeline) rescue StateMachines::InvalidTransition => e Gitlab::E...
29.52381
84
0.733871
1abfe4035326afa5a0ad5d09550935af08e2e31f
499
class User < ActiveRecord::Base has_many :done_list def self.create_with_omniauth(auth) #instruction(auth['info']['nickname']) create! do |user| user.provider = auth['provider'] user.uid = auth['uid'] user.screen_name = auth['info']['nickname'] user.name = auth['info']['name'] ...
23.761905
70
0.645291
87362a4969cb89040f0a99201bd15c54f7765cd5
6,196
require 'spec_helper' require './fever_api' describe FeverAPI do include Rack::Test::Methods def app FeverAPI::Endpoint end let(:api_key) { 'apisecretkey' } let(:story_one) { StoryFactory.build } let(:story_two) { StoryFactory.build } let(:feed) { FeedFactory.build } let(:stories) { [story_one, s...
37.325301
133
0.683183
b951b0a74868b0d8accad6a32d61d827d159841d
1,526
# 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 'spec_helper' require 'json' requi...
30.52
111
0.749017
08fe14a7c3af7af29e7ad0718ab776c7d3b60519
1,958
class Datree < Formula desc "CLI tool to run policies against Kubernetes manifests YAML files or Helm charts" homepage "https://www.datree.io/" url "https://github.com/datreeio/datree/archive/1.2.0.tar.gz" sha256 "ed579d04e500b2963c627b5e03fc34f5ebca40430557d7598ff8c2fe7d42ac6f" license "Apache-2.0" head "h...
39.16
129
0.73238
ab11e2a5e6af0ad04b4fc39b7718e6dc4d4e9068
845
cask 'brave-browser-beta' do version '80.1.7.80,107.80' sha256 '3e367a226cf197d79cd48b2cdeeea497d21b17bb5c4d325a4331fb25f472ba1a' # updates-cdn.bravesoftware.com/sparkle/Brave-Browser was verified as official when first introduced to the cask url "https://updates-cdn.bravesoftware.com/sparkle/Brave-Browser/bet...
38.409091
118
0.719527
1dbc1ffce05a10f160cda7433b011863880764ba
1,376
# # Be sure to run `pod lib lint DcMVVM.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 = 'DcMVVMTest' ...
34.4
101
0.642442
6ad634627918d4a4dde098e312b36f0f4ff9f330
40
class Employer < ActiveRecord::Base end
13.333333
35
0.8
f850fd731d3e173a1307abe7de0649920b76d14e
1,430
# frozen_string_literal: true require 'spec_helper' RSpec.describe 'User sees Security Configuration table', :js do let_it_be(:user) { create(:user) } let_it_be(:project) { create(:project, :repository) } before_all do project.add_developer(user) end before do sign_in(user) end context 'with ...
24.655172
71
0.653147
39828a7cb958f3a24b35941c5575c3150eea9338
206
require "test_helper" class YarcsvTest < Test::Unit::TestCase def test_that_it_has_a_version_number refute_nil ::Yarcsv::VERSION end def test_it_does_something_useful assert false end end
17.166667
39
0.776699
4a1a45723c33a461f4780f652ab58a265348c76b
742
class Phpmd < Formula desc "PHP Mess Detector" homepage "https://phpmd.org" url "https://github.com/phpmd/phpmd/releases/download/2.8.2/phpmd.phar" sha256 "0b531cbbc18a26115eede06077d5670e1f4fd0a8545d7fe547adf068fb7f18c5" bottle :unneeded def install bin.install "phpmd.phar" => "phpmd" end test d...
26.5
107
0.680593
619fef109af8e28823f0026e42ab5fb341f1b06e
4,141
class Hdf5 < Formula desc "File format designed to store large amounts of data" homepage "https://www.hdfgroup.org/HDF5" url "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.bz2" sha256 "97906268640a6e9ce0cde703d5a71c9ac3092eded729591279bf2e3ca9765f61" license "BSD-3-C...
35.698276
122
0.654673
38b1ed5337fe1bc633b590000f51dbaabc6e35db
61
Chartkick.options = { colors: ["red", "orange", "green"] }
15.25
36
0.590164
ff033d9b3856a6d58c4101b3067c6bfb9908a666
146
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_salesAppServer_session'
36.5
84
0.815068
616b219e29c357c614974c8913667ad98fde2ba0
7,281
=begin #SendinBlue API #SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/or...
34.671429
839
0.643318
873f9d1845e7ed1d60dfc59447da0351daaf5ab5
1,969
# # Cookbook Name:: eos # Spec:: default # # Copyright (c) 2016 Arista Networks, All Rights Reserved. require 'spec_helper' describe 'eos::default' do context 'When all attributes are default, on an unspecified platform' do let(:chef_run) do runner = ChefSpec::ServerRunner.new(platform: 'fedora', version:...
30.765625
80
0.670899
3833c82935d36886afb60ef480d519db55b6f762
1,979
# 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...
30.446154
86
0.690753
26f689e497f97bda491979ace803e604ab6d04b3
525
# frozen_string_literal: true class Github::Actor < Github::Client def self.get(date: nil) new.get(date) end def get(date) if date response = @client.search_issues "repo:oss-gate/workshop is:issue created: #{date.to_s}" else response = @client.search_issues 'repo:oss-gate/workshop is:iss...
23.863636
94
0.664762
d555416afebf23494b5e74525c02e5fe7d1a01b9
1,848
require File.dirname(__FILE__) + '/../../spec_helper' require File.dirname(__FILE__) + '/fixtures/classes' # arcsine : (-1.0, 1.0) --> (-PI/2, PI/2) describe "Math.asin" do it "return a float" do Math.asin(1).class.should == Float end it "returns the arcsine of the argument" do Math.asin(1).shoul...
33.6
86
0.6829
f806e142758ed70368211c100324f6dbb36594b6
362
# Ubuntu Amazon EC2 AMI Finder: https://cloud-images.ubuntu.com/locator/ec2/ # module VarsAws AWS_NAME = "bosh-jumpbox" AWS_ACCESS_KEY = "" AWS_SECRET_KEY = "" AWS_KEY_PEMNAME = "keypair" AWS_KEY_PEMPATH = "/home/$USER/keypair.pem" AWS_UBUNTU_AMI = "ami-5189a661" AWS_REGION = "us-west-2" AWS_TYPE_INS = ...
25.857143
76
0.709945
f849513c4a632fc5f463d9f86f2b4cc3250fd39f
907
module RescueRegistry module Controller extend ActiveSupport::Concern included do include Context end def process_action(*args) if RescueRegistry.context # Controller logger isn't yet available Rails.logger.warn "Didn't expect RescueRegistry context to be set in controlle...
32.392857
99
0.70452
037700e17ebd7be0579bd77b4dd01350645ab801
1,299
# frozen_string_literal: true # Load database configuration require_relative "../../../../config/database" require "active_brainz" namespace :active_brainz do namespace :models do desc "Annotate models" task :annotate do require "annotate" options = Annotate .setup_options .mer...
27.638298
82
0.618168
79d458ad78a515ff57847eac51d3d175ec157995
3,431
#!/usr/bin/ruby if __FILE__ == $0 def get_depth(entry) if( entry == '.') return 0 else return entry.to_i end end $:.unshift File.join(File.dirname(__FILE__),'.') require 'vcf_line' if(ARGV.length < 1) puts "USAGE: add_allele_freq.rb [vcf_file] -clean\n the -clean option will remove alleles with a...
28.831933
158
0.617021
f75088df9436f5a7afa6cf0a8e76d1bb95a8c5ba
317
# frozen_string_literal: true class TezosClient module Tools class HashToMicheline < ActiveInteraction::Base class Contract < Base def encode raise "#{data} #{data.class} Not a 'String' type" unless data.is_a? ::String { string: data } end end end end end
21.133333
86
0.618297
1170bac039cc36a2c2e79527f4435aeda4b6ba7c
1,842
# TODO(test): Test 401 on bad login, etc RSpec.describe RegistrationsController do let!(:user) { create :user } def serializer UserSerializer end before { @request.env["devise.mapping"] = Devise.mappings[:user] } describe '#create' do context 'with a valid email and password' do it 'register...
29.238095
84
0.607492
1c4f96133d5babc5b45c6864efb624c95e8cd281
5,397
# 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...
45.737288
203
0.676672
d53131a365f4d054da4308ebde5a88c38c9bbd81
1,330
# frozen_string_literal: true # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
39.117647
82
0.797744
bb902767ecc4fcdbb50f361897354e1a1bd2ba96
374
class ScanBuild < Formula desc "Clang Static Analyzer" homepage "http://clang-analyzer.llvm.org/scan-build.html" url "https://clang-analyzer.llvm.org/downloads/checker-279.tar.bz2" sha256 "f583b58d207e14ce6fc64a623c11d0d8001ab69ffb444b73ba638436a245c784" def install prefix.install Dir["*"] end test ...
24.933333
75
0.735294
26ab04c58941a1a535e766b4bbaabfff2480a438
4,757
# frozen_string_literal: true require 'chromedriver-helper' require 'fileutils' require 'open-uri' require 'watir' require_relative '../helpers/application_helper' require_all 'app/models' # Contains logic to scrape a full menu class FullMenu < Menu attr_reader :html def initialize(url, campus) type = 'Ful...
30.107595
122
0.692243
1cee94a635dddee30913df08fa8e2bcbda018f31
162
class CreateUsers < ActiveRecord::Migration[5.0] def change create_table :users do |t| t.string :username t.string :password end end end
16.2
48
0.660494
21ce25d17c4cb6ddf933bd9b579be6e0c044fcde
1,093
# 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...
36.433333
86
0.752059
4a07d5071a403374639bffdd7c234a56e8724c0a
344
module Galaxy module Invaders Enemy = Struct.new( :x0, :y0, :x1, :y1, :x2, :y2, :x3, :y3 ) do def area @area ||= [ Vector2.new(x0, y0), Vector2.new(x1, y1), Vector2.new(x2, y2), Vector2.new(x3, y3) ] ...
16.380952
32
0.398256
d5b122adbb73e109601b9e36dc19989663ac318d
12,753
# Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| # The secret key used by Devise. Devise uses this key to generate # random tokens. Changing this key will render invalid all existing # confirmat...
49.05
154
0.750333
085386e43e022a35efe2bfd39002e9cf2669bde5
785
# frozen_string_literal: true # Configure Rails Environment ENV['RAILS_ENV'] = 'test' require 'webmock/rspec' # Run Coverage report require 'solidus_dev_support/rspec/coverage' require File.expand_path('dummy/config/environment.rb', __dir__) # Requires factories and other useful helpers defined in spree_core. requ...
29.074074
80
0.794904
11413cabf5a8c28e491765953607a3fac54bc281
6,172
# frozen_string_literal: true require "rails_helper" # This spec was generated by rspec-rails when you ran the scaffold generator. # It demonstrates how one might use RSpec to test the controller code that # was generated by Rails when you ran the scaffold generator. # # It assumes that the implementation code is gen...
27.801802
111
0.66267
286ea850af164094d50e20da9f3226a8eb6b08a5
424
# frozen_string_literal: true module Settings class MutedUsersController < ApplicationV6Controller before_action :authenticate_user! def index @mute_users = current_user.mute_users.order(id: :desc) end def destroy mute_user = current_user.mute_users.find(params[:mute_user_id]) mut...
23.555556
70
0.745283
ab6a7ef015ee0b12939832afcde5c4132e344758
9,828
require "integration_test_helper" class GwyliauBancTest < ActionDispatch::IntegrationTest setup do content_item_cy = { base_path: "/gwyliau-banc", schema_name: "calendar", document_type: "calendar", locale: "cy", } stub_content_store_has_item("/gwyliau-banc", content_item_cy) ...
46.140845
173
0.582316
ffb9694e806596a05fc15ed9c306f6a8e392e6f3
3,955
# frozen_string_literal: true require 'spec_helper' RSpec.describe 'Batch diffs', :js do include MergeRequestDiffHelpers include RepoHelpers let(:project) { create(:project, :repository) } let(:merge_request) { create(:merge_request, source_project: project, source_branch: 'master', target_branch: 'empty-bra...
35.954545
134
0.695322
ab34e1d451d9d2344b898956dd25a1b4d05c2faf
269
class RESO::Lookup::PoolFeature < RESO::Enumeration has_many :pool_feature_assignments, foreign_key: :enumeration_id has_many :reso_property_characteristics, through: :pool_feature_assignments, source: :enumerable, source_type: "RESO::Property::Characteristic" end
53.8
145
0.825279
1c469ce850dbf77b56cd11e6c1ccdff572cbf660
49,215
# frozen_string_literal: true # 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::AutoScaling class AutoScalingGroup extend Aws::Deprecations ...
35.431965
179
0.638505
87dd1b591d2b89b6c051972ec4688541980ef15b
173
FactoryBot.define do factory :email_subscription do oidc_user sequence(:name) { |n| "subscription-#{n}" } sequence(:topic_slug) { |n| "topic-#{n}" } end end
21.625
47
0.641618
017582375bfd6a6f4c4e522065489f532b2abf06
3,183
# This file was automatically generated for ClickSend by APIMATIC v2.0 ( https://apimatic.io ). module ClickSend class SmsMessage < BaseModel # Your method of sending e.g. 'wordpress', 'php', 'c#'. # @return [String] attr_accessor :source # Your sender id - more info: http://help.clicksend.c...
30.028302
143
0.545712
33302b812e233027bbdad210673dd2a629336387
8,069
# frozen_string_literal: true require 'dry-struct' require 'dry-types' require 'base64' require 'yaml' module K8s # Common struct type for kubeconfigs: # # * converts string keys to symbols # * normalizes foo-bar to foo_bar class ConfigStruct < Dry::Struct transform_keys do |key| case key wh...
37.013761
127
0.66489
38ff40e86107f9b7c8fd48b27b200578318680d2
1,273
# -*- encoding: utf-8 -*- $:.push File.expand_path('../lib', __FILE__) require 'suspenders/version' require 'date' Gem::Specification.new do |s| s.required_ruby_version = ">= #{Suspenders::RUBY_VERSION}" s.authors = ['thoughtbot', 'kiramclean'] s.date = Date.today.strftime('%Y-%m-%d') s.description = <<-HERE ...
35.361111
94
0.696779
28ead8d44dac0f93a334939a04f21da39ea20183
2,934
# frozen_string_literal: true class Import::FogbugzController < Import::BaseController before_action :verify_fogbugz_import_enabled before_action :user_map, only: [:new_user_map, :create_user_map] rescue_from Fogbugz::AuthenticationException, with: :fogbugz_unauthorized def new end def callback begi...
26.672727
125
0.730402
088e49f803b4838639aaf29290b32ba3e6e9c2cc
4,327
require 'date' class ConsumerJob < ApplicationJob def perform(params) puts "performing job" kafka = KAFKA_CLUSTERS[params[:cluster_name]] # k = KafkaCluster.find_by(name: params[:cluster_name]) # kafka = Kafka.new(k.broker_uri.split(","), client_id: "KafkaMan", logger: Rails.lo...
34.070866
215
0.584932
014bbe50a7bb34a384f285ea75a3cfa26c81f34e
207
class CreateProductsTaxons < ActiveRecord::Migration def change add_column :spree_products_taxons, :id, :primary_key add_column :spree_products_taxons, :position, :integer, :default => 0 end end
29.571429
73
0.768116
4a7511f64930f2b1118f69e6aaa3c102914019cb
4,641
require File.expand_path('../../../spec_helper', __FILE__) require File.expand_path('../fixtures/classes', __FILE__) describe "Enumerable#any?" do before :each do @enum = EnumerableSpecs::Numerous.new @empty = EnumerableSpecs::Empty.new() @enum1 = [0, 1, 2, -1] @enum2 = [nil, false, true] end it...
32.683099
87
0.615385