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
87a02231b366c2d5c73eaf7b19856e656eff8fec
1,323
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'portal_module/version' Gem::Specification.new do |spec| spec.name = "portal_module" spec.version = PortalModule::VERSION spec.authors = ["Jeff McAffee"] spec.email ...
38.911765
74
0.693878
f7a8978ac530ac843374db340a91c9e6506103e2
137
json.array!(@users) do |user| json.extract! user, :id, :name, :password, :email, :address json.url user_url(user, format: :json) end
27.4
61
0.678832
0135bb2fc6a2cb3c4e80c3215e9ee6177d3198ac
45
GlobalID::Locator.use :pvb, ModelLocator.new
22.5
44
0.8
5dca37486cce2d37fcdf6a863c0eec7b9b177bfe
578
module UniversalAr::Concerns::Commentable extend ActiveSupport::Concern included do has_many :comments, class_name: 'UniversalAr::Comment', as: :subject def save_comment!(content, user, passed_scope=nil, kind=nil, title=nil) comment = self.comments.create content: content, ...
28.9
83
0.562284
5d3542098340822a4926cafd58290d8cb6d74e94
6,417
class FfmpegAT28 < Formula desc "Play, record, convert, and stream audio and video" homepage "https://ffmpeg.org/" url "https://ffmpeg.org/releases/ffmpeg-2.8.15.tar.bz2" sha256 "35647f6c1f6d4a1719bc20b76bf4c26e4ccd665f46b5676c0e91c5a04622ee21" revision 2 bottle do sha256 "6e6ac30c4fb35f630d0cf34fc7460...
37.092486
121
0.666355
e9d7a47f11b1e597842bfba77e920fb20644806a
7,874
require 'active_support/xml_mini' require 'active_support/time' require 'active_support/core_ext/object/blank' require 'active_support/core_ext/object/to_param' require 'active_support/core_ext/object/to_query' require 'active_support/core_ext/array/wrap' require 'active_support/core_ext/hash/reverse_merge' require 'ac...
32.403292
116
0.58255
1d931640d82b31a89768a2c7d9b5c726aec9b3dd
1,834
# # Be sure to run `pod lib lint hippy.podspec --verbose --use-libraries' 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 ...
40.755556
125
0.648855
e2fa6fa845e268f08d9516262a8091ec6efed6c1
4,284
require 'spec_helper' describe CclaSignature do context 'associations' do it { should belong_to(:user) } it { should belong_to(:ccla) } it { should belong_to(:organization) } end context 'validations' do it { should validate_presence_of(:first_name) } it { should validate_presence_of(:last_n...
39.666667
119
0.701914
6a59cd0b3c59eab641b34587528b94f99ec176d8
4,251
# Track Chrome stable. # https://omahaproxy.appspot.com/ class V8 < Formula desc "Google's JavaScript engine" homepage "https://github.com/v8/v8/wiki" url "https://github.com/v8/v8-git-mirror/archive/5.1.281.47.tar.gz" sha256 "63c9933227d6912689ea6bc012eea6a1fabaf526ac04bc245d9381e3ea238bf6" bottle do ce...
36.025424
116
0.70454
3816a50ec74db26e45fbd8e437bf6a5a02746aba
1,601
require 'test_helper' class UsersSignupTest < ActionDispatch::IntegrationTest def setup ActionMailer::Base.deliveries.clear end test "invalid signup information" do get signup_path assert_no_difference 'User.count' do post users_path, params: { user: { name: "", em...
27.135593
78
0.671455
21a193af02ba991cfd22075248cdb494013e021c
479
# frozen_string_literal: true require 'spec_helper' RSpec.describe EnotasApi::V1::IncluirAtualizarEmpresa do let(:empresa) { EnotasApi::V1::Empresa.new({ id: '123' }) } let(:instance) { described_class.new(empresa) } it 'have expected uri' do expect(instance.uri).to eq('/v1/empresas') end it 'have exp...
22.809524
61
0.705637
ab4933c0ca2b986802be790d5bd8e6492230a284
2,672
require "rails_helper" RSpec.describe "Plans", type: :feature do before do @default_template = create(:template, :default, :published) @org = create(:org) @research_org = create(:org, :organisation, :research_institute, templates: 1) @funding_org = create(:org, :...
33.822785
202
0.647829
e94af46927f28405fbb544ef450a0a31ce19fbf2
451
cask "pichon" do version "1.0.9,11" sha256 :no_check url "https://desktop.icons8.com/updates/pichon/Pichon.dmg" name "Pichon" desc "Search utility for icons8" homepage "https://icons8.com/" livecheck do url "https://desktop.icons8.com/updates/pichon/cast.xml" strategy :sparkle end app "Pich...
20.5
60
0.685144
f7c21d64c838791836db0b7b9de53951b84f113b
1,481
class StatsController < ApplicationController def speakers_count @speakers = Speaker.all.sort_by { |s| s.talks.count }.reverse @total_talks = Talk.all.count end def by_year @year = year_params['year'] redirect_to root_path unless @year =~ /\d{4}/ @speakers = [] Speaker.all_by_year(@year)...
24.278689
71
0.648886
f7caaa7957ffc7cf570ade3bd0daa7648c6bc00e
1,074
class YamlCpp < Formula desc "C++ YAML parser and emitter for YAML 1.2 spec" homepage "https://github.com/jbeder/yaml-cpp" url "https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.6.3.tar.gz" sha256 "77ea1b90b3718aa0c324207cb29418f5bced2354c2e483a9523d98c3460af1ed" bottle do cellar :any_skip_relocation...
31.588235
93
0.681564
d52b6f0700079b402a21fb597dc24b939b75b92b
2,959
require "spec_helper" describe 'Commenter use case (a1: p1>c1, a2: p2>c1, p3>c2, a3: p4>c3)' do before do @c1 = Category.create! @c2 = Category.create! @c3 = Category.create! @a1 = Author.create! @a2 = Author.create! @a3 = Author.create! @p1 = @a1.posts.create! :category => @c1 @p2 = ...
27.146789
96
0.611355
7a4380ca99744e5e9a041485b6177b6c154230b7
4,860
# Generated by the protocol buffer compiler. DO NOT EDIT! # Source: google/cloud/dialogflow/v2beta1/intent.proto for package 'google.cloud.dialogflow.v2beta1' # Original file comments: # Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in ...
51.157895
145
0.659465
5daaf1034dc2adf16561975dfb496d28d490bae7
808
module BashCompSpecHelpers module ClassMethods def basename BashCompleteFixtures::Main.basename end end def basename self.class.basename end def build_request *words, cword: -1, cur: nil, split: nil, prev: nil words.map! { |word| if word == '$0' basename else ...
19.238095
70
0.592822
3382ee48cfd04916ec09d452dfe7e56bd9ae0569
1,693
require 'spec_helper' describe TxmlImporter do it 'has a version number' do expect(TxmlImporter::VERSION).not_to be nil end describe '#stats' do it 'reports the stats of a .txml file' do file_path = File.expand_path('../txml_importer/spec/sample_files/sample_1.txml') txml = TxmlImporter::Txm...
35.270833
101
0.670408
ed799e5a58c3edfbac72d9ef36c405f06699f0ce
5,285
=begin #Beanie ERP API #An API specification for interacting with the Beanie ERP system OpenAPI spec version: 0.8 Contact: dev@bean.ie Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.0-SNAPSHOT =end require 'date' module Beanie class StockLocation attr_accessor :...
27.962963
107
0.612867
1127cb70581c18fd83d864da65ba0cb9d5d6334f
1,369
=begin JRubyFX - Write JavaFX and FXML in Ruby Copyright (C) 2013 The JRubyFX Team 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...
34.225
95
0.639883
38720ce3c01c993ca2e5d4bf66b9f76a5fb2a83c
1,671
module FarmEvents class Update < Mutations::Command NOT_YOURS = "Not your farm_event." include FarmEvents::ExecutableHelpers include FarmEvents::FragmentHelpers using Sequences::CanonicalCeleryHelpers has_executable_fields required do model :farm_event, class: FarmEvent model :d...
26.52381
79
0.684022
18213cb23b10f2ef6ad316f19cb67d2f681fd3cd
1,852
module ProcessSpecs class Daemonizer attr_reader :input, :data def initialize # Fast feedback for implementations without Process.daemon raise NotImplementedError, "Process.daemon is not implemented" unless Process.respond_to? :daemon @script = fixture __FILE__, "daemon.rb" @input = ...
24.051948
103
0.62743
38326e9fec8daefce735fde064ccdb5c060aafb0
18,688
# :stopdoc: ENV['RC_ARCHS'] = '' if RUBY_PLATFORM =~ /darwin/ require 'mkmf' ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')) # # functions # def windows? RbConfig::CONFIG['target_os'] =~ /mingw32|mswin/ end def solaris? RbConfig::CONFIG['target_os'] =~ /solaris/ end def darwin? RbConfi...
27.809524
175
0.628853
03e35bf5d5e3351ea1aae630d94886014b07b831
677
$:.push File.expand_path("lib", __dir__) # Maintain your gem's version: require "alchemy_i18n/version" # Describe your gem and declare its dependencies: Gem::Specification.new do |s| s.name = "alchemy_i18n" s.version = AlchemyI18n::VERSION s.authors = ["Thomas von Deyen"] s.email = ["thom...
30.772727
72
0.654357
87f66e2bf97eab0fce28366bdf931d72792028cf
18,117
# frozen_string_literal: true require "spec_helper" require "dependabot/dependency" require "dependabot/dependency_file" require "dependabot/python/update_checker/pipenv_version_resolver" namespace = Dependabot::Python::UpdateChecker RSpec.describe namespace::PipenvVersionResolver do let(:resolver) do described...
32.40966
80
0.578241
1129087bb206f6446815d5d1e5d7d318123508f6
256
class CreateProducts < ActiveRecord::Migration def change create_table :products do |t| t.string :title t.text :description t.string :picture t.decimal :price t.date :date_published t.timestamps end end end
18.285714
46
0.648438
7a220dafaecd167b210807f7cc0f66b17391be87
1,058
require 'rails_helper' RSpec.describe 'Opening Course from User Dashboard', type: :system do let!(:default_path) { create(:path, default_path: true) } let!(:foundations_course) { create(:course, title: 'Foundations', path: default_path) } let!(:section) { create(:section, course: foundations_course) } let!(:fi...
31.117647
91
0.689981
5d9bac038b9b0c08e416480d0f0c45f68515519f
1,112
require "spec_helper" RSpec.describe SentenceValidator do context 'when the sentence does not include a verb' do let(:sentence) { ['abcd', 'e'] } it 'the sentence should be invalid' do expect(described_class.new(sentence).valid_sentence?) .to eq false end end context 'when the sentence includ...
27.8
74
0.649281
ff426b0b67ae702ebe301c9356e0d4bf5ffc96c6
115
# require 'rails_i18n/common_pluralizations/west_slavic' # ::RailsI18n::Pluralization::WestSlavic.with_locale(:cs)
38.333333
57
0.817391
e2f46137b5a8594dcf59b87182d26ac977a6c48d
832
# frozen_string_literal: true RSpec.describe Hyrax::GrantEditJob do let(:depositor) { create(:user) } context "when use_valkyrie is false" do let(:file_set) { create(:file_set) } it 'grants a user edit access to a FileSet' do described_class.perform_now(file_set.id, depositor.user_key, use_valkyrie:...
33.28
91
0.735577
6a4925ab510bd67362f72affd522e40e03875a82
2,387
require "stringio" require 'rexml/document' require "test/unit" require "test/unit/ui/junitxml/testrunner" require_relative "check" class TestXmlMultibyteName < Test::Unit::TestCase include Check setup do test_case = Class.new(Test::Unit::TestCase) do test "成功" do assert_equal(1, 1) end ...
25.945652
64
0.669041
397c5a939d3606795e60e97ed8c575d716aeee4d
43,529
require "isolation/abstract_unit" require 'rack/test' require 'env_helpers' class ::MyMailInterceptor def self.delivering_email(email); email; end end class ::MyOtherMailInterceptor < ::MyMailInterceptor; end class ::MyPreviewMailInterceptor def self.previewing_email(email); email; end end class ::MyOtherPrevie...
29.551256
157
0.679179
269ccab982a765f18ccc475e47f994998ba96895
1,134
module VCAP::CloudController class BuildUpdate class InvalidBuild < StandardError end def initialize @logger = Steno.logger('cc.action.build_update') end def update(build, message) build.db.transaction do build.lock! MetadataUpdate.update(build, message) if m...
29.076923
78
0.652557
6a439f6cc6356bc84a25a8587cf6c084e801f2cd
885
# # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. # Run `pod lib lint vlc_flutter.podspec' to validate before publishing. # Pod::Spec.new do |s| s.name = 'vlc_flutter' s.version = '0.0.1' s.summary = 'A new flutter plugin project.' s.description...
36.875
105
0.588701
03d8c2d9390b4468d40c456d317f224af315116e
4,300
# # Copyright 2012-2018 Chef Software, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
29.452055
80
0.64907
1da9823812402b1ae83a989e06844453391253a3
660
# frozen_string_literal: true module Kafka module Protocol class DescribeConfigsRequest def initialize(resources:) @resources = resources end def api_key DESCRIBE_CONFIGS_API end def api_version 0 end def response_class Protocol::Descr...
18.333333
64
0.609091
213308cd1dc084686e80f849f1992895f707a125
2,615
# Copyright © 2011-2020 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.545455
146
0.759082
ffdeff23fde490583406e5a1f97d46ff0eef5cd2
4,456
require 'spec_helper' describe PostReceive do let(:changes) { "123456 789012 refs/heads/tést\n654321 210987 refs/tags/tag" } let(:wrongly_encoded_changes) { changes.encode("ISO-8859-1").force_encoding("UTF-8") } let(:base64_changes) { Base64.encode64(wrongly_encoded_changes) } let(:project) { create(:project) ...
36.52459
114
0.710278
18c4746bf2bb6eac745b7b5e32c4e3fe677ffc02
326
class CreateExperiences < ActiveRecord::Migration[5.2] def change create_table :experiences do |t| t.belongs_to :user, index: true t.string :title t.string :company_name t.date :start_date t.date :end_date t.string :location t.string :description t.timestamps end en...
21.733333
54
0.662577
b9f8699430b7480dd465c5775678aaeb3f53bbc1
1,029
require 'digest/md5' module Delayed module Backend module ActiveRecord class Job < ::ActiveRecord::Base attr_accessor :loner attr_accessor :unique_on attr_accessor :store_conflict_id_from validate :check_uniqueness def check_uniqueness if loner || unique_...
27.810811
103
0.584062
03af659e0944b805a603be784315a8b37793202b
1,925
require 'sinatra' require 'haml' require 'kramdown' require_relative 'beef_config' get '/' do @beef = get_beef() @subtitle = "#{@beef.number_of_links} hot links" haml :links end get '/posts' do @beef = get_beef() haml :posts end get '/~*.md' do filepath = "pages/" + params[:splat][0].to_s + ".md" if Fi...
21.388889
63
0.605714
1c79a184736340dcddb9c4b845ef2e9568de8655
4,918
module Awspec::Type class SecurityGroup < ResourceBase aws_resource Aws::EC2::SecurityGroup tags_allowed def resource_via_client @resource_via_client ||= find_security_group(@display_name) end def id @id ||= resource_via_client.group_id if resource_via_client end def opened?...
33.006711
114
0.663888
1d6e035005258aa6f17527248888bbf5b386bf1b
963
require './lib/move.rb' class Player attr_reader :name def initialize(name, board) @name = name @board = board end def choose_move move = Move.new(@board) unless move.valid? print "\nInvalid movement, try again!\n" return choose_move end @board.save(move, self) en...
20.934783
76
0.559709
38650eea0d0f46c3ee274f0a2a265853b6ec6d25
464
# encoding: UTF-8 require 'spec_helper' describe BreweryDB::Resources::Categories, :resource do context '#all', :vcr do let(:response) { described_class.new(config).all } it 'fetches all of the cagtegories at once' do response.length.should eq 12 end end context '#find', :vcr do let(:res...
21.090909
58
0.670259
26861bda61f313cd247138d65e332872559f7234
912
require "spec_helper" RSpec.describe Snowglobe::RSpecProject, project: true do describe ".create" do it "creates a directory for the project" do expect(project_directory.exist?).to be(true) end it "adds a Gemfile with RSpec in it" do expect("Gemfile").to have_line_starting_with('gem "rspec"'...
26.823529
78
0.649123
1876e81896e77bcc3da3611859b4134bc08be9b7
176
require_relative '../test_helper' class ArkrbTest < TestHelper describe 'Running the execute method' do it 'Should return nil' do assert true end end end
13.538462
42
0.693182
abc4c76261df7b17160f981641c19267f5c4b2b8
932
require "rails_helper" RSpec.describe Api::Users::Comments::Hot::WeekController, context: :as_signed_in_user do describe ".index" do it "returns paginated weekly comments sorted by hot score" do user = context.user _unrelated_comment = create(:created_last_week_comment, created_by: user) first_...
46.6
107
0.758584
f7d15165dd4093db04b5cdca9b6c5a4137428be0
176
puts IO.read(File.join(File.dirname(__FILE__), 'README')) puts "\n--\n" puts "To continue installation, please install a shipping, payment, and fulfillment processor module"
29.333333
101
0.755682
d566c48bf7e542a2ecad051f99cb9239b48e74d5
1,161
# frozen_string_literal: true require_relative "lib/anycable/version" Gem::Specification.new do |spec| spec.name = "anycable" spec.version = AnyCable::VERSION spec.authors = ["palkan"] spec.email = ["dementiev.vm@gmail.com"] spec.summary = "AnyCable is a polyglot replacement for ActionCable-compatible serv...
35.181818
92
0.708872
2171e77e76668c6c4406ebf700d8ab921925b1bb
2,102
require 'i18n/tasks/data/file_system' module I18n::Tasks module Data DATA_DEFAULTS = { adapter: 'I18n::Tasks::Data::FileSystem' } # I18n data provider # @see I18n::Tasks::Data::FileSystem def data @data ||= begin data_config = (config[:data] || {}).deep_symbolize_keys ...
29.194444
113
0.636537
e9558075efb7dfcc342a5131ae3cdc17d3ab4534
3,738
class Rubygem < ActiveRecord::Base include Pacecar has_many :owners, :through => :ownerships, :source => :user has_many :ownerships, :dependent => :destroy has_many :subscribers, :through => :subscriptions, :source => :user has_many :subscriptions has_many :versions, :dependent => :destroy do def lates...
26.13986
117
0.685126
ab81bd98b443856d73e2a58cfceac89d2c80e877
308
require File.expand_path('../../../../../../../spec_helper', __FILE__) describe "Gem::RequestSet::Lockfile::Tokenizer::Token#type" do it "needs to be reviewed for spec completeness" end describe "Gem::RequestSet::Lockfile::Tokenizer::Token#type=" do it "needs to be reviewed for spec completeness" end
30.8
70
0.717532
795fce12ebe7a9bdba24fa69a9ef61d34d13486b
372
# frozen_string_literal: true require 'rails_helper' describe Projects::CreateSlackChannelJob do describe '#perform' do let(:project) { create(:project) } it 'calls Projects::Kickoff operation' do expect(Ops::Projects::GenerateProjectSlackChannel).to receive(:call).with(project: project) descri...
24.8
97
0.739247
e202789e74c093e8fed586830a915c0ae022bd9c
1,158
class LogsController < ApplicationController def index #byebug user = User.find_by(id: params[:user_id]) logs = user.logs.last(10) render json: logs.to_json(:include => { #:user => {:only => [:name, :id]}, :emotions => {:only => [:name, :intensity]} ...
42.888889
102
0.598446
91fc1f852b6b3a56c3d33e12362fe19393ddde8d
234
# frozen_string_literal: true require 'active_support' module HexletCode # Module to build form input fields module Inputs extend ActiveSupport::Autoload autoload :Input autoload :Text autoload :Select end end
16.714286
37
0.74359
28700c6e0836b0e5c3e77655e71914aa20a698e0
5,801
require File.join(File.expand_path(File.dirname(__FILE__)), '../..', 'test_helper.rb') require 'rbbt/workflow' require 'rbbt/workflow/task' require 'rbbt/workflow/step' require 'rbbt/tsv' require 'rbbt' require 'rbbt-util' class TestStep < Test::Unit::TestCase def test_step task = Task.setup do "TEST" end ...
25.00431
86
0.585761
aca1d0b02be320a479eec77c9dbe05409645feda
574
# This is a helper type to encapsulate iControl # enumerations in a way which easily gives us # access to the member as well as the value, # since the SOAP API and the Savon serializers # seem to use the string version of the member # name rather than the value. # # Additional iControl enumerations can be generated # u...
23.916667
51
0.71777
ed9b43f5ff572aeb48119db6d511dfd311112737
1,106
# We're not including this in clerk-rails/app/helpers because it is injected # into ActionController::Base via initializes/add_application_helpers and cannot be in the autoload path # https://stackoverflow.com/questions/29636334/a-copy-of-xxx-has-been-removed-from-the-module-tree-but-is-still-active module ClerkRails ...
27.65
118
0.648282
5d7e5f89834de62a068dbfbb3c54083757731a98
1,812
require 'minitest/autorun' require 'minitest/pride' require 'uri' require 'json' require 'fakeweb' require 'sailthru' FakeWeb.allow_net_connect = false class Minitest::Test include Sailthru::Helpers def setup FakeWeb.clean_registry end def fixture_file(filename) return '' if filename == '' Fil...
26.26087
117
0.681567
e226581f4a4203009f15e033a3906d4bba266d96
1,177
require_dependency 'core/application_record' require_dependency 'core/person/staff' module Core module Sefaz class Allotment < ApplicationRecord self.table_name = 'extranet.sefaz_allotments' belongs_to :staff, required: false, class_name: ::Core::Person::Staff belongs_to :send_sta...
42.035714
112
0.671198
1de6c74d9d4adf40f1ac344b55d1eada17951b13
226
FactoryBot.define do factory :admin_contact, class: Schools::OnBoarding::AdminContact do email { 'g.chalmers@springfield.edu' } email_secondary { 's.skinner@springfield.edu' } phone { '+441234567890' } end end
28.25
69
0.716814
f8fcde4d0db56f3c6eff5cec46639083dbeacb20
3,928
# Processes boundwith records from SCSB dump files coming from Alma and updates the # DumpFile for submission to the S3 Bucket. class RecapBoundwithsProcessingJob < RecapDumpFileProcessingJob attr_reader :dump def perform(dump) @dump = dump # Extract boundwith from all dump files, process, and save in temp...
37.056604
117
0.672607
ed97560a68abf1e2dd1c3a0f7dda8f0f5597508d
281
class Object # An object is blank if it's false, empty, or a whitespace string. For example, '', ' ', nil, [], and {} are all blank. def blank? respond_to?(:empty?) ? !!empty? : !self end # An object is present if it's not blank. def present? !blank? end end
21.615385
121
0.615658
2625ed38336e552edd94e80537220777153a4bfb
738
require './config/environment' class ApplicationController < Sinatra::Base configure do set :public_folder, 'public' set :views, 'app/views' enable :sessions set :session_secret, "secret" end get '/' do erb :welcome end helpers do def current_shopper @current_shopper ||= Shoppe...
18.923077
92
0.649051
0346b4c6293223975f7ddf542d82ae9191be17d1
8,270
# coding: utf-8 # frozen_string_literal: false # Copyright Ayumu Nojima (野島 歩) and Martin J. Dürst (duerst@it.aoyama.ac.jp) require 'test/unit' require 'unicode_normalize/normalize' class TestUnicodeNormalize < Test::Unit::TestCase UNICODE_VERSION = RbConfig::CONFIG['UNICODE_VERSION'] path = File.expand_path("....
38.826291
132
0.708222
ac90e62fabf086afefed1669d05a8e8d015aebc4
33,342
# 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::Network::Mgmt::V2018_12_01 # # ServiceEndpointPolicyDefinitions # class ServiceEndpointPolicyDefinitions include MsRestAzure ...
49.838565
253
0.736578
1ac6e912d662aa6320dcf853f04f6dffb5a85c9c
577
class MakeTargetRepresentativeWellConnectedAndImportanceGlobalStats < ActiveRecord::Migration[5.0] def change rename_column :aichi11_targets, :representative_terrestrial, :representative_global remove_column :aichi11_targets, :representative_marine, :float rename_column :aichi11_targets, :well_connected_...
44.384615
98
0.830156
e24e5ff8805fd4ab3b500246d31f00d82ab8dfc8
100
class DropPurchases < ActiveRecord::Migration[4.2] def change drop_table :purchases end end
16.666667
50
0.75
4ae972522dfaf4ca0d66b5ca3553df2e9c7dacf7
1,941
require 'spec_helper' module Librato describe Metrics do describe "#authorize" do context "when given two arguments" do it "should store them on simple" do Metrics.authenticate 'tester@librato.com', 'api_key' Metrics.client.email.should == 'tester@librato.com' Metrics.clie...
30.328125
97
0.64915
1d3ade8650a6596db6051e9264357e4345747252
912
describe Finder do let(:finder) { Finder.new } describe "given a valid file" do it "performs a search" do result = finder.search('spec/test_files/langs.yml') expect(result.count).to eql(3) end it "performs a search for languages with symbols in their names" do result = finder.search(...
26.057143
71
0.653509
7abd2de76b4c220fbc2bb6d02efaeca1363e0300
13,157
=begin PureCloud Platform API With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more. OpenAPI spec version: v2 Contact: DeveloperEvangelists@genesys.com Generated by: https://github.com/swagger-ap...
20.525741
225
0.529604
878aed61fefd84a727074bb199fa9199ab804194
1,604
# See the Pagy documentation: https://ddnexus.github.io/pagy/extras/overflow # frozen_string_literal: true class Pagy VARS[:overflow] = :last_page def overflow?; @overflow end module Overflow def initialize(vars) super rescue OverflowError @overflow = true # add...
32.734694
132
0.540524
4a14e78b0223be89b03b3e95b9d4ce210a5c6b8c
3,919
class MapnikAT2 < Formula desc "Toolkit for developing mapping applications" homepage "http://www.mapnik.org/" url "https://s3.amazonaws.com/mapnik/dist/v2.2.0/mapnik-v2.2.0.tar.bz2" sha256 "9b30de4e58adc6d5aa8478779d0a47fdabe6bf8b166b67a383b35f5aa5d6c1b0" revision 4 bottle do sha256 "07181d3a7481f2127...
35.954128
145
0.673386
5dc9940a079792a82f86eec195763014b7b150ed
59
# encoding: utf-8 class FormForSpecs < SpecController end
11.8
35
0.779661
79359a95372ba660f24f3ea31f472471e2a1b296
8,627
=begin #NSX-T Data Center Policy API #VMware NSX-T Data Center Policy REST API OpenAPI spec version: 3.1.0.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: 2.4.17 =end require 'date' module NSXTPolicy # Label that will be displayed for a UI element. class Label ...
30.270175
168
0.622812
6aad59b7b42d1cb4767a766e79be2736e96cc830
2,776
# # Specify all country specific PayPal instruction texts / link in this module # # Feel free to add country-specific links to this module when ever you feel that there's # a better page than the default page available # module PaypalCountryHelper FEE_URL = { # List all the contries that have the new fee page ...
33.445783
99
0.723703
33923c4b66fedca7449e33f343a514e8a9811f8a
5,896
# frozen_string_literal: true require "active_support" require "active_support/testing/autorun" require "active_support/testing/method_call_assertions" require "active_support/testing/stream" require "active_record/fixtures" require "cases/validations_repair_helper" module ActiveRecord # = Active Record Test Case ...
33.5
188
0.709125
7ae5118cea8a0fbe3da986138de471e78e3482e5
1,676
class Libtextcat < Formula desc "N-gram-based text categorization library" homepage "https://software.wise-guys.nl/libtextcat/" url "https://software.wise-guys.nl/download/libtextcat-2.2.tar.gz" mirror "https://src.fedoraproject.org/repo/pkgs/libtextcat/libtextcat-2.2.tar.gz/128cfc86ed5953e57fe0f5ae98b62c2e/lib...
46.555556
138
0.74821
21f60fc239d15bb6b9be7fd315fb1ecbaa043b27
1,895
class CommentsController < ApplicationController before_action :set_comment, only: [:show, :edit, :update, :destroy] # GET /comments # GET /comments.json def index @comments = Comment.all end # GET /comments/1 # GET /comments/1.json def show end # GET /comments/new def new @comment = Co...
25.266667
93
0.660686
abfcd779b5ff3377aeb29bf68da2aa7fb47bc700
400
class Revision < ActiveRecord::Base belongs_to :page belongs_to :user validates_presence_of :content # Returns the revision number as a human-readable number # between 1 and parent's total revision count def hid i = page.revisions.length - 1 until i == 0 || page.revisions[i] == self i -= 1 ...
17.391304
58
0.6625
39adfd6f29649d837489abb3d2da955243421972
2,727
require 'spec_helper' describe BasketballTeam do context "upon creation" do it "orders by city" do cavs = BasketballTeam.create!({:name => "Cavaliers", :city => "Cleveland"}); hawks = BasketballTeam.create!({:name => "Hawks", :city...
32.464286
105
0.628896
086cf4c21504c8ef40fdc6f77762afa0ca54fbd3
43
class Ag::Resident < ApplicationRecord end
14.333333
38
0.813953
1a1c0f9e9d3ac0e9a055d526adccd0320129bd1e
501
# Be sure to restart your server when you modify this file. # Version of your assets, change this if you want to expire all your assets. Rails.application.config.assets.version = '1.0' # Add additional assets to the asset load path. # Rails.application.config.assets.paths << Emoji.images_path # Precompile additional...
41.75
76
0.766467
79456b64bab661b339630ae24606af4d30fbbd7f
392
# frozen_string_literal: true require_relative '../../test_helper' class TestFakerTvShowsRickAndMorty < Test::Unit::TestCase def setup @tester = Faker::TvShows::RickAndMorty end def test_character assert @tester.character.match(/\w+/) end def test_location assert @tester.location.match(/\w+/) ...
17.818182
57
0.704082
2611bad014737cb28376d8976d370187b252f770
3,204
module Hardware class CPU INTEL_32BIT_ARCHS = [:i386].freeze INTEL_64BIT_ARCHS = [:x86_64].freeze PPC_32BIT_ARCHS = [:ppc, :ppc32, :ppc7400, :ppc7450, :ppc970].freeze PPC_64BIT_ARCHS = [:ppc64].freeze class << self OPTIMIZATION_FLAGS = { native: "-march=native", nehalem...
18.736842
76
0.503121
7ab1600ef86f741c1d18eba778c5132ec8fde14b
473
Rails.application.routes.draw do # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html get '/welcome' => 'welcome#index' resources :games do resources :levels do post :regenerate post :north post :south post :west post :east end...
22.52381
101
0.659619
d58b070b55907e49167eef7123063d396cc32737
27,697
# 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::Network::Mgmt::V2018_11_01 # # ExpressRouteGateways # class ExpressRouteGateways include MsRestAzure # # Creates and init...
46.008306
170
0.716937
1d9a47ad20bea8ec6bd86eeeea28af28b20ec54a
841
class RemoveIndexesNcbiNodes < ActiveRecord::Migration[5.2] def up remove_column :ncbi_nodes, :kingdom_r, :string remove_column :ncbi_nodes, :phylum_r, :string remove_column :ncbi_nodes, :class_r, :string remove_column :ncbi_nodes, :order_r, :string remove_index :ncbi_nodes, name: :ncbi_nodes_exp...
36.565217
59
0.741974
1831c2de153b8b2c849a88ac46aa3782863c2045
1,155
class Libcue < Formula desc "Cue sheet parser library for C" homepage "https://github.com/lipnitsk/libcue" url "https://github.com/lipnitsk/libcue/archive/v2.2.1.tar.gz" sha256 "f27bc3ebb2e892cd9d32a7bee6d84576a60f955f29f748b9b487b173712f1200" bottle do cellar :any sha256 "209e548399503830e0f786c6fae...
33.970588
94
0.716017
39a1d4dde86c1402093fd99b9fa3fd1766934226
4,341
# frozen_string_literal: true module Reality::Describers::Wikidata::Impl module Modules # Returns pages having coordinates that are located in a certain area. # # The "submodule" (MediaWiki API term) is included in action after setting some param, providing # additional tweaking for this param. Examp...
33.392308
291
0.571297
182c3f83e465bdc0a251415a48ef76e68a3529be
1,049
require 'rspec' require_relative '../lib/dynamic_key' describe 'AgoraDynamicKey::RTMTokenBuilder' do let(:rtm_token_params) do { app_id: "970CA35de60c44645bbae8a215061b33", app_certificate: "5CFd2fd1755d40ecb72977518be15d3b", account: "test_user", salt: 1, role: AgoraDynamicKey::RT...
31.787879
121
0.743565
7990046786835e691567f2b29e29c16fbe2e6415
4,524
require "rest-client" require "webmock/rspec" require_relative "../lib/user" RSpec.describe User do let(:fake_uaa_client) do @fake_uaa_client = RestClient::Resource.new("http://fake-uaa.internal", headers: { "Authorization" => "fake-token", "Content-Type" => "application/json", }) end it "c...
35.34375
146
0.640805
87aca9eafea6e26a9f836d85d0d9a4fcbf6206e4
3,852
module Admitad module AffiliatePrograms class Success < Admitad::Success attribute :message, String attribute :success, String end class Action < Admitad::Success attribute :hold_time, Integer attribute :payment_size, String attribute :type, String attribute :name, Str...
30.330709
110
0.656282
5daf6d4fca94d85eb59aae7828222ebf04763b7b
77
class User < ActiveRecord::Base has_many :topics has_secure_password end
15.4
31
0.792208
ed3cfd6b02323d8ad030f0ea2d1a094320f08c15
1,132
module Banzai module Pipeline class GfmPipeline < BasePipeline def self.filters @filters ||= FilterArray[ Filter::SyntaxHighlightFilter, Filter::SanitizationFilter, Filter::UploadLinkFilter, Filter::ImageLinkFilter, Filter::EmojiFilter, Fi...
26.952381
60
0.627208
4a8191c2b0afb5040b0c0ad355e5607ec8c86197
443
Pod::Spec.new do |s| s.name = "ZMBLESDK" s.version = "1.3.0" s.summary = "Bluetooth" s.homepage = "https://github.com/humoroutlaw/ZMBLESDK" s.license = { :type => 'MIT' } s.author = "humoroutlaw" s.platform = :ios, "9.0" s.source = {:git => "https://github.com/humorou...
34.076923
88
0.598194
bfe1daa6d053d87ba4947ed01077412b69e86241
8,005
# frozen_string_literal: true require "spec_helper" describe "Backup::Packager" do let(:packager) { Backup::Packager } it "should include Utilities::Helpers" do expect(packager.instance_eval("class << self; self; end") .include?(Backup::Utilities::Helpers)).to eq(true) end describe "#package!" do ...
36.386364
90
0.642349
abcf7446d8cc8b08aa6782c651b1955047ad94e9
1,100
require 'spec_helper' set :os, :family => 'base' describe user('root') do it { should exist } end describe user('root') do it { should belong_to_group 'root' } end describe user('root') do it { should belong_to_primary_group 'root' } end describe user('root') do it { should have_uid 0 } end describe user(...
27.5
432
0.803636
6a9a9913a71297f8fd21f70417d2051ddc94e97d
368
module PasswordBlacklist class Checker def initialize file_path = File.expand_path('../../../data/Top95Thousand-probable.txt', __FILE__) @data = File.read(file_path) end def blacklisted?(password) !!@data.match(Regexp.escape(password.downcase)) end def inspect "#<#{self....
20.444444
88
0.641304