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 |
|---|---|---|---|---|---|
016f431aa10688d8e5fae823edc9c8fad3210019 | 1,825 | module OpenActive
module Models
module Schema
class PriceSpecification < ::OpenActive::Models::Schema::StructuredValue
# @!attribute type
# @return [String]
def type
"schema:PriceSpecification"
end
# @return [Boolean,nil]
define_property :value_adde... | 26.838235 | 95 | 0.547397 |
1abfd60f3edfd6bef16c8ed79b0188bfcffd1c5b | 10,720 | require 'rails_helper'
require "#{BenefitSponsors::Engine.root}/spec/shared_contexts/benefit_market.rb"
require "#{BenefitSponsors::Engine.root}/spec/shared_contexts/benefit_application.rb"
RSpec.describe GroupSelectionPrevaricationAdapter, dbclean: :after_each, :if => ::EnrollRegistry[:aca_shop_market].enabled? do
... | 38.014184 | 126 | 0.66959 |
e945b374c6de80a8e045a96e1148fa004f23c65f | 1,112 | # include helper methods
class ::Chef::Recipe
include ::Opscode::ChefClient::Helpers
end
# libraries/helpers.rb method to DRY directory creation resources
client_bin = find_chef_client
Chef::Log.debug("Found chef-client in #{client_bin}")
node.default['chef_client']['bin'] = client_bin
create_chef_directories
dist_... | 30.054054 | 83 | 0.714029 |
2833e95cefc9159b57b0f03768b67b86519e4b44 | 2,991 | xml.instruct!
xml.programs {
#@channel.playlists.each { |pl|
@programs.each { |prog|
#prog = pl.program
xml.program {
xml.name prog.title
#xml.clips {
# prog.children.each {|sp|
# xml.clip {
# xml.name sp.title
# xml.filename sp.filename
# }
#... | 29.613861 | 76 | 0.386827 |
7ac700737cd118fce5be92896faa8943dbbe8521 | 689 | module VagrantPlugins
module Bindler
module LocalPluginsManifestExt
PLUGINS_LOOKUP = [
ENV['VAGRANT_PLUGINS_FILENAME'],
'vagrant/plugins.json',
'vagrant/plugins.yml',
'.vagrant_plugins.json',
'.vagrant_plugins.yml',
'plugins.json',
'plugins.yml'
... | 25.518519 | 102 | 0.624093 |
f789e9850530476f2ff8a3341b59a8388141721e | 6,364 | module Spree
module ProductsFiltersHelper
PRICE_FILTER_NAME = 'price'.freeze
FILTER_LINK_CSS_CLASSES = 'd-inline-block text-uppercase py-1 px-2 m-1 plp-overlay-card-item'.freeze
ACTIVE_FILTER_LINK_CSS_CLASSES = 'plp-overlay-card-item--selected'.freeze
CLEAR_ALL_FILTERS_LINK_CSS_CLASSES = 'btn spree-... | 37.656805 | 144 | 0.694846 |
330829d758c355fe2075f59f1a243121b5968221 | 6,630 | require 'json'
module Robinhood
module REST
class API
def account
raw_response = HTTParty.get(endpoints[:accounts], headers: headers)
JSON.parse(raw_response.body)
end
def investment_profile
raw_response = HTTParty.get(endpoints[:investment_profile], headers: head... | 31.273585 | 178 | 0.557315 |
3814a5a862f4bb9720bf3c2a4d3c6c9001441b8d | 190 | Joybox::TMX::ObjectLayer = CCTMXObjectGroup
class CCTMXObjectGroup
alias_method :name, :groupName
alias_method :offset, :positionOffset
def [](key)
objectNamed(key)
end
end | 15.833333 | 43 | 0.736842 |
39b012c6585f4fddb6defd93ab3bdde8a70bcba5 | 17,983 | # frozen_string_literal: true
# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0... | 29.674917 | 129 | 0.538564 |
1a69bc39123e4ac5720a8a377da217323efc35e2 | 377 | live_loop :flibble do
sample :bd_haus, rate: 1
sleep 0.5sample :ambi_choir, rate: 0.3
sample :bd_haus, rate: 0.6
sleep 0.7
end
live_loop :guit do
with_fx :echo, mix: 0.5, phase: 0.2 do
sample :guit_em9, rate: 1
end
sample :guit_em9, rate: 1
sleep 8
end
live_loop :boom do
with_fx :reverb, room: 0.4 do
... | 19.842105 | 40 | 0.668435 |
bb50ab6d445aeb55044dc3d761d0cb3cba702948 | 21,582 | ##########################GO-LICENSE-START################################
# Copyright 2014 ThoughtWorks, 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/li... | 56.203125 | 290 | 0.700723 |
5de3fa45daf81bb30575779f2b9b63c943c9afce | 497 | #
# encoding: utf-8
# Inspec test for recipe cb_cis_windows_2016::cis-18-7-start-menu-and-taskbar
# The Inspec reference, with examples and extensive documentation, can be
# found at http://inspec.io/docs/reference/resources/
unless os.windows?
# This is an example test, replace with your own test.
describe user... | 24.85 | 77 | 0.730382 |
e8f8ab8826fb0f5c6340ea536d6bd3484a47f37e | 2,190 | require 'rails_helper'
RSpec.describe Participant, type: :model do
subject { described_class.new(attributes) }
let(:attributes) { {} }
# Avoid saving to the database
before do
allow(subject).to receive(:save).and_return(true)
end
describe '.valid_reference?' do
context 'for a valid reference' do... | 28.441558 | 99 | 0.683105 |
6a0b7a8ea4898db374303405c20c1a12a5f1b9cf | 887 | $:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "outdatedbrowser_rails/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "outdatedbrowser_rails"
s.version = OutdatedbrowserRails::VERSION
s.authors = ["Luisa Lima"]... | 35.48 | 85 | 0.677565 |
261002443e953d76ccbf78e00883e8b8ab65d449 | 3,256 | # frozen_string_literal: true
require "test_helper"
class CamaleonImageOptimizer::Test < ActiveSupport::TestCase
ORIG_JPG = "test/dummy/app/assets/images/orig.jpg"
TEST_JPG = "test/dummy/app/assets/images/test.jpg"
ORIG_PNG = "test/dummy/app/assets/images/orig.png"
TEST_PNG = "test/dummy/app/assets/images/tes... | 36.58427 | 109 | 0.746929 |
7a6527ce62d94abd36253da797855464359c270b | 1,070 | $:.push File.expand_path("lib", __dir__)
# Maintain your gem's version:
require "yaffle/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |spec|
spec.name = "yaffle"
spec.version = Yaffle::VERSION
spec.authors = ["sunakan"]
spec.email = ["sunakan03@gmail... | 34.516129 | 96 | 0.671963 |
6a4e05f51a67bfd98bea423c050ebbfb57c690a4 | 420 | class Spiff < Formula
desc "declarative BOSH deployment manifest builder"
homepage "https://github.com/cloudfoundry-incubator/spiff"
url "https://github.com/cloudfoundry-incubator/spiff/releases/download/v1.0.7/spiff_darwin_amd64.zip"
version "1.0.7"
sha256 "482b77c522e5d8ac95cfe1b8e785f5d4fe9183f7d25122fa18d... | 26.25 | 103 | 0.771429 |
bf4b56bdc8127b0740bd4dc488b6adfe22a132c0 | 286 | class Integer
TWO_POWER_WORD1 = 2 ** (1.size * 8 - 1)
TWO_POWER_WORD = 2 ** (1.size * 8)
def self.to_signed(number)
number >= TWO_POWER_WORD1 ? number - TWO_POWER_WORD : number
end
def self.to_unsigned(number)
number < 0 ? number + TWO_POWER_WORD : number
end
end
| 22 | 64 | 0.667832 |
614ef6fd87babe422a9eda7176b07cd69f9028a4 | 1,398 | # Encoding: utf-8
#
# This is auto-generated code, changes will be overwritten.
#
# Copyright:: Copyright 2015, Google Inc. All Rights Reserved.
# License:: Licensed under the Apache License, Version 2.0.
#
# Code generated by AdsCommon library 0.9.8 on 2015-07-17 13:42:19.
require 'ads_common/savon_service'
require '... | 29.744681 | 79 | 0.744635 |
26a321cea2f6a7612cc4b1c71e5146bfefe0de41 | 5,120 | require 'rails_helper'
require_relative '../../../app/api_models/inventory/remove_reserved.rb'
require_relative './shared_examples.rb'
RSpec.describe RemoveReserved, type: :model do
describe 'validation' do
before(:each) do
inventory_item = FactoryBot.create(:inventory)
amount ... | 44.521739 | 108 | 0.561328 |
abd58dcd834fc04faad17ef77f8000c0b25018ad | 3,574 | require 'test/unit'
require 'timeout'
require 'socket'
require 'net/http'
class TestTimeout < Test::Unit::TestCase
def test_timeout_for_loop
n = 10000000
assert_raises(Timeout::Error) do
Timeout::timeout(1) { for i in 0..n do; (i + i % (i+1)) % (i + 10) ; end }
end
end
def do_timeout(time, cou... | 23.513158 | 97 | 0.633464 |
b97040856dd011bd3bb3cb31cb0b5edad8fea5cd | 841 | module Spec
module Rails
module VERSION #:nodoc:
unless defined?(REV)
# RANDOM_TOKEN: 0.510454315029681
REV = "$LastChangedRevision: 2338 $".match(/LastChangedRevision: (\d+)/)[1]
end
end
end
end
# Verifies that the plugin has the same revision as RSpec
if Spec::VERSION::REV != ... | 30.035714 | 83 | 0.571938 |
f70ced01fb8d0135340ae4671626f3598bf2ae78 | 14,658 | require 'test_helper'
require 'yadriggy/ast'
require 'yadriggy/eval'
require 'yadriggy/eval_all'
module Yadriggy
def self.check_implementations(evaluator)
evaluator.nil_value(nil)
evaluator.identifier(Identifier.new([:@ident, "a", [1, 1]]))
evaluator.const(Const.new([:@const, "P", [6, 4]]))
evaluator... | 36.829146 | 79 | 0.432051 |
91e6fb14bf5b8ed69d12066315283104cd0ad528 | 3,867 | # frozen_string_literal: true
require 'json'
module Bolt
class ResourceInstance
attr_reader :target, :type, :title, :state, :desired_state
attr_accessor :events
# Needed by Puppet to recognize Bolt::ResourceInstance as a Puppet object when deserializing
def self._pcore_type
ResourceInstance
... | 30.448819 | 96 | 0.608482 |
03be62ec3cace6986583b0f2c7ea08c57691abf4 | 3,907 | module Sleek
module Queries
# The query.
#
# Queries are performed on a set of events and usually return
# numeric values. You shouldn't be using Sleek::Queries::Query
# directly, instead, you should subclass it and define +#perform+ on
# it, which takes an events criteria and does its job.
... | 27.131944 | 92 | 0.578193 |
5d2d54f62586715762972fa5805285773b338c8c | 10,457 | require 'spec_helper_acceptance'
test_name 'client -> 2 server without TLS'
describe 'rsyslog class' do
before(:all) do
# Ensure that our test doesn't match messages from other tests
sleep(1)
@msg_uuid = Time.now.to_f.to_s.gsub('.','_') + '_NO_TLS'
end
let(:client){ only_host_with_role( hosts, 'cli... | 35.811644 | 142 | 0.63326 |
6afdc5ebace0e11870a438872c80a5d69a865bd4 | 700 | Pod::Spec.new do |s|
s.name = "SlideMenuControllerSwift"
s.version = "4.0.0"
s.summary = "iOS Slide View based on iQON, Feedly, Google+, Ameba iPhone app."
s.homepage = "https://github.com/dekatotoro/SlideMenuControllerSwift"
s.license = { :type => "MIT", :file => "LICENSE" }
s.au... | 43.75 | 110 | 0.622857 |
031bf3506cdd8e0729738eeef9a960628c49527e | 879 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
require "csv_rb"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/ini... | 38.217391 | 99 | 0.718999 |
ab1cf63ae12630c5aaf706114329aad905f70e46 | 4,671 | module Downloads
class File
class Error < Exception ; end
attr_reader :data, :options
attr_accessor :source, :original_source, :downloaded_source
def initialize(source, options = {})
# source can potentially get rewritten in the course
# of downloading a file, so check it again
@so... | 30.331169 | 118 | 0.623207 |
3350d1ad22ec3fa3c7fc8f2189fd908c26b779ce | 207 | # Ruby
good_pays = records.select {|r| r.last >= 8000}
names = good_pays.map {|r| "#{r[1]} ##{r[2]}"} # ["Jofrey Baratheon", "Tyrion Lannister", "Eddard Stark", "Daenerys Targaryen", "Cersei Lannister"]
| 51.75 | 151 | 0.63285 |
114247001992bf72ced43e4bddef12b645aedc05 | 418 | class Organization < ApplicationRecord
extend FriendlyId
acts_as_paranoid
include NkSyncable
has_and_belongs_to_many :members, class_name: 'Person'
friendly_id :name, use: :slugged
has_many :paper_originators, as: :originator, dependent: :destroy
has_many :papers, -> { answers }, through: :paper_origin... | 22 | 67 | 0.758373 |
1c0a41012ae2b781f7076591e3d38527941c9dbc | 1,711 | class PryMoves::TracedMethod < Hash
@@last = nil
def self.last
@@last
end
def initialize(binding_)
super()
method = find_method_definition binding_
if method
source = method.source_location
set_method({
file: source[0],
start: source[1],
name: method.name,
... | 24.098592 | 138 | 0.651081 |
f800cea00139d7d19fd208f2570e8f9310d00bbc | 4,381 | 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 thre... | 42.533981 | 104 | 0.715818 |
bf0395e681708a1d09f61f18cfbbb71f881d5d15 | 658 | require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module TraJapa
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails v... | 32.9 | 82 | 0.764438 |
f811bdb8a349433862d37527f01eab5dfe0829b7 | 221 | require 'rubygems'
require 'actionpack'
require 'action_controller'
require 'action_controller/test_process'
require 'test/unit'
require 'mocha'
require File.dirname(__FILE__) + '/../lib/totally_restful_authorization'
| 20.090909 | 72 | 0.800905 |
f89d6b12e18807e2928043591d52a6f5028022d1 | 2,008 | require 'rdoc/task'
require 'rails/api/task'
# Monkey-patch to remove redoc'ing and clobber descriptions to cut down on rake -T noise
class RDocTaskWithoutDescriptions < RDoc::Task
include ::Rake::DSL
def define
task rdoc_task_name
task rerdoc_task_name => [clobber_task_name, rdoc_task_name]
task cl... | 30.892308 | 163 | 0.679781 |
0842d456b263a75b00a9ea083490657b6ec42adc | 410 | require 'test_helper'
module AtlanticaOnlineCraftCalculatorEngine
class CustomPricesControllerTest < ActionController::TestCase
test 'index' do
get :index
assert_response :success
end
test 'update' do
put :update
assert_redirected_to custom_prices_path
end
test 'destroy'... | 19.52381 | 63 | 0.717073 |
1a75ebf91f431124f90956c7042b85814a1909b4 | 1,880 | module PageObjectModel
module PageActions
def tap_on_saved_card
user_library_page.user_library_saved_card_popup.payment_card_number.touch
end
def tap_on_pay_now_button
user_library_page.user_library_payment_confirmation_popup.pay_now_button.touch
end
def tap_on_goto_my_library_button... | 39.166667 | 105 | 0.766489 |
1cfeec3a277cbc850e154c076553a1379c54c7a4 | 253 | require 'rails_helper'
RSpec.describe "items/new", type: :view do
before(:each) do
assign(:item, Item.new())
end
it "renders new item form" do
render
assert_select "form[action=?][method=?]", items_path, "post" do
end
end
end
| 16.866667 | 67 | 0.648221 |
87c4dd3fece1a917a907b7b07e846e6abcccc49d | 1,757 | # encoding: utf-8
module RailsBestPractices
module Reviews
# Review a view file to make sure there is no complex logic call for model.
#
# See the best practice details here https://rails-bestpractices.com/posts/2010/07/24/move-code-into-model/
#
# Implementation:
#
# Review process:
#... | 42.853659 | 127 | 0.702903 |
d50f4329853ed794bc00dbfec2c796a73a0eb36f | 1,675 | require "spec_helper"
describe Bitbot::Configuration do
subject { Bitbot.configuration }
before do
allow(Bitbot).to receive(:log)
end
it "allows adding locale files" do
subject.locales = fixture("en.yml")
subject.locales = [fixture("es.yml"), fixture("dk.yml")]
expect(I18n.load_path).to inclu... | 28.389831 | 85 | 0.680597 |
b9da7b2426ed4807dc9ec843f0d1d4c54231e117 | 14,859 | module Employers::EmployerHelper
def address_kind
@family.try(:census_employee).try(:address).try(:kind) || 'home'
end
def employee_state_format(census_employee=nil, employee_state=nil, termination_date=nil)
if employee_state == "employee_termination_pending" && termination_date.present?
return "Te... | 47.171429 | 350 | 0.743792 |
bffd65771cfc45610eb35b47f48342378e46d11f | 200 | class CreateUsersTable < ActiveRecord::Migration[4.2]
def change
create_table :users do |t|
t.string :username
t.text :email
t.string :password_digest
end
end
end | 22.222222 | 54 | 0.645 |
b90f9d7a10b904b5be5e5e9b3a8ec98ae4d26ee7 | 335 | class Notification::TopicReply < Notification::Base
belongs_to :reply
delegate :body, to: :reply, prefix: true, allow_nil: false
def notice_hash
return '' if self.reply.blank?
{
title: '您关注的话题有了新回复。'
content: self.reply_body[0, 30],
content_path: self.content_path
}
end
def content_... | 18.611111 | 60 | 0.683582 |
b939ca9089683d7fc1718f5d6b81062a3cb0521e | 2,915 | =begin
#Dependency-Track API
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 3.8.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.1
=end
require 'spec_helper'
require 'json'
require 'date'
... | 28.578431 | 107 | 0.718696 |
79fe556c5afc00e4e1be90f64c32676082ab90d7 | 229 | # frozen_string_literal: true
module Doorkeeper
module CustomTokenResponse
def body
{
data: {
id: @token.id,
type: 'token',
attributes: super
}
}
end
end
end
| 14.3125 | 29 | 0.519651 |
38c870d7b23a23beba7bbdc0d6620ddff68417d5 | 5,333 | # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... | 35.317881 | 245 | 0.676542 |
622513d38054bfe6a235ac1d3b73f5ebeb402b70 | 2,411 | #!/usr/bin/env ruby
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... | 39.52459 | 80 | 0.77893 |
01aab1c2e85dfe8720a684b813a060dd0a7bbc13 | 1,892 | module Aptly
module Watcher
class AptlyShim
def initialize(name, components, config)
@name = name # distribution
@components = components # repos
@config = config
create
end
def create
repo_list = `aptly repo list #{config} --raw`
... | 32.62069 | 109 | 0.574524 |
e27841148dacb8b6c443c513453411d510ac8d2c | 257 | class CreateSchoolDistricts < ActiveRecord::Migration
def self.up
create_table :school_districts do |t|
t.string :name
t.integer :jurisdiction_id
t.timestamps
end
end
def self.down
drop_table :school_districts
end
end
| 18.357143 | 53 | 0.70428 |
5d81f97e1455076caa33333b4d484c7ab410f6fc | 1,631 | require 'formula'
class TomcatNative < Formula
homepage 'http://tomcat.apache.org/native-doc/'
url 'http://www.apache.org/dyn/closer.cgi?path=tomcat/tomcat-connectors/native/1.1.31/source/tomcat-native-1.1.31-src.tar.gz'
sha1 '177b1f43f3dbc16eeea39d85147355be29a6089f'
depends_on "libtool" => :build
depends_... | 39.780488 | 166 | 0.660331 |
87b15d28720f8108d76723b3e4fc6a4f6a3db12c | 1,035 | module GovukIndex
class SupertypeWorker < Indexer::BaseWorker
BULK_INDEX_TIMEOUT = 60
QUEUE_NAME = 'bulk'.freeze
sidekiq_options queue: QUEUE_NAME
def perform(records, destination_index)
actions = Index::ElasticsearchProcessor.new(client: GovukIndex::Client.new(timeout: BULK_INDEX_TIMEOUT, inde... | 27.972973 | 141 | 0.689855 |
4a5b2ead163aa84b407259e729bef632034212b7 | 9,249 | # frozen_string_literal: true
module API
class MavenPackages < ::API::Base
MAVEN_ENDPOINT_REQUIREMENTS = {
file_name: API::NO_SLASH_URL_PART_REGEX
}.freeze
feature_category :package_registry
content_type :md5, 'text/plain'
content_type :sha1, 'text/plain'
content_type :binary, 'applica... | 35.710425 | 148 | 0.670883 |
ab3c541aea908fb06506646554508db9807a0774 | 376 | # frozen_string_literal: true
module Pipe
class Person < Entity
class << self
def fields
@fields ||= Pipe::Field.fields(:person)
end
end
def inspect
"<Pipe::Person @id=#{id} @name=#{name} @email=#{email}>"
end
def organization
return nil unless self.org_id
... | 17.090909 | 62 | 0.603723 |
ffad00fa7d74d5054fdc6c303a8ca737ed2ef997 | 2,642 | # frozen_string_literal: true
module Gitlab
module DependencyLinker
class BaseLinker
URL_REGEX = %r{https?://[^'" ]+}.freeze
GIT_INVALID_URL_REGEX = /^git\+#{URL_REGEX}/.freeze
REPO_REGEX = %r{[^/'" ]+/[^/'" ]+}.freeze
class_attribute :file_type
def self.support?(blob_name)
... | 24.691589 | 146 | 0.58327 |
3959770420fa4a6856397e4cf47cd278f42eebb3 | 575 | module MongodbLogger
class Application
end
end
class Rails
module VERSION
MAJOR = 4
end
def self.env
ActiveSupport::StringInquirer.new("test")
end
def self.root
Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "tmp")))
end
def self.application
MongodbLogg... | 14.375 | 88 | 0.683478 |
bfe0d2ee9b87307af304e49c5386dec7460e70ce | 383 | # frozen_string_literal: true
class CreateWarnings < ActiveRecord::Migration[4.2]
def change
create_table :warnings do |t|
t.references :topic, null: false
t.references :user, null: false
t.integer :created_by_id, null: false
t.timestamps null: false
end
add_index :warnings, :user... | 25.533333 | 51 | 0.694517 |
bb4c7c308b88bff6edd0b7d97412abc57a373675 | 188 | class CreateRounds < ActiveRecord::Migration[5.0]
def change
create_table :rounds do |t|
t.integer :round_map
t.integer :round_room
t.timestamps
end
end
end
| 17.090909 | 49 | 0.664894 |
abbb765b8942a44dfa4d725bc52a48c3db5f19e4 | 1,206 | require 'bundler/inline'
require 'etc'
require 'optparse'
gemfile(true) do
source 'https://rubygems.org'
gem 'rails', '~> 6.1.4.1'
gem 'puma', '~> 5.5.0'
end
require 'action_controller/railtie'
class App < Rails::Application
routes.append do
get '/' => 'greeting#index'
get '/greeting/:name' => 'gree... | 22.333333 | 68 | 0.692371 |
11595dec86d02cc9cc61e66bd24bd68c2a30eff4 | 835 | module Sufia
module BlacklightOverride
def render_bookmarks_control?
false
end
def url_for_document(doc, _options = {})
if doc.is_a?(SolrDocument) && doc.hydra_model == 'Collection'
[collections, doc]
else
[sufia, doc]
end
end
def render_constraints_query(... | 30.925926 | 103 | 0.605988 |
7949a427c340db722709fe0c6e7ef3326b25af0a | 820 | cask "db-browser-for-sqlite" do
version "3.12.2"
sha256 "546d57b6c88c2be7517759c016c0bf0313dfcc14adfcb43967f3c5d24657f366"
url "https://github.com/sqlitebrowser/sqlitebrowser/releases/download/v#{version}/DB.Browser.for.SQLite-#{version}.dmg",
verified: "github.com/sqlitebrowser/sqlitebrowser/"
name "DB ... | 34.166667 | 122 | 0.72439 |
6afa8fd2fabc51aac5ca07fc883c3d4688bd8a0f | 3,980 | # This file was generated by the `rails generate rspec:install` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause this
# file to always be loaded, without a need to explicitly require ... | 47.951807 | 129 | 0.744724 |
33e5f25894128c760f1cbc2fd8de149c57579e23 | 805 | class Mint < Formula
desc "Dependency manager that installs and runs Swift command-line tool packages"
homepage "https://github.com/yonaskolb/Mint"
url "https://github.com/yonaskolb/Mint/archive/0.11.2.tar.gz"
sha256 "9090af8dfb6b0334e961bcd373950bf1a33fc54fad064723afd4774df8871504"
bottle do
cellar :any... | 30.961538 | 93 | 0.737888 |
6138a1d38399e85cc4921df51f462b7317ae9e8d | 1,126 | require 'test_helper'
class TestimonialsControllerTest < ActionDispatch::IntegrationTest
setup do
@testimonial = testimonials(:one)
end
test "should get index" do
get testimonials_url
assert_response :success
end
test "should get new" do
get new_testimonial_url
assert_response :success
... | 22.979592 | 70 | 0.735346 |
f7f516c38abc97d078d9cd7b5dc2ed17e3bd4abf | 336 | module Ckeditor::ApplicationHelper
def assets_pipeline_enabled?
if Gem::Version.new(::Rails.version.to_s) >= Gem::Version.new('4.0.0')
defined?(Sprockets::Rails)
elsif Gem::Version.new(::Rails.version.to_s) >= Gem::Version.new('3.0.0')
Rails.application.config.assets.enabled
else
false
... | 30.545455 | 77 | 0.678571 |
d5e491c2274eb2382db725bb89ad0e5ce8fb3483 | 2,559 | require "highline/import"
class QuotesController
def index_phil
if Quote.count > 0
quotes = Database.execute("SELECT name FROM quotes WHERE author_id==1")
choose do |menu|
menu.header = "Please pick which Dr. Phil inspirational you'd like to access.\n"
quotes.each do |dr_quotes|
... | 23.694444 | 89 | 0.57796 |
610bd411f09f050fc258d5c3255e2200bd392d50 | 267 | class CreateOminousWarningClosers < ActiveRecord::Migration
def change
create_table :ominous_warning_closers do |t|
t.column :warning_id, :integer
t.column :closer_id, :integer
t.column :position, :integer
t.timestamps
end
end
end
| 24.272727 | 59 | 0.707865 |
e87245949f45a462a8e170c3f3e3ee626b0b8d12 | 4,142 | # frozen_string_literal: true
require "spec_helper"
require "dependabot/dependency"
require "dependabot/dependency_file"
require "dependabot/file_fetchers/java_script/npm_and_yarn/"\
"path_dependency_builder"
namespace = Dependabot::FileFetchers::JavaScript::NpmAndYarn
RSpec.describe namespace::PathDependency... | 34.231405 | 80 | 0.629889 |
abc380e477647db7e5345a7738d330fb7b521529 | 4,216 | # scraper.rb
# Extract and present data from the Seattle food truck website
# Parse JSON into some useful information
# Key Features
#
# Display food truck info in Bellevue:Barnes and Nobel
# Able to provide food truck info on current day
# Able to provide food truck info on a specific day as specified by a user
# Info... | 28.295302 | 234 | 0.628083 |
91652acc842bee1ed0a71d052a178cf02dcbf80f | 1,537 | class Api::V1::ProblemsController < ApiController
before_filter :authenticate
def new
@politician = Politician.find(params[:politician_id])
@problem = @politician.problems.new
@solution = @problem.solutions.new
end
def create
@politician = Politician.find(params[:politician_id])
@problem =... | 34.931818 | 115 | 0.685751 |
79dc8cfbda6dcd7a46f83f48751f42b982899d43 | 3,403 | ##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = AverageRank... | 26.585938 | 116 | 0.542463 |
21bced57ef8d65e19b288532394b71f1b1d6dd36 | 5,855 | ##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'rex'
class Metasploit3 < Msf::Post
include Msf::Post::Windows::Priv
include Msf::Post::File
include Msf::Post::Windows::Registry
def initialize(... | 29.129353 | 111 | 0.635867 |
5d8df7a3e3282e2b09fc6022bb2381952244ad75 | 3,929 | require "spec_helper"
require "govuk_app_config/govuk_healthcheck"
RSpec.describe GovukHealthcheck::Checkup do
let(:test_healthcheck) do
Class.new do
def name
"#{status}_check".to_sym
end
def status
:unknown
end
end
end
let(:ok_check) do
Class.new(test_health... | 28.266187 | 111 | 0.69127 |
d5809641064ae71e078205da1c7697208585b99a | 462 | cask "geph" do
version "4.4.4"
sha256 "5381ad57c9bed2a6c238eeaf28f9c345eb1a0cacadd6ff59566032502d20fb99"
url "https://f001.backblazeb2.com/file/geph4-dl/Geph4Releases/#{version}/geph-macos-#{version}.dmg",
verified: "f001.backblazeb2.com/file/geph4-dl/"
name "Geph"
desc "Modular Internet censorship cir... | 27.176471 | 102 | 0.733766 |
acded2a39a9ef0f70360cc20497a6a90181f7509 | 1,847 | class Task < Formula
desc "Feature-rich console based todo list manager"
homepage "https://taskwarrior.org/"
url "https://github.com/GothenburgBitFactory/taskwarrior/releases/download/v2.6.2/task-2.6.2.tar.gz"
sha256 "b1d3a7f000cd0fd60640670064e0e001613c9e1cb2242b9b3a9066c78862cfec"
license "MIT"
head "http... | 37.693878 | 123 | 0.687602 |
1c6c145ed9b548cad5b2a06690ee2df08e405da9 | 2,148 | class Postgrest < Formula
desc "Serves a fully RESTful API from any existing PostgreSQL database"
homepage "https://github.com/PostgREST/postgrest"
url "https://github.com/PostgREST/postgrest/archive/v7.0.1.tar.gz"
sha256 "12f621065b17934c474c85f91ad7b276bff46f684a5f49795b10b39eaacfdcaa"
license "MIT"
head ... | 32.545455 | 93 | 0.658287 |
21e9e735cc5eb61c2b6bb77f3f8994f33b3877d8 | 596 | require 'spec_helper'
describe Organization do
it 'can be converted to full tree hash with all recursive children' do
FactoryGirl.create(:kirjasto)
tree = Organization.root.tree_hash[:children]
tree.count.should > 0
str_dump = tree.to_s
str_dump.should include('Kirjasto')
end
it 'provides an... | 22.923077 | 72 | 0.696309 |
3357f60dc3730e507e289872506c241559ee3bbe | 4,490 | # encoding: utf-8
module Mail
class Ruby19
# Escapes any parenthesis in a string that are unescaped this uses
# a Ruby 1.9.1 regexp feature of negative look behind
def Ruby19.escape_paren( str )
re = /(?<!\\)([\(\)])/ # Only match unescaped parens
str.gsub(re) { |s| '\\' + s }
e... | 29.539474 | 123 | 0.572606 |
91b3b7ff7a5fefc9950dcf524861069b987cd239 | 461 | require 'delegate'
# Aruba
module Aruba
# Platforms
module Platforms
# This is a command which should be run
#
# This adds `cmd.exec` in front of commmand
#
# @private
class WindowsCommandString < SimpleDelegator
def initialize(cmd)
__setobj__ format('%s /c "%s"', Aruba.platfo... | 19.208333 | 77 | 0.62256 |
ac18809a1790157f51fdf203ac4e4adc854ef688 | 53,400 | # frozen_string_literal: true
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 54.769231 | 175 | 0.603202 |
4a66a188101c88e6526dc6add450d907c3bb188c | 1,591 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Commands / Delete' do
include_context 'container'
include_context 'users and tasks'
subject(:users) { container.commands.users }
before do
configuration.relation(:users) do
def by_name(name)
restrict(name: name)
end
... | 22.728571 | 74 | 0.650534 |
bf838eb8b7d179745747d8d36cb0989b10bdecef | 4,078 | # frozen_string_literal: true
require 'test_helper'
module Nls
module EndpointInterpret
class TestLtras < NlsTestCommon
def setup
super
Nls.remove_all_packages
Interpretation.default_locale = nil
ltras_package = Package.new('ltras')
ltras = ltras_package.new_inte... | 38.471698 | 139 | 0.675576 |
4ab5acbaaecffba4c6e392c80ac447b32695281e | 5,919 | module Sequel::Plugins::VcapRelations
# Depend on the instance_hooks plugin.
def self.apply(model)
model.plugin(:instance_hooks)
end
module InstanceMethods
def has_one_to_many?(association)
association_type(association) == :one_to_many && send(association).count > 0
end
def has_one_to_on... | 32.344262 | 152 | 0.647576 |
4a44f3274dcd1b2932db17449997af1b9a25bc16 | 141 | require 'pusher'
Pusher.url = "http://136065ba56ec3683eddd:e1ea4e724f08c530a8fc@api.pusherapp.com/apps/108919"
Pusher.logger = Rails.logger
| 28.2 | 93 | 0.808511 |
e8ab97d051f465e5f275036b52d47cd1ba5e2513 | 711 | require_relative "boot"
require "rails/all"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module MunchkinHelper
class Application < Rails::Application
# Initialize configuration defaults for originally generated ... | 30.913043 | 79 | 0.739803 |
91306b0b5db73c45131ceb7af1ebc089f2ab789f | 26,029 | module RBS
module Types
module NoFreeVariables
def free_variables(set = Set.new)
set
end
end
module NoSubst
def sub(s)
self
end
end
module NoTypeName
def map_type_name
self
end
end
module EmptyEachType
def each_type
... | 23.989862 | 204 | 0.544739 |
bb918936cd1c8b1bc0b9830611b9249ad874dd56 | 4,041 |
#
# Specifying rufus-scheduler
#
# Sat Mar 21 17:43:23 JST 2009
#
require 'spec_base'
describe SCHEDULER_CLASS do
it 'stops' do
var = nil
s = start_scheduler
s.in('3s') { var = true }
stop_scheduler(s)
var.should == nil
sleep 4
var.should == nil
end
unless SCHEDULER_CLASS == ... | 16.228916 | 83 | 0.519426 |
28833c901727fafac38a7e7dec92c4b8abab5a5c | 9,849 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/tpu/v1/cloud_tpu.proto
require 'google/protobuf'
require 'google/api/annotations_pb'
require 'google/api/client_pb'
require 'google/api/field_behavior_pb'
require 'google/api/resource_pb'
require 'google/longrunning/operations_pb'
requi... | 48.517241 | 160 | 0.716418 |
ac2a88bd49615b6a5726df1321f0f6de94ddf70f | 5,163 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Post
include Msf::Auxiliary::Report
def initialize(info = {})
super(update_info(info,
'Name' => 'Multi Recon Local Exploit Sug... | 28.843575 | 118 | 0.649816 |
e2259fe7edb825685917d07a79ae3869c868ab6e | 2,412 | require 'helper'
require 'mws/feeds/client'
class TestMWSFeedsClient < MiniTest::Test
def setup
@client = MWS::Feeds::Client.new
end
def test_submits_feed
operation = {
'Action' => 'SubmitFeed',
'FeedType' => 'type',
'MarketplaceIdList.Id.1' => '1'
}
@client.stub(:run, nil) do... | 23.192308 | 70 | 0.641791 |
f7eae081f6c0af2e2ce30915c1d6f872109db4c0 | 239 | class CreateUsers < ActiveRecord::Migration[5.1]
def change
create_table :users do |t|
t.string :username
t.string :display_name
t.string :email
t.string :password_digest
t.timestamps
end
end
end
| 18.384615 | 48 | 0.65272 |
e831f156f7cbaa5c108a5c52ecdff10880c3e735 | 17,012 | # frozen-string-literal: true
module Sequel
module Plugins
# The many_through_many plugin allow you to create an association using multiple join tables.
# For example, assume the following associations:
#
# Artist.many_to_many :albums
# Album.many_to_many :tags
#
# The many_through_... | 52.344615 | 354 | 0.637785 |
91b762f600593d6cdc07e056bc9be5aadc19d500 | 1,282 | require 'json'
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
Pod::Spec.new do |s|
s.name = 'EXConstants'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.license = package['license']
s.a... | 33.736842 | 188 | 0.624025 |
1dec5ca8828f8e0c75dcb0eccef6ea7963662326 | 4,579 | class FromInvitation < ActiveRecord::Migration
def self.up
rename_column :users, :was_invited, :from_invitation
change_column :users, :administrator, :boolean, :default => false
change_column :users, :preferred_view, :string, :default => :expanded
change_column :users, :subscriptions_count, :integer, ... | 61.878378 | 97 | 0.699498 |
61a5ca5a9f4b682a5725ca4a3aa9b18d046a5a56 | 2,574 | class User < ActiveRecord::Base
has_many :characters
has_secure_password
validates :email, :uniqueness => true
validates :username, :uniqueness => true
validates :display_name, :uniqueness => true
def admin_panel?
# Needed before Rails.application.config loads...
%w(ADMIN LIBRARIAN MODERATOR).incl... | 28.6 | 121 | 0.71251 |
ac18b52ffcde935507798e631c22fdc91a888f64 | 3,404 | #
# Copyright:: Copyright (c) 2013-2014 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# 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/LICE... | 35.092784 | 103 | 0.665981 |
bb84bd35fbf5f97c7f90776cba278f532a03b32c | 952 | module KlarnaGateway
class << self
attr_accessor :_configuration
def configuration
if self._configuration.nil?
raise ConfigurationMissing.new("KlarnaGateway._configuration is missing. Please run <rails generate klarna_gateway:install> or create an initializer for this configuration")
end
... | 23.8 | 181 | 0.709034 |
265394c8bf3a6359372130133ef8d8754a9edfae | 984 | # frozen_string_literal: true
# need to override some methods from BlacklightMaps
require Blacklight::Maps::Engine.root.join(CommonwealthVlrEngine::Engine.root,
'config', 'initializers', 'patch_blacklight_maps')
class BlacklightMaps::GeojsonExport
# LOCAL OVERRIDE - set pa... | 42.782609 | 103 | 0.705285 |
39f9dbfefa464606f3a2b8483f707e340ca5fe02 | 1,086 | #
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'integration_test'
s.version = '0.0.1'
s.summary = 'Adapter for integration tests.'
s.description = <<-DESC
Runs tests that use the flutter_test API as integra... | 41.769231 | 110 | 0.633517 |
1c704c1d7ba8192bf985889ef1b3cc5bc5b84150 | 49,996 | # Copyright 2019 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 applicable law or agreed to in writing, ... | 43.588492 | 164 | 0.61947 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.