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
f70bfdeff170eb504d59240126249ad85c8518c9
673
class AddCategoriesToPurchases < ActiveRecord::Migration[6.1] def change safety_assured { add_monetize :purchases, :amount_spent_on_diapers, currency: { present: false } } safety_assured { add_monetize :purchases, :amount_spent_on_adult_incontinence, currency: { present: false } } safety_assured { add_mon...
61.181818
113
0.781575
08d9ad73aa35c5e62b27ce35c9302315dfdab3ac
398
require 'spec_helper' describe Aws::Broker::Config do subject { described_class.new } it { should have_attr_accessor(:enabled) } it { should have_attr_accessor(:queue_prefix) } it { should have_attr_accessor(:topic_prefix) } it { should have_attr_accessor(:sns) } it { should have_attr_accessor(:sqs) } ...
26.533333
74
0.728643
b9d43350d0b6c38079ca9f7c2237201a12fefe55
919
require "language/node" class Bit < Formula desc "Distributed Code Component Manager" homepage "https://www.bitsrc.io" url "https://registry.npmjs.org/bit-bin/-/bit-bin-0.10.8.tgz" sha256 "a8d19cde1ac47937a781a22d2f8ad7a93057a767fa4d68c7218d9f864da729f4" head "https://github.com/teambit/bit.git" bottle do...
32.821429
93
0.754081
bf90769f77aaf8024b95186223b0d06f32155b17
3,716
#-- copyright # OpenProject is a project management system. # Copyright (C) 2012-2014 the OpenProject Foundation (OPF) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 3. # # OpenProject is a fork of ChiliProject, which is a fork of ...
25.278912
91
0.649892
ab27bd29e0df9c04903784438ab0eb2937c02020
1,372
require File.expand_path("../Abstract/abstract-php-extension", __dir__) class Php70Blitz < AbstractPhp70Extension init desc "Blitz, the fasted template engine for PHP!" homepage "http://alexeyrybak.com/blitz/blitz_en.html" url "https://github.com/alexeyrybak/blitz/archive/0.10.2-PHP7.tar.gz" version "0.10.2"...
29.191489
75
0.700437
bf48cb1a5e9459f9d3a5f443938cc09a3e5c015d
1,476
module Nin class Item attr_accessor :id, :desc, :date, :tags, :uid, :completed, :archived def initialize(id, desc, date = Date.today, tags = [], uid = nil, completed = false, archived = false, ...
20.788732
71
0.504065
bf11cf1f60009b70c21ea19c45797b8e06470931
397
require 'spec_helper' describe SageoneSdk do describe "configurable" do it "can be configured" do SageoneSdk.configure do |config| config.access_token = "foo" end expect(SageoneSdk.access_token).to eq("foo") end end describe "client" do it "returns a new client" do e...
19.85
65
0.672544
266adff3879cbb9ed2880927d49c538501edc26d
344
class AddNewCalendarFields < ActiveRecord::Migration[5.1] def change add_column :calendars, :based_on_id, :integer, index: true add_column :calendars, :calendar_area_id, :integer, index: true add_column :calendars, :template, :boolean, default: false rename_column :calendars, ...
38.222222
74
0.688953
62c1eae55906a6db6ed5e8f6cf03ebf698ab3d13
1,606
# frozen_string_literal: true module RuboCop module Cop module Rails # This cop checks for places where ordering by `id` column is used. # # Don't use the `id` column for ordering. The sequence of ids is not guaranteed # to be in any particular order, despite often (incidentally) being ch...
30.301887
90
0.582814
1c354298a402ce58cb2be71e4b0fb4096b20fd2b
513
require 'spec_helper' module AccountManager module Handlers describe PasswordStrength do def app AccountManager::Handlers::PasswordStrength end it 'returns 1 if the password is strong' do post '/password_strength', password: 'VERY_fuerte_password!' last_response.body.s...
22.304348
68
0.651072
797e5576a6fc098fc6ba43dc83c91ae1d97738fa
158
# frozen_string_literal: true FactoryBot.define do factory :research_fund do grant { create :grant } publication { create :publication } end end
17.555556
39
0.727848
1172f690f0f275f5e11816de48d9abd43dbcda8b
1,901
class ChargesController < ApplicationController layout "dashboard" def new end def create # Amount in cents @amount = Option.find_by_name('CONTRIBUTION').value @final_amount = @amount @code = params[:couponCode] if !@code.blank? @discount = get_discount(@code) if @discount.n...
24.063291
128
0.614413
e91868dd9e8bb0fb3b2e9475248a7a1b6aebf3df
11,093
# 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 source for your # dat...
40.6337
132
0.713603
1c085c1fb03b7626210731d90d749ca350652c06
39
TaskCarrier::Engine.routes.draw do end
13
34
0.820513
2639eb50238e94ef71857acc3408a88a3344ea1c
478
require 'rails_helper' RSpec.describe CreateGroupAssignmentInvitationJob, type: :job do it 'creates a vaild invitation for the group_assignment' do group_assignment = create(:group_assignment) assert_performed_with(job: CreateGroupAssignmentInvitationJob, args: [group_assignment], queue: 'default') do ...
34.142857
113
0.809623
28505ca5c91bfe28277c30bd73415cbca8794f69
1,790
# coding: utf-8 class ListenedsController < ApplicationController before_action :set_listened, only: [:show, :edit, :update, :destroy] # GET /listeneds def index @search_listened = Listened::Search.new(search_params) @listeneds = @search_listened.search(params[:page]) end # GET /listeneds/1 def sh...
23.552632
162
0.68324
d5845b10d352c035858d1718aeb09e98d78c1e4a
10,111
class VotesController < ApplicationController before_action :authenticate_user! def index @election = Election.find(params[:election_id]) now = Time.zone.now if @election.offline_only? flash[:alert] = "only offline voting is allowed for this election" redirect_to root_path elsif curren...
32.407051
146
0.682524
79d93d7d6334fccf1ac70d2288803f1565ce3fad
223
require 'rubygems' require 'bundler/setup' require 'lotus/setup' require_relative '../lib/new_container' require_relative '../apps/web/application' Lotus::Container.configure do mount Web::Application, at: '/mypath' end
22.3
42
0.7713
5dd34e04d28c86d99db22c15e871328b853bc6dc
487
require 'httpclient' class Template include Base class << self def post(opt) Base.ehrbase_connection.post('definition/template/adl1.4', opt, 'Content-Type' => 'application/xml') end def all list = JSON.parse(Base.ehrbase_connection...
21.173913
93
0.570842
01f88188a145d08cbee5f3ce0b0eef7cdc2df883
1,138
# frozen_string_literal: true lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'surro-gate/version' Gem::Specification.new do |spec| spec.name = 'surro-gate' spec.version = SurroGate::VERSION spec.authors = ['Dávid Halász'] spec.email ...
34.484848
93
0.678383
1a1dba6a7cdec0dbd4eb9cd72debc76869d33e7f
1,074
require_relative '../../test_helper' class StateWithNameTest < StateMachinesTest def setup @klass = Class.new @machine = StateMachines::Machine.new(@klass) @machine.states << @state = StateMachines::State.new(@machine, :parked) end def test_should_have_a_name assert_equal :parked, @state.name ...
24.409091
75
0.755121
5da59b4d4ec4326ca31edd67369499ffefaa0155
609
# frozen_string_literal: true # encoding: utf-8 require 'ffaker/address' module FFaker module AddressID include FFaker::Address extend ModuleUtils extend self STREET_PREFIX = %w(Jl Jln).freeze def zip_code FFaker.numerify '#####' end def state fetch_sample(STATE) end ...
15.225
83
0.643678
03a50be3d2a35d15307568afdf3de7c0a379e498
8,562
require 'test_helper' require 'rack/mock' class BobRossServerTest < Minitest::Test def create_store StandardStorage::Filesystem.new({ path: File.expand_path('../../fixtures', __FILE__) }) end def create_server(configs={}) configs[:store] ||= create_store Rack::MockRequest.new(BobRoss:...
43.025126
173
0.677529
1a77cd02775e0357b590eb5775e801cc4d2347f2
329
class CreateQuestions < ActiveRecord::Migration[5.2] def change create_table :questions do |t| t.text :content t.text :answer_a t.text :answer_b t.text :answer_c t.text :answer_d t.string :correct_answer t.references :round, foreign_key: true t.timestamps end ...
20.5625
52
0.644377
014f6fda38d506751bc79a00b524f19158e86319
187
class ContactMailerPreview < ActionMailer::Preview def send_email ContactMailer.send_email({ name: 'My name', email: 'test@email.com', message: 'Hello from the gutter' }) end end
31.166667
108
0.737968
7912d53b8249ab0f6397d584c8c544e5486be1ed
63
require 'omniauth_mv/version' require 'omniauth/strategies/mv'
21
32
0.825397
39aee5819bbed1648b7d5810f8224504c42d5ead
487
require_relative 'base_handler' module TestSteps module Handlers class CheckScreendata < Base register :check_screen_data def perform(step_attributes) check_text = step_attributes[:testvalue] Browser.b.wait_until { Browser.b.element.text.include? check_text } MyLog.log.info(...
23.190476
75
0.665298
b930448cd4de906bff01b987ac36b71b998b8e98
215
User.create!(:email => "user1@example.com", :password => "password", :password_confirmation => "password") User.create!(:email => "user2@example.com", :password => "password", :password_confirmation => "password")
53.75
106
0.697674
b96dffe533eb8cc0ab1862014e161d314528a9cd
436
cask "tinymediamanager" do version "3.1.8" sha256 "650a43fc41fd188eb336760d0038ef9fa8efdaeb5e618e00a4aeebb21a24e68d" url "https://release.tinymediamanager.org/v#{version.major}/dist/tmm_#{version}_mac.zip" appcast "https://release.tinymediamanager.org/" name "tinyMediaManager" homepage "https://www.tinymed...
24.222222
90
0.763761
331005286c63e272987c2010e77f15441fad30f5
85
Rails.application.routes.draw do mount UserRemarks::Engine => "/user_remarks" end
17
46
0.764706
edafb2c55bbce39e120ea2c33a2b230662d26ec8
2,618
#Builder to generate options for getting test history #All of the with... methods return self for method chaining class TestHistoryBuilder def initialize @options = {} end #Sets the max number of tests to return def withLimit(limit) @options["num"] = limit self end...
25.666667
98
0.632926
bb89475e85dbd041d938ff99cbb7bcca4170f767
1,848
#-- encoding: UTF-8 #-- copyright # OpenProject is a project management system. # Copyright (C) 2012-2015 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.322034
91
0.737554
39596b80c72cfa6f7619b5b5ddcc1bd00a00d338
7,693
class Tracksperanto::Export::FlameStabilizer2014 < Tracksperanto::Export::Base COLOR = "50 50 50" DATETIME_FORMAT = '%a %b %d %H:%M:%S %Y' def self.desc_and_extension "flamesmoke2014.stabilizer" end def self.human_name "Flame/Smoke 2D Stabilizer setup (v. 2014 and above)" end def start...
29.702703
93
0.650981
7a741fb69cd30959c90c3650b499da62c9271bcc
301
module ConstantAttributeReader def read_constant_attribute(name_index) attribute = {} attribute[:attribute_name_index] = name_index attribute[:attribute_length] = load_bytes(4).to_i(16) # expected is 2 attribute[:constantvalue_index] = load_bytes(2).to_i(16) attribute end end
30.1
73
0.750831
1a20d7ad0df82b2d3566e58d43f386ffefd9ddd1
334
RSpec.describe Magick::Image, '#delay' do it 'works' do image = described_class.new(100, 100) expect { image.delay }.not_to raise_error expect(image.delay).to eq(0) expect { image.delay = 10 }.not_to raise_error expect(image.delay).to eq(10) expect { image.delay = 'x' }.to raise_error(TypeErr...
27.833333
58
0.673653
03c3233ed6df7aeb705176b640824c9f590b4d01
216
require 'spec_helper' describe ParamsTransformer do it 'has a version number' do expect(ParamsTransformer::VERSION).not_to be nil end it 'does something useful' do expect(false).to eq(true) end end
18
52
0.731481
f7a4535da788d6401b7d41e9d4ac67484449505c
12,967
# frozen_string_literal: false # # irb/input-method.rb - input methods used irb # $Release Version: 0.9.6$ # $Revision$ # by Keiju ISHITSUKA(keiju@ruby-lang.org) # # -- # # # require_relative 'src_encoding' require_relative 'magic-file' require_relative 'completion' require 'io/console' require 'reline' requ...
27.589362
125
0.618493
1ad2264858696e8d2792e826482e0323d6a27cd5
2,469
#! /usr/bin/env ruby require 'spec_provider_helper' require 'puppet/provider/force10_portchannel/dell_ftos' provider_class = Puppet::Type.type(:force10_portchannel).provider(:dell_ftos) describe provider_class do before do @portchannel = stub_everything 'portchannel' @portchannel.stubs(:name).returns('152'...
33.364865
98
0.678412
bf9ac72de1acd88d9d1503cc65e8c1561b93c7d5
591
# encoding: utf-8 require 'multi_json' require 'sinatra' require 'data_mapper' require 'dm-migrations' class <%= _.capitalize(baseName) %> < Sinatra::Application enable :sessions configure :development do DataMapper::Logger.new($stdout, :debug) DataMapper.setup( :default, 'sqlite:///tmp/my.db'...
19.064516
59
0.705584
3315cf98158f8deb97f8958ef3e34a0d5b872a81
1,654
# frozen_string_literal: true # # Namespace for the Socializer engine # module Socializer # Decorators that can be shared with the other decorators by inheriting # from ApplicationDecorator class ApplicationDecorator < Draper::Decorator # Returns an HTML time tag # # @param options [Hash] # #...
26.253968
77
0.639661
e2e4a5e38706f1468648fe23dd79f3c606d35a15
1,289
module BackgrounDRb class RailsWorkerProxy attr_accessor :worker_name, :worker_method, :data, :job_key,:middle_man def self.worker(p_worker_name,p_job_key = nil,p_middle_man = nil) t = new t.worker_name = p_worker_name t.middle_man = p_middle_man t.job_key = p_job_key t end ...
32.225
132
0.657874
edca08e34566ad5b54406f719ec1be8039b7b2d6
5,103
require File.dirname(__FILE__) + '/../../../test_helper' class PaypalMasspayNotificationTest < Test::Unit::TestCase include ActiveMerchant::Billing::Integrations def setup @paypal = Paypal::MasspayNotification.new(http_raw_data) end def test_accessors assert @paypal.complete? assert_equal "Comple...
42.173554
801
0.789732
7a630799e51985d7f587020014c8ea71865468eb
2,774
class ParticipationsController < ApplicationController before_action :set_player before_action :set_participation, only: [:show, :edit, :update, :destroy] # GET /players/1/participations # GET /players/1/participations.json def index @participations = @player.participations.all end # GET /players/1/...
31.522727
91
0.663663
b9da8baad212912988faf86d45c760cc289705f6
1,039
# coding: utf-8 require 'spec_helper' describe SpellingAlphabet do describe 'Converter' do context 'when generated without arguments' do before do @c = SpellingAlphabet::Converter.new end it 'converts letters to the corresponding words with the default word set' do ...
24.162791
83
0.615977
e90fe1b50783e85d171b972a23dd5642bdbacacb
121
class DropApplicationsAdminRoles < ActiveRecord::Migration def change drop_table :applications_admin_roles end end
24.2
58
0.834711
39b7222106b1b8a3f8b81116e0a03bf7c67714d7
945
Pod::Spec.new do |spec| spec.name = "CoreGraphicsExt" spec.version = "0.9.3" spec.summary = "CoreGraphicsExt" spec.description = "Core Graphics extensions" spec.homepage = "https://github.com/mntone/MTKit" spec.license = "MIT license" spec.author = { "mntone" => "mntone@o...
36.346154
108
0.625397
6a6194b588abcdb8e097a56ad21f8c47fb7a52e7
318
desc "Archive unresolved reports which no longer reference a valid post" task :archive_invalid_reports => :environment do @reports = Report.where(status: 0) @reports.each do |report| if report.concerns_model == 'post' && Post.where(id: report.concerns_id).empty? then report.archived! end end end
28.909091
88
0.72327
26d927f3add408b608fe7b4c38d2f933a7f0f187
1,213
module ActiveRecord module ConnectionAdapters class SQLServerAdapter # Returns true as this adapter supports views. def supports_views? true end # Get all of the non-view tables from the currently connected schema def nonview_tables(name = nil) # this is untest...
28.880952
79
0.608409
4a5aa902b880deba28571e50aaffee4376beeaf4
34,039
# frozen_string_literal: true require "active_support/core_ext/string/filters" require "concurrent/map" module ActiveRecord # = Active Record Reflection module Reflection # :nodoc: extend ActiveSupport::Concern included do class_attribute :_reflections, instance_writer: false, default: {} cla...
32.635666
146
0.649167
18666ed67c0238b76e2d1902d4968dfd705b50ee
515
module ApplicationHelper def site_mode lite_mode? ? 'lite' : 'media' end def icon_sizes [57, 60, 70, 72, 76, 114, 120, 144, 150, 152, 180, 192, 200, 300, 310, 500, 600] end def largest_touch_icon_url size = icon_sizes.last dimensions = "#{size}x#{size}" asset_url("icons/icon-#{dim...
20.6
84
0.619417
61927b36521e02b9bf3045dee724038e8c1e2b83
1,606
require 'test_helper' module DeveloperPortal::ControllerMethods class PlanChangesMethodsTest < ActiveSupport::TestCase class DummieController < ApplicationController include ::DeveloperPortal::ControllerMethods::PlanChangesMethods end def setup @controller = DummieController.new ...
20.589744
95
0.666874
f7555c8b8bd124a92799c788496191d053ce44ef
136
Cdx::User.create(email: 'admin@cdx.io', password: 'cdx123', roles: Cdx::User::AVAILABLE_ROLES) Cdx::Taxonomy.create(name: 'Catégories')
45.333333
94
0.735294
797050413a6a1483bbc596e17c843111b84fb93b
120
class ProMembershipPlanSerializer < ActiveModel::Serializer attributes :id, :name, :amount, :duration, :recurring end
30
59
0.791667
33b0d7c1354110afea55a66800099c4542ffd19e
2,793
# frozen_string_literal: true require 'spec_helper' describe Overcommit::Hook::PreCommit::PhpCsFixer do let(:config) { Overcommit::ConfigurationLoader.default_configuration } let(:context) { double('context') } subject { described_class.new(config, context) } before do subject.stub(:applicable_files).an...
32.103448
108
0.634801
1ac29711f4e517be52d0333c68280995d174f6fb
963
Gem::Specification.new do |spec| spec.name = 'puppet-lint-anchor-check' spec.version = '1.0.0' spec.homepage = 'https://github.com/voxpupuli/puppet-lint-anchor-check' spec.license = 'Apache-2.0' spec.author = 'Vox Pupuli' spec.email = 'voxpupuli@groups.io' spec.files = D...
35.666667
86
0.649013
39c4c4e935b029efca30e4022c3b19934deb2a14
2,209
FactoryBot.define do factory :target do title { Faker::Lorem.words(number: 6).join ' ' } role { Target.valid_roles.sample } target_group sequence(:sort_index) visibility { Target::VISIBILITY_LIVE } trait :archived do safe_to_change_visibility { true } visibility { Target::VISIBILI...
26.939024
129
0.655953
bfbf5a6bf644eafcadc5dd7a437bba8acd1ff257
18,052
# frozen_string_literal: true # EndProductEstablishment represents an end product that Caseflow has either established or attempted to # establish (if the establishment was successful `established_at` will be set). The purpose of the # end product is determined by the `source`. # # Most columns on EndProductEstablishm...
31.177893
119
0.747341
f7c4a88663b480eaedb9f592a1c051525227ea87
497
require_relative 'boot' require 'rails/all' Bundler.require(*Rails.groups) require "spectre" module Dummy class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults 5.1 # Settings in config/environments/* take precedence over...
26.157895
82
0.7666
1de9a9ae04c913eaabc65b3a8da1bee10c1565c6
10,479
# encoding: UTF-8 # This file contains data derived from the IANA Time Zone Database # (http://www.iana.org/time-zones). module TZInfo module Data module Definitions module Pacific module Chatham include TimezoneDefinition timezone 'Pacific/Chatham' do |tz| ...
51.117073
69
0.577918
6a5b2207a9d282eecc03c5733c3294490de9b3e5
5,265
# # Be sure to run `pod spec lint MD360Player4iOS.podspec' to ensure this is a # valid spec and to remove all comments including this before submitting the spec. # # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html # To see working Podspecs in the CocoaPods repo see https://gi...
38.430657
192
0.605508
1ce3d49693380d4ba5e2ef1d7f3c01016621d588
1,013
class MovesGenerator include Callable attr_accessor :player, :others delegate :floor, to: :player def initialize(player, participants:) self.player = player self.others = participants - [player] end def call surrounding_moves end private def surrounding_moves permutations = ((pla...
22.021739
102
0.631787
e29c36f34c07e79c9a67aaf64ab87d7a990088bb
1,354
cask "rider" do version "2021.2.1,212.5080.71" sha256 "6d3d71c5a7ea0443427903e6749e19d808dbb9280f51d96d61584d6f2e105500" url "https://download.jetbrains.com/rider/JetBrains.Rider-#{version.before_comma}.dmg" name "JetBrains Rider" desc ".NET IDE" homepage "https://www.jetbrains.com/rider/" livecheck do ...
32.238095
115
0.690547
2823d5a680483f0d8edc80a232a049156d186bdb
302
name "distro" default_version "1.3.0" dependency "python" dependency "pip" build do ship_license "https://raw.githubusercontent.com/nir0s/distro/master/LICENSE" pip "install --install-option=\"--install-scripts="\ "#{windows_safe_path(install_dir)}/bin\" "\ "#{name}==#{version}" end
23.230769
78
0.695364
032ed593204051e073e3d03aec462421681eb9d9
9,192
describe Fastlane do describe Fastlane::FastFile do describe "Get Version Number Integration" do require 'shellwords' path = File.absolute_path("./fastlane/spec/fixtures/actions/get_version_number/get_version_number/") it "gets the correct version number for 'TargetA'", requires_xcodeproj: tru...
45.058824
139
0.652198
876f72619d2ddeeec9039a665338343b83d76deb
354
class FontOriginalSurfer < Formula head "https://github.com/google/fonts/raw/main/ofl/originalsurfer/OriginalSurfer-Regular.ttf", verified: "github.com/google/fonts/" desc "Original Surfer" homepage "https://fonts.google.com/specimen/Original+Surfer" def install (share/"fonts").install "OriginalSurfer-Regul...
32.181818
133
0.757062
1c948dd91c8f6df208795007507f9936ced50b30
1,708
# This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # This file is the source Rails uses to define your schema when running `bin/rai...
37.955556
86
0.724824
b90b88c15ca6e89f8450a4e980dfb3760eba0d67
2,893
require 'rubygems' require 'bundler/setup' require 'reel' class TimeServer include Celluloid include Celluloid::Notifications def initialize async.run end def run now = Time.now.to_f sleep now.ceil - now + 0.001 every(1) { publish 'time_change', Time.now } end end class TimeClient inc...
23.520325
136
0.622883
188ec64d8f29611558360f755de716e2ae8a6a2b
1,672
require 'spec_helper' require 'bosh/director/models/variable' module Bosh::Director::Models::Links describe LinkConsumer do let(:deployment) {Bosh::Director::Models::Deployment.create(name: 'my-dep')} describe '#validate' do it 'validates presence of deployment_id' do expect { LinkCo...
27.409836
88
0.581938
1c30face536d315ea47fc78c3422c16323736d4a
875
require 'zip/filesystem' require 'fileutils' module Powerpoint module Slide class Powerpoint::Slide::Intro def initialize extract_path, title, subtitile=nil template_path = "#{TEMPLATE_PATH}/ppt/slides/slide1.xml" xml = File.read template_path xml_title = '<a:p><a:r><a:rPr lang="en...
39.772727
161
0.632
18b7a95f62be19570a8a4c3e9fce9d6a4765167d
7,131
# frozen_string_literal: true module Engine module Game module G18Tokaido module Map TILES = { '3' => 3, '4' => 3, '5' => 3, '6' => 3, '7' => 'unlimited', '8' => 'unlimited', '9' => 'unlimited', '14' => 3, '15...
32.266968
127
0.38578
edf7cecde066cc0689682efb389072a0fb60e8ef
193
class AddNumberAndDistrictToSpreeAddress < ActiveRecord::Migration def change add_column :spree_addresses, :number, :integer add_column :spree_addresses, :district, :string end end
27.571429
66
0.787565
38398fde20c509df545859bd29044ad1e4d6d00a
2,067
class CartController < ApplicationController def index respond_to do |format| format.html { render } format.js { render layout: false } end end def add_item @cart.add_item(params[:id]) render json: true end def remove_item @cart.remove_item(params[:id]) redirect_to cart...
29.956522
216
0.656023
e2889dcc5b26264f63a31501ab2c54a34edb19d0
798
# Adapted from https://github.com/flyerhzm/code_analyzer # License: MIT class Array def line_number case self[0] when :def, :defs, :command, :command_call, :call, :fcall, :method_add_arg, :method_add_block, :var_ref, :vcall, :const_ref, :const_path_ref, :class, :module, :if, :unless, :elsif,...
31.92
78
0.661654
bbc10f6625505be17f0d1cbeda6ddd8ade016724
11,086
# frozen_string_literal: true require "uri" module ActiveRecord module ConnectionAdapters class ConnectionSpecification #:nodoc: attr_reader :name, :config, :adapter_method def initialize(name, config, adapter_method) @name, @config, @adapter_method = name, config, adapter_method end ...
37.201342
240
0.547988
f777e5a0aaa5f979a7710eb3b03e44bdef2ae2dc
1,090
require_relative 'color' class Snap class Sprite module Drawing include Color attr_reader :pen_is_up alias_method :pen_up?, :pen_is_up def init_drawing(size: 1, color: [0, 0, 0, 255], up: false) @pen_size = size @pen_color = color @pen_is_up = up end ...
20.961538
78
0.543119
e8076c96fa9d17089a659cbbed2a7156b67f0c8d
1,178
require 'test_helper' class WebProfilesControllerTest < ActionController::TestCase def setup @controller = WebProfilesController.new end test "should get index" do get :index assert_response :success assert_not_nil assigns(:web_profiles) end test "should get new" do get :new asser...
23.56
72
0.709677
031eeb9fd72066b2da1c8a57d20fe547e9f4529b
346
# frozen_string_literal: false # # TkTrans support (win32 only) # by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp) # require 'tk' # call setup script for general 'tkextlib' libraries require 'tkextlib/setup.rb' # call setup script require 'tkextlib/tktrans/setup.rb' # load library require '...
21.625
75
0.693642
f79eb0cd1bf1b36ca1f6a394c179a2e9707dfd2d
4,125
# rubocop:disable Style/ClassVars module Gitlab module Metrics module Methods extend ActiveSupport::Concern included do @@_metric_provider_mutex ||= Mutex.new @@_metrics_provider_cache = {} end class_methods do def reload_metric!(name) @@_metrics_provid...
31.730769
106
0.588606
26fd6b9efe6a5134458cd66f4aa801aa3b576ff8
1,517
# 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::DevTestLabs::Mgmt::V2018_09_15 module Models # # Properties of a user's secret store. # class UserSecretStoreFragment ...
26.155172
70
0.535926
bb6db304fdbba990a60054795c3da62ad8da2467
381
# Extra full path added to fix loading errors on some installations. %w( base measurements area bar line pie spider net stacked_area stacked_bar side_stacked_bar side_bar accumulator_bar themes scene mini/legend mini/bar mini/pie mini/side_bar ).each do |filename| require File...
12.7
68
0.708661
39abb15610505170bd5b864bc041abb1dcc727e7
287
begin require 'rails' require 'cached_counts/railtie' rescue LoadError #do nothing end require 'cached_counts/active_record_base_methods' require 'cached_counts/active_record_relation_methods' require 'cached_counts/cache' require 'cached_counts/version' module CachedCounts end
19.133333
54
0.836237
d51df8bcb5d1fd6830c2e6b9a6dd72d58d2a1f1f
3,345
module Ransack module Constants DISTINCT = 'DISTINCT '.freeze DERIVED_PREDICATES = [ [CONT, { arel_predicate: 'matches'.freeze, formatter: proc { |v| "%#{escape_wildcards(v)}%" } } ], ['not_cont'.freeze, { arel_predicate: 'does_not_match'.freeze, form...
29.342105
61
0.50852
d59cd00edf1bdb005cbd6d495c81304ef478e254
51
module TestrailRspec VERSION = '0.1.5'.freeze end
17
26
0.745098
ed75d662b0afc28254379651444cb0947edfaafd
551
module Api module V1 module CreditCard module Response def self.included(base_class) schema = Base.schema base_class.include Api::V1::Account::Response base_class.def_param_group :credit_card_response do schema.each do |name, info| type, desc ...
25.045455
82
0.584392
b931df3ceb17e4b04488d5bb5ff26f951651644b
131
require 'test_helper' class ItemControllerTest < ActionController::TestCase # test "the truth" do # assert true # end end
16.375
53
0.725191
61f526bd77e894d3c57ab32f1f79ad2e93eaee98
341
# frozen_string_literal: true class AddVerificationStateToPackageFiles < ActiveRecord::Migration[6.0] DOWNTIME = false def change add_column :packages_package_files, :verification_state, :integer, default: 0, limit: 2, null: false add_column :packages_package_files, :verification_started_at, :datetime_wit...
31
104
0.797654
213cf47afca8ee8cc874a4b8e74aedaa4b2b2769
157
# frozen_string_literal: true require "rails_helper" RSpec.describe HotwiredComponent::Daisy::CardComponent, type: :view do pending "add tests here" end
19.625
70
0.789809
61b73a4c172fe703438f3561f4bbef0970871d3d
334
cask 'font-chicle' do version :latest sha256 :no_check # github.com/google/fonts was verified as official when first introduced to the cask url 'https://github.com/google/fonts/raw/master/ofl/chicle/Chicle-Regular.ttf' name 'Chicle' homepage 'http://www.google.com/fonts/specimen/Chicle' font 'Chicle-Reg...
27.833333
86
0.748503
eda7341d94d0d8962088c6b11d4bfd5ca0e0c691
5,400
# 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...
43.902439
109
0.733889
1dd4be01de9b745829da56bfd864ca761c40f485
395
# frozen_string_literal: true require 'spec_helper' require_relative '../../../../apps/web/controllers/todos/list' describe Web::Controllers::Todos::List do let(:action) { Web::Controllers::Todos::List.new } context 'of successful cases' do let(:params) { {}.merge(jwt) } it 'is got' do response = ...
21.944444
62
0.663291
ff0ef8de7c2687d23939fba399fdd228c3af33de
130
require 'test_helper' class AddControllerTest < ActionController::TestCase # test "the truth" do # assert true # end end
16.25
52
0.723077
e9be43824dcdd2c412ab8634ed65bbd7982f4200
221
require 'result/version' require 'result/errors' require 'result/constants' require 'result/chainable' require 'result/command' require 'result/result' require 'result/success' require 'result/failure' module Result end
18.416667
26
0.800905
38c6854087a830f2dbf57114feae3110a8d280d3
170
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe "Etherscan" do it "has a version" do expect(Etherscan::VERSION).not_to be_nil end end
21.25
65
0.741176
e24c6453825c6b30eff51325ae29384686787f8b
373
cask 'insync' do version '3.0.28.40721' sha256 '11bbdf6de20438d7935d4de987838d160d4a2f3e59c6c5f33e25a01547011373' url "http://s.insynchq.com/builds/Insync-#{version}.dmg" appcast 'https://www.insynchq.com/downloads?start=true' name 'Insync' homepage 'https://www.insynchq.com/' auto_updates true confli...
24.866667
75
0.747989
4a5379c88ea785b454a385510785b90f49ec8364
997
# encoding: utf-8 module UpdateHelper module Mapper module Florensia module Item class FusionHelpBreakModel include UpdateHelper::Mapper::TableFile model ::Florensia::Item::FusionHelpBreak partial false primary_key :item_id map('코드', 'item_id') ...
24.925
50
0.486459
6a6fcf8e09584191dd69cbdc70ea540cdc21e58c
394
# 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::StorageCache::Mgmt::V2019_11_01 module Models # # Defines values for FirmwareStatusType # module FirmwareStatusType Av...
23.176471
70
0.715736
2629a7a7e9c1a67ed4c4a8eabd4d332b2b483cd8
5,346
# 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 module Models # # Peer Express Route Circuit Connection in an ExpressRouteCircuitPeering # resource. ...
33.4125
77
0.534605
e286a0ed69715fda820add55d359e886a9b1ad8c
208
class Member < ApplicationRecord validates :name, :initials, presence: true has_many :assignments, dependent: :destroy has_many :projects, through: :assignments belongs_to :group, optional: true end
26
44
0.769231
bb9024eb6ed9333864b005af703609d21464f811
2,523
class BuildCloud::Subnet include ::BuildCloud::Component @@objects = [] def self.get_id_by_name( name ) subnet = self.search( :name => name ).first unless subnet raise "Couldn't get a Subnet object for #{name} - is it defined?" end subnet_fog = subnet.read ...
23.361111
90
0.563615
7a85e566b6ec6d46c0d6db472148615340bc4ebc
345
require 'spec_helper' describe Eucalypt do describe Eucalypt::Migration do context 'Types' do before { Temporary.create_app } after { Temporary.clear } it do output = tmp { execute 'migration types' } expect(output).to include *Migration::Validation::COLUMN_TYPES.map(&:to_s) ...
23
82
0.655072