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
1dee32b4ce50cf9f550000ab6af023c58d537277
852
# Copyright 2011-2015, The Trustees of Indiana University and Northwestern # University. 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 # ...
37.043478
82
0.733568
26cb0fe7966a5e957d65cae49cb4435e6963ee7b
356
require 'travis/services/base' module Travis module Services class FindRepo < Base register :find_repo def run(options = {}) result end def updated_at result.try(:updated_at) end private def result @result ||= scope(:repository).find_by(pa...
14.833333
56
0.573034
0830f835bf45076080ab3a16319b7ac975df8437
648
# frozen_string_literal: true # This file was auto-generated by lib/tasks/web.rake module Slack module Web module Api module Endpoints module TeamProfile # # Retrieve a team's profile. # # @option options [Object] :visibility # Filter by visibilit...
27
115
0.597222
edeba355bd30dc1c976ecdff549ab74c9ed4e519
801
require "bundler/setup" require "rails_matching" require 'simplecov' require 'codacy-coverage' require 'pp' require 'faker' require "active_record" require 'factory_girl_rails' require_relative "support/factory_girl" RSpec.configure do |config| SimpleCov.start Codacy::Reporter.start # Enable flags like --onl...
22.885714
82
0.756554
abda0b6c686d3a8ff3b171b38f05285d7166d1b4
160
# frozen_string_literal: true class AddProductIdToReview < ActiveRecord::Migration[5.2] def change add_column(:reviews, :product_id, :integer) end end
20
57
0.7625
871211c9adae9242cffc7b2660ebcf28a27bb7d6
978
# frozen_string_literal: true class Shrine module Plugins # Documentation can be found on https://shrinerb.com/docs/plugins/upload_options module UploadOptions def self.configure(uploader, options = {}) uploader.opts[:upload_options] ||= {} uploader.opts[:upload_options].merge!(options)...
29.636364
101
0.671779
ed096c10863118149a5cc0c7ff1671907f2f247e
125
json.extract! event, :id, :title, :date, :location, :body, :created_at, :updated_at json.url event_url(event, format: :json)
41.666667
83
0.72
21a4fdf97fe4e2a3025d7525e5bcf62d73fe913b
1,358
# # Be sure to run `pod lib lint BCLKeyValueObservation.podspec' to ensure this is a # valid spec and remove all comments before submitting the spec. # # Any lines starting with a # are optional, but encouraged # # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s|...
43.806452
115
0.679676
f8cff785cdbf23641d651a0411f32c172872c454
4,396
require File.join(File.dirname(__FILE__), 'spec_helper') describe SData::Resource::Base do describe ".initial_scope" do context "given a resource with a baze class" do before :all do class TestModel < ActiveRecord::Base; end class TestResource < SData::Resource::Base self.baze_cla...
32.087591
184
0.629208
01861b391654225bbda8b5c093ef326a2d6a5ab7
2,260
# frozen_string_literal: true require 'spec_helper' describe Ci::Maskable do let(:variable) { build(:ci_variable) } describe 'masked value validations' do subject { variable } context 'when variable is masked' do before do subject.masked = true end it { is_expected.not_to allo...
27.901235
78
0.65354
91a248296f40b21dbb2f1a10f5f8e3d6c97aff15
432
require 'open-uri' module Inflation class Service def calculate_price_now(year: year, amount: amount) open(build_url(year, amount)).read.tr('""', '').to_d end private def build_url(from, amount) now = Date.current.year "https://www.statbureau.org/calculate-inflation-price-json?co...
22.736842
159
0.678241
d572c543924f4e44b67e1b53946fafa801f46cf1
496
module Srunr class Configuration attr_accessor :options DEFAULTS = { hostname: "" } DEFAULTS.each do |k,v| define_method(k) do get_option(k) end define_method("#{k}=") do |val| options[k] = val end end def initialize(opts=nil) @options = ...
14.588235
37
0.530242
18d058cc0051072d1bc258e7de225f673630a084
1,608
class Babeld < Formula desc "Loop-avoiding distance-vector routing protocol" homepage "https://www.irif.fr/~jch/software/babel/" url "https://www.irif.fr/~jch/software/files/babeld-1.9.2.tar.gz" sha256 "154f00e0a8bf35d6ea9028886c3dc5c3c342dd1a367df55ef29a547b75867f07" license "MIT" head "https://github.com/...
33.5
95
0.710199
bb08d95d0a73aa589ea8cde81d1db4bda23fdf21
427
# frozen_string_literal: true module SolidusMultiDomain module Spree module ProductDecorator def self.prepended(base) base.class_eval do has_and_belongs_to_many :stores, join_table: 'spree_products_stores' scope :by_store, lambda { |store| joins(:stores).where("spree_products_s...
23.722222
111
0.679157
5db9473418c3886913794a6aa44f57233c620ad7
881
Pod::Spec.new do |s| s.name = 'YPImagePicker' s.version = "3.5.3" s.summary = "Instagram-like image picker & filters for iOS" s.homepage = "https://github.com/Yummypets/YPImagePicker" s.license = { :type => "MIT", :file => "LICENSE" } s.author = 'S4ch...
44.05
95
0.580023
089774a6ef73a99edcf5055097ff35548f5c88cb
104
class Admin::DashboardController < AdminController def index @dashboard = Dashboard.new end end
17.333333
50
0.759615
f783b84cbca860a4fc1eab31a413687eb3684c23
483
require 'fastlane/plugin/qiye_wechat_bot/version' module Fastlane module QiyeWechatBot # Return all .rb files inside the "actions" and "helper" directory def self.all_classes Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))] end end end # By default we want to import all ...
28.411765
79
0.753623
aca7df5445f9a3badebf63e13a80320f4215936d
1,710
# frozen_string_literal: true require 'spec_helper' RSpec.describe Mutations::MergeRequests::SetLocked do let(:merge_request) { create(:merge_request) } let(:user) { create(:user) } subject(:mutation) { described_class.new(object: nil, context: { current_user: user }, field: nil) } specify { expect(describe...
31.666667
119
0.7
e2dcf60598dbd56318ab50058cd090ec04eb3b0b
2,771
#!/usr/bin/env ruby -S rspec require 'spec_helper' def store_valid_legacy_passwords(id_base, password_base, salt_base) expected = { 'keys' => {}, 'folders' => [] } # add passwords (1..3).each do |num| id = "#{id_base}_#{num}" prev_password = "old #{password_base} #{num}" current_password = "#{pa...
34.209877
89
0.666185
18cccee01b83c4bb6cc0898ea284d50300eb2588
4,520
# The pg_enum extension adds support for Sequel to handle PostgreSQL's enum # types. To use this extension, first load it into your Database instance: # # DB.extension :pg_enum # # It allows creation of enum types using create_enum: # # DB.create_enum(:type_name, %w'value1 value2 value3') # # You can also add valu...
32.992701
130
0.64292
39dab86d9f48cbe1370aaa2caf37cb3c1469b278
151
class AddUsersFullname < ActiveRecord::Migration def change change_table(:users) do |t| t.string :full_name, default: "" end end end
18.875
48
0.682119
ab782cd495f9d91ff9e006f3930cbb6976c23cac
454
# == Schema Information # # Table name: acts_as_relating_to_roles # # id :integer not null, primary key # name :string # display_name :string # created_at :datetime not null # updated_at :datetime not null # reciprocal :string # require_dependency 'acts_as_relatin...
22.7
55
0.636564
91139d421f567cfde8fdd18ee5a173460cae1d26
53,976
require 'spec_helper' module Gitlab module Ci describe YamlProcessor do subject { described_class.new(config, user: nil) } describe '#build_attributes' do subject { described_class.new(config, user: nil).build_attributes(:rspec) } describe 'attributes list' do let(:config)...
38.091743
157
0.522603
08c2319cbca67851cd1ab1c4ce82800643d0d68d
713
module Fog module OpenStack class Network class Real def get_network_ip_availability(network_id) request( :expects => [200], :method => 'GET', :path => "network-ip-availabilities/#{network_id}" ) end end class Mock ...
24.586207
65
0.545582
acd064edf92e85e42e41975371a97edd92e71272
141
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_speakeasy_session'
35.25
79
0.808511
5d3c20f67f9e0a7f695a02e9d8813277ada12b0d
8,261
# encoding: US-ASCII require "unit_spec_helper" require 'unit/notification_shared.rb' describe Rpush::Apns::Notification do it_should_behave_like 'an Notification subclass' let(:app) { Rpush::Apns::App.create!(:name => 'my_app', :environment => 'development', :certificate => TEST_CERT) } let(:notification_clas...
39.526316
323
0.700521
d5ed14dcb5a055b49773f97bee66f2023e562608
8,238
describe ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScript do let(:ansible_script_source) { FactoryBot.create(:embedded_ansible_configuration_script_source) } let(:playbook) { FactoryBot.create(:embedded_playbook, :configuration_script_source => ansi...
39.416268
166
0.67395
f823319f762d54d58b4f907cc5e56528d523e6a5
952
# frozen_string_literal: false require "tkclass" $tkline_init = false def start_random return if $tkline_init $tkline_init = true if defined? Thread Thread.start do loop do sleep 2 Line.new($c, rand(400), rand(200), rand(400), rand(200)) end end end end Label.new('text'=>'...
19.428571
65
0.638655
b939b7758d46bab9e2bf6f40c1be1e45c0ee7b32
2,062
module RequestLogAnalyzer::RSpec::Mocks def mock_source source = mock('RequestLogAnalyzer::Source::Base') source.stub!(:file_format).and_return(testing_format) source.stub!(:parsed_requests).and_return(2) source.stub!(:skipped_requests).and_return(1) source.stub!(:parse_lines).and_return(10) ...
28.246575
77
0.684287
03e79fdf13bccf93a2974ddf8982f3a8233daa56
58
module RailsSemanticLogger VERSION = '4.4.2'.freeze end
14.5
26
0.758621
3319d5c0b0d788c873482a75b48798c78712a851
2,186
require 'rails_helper' RSpec.describe TeamUsersController, type: :controller do include Devise::Test::ControllerHelpers before(:each) do request.env["HTTP_ACCEPT"] = 'application/json' @request.env["devise.mapping"] = Devise.mappings[:user] @current_user = FactoryGirl.create(:user) sign_in @curre...
27.325
92
0.620769
03a44dea6f2e9f287341ce1e437245249c9b664a
1,311
# -*- encoding: utf-8 -*- $:.push File.expand_path('../lib', __FILE__) require 'acts_as_list/version' Gem::Specification.new do |s| # Description Meta... s.name = 'acts_as_list' s.version = ActiveRecord::Acts::List::VERSION s.platform = Gem::Platform::RUBY s.authors = ['David Heinemeier Ha...
42.290323
250
0.661327
62c0f00753826f556d18e4f41097d18c257308e1
613
name 'selenium' maintainer 'Dennis Hoer' maintainer_email 'dennis.hoer@gmail.com' license 'MIT' description 'Installs/Configures Selenium' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) source_url 'https://github.com/dhoer/chef-selenium' issues_url 'https://github.com/dhoer/chef-selenium/issue...
24.52
72
0.755302
b9bdff2f46329fc8914b808df68c00fb4ceeaf02
1,865
# frozen_string_literal: true # The MIT License (MIT) # # Copyright <YEAR> <COPYRIGHT HOLDER> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitat...
44.404762
83
0.799464
bb40cb3ea9cf224cf194cc493010104ba2b088dc
4,979
# encoding: UTF-8 # # Author:: Geoff Meakin # Author:: Matt Ray (<matt@getchef.com>) # # Copyright:: 2012-2014, Chef Software, Inc <legal@getchef.com> # # 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 Lic...
36.610294
146
0.65234
015d04570ecd184ef125dac3f9e1623b18367b38
16,675
require 'puppet/util/windows' require 'win32/process' require 'ffi' module Puppet::Util::Windows::Process extend Puppet::Util::Windows::String extend FFI::Library WAIT_TIMEOUT = 0x102 def execute(command, arguments, stdin, stdout, stderr) Process.create( :command_line => command, :startup_info => {:stdin...
33.483936
145
0.706927
1abf6c93bfa9a2bd90e212d10b4f57650899012e
582
require 'rails_helper' describe 'Form Submission with Enter Key', js: true do before do login draft = create(:empty_variable_draft, user: User.where(urs_uid: 'testuser').first) visit edit_variable_draft_path(draft) end context 'when pressing enter on a form' do before do fill_in 'Name', wi...
26.454545
114
0.701031
1aa2fe73b2b88b6d3a8a02d8e1709bf184266f76
4,849
require 'net/http' require 'cgi/util' require 'nokogiri' require 'xmlrpc/client' require 'zlib' require 'stringio' module Suby class Downloader DOWNLOADERS = [] def self.inherited(downloader) DOWNLOADERS << downloader end attr_reader :show, :season, :episode, :video_data, :file, :lang def...
26.210811
106
0.605898
79e85fe860cab59694f12c135332cd7174058270
694
class DiffSoFancy < Formula desc "Good-lookin' diffs with diff-highlight and more" homepage "https://github.com/so-fancy/diff-so-fancy" url "https://github.com/so-fancy/diff-so-fancy/archive/v0.9.3.tar.gz" sha256 "b057683f325874f2473ebfd90583083efc18253cd42fe8d16bcd25bbe426babb" bottle :unneeded def insta...
28.916667
75
0.707493
4a51e50a34c9b8e9d0063a5f346217cf28f73362
1,781
class TextItemHeaderMigrator < SimpleService def initialize(item) @item = item end def call return unless @item.is_a?(Item::TextItem) && @item.ops.present? @item.ops = modify_quill_ops @item.update_columns(data_content: @item.data_content) end private def modify_quill_ops ops = [] ...
27.828125
91
0.597417
18a5e4fdb114f5424e35d1e8632e2272cfb480d2
426
# external dependencies require 'curses' require 'singleton' # internal dependencies require 'ascii_art/painter' require 'ascii_art/canvas' require 'ascii_art/brush' require 'ascii_art/printer' require 'ascii_art/scanner' module AsciiArt def self.start(filename=nil) Painter.new(filename).paint end def self...
20.285714
53
0.786385
792b40f4497067404909101f2db246c7f27b63ef
2,225
class Awscli < Formula include Language::Python::Virtualenv desc "Official Amazon AWS command-line interface" homepage "https://aws.amazon.com/cli/" url "https://github.com/aws/aws-cli/archive/2.2.12.tar.gz" sha256 "4a7fe6f1be73d454b0f506de5ec9f9e78ead3cb04ad8c3b4f6087f9d102d65e6" license "Apache-2.0" he...
34.765625
106
0.678652
91e5b0dd140459bf71922477e695b002305b1c43
2,345
class Itinerary < ActiveRecord::Base belongs_to :user has_many :reservations has_many :meals has_many :activities has_many :hotels, through: :reservations has_many :attractions, through: :activities has_many :restaurants, through: :meals has_many :itinerary_items validates_presence_of :title, :user_id...
27.588235
149
0.699787
1cc84fd1548f89bf524e6d64584cbbd75903d05f
421
# 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::Hdinsight::Mgmt::V2018_06_01_preview module Models # # Defines values for PublicNetworkAccess # module PublicNetworkAccess ...
24.764706
70
0.733967
1ce13bb3c3123551eaed3af2b14a40e8abb0a44c
3,495
require 'date' module MergetrainCheck class TraintableFormatter def initialize(max_length, firstname_only) @max_length = max_length @firstname_only = firstname_only end def format(body) values = [['St', 'Waiting', 'Running', 'MR', 'Pipe ID', 'User', 'Title']] values << spacer = n...
31.486486
163
0.590558
e9f328824d4f6e706fde17255878156813946b7f
1,817
# Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::Kusto::Mgmt::V2019_11_09 module Models # # A principal assignment check name availability request. # class DatabasePrincipalAssignmentCheckNam...
29.306452
89
0.571822
388f5853e8f9b4b641cd05facc77f275e4a32e9e
590
e = 0.5 ##| ##| SARE JAHAN SE ACCHA play_pattern_timed [:F,:F,:E,:D,:E,:Db,:D,:D], [e,e,e,e,e,e,e,e], amp: 2, sustain: 0 sleep 1 ##| ##| HINDOSTAN HAMARA HAMARAAA play_pattern_timed [ chord(:A, :minor), chord(:B, :minor) ,:D ,:E ,:F3 ,:G ,:F3 ,:F3 ,:E ,:G ,:F3 ,:E ,:D ,:Eb], [e,e,e,e,e,e,e,e,e,e,e,e,e], amp: 2, su...
32.777778
112
0.545763
18e4277d7a089a31aad77b7f348464999af2378f
35,688
require 'zlib' require 'abstract_unit' require 'active_support/ordered_options' class AssetTagHelperTest < ActionView::TestCase tests ActionView::Helpers::AssetTagHelper attr_reader :request def setup super @controller = BasicController.new @request = Class.new do attr_accessor :script_name...
46.773263
237
0.681714
21fa665d9205bf5c3ce842047a16021f644df8e9
14,301
# 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...
38.443548
225
0.718341
87f27734ee9adb964feb33e52bd8c38872ada689
24
module ShadowHelper end
8
19
0.875
e893ada85e2b68c6623c2632dfa0c11d82b13a81
23,807
# 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::Batch::Mgmt::V2017_05_01 # # ApplicationPackageOperations # class ApplicationPackageOperations include MsRestAzure # # Cr...
52.438326
200
0.709203
bf2f4883e8623c9326b9370ed7c4d9fb9c80fb74
66,395
require 'spec_helper' # # Class methods. # describe VirtFS::VFile, "(#{$fs_interface} interface)" do before(:all) do @spec_name = VfsRealFile.basename(__FILE__, ".rb") @temp_prefix = "#{@spec_name}-" @this_dir = VfsRealDir.getwd @root = File::SEPARATOR @slink_path = temp_name(@temp_p...
31.511628
118
0.614835
e8e32e2641dd7ba7c37ffce8d7c124aa513465ae
7,514
# == Schema Information # # Table name: feed_versions # # id :integer not null, primary key # feed_id :integer not null # feed_type :string default("gtfs"), not null # file :string default(""), not null # earlie...
42.693182
136
0.690578
87bba3e44fc9ccab4bf90fcaf5e12034775973ca
1,001
require "redis_lua/version" require "digest" require "redis" require "yaml" module RedisLua class << self attr_accessor :config_file_path, :lua_script_path def config @config ||= load_config(config_file_path) end def load_config(file_path) YAML.load(File.read(file_path)) end de...
20.428571
63
0.633367
5d95b649ee88c8d36bc0e3f85f5c242e662d12ff
339
class StaticPagesController < ApplicationController def home if logged_in? @micropost = current_user.microposts.build @feed_items = current_user.feed.paginate(page: params[:page]) @feed_items = current_user.feed.paginate(page: params[:page]) end end def help end def about end def ...
16.142857
68
0.707965
e92d75cf4a5823909dc486d9a57ee2c458b9ed9a
7,157
require 'yt/models/resource' module Yt module Models # A channel resource contains information about a YouTube channel. # @see https://developers.google.com/youtube/v3/docs/channels class Channel < Resource # @!attribute [r] videos # @return [Yt::Collections::Videos] the channel’s videos. ...
36.329949
103
0.654324
e9e7a9322dd8ede1d372bc32403153b4ce105470
2,159
# Copyright (c) 2017-present, Facebook, Inc. All rights reserved. # # You are hereby granted a non-exclusive, worldwide, royalty-free license to use, # copy, modify, and distribute this software in source code or binary form for use # in connection with the web services and APIs provided by Facebook. # # As with any so...
29.575342
82
0.68226
01a28586df7eadbf1b263aaf32273b90cc0a2be8
1,554
module Refinery class UsersController < ::Devise::RegistrationsController # Protect these actions behind an admin login before_filter :redirect?, :only => [:new, :create] layout 'login' def new @user = User.new end # This method should only be used to create the first Refinery user. ...
30.470588
138
0.630631
ab64f8342088c8b67468a2ad96a448929b0c3128
1,846
module DestroyRestriction extend ActiveSupport::Concern module ClassMethods attr_reader :destroy_restrictions # Запрещает удалять модель, если выполнится условие из коллбэка # @param [Proc, Symbol] if # @param [String, Symbol] attribute название атрибута, который будет добавлен в ошибки вместе с с...
36.92
156
0.736728
91627da5d15b5f1a64ed5e6b3efa1a407d2bd338
1,005
require 'rails_helper' RSpec.describe Listing, type: :model do pending "add some examples to (or delete) #{__FILE__}" end # == Schema Information # # Table name: listings # # id :integer not null, primary key # source :integer not null # source_listing_id :text ...
27.916667
84
0.589055
d59be0fa4c854a8512d7b2f1ad957192ae4cecd5
1,002
# coding: utf-8 lib = File.expand_path('../lib', __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'holy_cow/version' Gem::Specification.new do |spec| spec.name = "holy_cow" spec.version = HolyCow::VERSION spec.authors = ["Brian Samson"] spec.email = ["brian...
38.538462
122
0.670659
01fcac67efab79d43fd351998e4964eaf37a2018
1,592
#-- encoding: UTF-8 #-- copyright # OpenProject is a project management system. # Copyright (C) 2012-2017 the OpenProject Foundation (OPF) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. # # OpenProject is a fork of ChiliProject...
31.84
91
0.749372
e9624dc3b6c5e3365c257a896b621b4e70faa435
918
# coding: utf-8 $:.push File.expand_path("../lib", __FILE__) require 'olap/view/version' Gem::Specification.new do |spec| spec.name = "olap-view" spec.version = Olap::View::VERSION spec.authors = ["stepanovit"] spec.email = ["stepanov@wondersoft.ru"] spec.summary = %q{OLAP ...
43.714286
196
0.657952
180c6d9e420845a75140ba2e2edd000342cc09d2
6,826
# frozen_string_literal: true require 'spec_helper' RSpec.describe Gitlab::GithubImport::Importer::RepositoryImporter do let(:repository) { double(:repository) } let(:import_state) { double(:import_state) } let(:client) { double(:client) } let(:wiki) do double( :wiki, disk_path: 'foo.wiki', ...
24.912409
107
0.635804
01f1c80781d10681398994876bfa7917bbcfe147
4,423
require 'spec_helper' describe 'nfs::server' do %w(5.11 6.8 8).each do |release| context "on Centos #{release}" do cached(:chef_run) do ChefSpec::ServerRunner.new(platform: 'centos', version: release).converge(described_recipe) end it 'includes recipe nfs::_common' do expect(ch...
29.486667
115
0.624237
01fd4e752e0563ed5895d79b38579128c1c8ed8d
144
# Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, key: '_packing-list_session'
36
82
0.805556
e8b92fe237a26a5f9a6b424ac1bf3e6e25b20d1a
1,047
require 'test_helper' class OrdersControllerTest < ActionController::TestCase test "new order path should create new order with id set to service_id parameter" do get "new" assert_response :success assert_not_nil assigns(:order) assert_not_nil :order.service_id end test 'A new order should tri...
36.103448
97
0.729704
7ab315cbd7a241e8bdd13dcfa0a21fb72e54226a
2,562
require "administrate/base_dashboard" class UserDashboard < Administrate::BaseDashboard # ATTRIBUTE_TYPES # a hash that describes the type of each of the model's fields. # # Each different type represents an Administrate::Field object, # which determines how the attribute is displayed # on pages throughout...
27.255319
76
0.708041
186eb81ac50237caeda5ffa66afcd1f7a1fcd4f0
53
class Token def name "jonathan colby" end end
10.6
20
0.679245
876e41f1a704093a6522a89e7261584225f4c148
9,165
# 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::V2019_09_01 # # AvailableDelegations # class AvailableDelegations include MsRestAzure # # Creates and init...
39.166667
141
0.688489
87adb56ef5b55e034a004a83cb9a65986afcf3d8
1,249
require_relative '../spec_helper' describe 'ValidatesType' do context 'validates_type :attribute' do subject { ActiveModel::TypeValidationTestClass.set_accessor_and_long_validator(:string) } it 'adds a validator to the subject' do klass = subject.class expect(klass.validators).to_not be_empty ...
36.735294
104
0.726181
260caef616c3789828a24a186488b616d02495ff
231
#--- # Excerpted from "Ruby on Rails, 2nd Ed." # We make no guarantees that this code is fit for any purpose. # Visit http://www.editions-eyrolles.com/Livre/9782212120790/ for more book information. #--- module LanguageHelper end
28.875
88
0.74026
18e92d38166db4f6e2699d8d649b804fa4116102
1,780
#-- encoding: UTF-8 #-- copyright # OpenProject is a project management system. # Copyright (C) 2012-2018 the OpenProject Foundation (OPF) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. # # OpenProject is a fork of ChiliProject...
29.666667
91
0.705618
f88c5b68a630f8202abe3df8d3374bc773f091aa
1,688
module Issues class ExportCsvService include Gitlab::Routing.url_helpers include GitlabRoutingHelper # Target attachment size before base64 encoding TARGET_FILESIZE = 15000000 def initialize(issues_relation) @issues = issues_relation @labels = @issues.labels_hash end def csv...
33.098039
88
0.587085
33bc25bf297559837ae62b04786f96a44b715489
1,330
require 'fileutils' cask 'unity@2017.1.2f1' do version '2017.1.2f1,cc85bf6a8a04' sha256 '1f4159eef6a588cc26ce3317574258f39928fcd04f244e0748be13a384a19d8f' url "http://download.unity3d.com/download_unity/#{version.after_comma}/MacEditorInstaller/Unity.pkg" name 'Unity Editor' homepage 'https://unity3d.com/un...
27.708333
102
0.7
01df70824befe14e64f3321d696584952c311645
4,772
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...
45.447619
114
0.762364
bbf4067b8e98dfac522047de7da8117feed1e692
1,336
# frozen_string_literal: true module Sourcescrub # Models module Models # Tag class CompanyItems < Entity attr_accessor :domain, :total, :items, :type def parse_response_items(domain, kclass_name, response) headers = response.dig('headers') headers&.keys&.each do |attr_name| ...
23.438596
103
0.584581
4a70424ec01568acd93427dbc70403c8f44d70df
325
# frozen_string_literal: true class Projects::DeployTokensController < Projects::ApplicationController before_action :authorize_admin_project! def revoke @token = @project.deploy_tokens.find(params[:id]) @token.revoke! redirect_to project_settings_ci_cd_path(project, anchor: 'js-deploy-tokens') end...
25
80
0.778462
bbc4d3c1db941999220cf9fa9fb68a4827c5cec2
14,900
# -*- coding: utf-8 -*- # Redmine - project management software # Copyright (C) 2006-2014 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License,...
38.501292
139
0.640537
4a1b92b6fb17c641daf1ddb338bf09f796a0f275
380
module AnswersHelper # def user_answer_edit(current_user, answer) # if current_user == answer.user # link_to "Edit Answer", edit_answer_path(answer) # end # # end def user_answer_delete(current_user, question, answer) if current_user == answer.user link_to "Delete", question_answer_pat...
22.352941
83
0.694737
21d71a2f487413aa1f272d789847dea5e54d12a5
664
require 'spec_helper' RSpec.describe 'news_items/latest_news.html.erb', type: :view do subject { render 'news_items/latest_news', news_item: news_item } let(:news_item) { build :news_item, content: "[[SERVICE_NAME]]\n\nFirst para" } it { is_expected.to have_css '.latest-news-banner.govuk-notification-banner' }...
47.428571
100
0.725904
611a886d25231e514a61e3209803fbd651d4022e
22,796
# frozen_string_literal: true require 'spec_helper' RSpec.describe Security::CiConfiguration::SastBuildAction do let(:default_sast_values) do { global: [ { field: 'SECURE_ANALYZERS_PREFIX', default_value: 'registry.gitlab.com/security-products', value: 'registry.gitlab.com/security-products' } ...
41.750916
161
0.670951
626e5d54ae94be9ce47302f19f7ded23b043ab84
109
class UsersController < Muck::UsersController def signup_complete redirect_to profiles_path end end
15.571429
45
0.798165
876391c9a1936446b206a2a8b796e97f9981c3fe
3,072
# The 0.9.0 tag in homebrew repository isn't working in OSX Mavericks # this version fixes Cpp11 problems about syntax and tr1 headers # All patches and this file can be found in this public gist: # https://gist.githubusercontent.com/rafaelverger/58b6eeafaae7d28b06cc class Thrift090 < Formula homepage "http://thrift...
38.886076
114
0.719076
6af201161bc28d6ff905dbc80baa0cd6bdb3f56b
1,791
class Foma < Formula desc "Finite-state compiler and C library" homepage "https://code.google.com/p/foma/" url "https://bitbucket.org/mhulden/foma/downloads/foma-0.9.18.tar.gz" sha256 "cb380f43e86fc7b3d4e43186db3e7cff8f2417e18ea69cc991e466a3907d8cbd" license "GPL-2.0-only" revision 1 unless OS.mac? livec...
30.87931
95
0.706868
e95696f1b448d18f356f2a5e8190ab32b9de52cc
2,309
require 'spec_helper' describe 'OutCommand' do def in_dir Dir.mktmpdir do |working_dir| yield working_dir end end def add_manifest(manifest) File.open(manifest, 'w') { |file| file.write('your text') } end def add_key(key) File.open(key, 'w') { |file| file.write('your text') } end ...
29.602564
77
0.631442
e208ebfccf36f248d5080b3fdd14d1d11a2aca36
200
=begin Marketplace API Cloud Loyalty LTM - Webpremios OpenAPI spec version: 1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git =end class VendorOrders < ApplicationRecord end
12.5
64
0.78
189e3a735cf0b4f94da46fae2e220aca5fc33520
6,141
require 'spec_helper' describe Paperclip::Validators do context "using the helper" do before do rebuild_class Dummy.validates_attachment :avatar, presence: true, content_type: { content_type: "image/jpeg" }, size: { in: 0..10240 } end it "adds the attachment_presence validator to the class" ...
37.218182
134
0.68751
1a7896eec8678631e69fcca013c86668be48fcb8
6,731
# # Copyright 2011-2013, Dell # Copyright 2013-2014, SUSE LINUX Products GmbH # # 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 requi...
28.888412
82
0.635121
184679eb97f4786cf1b30793c47d515a260078a9
701
module RedPandas class Series def initialize(data=[], type: Type::String) @type = Type.lookup(type) @data = data.map { |value| @type.cast(value) } end attr_reader :type, :data def type_name type.type_name end def empty? @data.empty? end def [](arg) @da...
17.525
52
0.560628
f8dbd589d10a363b8cdf4131bd5735c24d9ce373
803
# frozen_string_literal: true require "randrizer/types/base_type" require "randrizer/types/type_expansion" module Randrizer module Types class Nullable include BaseType class << self def build(null_prob:, inner_type:) new(null_prob: null_prob, inner_type: inner_type) end ...
21.702703
76
0.630137
b9e3f530d21d8058387f08ee9cf65413ddc8215e
384
testcase "Test Scope" do def helper_method "helped!" end test "can use helper method" do helper_method.assert == "helped!" end context "sub-case inherits helpers" do test "can use helper method" do helper_method.assert == "helped!" end end test "test can't access case methods" ...
14.769231
42
0.643229
f70292b37dbfd92f9ca76ff964bc2ee1b86043be
624
# frozen_string_literal: true module AcaEntities module MagiMedicaid module Mitc module Contracts # Schema and validation rules for {AcaEntities::MagiMedicaid::Mitc::Determination} class DeterminationContract < Dry::Validation::Contract # @!method call(opts) # @param [Ha...
29.714286
90
0.647436
e24d837703b9292848411c7f5a571cec965bb3f5
1,875
require 'test_helper' class RemoteSoEasyPayTest < Test::Unit::TestCase def setup @gateway = SoEasyPayGateway.new(fixtures(:so_easy_pay)) @amount = 100 @credit_card = credit_card('4111111111111111', {:verification_value => '000', :month => '12', :year => '2015'}) @declined_card = credit_card('400030...
28.846154
115
0.693333
08bcd88136c40db4874f5866c9a21cbd79319174
628
require 'roar/representer' require 'roar/json' require 'roar/json/hal' require 'poto/representers/file_representer' module Poto module FileCollectionRepresenter include Roar::JSON::HAL include Roar::Hypermedia include Grape::Roar::Representer collection :files, extend: FileRepresenter, embedded: tru...
27.304348
94
0.711783
3345636339e411d18d8fe3fe3b35f34359f43815
967
class Direnv < Formula desc "Load/unload environment variables based on $PWD" homepage "https://direnv.net/" url "https://github.com/direnv/direnv/archive/v2.14.0.tar.gz" sha256 "917838827cb753153b91cb2d10c0d7c20cbaa85aa2dde520ee23653a74268ccd" head "https://github.com/direnv/direnv.git" bottle do cell...
32.233333
93
0.752844
7acd39eae83d4af54d0c4c9d94658b5baa0f13d0
1,906
class CreateNobelPrizeWinners < ActiveRecord::Migration def change create_table :nobel_prize_winners do |t| t.string :first_name t.string :last_name t.string :category t.integer :year end [ {first_name: 'Norman', last_name: 'Borlaug', category: 'Peace', ...
61.483871
105
0.550892
1a36da7acb40f00f8c8e3b12302c8fd6d0ba85e0
139
module Vagrant module SshFS class Error < Errors::VagrantError error_namespace("vagrant.config.sshfs.error") end end end
17.375
51
0.71223
e8a02be6780343d71da1b7cb99ae58902ebe57e2
529
class ReferencesController < ApplicationController def index @references = Reference.all end def new @reference = Reference.new end def create @references = Reference.all @reference = Reference.new(reference_params) if @reference.save respond_to do |format| format.html { r...
18.892857
95
0.671078
38cf089c062051d94b587835323839d001f865f9
835
unless ENV['CI'] require 'simplecov' SimpleCov.start end require 'seeclickfix' require 'rspec' require 'webmock/rspec' def a_delete(url) a_request(:delete, seeclickfix_url(url)) end def a_get(url) a_request(:get, seeclickfix_url(url)) end def a_post(url) a_request(:post, seeclickfix_url(url)) end def a_pu...
16.057692
45
0.742515