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 |
|---|---|---|---|---|---|
1a15e2e79ba2253b44dae8e6f08e1f32fd838f26 | 1,953 | class Rubberband < Formula
desc "Audio time stretcher tool and library"
homepage "https://breakfastquay.com/rubberband/"
url "https://breakfastquay.com/files/releases/rubberband-1.8.2.tar.bz2"
sha256 "86bed06b7115b64441d32ae53634fcc0539a50b9b648ef87443f936782f6c3ca"
revision 1
head "https://bitbucket.org/br... | 35.509091 | 93 | 0.715822 |
03ad3ff9385fe54e6df442664ffc387cc3831e7e | 4,048 | require File.expand_path(File.dirname(__FILE__) + '/test_helper')
require 'active_record/schema_dumper'
class SchemaDumperTest < Test::Unit::TestCase
def setup
teardown
end
def teardown
['V_PEOPLE', 'V_PROFILE'].each do |view|
if ActiveRecord::Base.connection.adapter_name == 'OracleEnhanced'
... | 30.900763 | 122 | 0.687006 |
ab251394895350729885d7c1ecca4be5e8cd1bfe | 733 | cask "opera-developer" do
version "72.0.3791.0"
sha256 "0cfbe2683f6397e86a532bc95e294ec9becec3c8b42612707108d316185e504e"
url "https://get.geo.opera.com/pub/opera-developer/#{version}/mac/Opera_Developer_#{version}_Setup.dmg"
name "Opera Developer"
homepage "https://www.opera.com/computer/beta"
auto_updat... | 34.904762 | 105 | 0.768076 |
1db9bfde9444c1d3aa0d2a76b45e24560f972e77 | 1,624 | #
# Be sure to run `pod lib lint iOSViews.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'iOSViews'
... | 37.767442 | 115 | 0.639778 |
11343484006fb4247f10413829568c39e9e090d8 | 302 | class CreateUsers < ActiveRecord::Migration[5.1]
def change
create_table :users do |t|
t.string :first_name
t.string :last_name
t.string :email
t.string :password_digest
t.string :city
t.string :bio
t.string :img_url
t.timestamps
end
end
end
| 20.133333 | 48 | 0.629139 |
ed0215bda9d0d2354f5868477e1354cfc42842ad | 14,964 | # frozen_string_literal: true
require "fileutils"
require "digest/md5"
require "rails/version" unless defined?(Rails::VERSION)
require "open-uri"
require "uri"
require "rails/generators"
require "active_support/core_ext/array/extract_options"
module Rails
module Generators
class AppBase < Base # :nodoc:
i... | 34.009091 | 132 | 0.560011 |
5d0117e54247b560dadfc7e12578a4ccf0d8e04b | 1,543 | #
# Be sure to run `pod lib lint NBButton.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'NBButton'
... | 35.883721 | 104 | 0.634478 |
874f9eb91ac39a759bb951700115beb5d21e2ce8 | 3,699 | require 'spec_helper'
describe 'Ad Hoc Option Values / Ad Hoc Variant Exclusions ', :js, type: :feature do
describe 'test add links / remove links / add options values / remove options values/ update and cancel buttons' do
extend Spree::TestingSupport::AuthorizationHelpers::Request
include IntegrationHelpers... | 35.912621 | 123 | 0.707218 |
4a92e1a8a4db8a02c1b2844ff730001d5f73bca9 | 831 | require "pact_broker/webhooks/http_request_with_redacted_headers"
require "pact_broker/webhooks/http_response_with_utf_8_safe_body"
module PactBroker
module Webhooks
class WebhookExecutionResult
attr_reader :request, :response, :logs, :error
def initialize(request, response, logs, error = nil)
... | 30.777778 | 101 | 0.700361 |
4a9230f8b3eba6468c63a8753e562d4d659f4644 | 4,184 | require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/common', __FILE__)
require File.expand_path('../shared/glob', __FILE__)
describe "Dir.glob" do
it_behaves_like :dir_glob, :glob
end
describe "Dir.glob" do
it_behaves_like :dir_glob_recursive, :glob
end
describe "Dir.... | 26.649682 | 137 | 0.633843 |
79f9f0e31c9a882c80c0ab2969b7edfa34a79e45 | 1,004 | #
# Be sure to run `pod spec lint SinoroadSDK.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://github... | 35.857143 | 94 | 0.651394 |
7a0e5ca935461a749f9d51b736862981c6067ff8 | 677 | require File.expand_path('../../../spec_helper', __FILE__)
require 'prime'
describe "Prime.new" do
it "returns a new object representing the set of prime numbers" do
Prime.new.should be_kind_of(Prime)
end
it "returns a object with obsolete featrues" do
Prime.new.should be_kind_of(Prime::OldCompatibility... | 29.434783 | 74 | 0.728213 |
ed4dcfe66d07ccb51d6c3e983d9f9867c71f51f4 | 1,375 | module Infoboxer
describe Navigation::Wikipath do
include Saharspec::Util
let(:document) {
Parser.document(multiline(%{
|Test in first ''paragraph''
|
| {{Use dmy dates|date=July 2014}}
|
|=== Section 1 ===
|
|{| some=table
||With
... | 31.25 | 117 | 0.568 |
91803f2f053e0c19c6bd655b9c44d529eb367a9f | 2,938 | # 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_06_01
module Models
#
# Response for the ListVirtualNetworkGateways API service call.
#
class VirtualNetworkGatewayListRe... | 29.38 | 80 | 0.542886 |
0123fdcfd678640819db252ca3899af34d35b5e4 | 277 | # frozen_string_literal: true
i = 0
json.array! @article.revisions.each do |revision|
i += 1
json.index i
json.rev_id revision.mw_rev_id
json.wp10 revision.wp10
json.date revision.date
json.username revision.user.username
json.characters revision.characters
end
| 21.307692 | 49 | 0.765343 |
62ce07299367fd45bf09a3b608ebadb0b30ca174 | 849 | class Parse
def initialize(file)
@pages_and_ip = []
@pages = []
File.open(file, "r") do |line|
line.each do |x|
@pages_and_ip << x
@pages << x.split.first
end
end
end
def page_views
ranked_pages = Hash.new
@pages.each{|x| ranked_pages[x] = @pages.count(x)}
puts r... | 18.456522 | 60 | 0.585395 |
6a04f85848249db6c2cffa72e98e483621af3802 | 2,629 | module Shoppe
class Order < ActiveRecord::Base
# The country which this order should be billed to
#
# @return [Shoppe::Country]
belongs_to :billing_country, class_name: 'Shoppe::Country', foreign_key: 'billing_country_id'
# Payments which have been stored for the order
has_many :payments, dep... | 25.278846 | 97 | 0.638646 |
bfd5ed031c386718e5f66a8da36042f54f3ba289 | 144 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_dev_and_jobs_session'
| 36 | 82 | 0.8125 |
6251e05c60f55ee03f96afdbf1ce8e2137578ff1 | 40 | module Certutil
VERSION = "0.2.0"
end
| 10 | 19 | 0.675 |
ff4a693ba02386addd44f6dcbf9f33d41f6490ad | 584 | require './config/environment'
class ApplicationController < Sinatra::Base
configure do
set :public_folder, 'public'
set :views, 'app/views'
enable :sessions
set :session_secret, "glasspassion"
end
get "/" do
erb :welcome
end
helpers do
def current_user
@current_user ||=... | 16.685714 | 80 | 0.638699 |
1ded521fe1f54511f40bd40d221f6f6cc529730b | 1,901 | module Boards
module Issues
class MoveService < Boards::BaseService
prepend EE::Boards::Issues::MoveService
def execute(issue)
return false unless can?(current_user, :update_issue, issue)
return false if issue_params.empty?
update(issue)
end
private
def bo... | 23.7625 | 93 | 0.6202 |
ac517b59af1dc8bdcc68cabf93d20779a7b0b6c4 | 2,358 | # encoding: utf-8
# frozen_string_literal: true
#
# = Message-ID Field
#
# The Message-ID field inherits from StructuredField and handles the
# Message-ID: header field in the email.
#
# Sending message_id to a mail message will instantiate a Mail::Field object that
# has a MessageIdField as its field type. This i... | 28.071429 | 90 | 0.675997 |
2641c917cd026df04e78eeac2e7bb9549f2331f2 | 320 | class CreateFeedbookPositionHasEmployees < ActiveRecord::Migration[5.1]
def change
create_table :feedbook_position_has_employees do |t|
t.references :position, foreign_key: true
t.references :employee, foreign_key: true
t.text :notes
t.string :version
t.timestamps
end
end
end
| 24.615385 | 71 | 0.715625 |
e2b8375200f8f3eb5224bbb17391b05da219b25d | 1,194 | require 'test/unit'
require './config/initializers/01_komet_init'
require './lib/isaac_rest/search_apis_rest'
class SearchTest < Test::Unit::TestCase
include KOMETUtilities
include SearchApis
include Fixtures
FAIL_MESSAGE = 'There may be a mismatch between the generated isaac-rest.rb file and rails_komet!: '
... | 36.181818 | 223 | 0.738693 |
39feca23773f39c41940e58961693540162ce28c | 1,020 |
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "direct_upload/version"
Gem::Specification.new do |spec|
spec.name = "direct_upload"
spec.version = DirectUpload::VERSION
spec.authors = ["Cameron Barker"]
spec.email = ["bar... | 35.172414 | 74 | 0.646078 |
d5a54b4d11729bf7d4e5e1e06e1a24fd316d2ce4 | 69 | module Marty
module Promises
module Delorean
end
end
end
| 9.857143 | 19 | 0.695652 |
6a888dcaa9e2b908d4604977ea7f35556e5cf5fb | 5,054 | #
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
#
# 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 requir... | 28.234637 | 103 | 0.661456 |
87551c75e507a7504e97d6f9f898fa46f30b07e0 | 6,113 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Slack::BlockKit::Element::MultiStaticSelect do
let(:instance) { described_class.new(**params) }
let(:placeholder_text) { 'some text' }
let(:action_id) { 'my-action' }
let(:params) do
{
placeholder: placeholder_text,
action_id: ... | 23.602317 | 80 | 0.521348 |
bb645d8a7742c06174a8ee152697b411c150f9dd | 48 | json.partial! 'records/record', record: @record
| 24 | 47 | 0.75 |
e9cf9804737d1c84d6f8eec9715b628ea9689735 | 447 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe SolidusShipstation do
describe '.config' do
subject { described_class.config }
specify :aggregate_failures do
is_expected.to respond_to(:username)
is_expected.to respond_to(:password)
is_expected.to respond_to(:weight_unit... | 24.833333 | 57 | 0.749441 |
1aede880226a14ddae3685a5d35036917bd4b53f | 278 | https://codility.com/programmers/task/prefix_set
https://codility.com/programmers/challenges/alpha2010
def solution(a)
b = a.uniq
n = b.size - 1
max = temp = 0
(0..n).each do |i|
temp = a.index(b[i])
if max < temp
max = temp
end
end
return max
end
| 18.533333 | 53 | 0.629496 |
bb4e677afdebc3204b76761d8c545b58ad9308ef | 15,253 | require "vagrant/action/builder"
module VagrantPlugins
module ProviderVirtualBox
module Action
autoload :Boot, File.expand_path("../action/boot", __FILE__)
autoload :CheckAccessible, File.expand_path("../action/check_accessible", __FILE__)
autoload :CheckCreated, File.expand_path("../action/che... | 36.490431 | 132 | 0.597587 |
216b242a1b5e8d43c079e17b5f3e89db759f57d1 | 533 | module Mongoid #:nodoc
module Errors #:nodoc
# This error is raised when trying to create set nested records above the
# specified :limit
#
# Example:
#
#<tt>TooManyNestedAttributeRecords.new('association', limit)
class TooManyNestedAttributeRecords < MongoidError
def initialize(ass... | 24.227273 | 77 | 0.621013 |
91907f464fbe471fa9c9902540e5a0bc9fd933be | 833 | # (c) Copyright 2020 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 39.666667 | 95 | 0.773109 |
e93a7077899e197a3b73a2471675bb9a115e8cde | 1,292 | module Api::V1
class UsersController < ApplicationController
before_action :set_user, only: [:show, :update, :destroy]
# GET /users
def index
@users = User.order(:id)
render json: @users
end
# GET /users/1
def show
render json: @user
end
# POST /users
def crea... | 21.898305 | 100 | 0.607585 |
87f7fb39a845e3cc25d7767490c7b1700a578521 | 180 | Rails.application.routes.draw do
resources :quizzes
resources :users
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end
| 30 | 102 | 0.783333 |
62dd2eb430696803dcf00e713c9ddcd4d4416a07 | 595 | cask 'focus' do
version '1.10.4'
sha256 '1155078036e9df1d4018eddadcc95d04228354c22ff14b74891249df791dac1a'
url "https://heyfocus.com/uploads/Focus-#{version}.zip"
appcast 'https://macupdater.net/cgi-bin/check_urls/check_url_redirect.cgi?url=https://heyfocus.com/focus.zip'
name 'Focus'
homepage 'https://hey... | 29.75 | 111 | 0.67395 |
21e30c2123f4b2aaf84165a1a5e495d02c7add64 | 1,788 | require 'test_helper'
class FollowingTest < ActionDispatch::IntegrationTest
def setup
@user = users(:michael)
@other = users(:archer)
log_in_as(@user)
end
test "following page" do
get following_user_path(@user)
assert_not @user.following.empty?
assert_match @user.following.count.to_s, ... | 27.9375 | 77 | 0.700783 |
e94590091e0a5f3f32fb4ff758f1ed77acaf801f | 5,835 | # 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 (the
# "License"); you may not... | 30.07732 | 67 | 0.604113 |
4af01806c09b6299bad7fec7359ad0e878616dc8 | 16,878 | require 'spec_helper'
require 'mspec/expectations/expectations'
require 'mspec/helpers/tmp'
require 'mspec/helpers/fs'
require 'mspec/matchers/base'
require 'mspec/runner/mspec'
require 'mspec/runner/example'
RSpec.describe MSpec, ".register_files" do
it "records which spec files to run" do
MSpec.register_files ... | 28.22408 | 99 | 0.690129 |
b91392a56d8e61bedb01aad835dea2a7e8f01e2f | 263 | # frozen_string_literal: true
include ActionDispatch::TestProcess
FactoryGirl.define do
factory :image, class: Bootsy::Image do
image_file do
fixture_file_upload(Rails.root.to_s + '/public/test.jpg', 'image/jpeg')
end
image_gallery
end
end
| 21.916667 | 77 | 0.737643 |
2809ca2cdbb77539fefa2c2f0c12a652630d1d64 | 138 | require 'test_helper'
class LiveAssets::Test < ActiveSupport::TestCase
test "truth" do
assert_kind_of Module, LiveAssets
end
end
| 17.25 | 48 | 0.76087 |
edb439fc11127dc0ff010126b2b0a01a51a39a1d | 2,757 | require File.dirname(__FILE__) + '/../../spec_helper'
require 'mspec/runner/formatters/specdoc'
require 'mspec/runner/example'
describe SpecdocFormatter do
before :each do
@formatter = SpecdocFormatter.new
end
it "responds to #register by registering itself with MSpec for appropriate actions" do
MSpec.s... | 25.766355 | 89 | 0.691331 |
873366a19024c64f64c0b280b01e040e954302b3 | 24,237 | # frozen_string_literal: true
RSpec.describe "major deprecations" do
let(:warnings) { err }
describe "Bundler" do
before do
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
gem "rack"
G
end
describe ".clean_env" do
before do
source = "Bundler.clean_en... | 33.6625 | 244 | 0.62549 |
5db0a70dad8d198ef6d1f09226841016f5a333f9 | 302 | # 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 end
module Azure::ServiceFabric end
module Azure::ServiceFabric::Mgmt end
module Azure::ServiceFabric::Mgmt::V2018_02_01 end
| 30.2 | 70 | 0.791391 |
b94086c7bb063e70d2455d8f9072bb52adeed829 | 24,531 | # 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... | 51.644211 | 145 | 0.561861 |
0368ee2041d739bd523e64ade469a932db53423e | 7,300 | # Copyright (c) 2016, 2022, 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... | 38.219895 | 245 | 0.68863 |
4aaf9f0ab4ea03677891b460da8a2973ffa72ee5 | 4,708 | require 'sqlite3'
$db = SQLite3::Database.open 'congress_poll_results.db'
def print_arizona_reps
puts 'AZ REPRESENTATIVES'
az_reps = $db.execute("SELECT name FROM congress_members WHERE location = 'AZ'")
az_reps.each { |rep| puts rep }
end
# Print out the number of years served as well as the name of the long... | 37.967742 | 136 | 0.722812 |
1d442ac59f74016f688a01bf04239619d9703e7a | 1,314 | # frozen_string_literal: true
require 'rails_helper'
describe Mutations::ApplySquadToMatch, type: :graphql do
subject { described_class }
let(:user) { create :user }
let(:team) { create :team, user: }
let(:match) { create :match, team: }
let(:squad) { create :squad, team: }
it { is_expected.to accept_ar... | 24.792453 | 65 | 0.664384 |
0816e8151e248c9971038adfba0decfa0b1a7f6f | 155 | class DeleteMemberDndFromUsers < ActiveRecord::Migration[4.2]
def change
remove_column :users, :member_dnd
remove_column :users, :role
end
end
| 22.142857 | 61 | 0.754839 |
186cb17f405cc7d6b3d2a3cd2c8af05f0ec33850 | 1,698 | # typed: false
# frozen_string_literal: true
# This file was generated by GoReleaser. DO NOT EDIT.
class Nuke < Formula
desc "☢️ Force quit all applications with one terminal command"
homepage "https://github.com/gleich/nuke"
version "5.2.1"
on_macos do
if Hardware::CPU.intel?
url "https://github.co... | 30.321429 | 98 | 0.706125 |
d564cacd2d8f5869964472979f1e3b280e31bc1f | 2,215 | # frozen_string_literal: true
require 'spec_helper'
describe Notes::PostProcessService do
let(:project) { create(:project) }
let(:issue) { create(:issue, project: project) }
let(:user) { create(:user) }
describe '#execute' do
before do
project.add_maintainer(user)
note_opts = {
note: ... | 29.533333 | 94 | 0.659594 |
ffe4a79302570ae0350ceb79412923b3cfb9c838 | 694 | require 'test_helper'
class StaticPagesControllerTest < ActionDispatch::IntegrationTest
def setup
@base_title = "Ruby on Rails Tutorial Sample App"
end
test "should get home" do
get root_path
assert_response :success
assert_select "title", @base_title
end
test "should get help" do
get h... | 21.6875 | 65 | 0.700288 |
268e37e6ead90be04abbe61f0a4ab9277c80c2b9 | 14,763 | # -*- encoding: utf-8 -*-
require 'spec_helper'
RSpec.describe Brcobranca::Boleto::BancoBrasil do #:nodoc:[all]
before do
@valid_attributes = {
valor: 0.0,
local_pagamento: 'QUALQUER BANCO ATÉ O VENCIMENTO',
cedente: 'Kivanio Barbosa',
documento_cedente: '12345678912',
sacado: 'Clau... | 47.622581 | 181 | 0.74978 |
4a13345be0402c805ce1a0801cc5b39d89c8956b | 136 | require "sfn"
module Sfn
# Container for monkey patches
module MonkeyPatch
autoload :Stack, "sfn/monkey_patch/stack"
end
end
| 15.111111 | 45 | 0.735294 |
1adfb0a8c0af603d50ece193268648f4c4a8304f | 1,462 | # -*- encoding: utf-8 -*-
# stub: rspec 2.99.0 ruby lib
Gem::Specification.new do |s|
s.name = "rspec"
s.version = "2.99.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Steven Baker", "David Chelimsky"]
s.da... | 34 | 105 | 0.632695 |
0374b36260205e367f1f868f5ef2f1355eca03bd | 1,072 | # -*- coding: utf-8 -*-
require 'helper'
class TestRegressionChartAxis27 < Test::Unit::TestCase
def setup
setup_dir_var
end
def teardown
@tempfile.close(true)
end
def test_chart_axis27
@xlsx = 'chart_axis27.xlsx'
workbook = WriteXLSX.new(@io)
worksheet = workbook.add_worksheet
... | 23.822222 | 80 | 0.586754 |
28c43367863ec48b23a4e41ce197ee8e8827ee20 | 1,539 | def update_carrier_type
CarrierType.find_each do |carrier_type|
case carrier_type.name
when "volume"
carrier_type = CarrierType.find_by(name: 'volume')
if carrier_type
unless carrier_type.attachment.attached?
carrier_type.attachment.attach(io: File.open("#{File.dirname(__FILE__)}... | 39.461538 | 157 | 0.666017 |
f7aea768557b91abea56b8917eb1254c9ffd8194 | 1,969 | # Redmine - project management software
# Copyright (C) 2006-2017 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, or (at your option) any... | 32.278689 | 81 | 0.740985 |
878ec0d6b73fa2454a4b1594f5e6e7219b24b230 | 2,314 | # 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... | 44.5 | 86 | 0.733362 |
e27624138cc7f4465c73a75486afbabf9a436d8a | 333 | module Dynflow
module Listeners
class Abstract
include Algebrick::TypeCheck
attr_reader :world, :logger
def initialize(world)
@world = Type! world, World
@logger = world.logger
end
def terminate(future = Future.new)
raise NotImplementedError
end
e... | 18.5 | 40 | 0.624625 |
6196afabed88900c9f3879fbab8e6f3a86688b95 | 42 | module OpenAgenda
VERSION = "0.0.0"
end
| 10.5 | 19 | 0.690476 |
bf286c299dba59fd61d6cd747d803fa888f43c2b | 7,263 | # frozen_string_literal: true
require "delegate"
require "io/console/size"
module ActionDispatch
module Routing
class RouteWrapper < SimpleDelegator
def endpoint
app.dispatcher? ? "#{controller}##{action}" : rack_app.inspect
end
def constraints
requirements.except(:controller,... | 26.604396 | 124 | 0.532149 |
91ccc19d45874f717cfb8aba45a80fc577450d2c | 700 | class ColorPickerButton < Button
def initialize(source=nil)
init_source source
init_inner_control_vars
end
def current_godot_object
"ColorPickerButton"
end
def init_inner_control_vars
super
@color = Color.new @source.color
end
def color
@color
end
def color=(v)
@color =... | 14.583333 | 44 | 0.682857 |
38cc95b637283956d485db9cb47876997e64c3e2 | 1,201 | # 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 `rails
#... | 44.481481 | 86 | 0.766028 |
38402fb64ef1155505d10ec4edc2ed524354c223 | 380 | module TD::Types
# Contains information about the period of inactivity after which the current user's account will automatically be
# deleted.
#
# @attr days [Integer] Number of days of inactivity before the account will be flagged for deletion; should range
# from 30-366 days.
class AccountTtl < Base
... | 34.545455 | 116 | 0.736842 |
ac561b977ab909f9f68121f3f445d418d1ba19e0 | 6,979 | describe "screen properties" do
before do
# Simulate AppDelegate setup of main screen
@screen = HomeScreen.new modal: true, nav_bar: true
@screen.on_load
end
it "should store title" do
HomeScreen.get_title.should == 'Home'
end
it "should set default title on new instances" do
@screen.... | 31.579186 | 112 | 0.713139 |
610181855e322353c0d7d8a6c54afb3847102fce | 2,000 | # 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::SQL::Mgmt::V2014_04_01
module Models
#
# ARM resource.
#
class Resource
include MsRestAzure
# @return [String]... | 24.691358 | 72 | 0.476 |
ff5ab3355e4ecd979fdedc2b3b582fdcf53b0f42 | 646 | # encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true
require 'grpc'
require 'google/protobuf'
require_relative 'proto/infinite_tracing_pb'
require_relative 'proto/infini... | 34 | 93 | 0.786378 |
7a6e57cd474155f6dc2e56f8e30e0bc27c14258e | 234 | class RenameInviteEmailField < ActiveRecord::Migration
def self.up
execute "ALTER TABLE invites RENAME COLUMN invite_email TO email"
end
def self.down
execute "ALTER TABLE invites RENAME COLUMN email TO invite_email"
end
end
| 23.4 | 67 | 0.799145 |
876d3c0b42a7c508d5c2972bf67947f07f63c0af | 12,372 | # frozen_string_literal: true
require 'active_support/deprecation'
require 'uri'
module QA
module Runtime
module Env
extend self
attr_writer :personal_access_token, :admin_personal_access_token
attr_accessor :dry_run
ENV_VARIABLES = Gitlab::QA::Runtime::Env::ENV_VARIABLES
# The ... | 25.095335 | 139 | 0.643146 |
bb4771671ca526fe3f7041e7b97e120e3d3f4f9e | 769 | #
# Cookbook Name:: kimchi
# Recipe:: default
#
# Copyright 2015-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | 30.76 | 74 | 0.763329 |
5d55dc31b0c4e0474e151ed6611c77727195d017 | 781 | #frozen_string_literal: false
require 'test_helper'
require 'time'
class JSONStringMatchingTest < Test::Unit::TestCase
include JSON
class TestTime < ::Time
def self.json_create(string)
Time.parse(string)
end
def to_json(*)
%{"#{strftime('%FT%T%z')}"}
end
def ==(other)
to_i ... | 20.025641 | 68 | 0.56338 |
38669454dce99751651707afd42e5c9c6f7e3c77 | 1,189 | require 'test_helper'
class CephalopodsControllerTest < ActionController::TestCase
setup do
@cephalopod = cephalopods(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:cephalopods)
end
test "should get new" do
get :new
assert_response :... | 23.78 | 108 | 0.719092 |
acc53877c5a594bc7e5b26df3decdc50856f62f8 | 1,795 | class ToursController < ApplicationController
before_action :require_login, except: [:index, :show]
before_action :set_tour, except: [:index, :new, :create, :best]
def index
if params[:agency_id] && current_user.id == params[:agency_id].to_i
@tours = current_user.tours
else
@tours = Tour.al... | 20.872093 | 100 | 0.627298 |
7adc48d206853f8351b8ba666250df75613d13e1 | 469 | module HealthSeven::V2_6
class Csp < ::HealthSeven::Segment
# Study Phase Identifier
attribute :study_phase_identifier, Cwe, position: "CSP.1", require: true
# Date/time Study Phase Began
attribute :date_time_study_phase_began, Dtm, position: "CSP.2", require: true
# Date/time Study Phase Ended
attribute :d... | 39.083333 | 79 | 0.765458 |
6a4858970be88924bfd404bc9e02cebc1e80bdd0 | 398 | # frozen_string_literal: true
require 'spec_helper'
describe CSI::AWS::CloudWatch do
it 'should display information for authors' do
authors_response = CSI::AWS::CloudWatch
expect(authors_response).to respond_to :authors
end
it 'should display information for existing help method' do
help_response =... | 24.875 | 61 | 0.758794 |
4a76c6d19640f846f8f1a5f7de9a86d39c92e167 | 509 | dir = File.dirname(__FILE__) + '/templatelets'
require dir + '/href'
require dir + '/attribute'
require dir + '/each'
require dir + '/include'
require dir + '/link'
require dir + '/text'
require dir + '/when'
require dir + '/code'
module REXML
class Element
def attribute_value!(name)
value = attribute_value(nam... | 21.208333 | 90 | 0.699411 |
bfba3bf2e1760890e494ad7d6b32de97175cb9f6 | 1,487 | # encoding: UTF-8
class ZlibSpecs
def self.compressed_data
File.open(
File.join(File.dirname(__FILE__), 'compressed_file.bin'), 'rb'
) do |f|
block_given? ? yield(f) : f.read
end
end
def self.compressed_data_nocomp
File.open(
File.join(File.dirname(__FILE__), 'compressed_file_n... | 22.530303 | 77 | 0.631473 |
e2431950826c8c7bb13db45ba13919bc27a9d5e5 | 77 | execute 'zabbix_restart' do
command 'sudo service zabbix-agent restart'
end | 25.666667 | 45 | 0.805195 |
ab086f6acc334a6d108cda1beaba86e4a852fd1f | 383 | class CreateTimeEntries < ActiveRecord::Migration
def change
create_table :time_entries do |t|
t.integer :user_id, null: false
t.date :date, null: false
t.decimal :hours, precision: 4, scale: 2, null: false
t.string :description, null: false
t.text :notes
t.timestamps null: fal... | 27.357143 | 59 | 0.671018 |
f76d130c748b6f39dab593782e54015b0b22ad05 | 7,932 | class ActivityWorker
include Sidekiq::Worker
def perform(band_id, activity, hours, song_id = nil)
@band = Band.find_by_id(band_id)
case activity
when 'practice'
@band.members.each do |member|
increase_skill_amount = (rand(1..6) * hours.to_f/5).ceil
member.increment!(:skill_primar... | 40.676923 | 215 | 0.666541 |
7967b0e2f67a2e1ae7560b12f91ede3ff50aa6e1 | 1,023 | module Apo214
module Concerns
module Models
module Asisreconocimiento
extend ActiveSupport::Concern
included do
include Sip::Modelo
belongs_to :lugarpreliminar, class_name: 'Apo214::Lugarpreliminar',
validate: true, foreign_key: 'lugarpreliminar_id'
... | 34.1 | 164 | 0.656891 |
183b039715c6b2489264bb2403576c3613be9fd0 | 672 | require 'test_helper'
class PasswordTest < ActiveSupport::TestCase
test 'should create password hash' do
assert hashed_password
end
test 'should return NullPassword for invalid hash' do
assert_kind_of(
MinimalistAuthentication::NullPassword,
MinimalistAuthentication::Password.new('').bcrypt_... | 21.677419 | 64 | 0.736607 |
21d58dc6194b84affe6ee10b857d007880c3f74b | 1,138 | class Pari < Formula
desc "Computer algebra system designed for fast computations in number theory"
homepage "https://pari.math.u-bordeaux.fr/"
url "https://pari.math.u-bordeaux.fr/pub/pari/unix/pari-2.9.5.tar.gz"
sha256 "6b451825b41d2f8b29592c08d671999527bf936789c599d77b8dfdc663f1e617"
bottle do
sha256 ... | 34.484848 | 93 | 0.691564 |
d52d912dee815cc4cf0fa31ec4b550277357d576 | 1,730 | class UsersController < ApplicationController
before_action :logged_in_user, only: [:index, :edit, :update, :destroy,:following, :followers]
before_action :correct_user, only: [:edit, :update]
before_action :admin_user,only: :destroy
def index
@users = User.search(params[:search]).paginate(page: params[:pa... | 21.358025 | 96 | 0.663584 |
267cefc1cafeb3c25e28045980e11f0889605491 | 4,043 | # RJR Request Representation
#
# Copyright (C) 2012-2014 Mohammed Morsi <mo@morsi.org>
# Licensed under the Apache License, Version 2.0
require 'json'
require 'rjr/result'
require 'rjr/core_ext'
require 'rjr/util/args'
require 'rjr/util/logger'
module RJR
# JSON-RPC request representation.
#
# Registered request han... | 29.086331 | 79 | 0.663616 |
f79552c469d51fbb9ea18536eab41cd5e0ffcc0c | 213 | require 'spec_helper'
require 'object_schema/types/nil'
describe NilClass::Schema do
it "#as_json" do
schema = NilClass::Schema.new
expect(schema.as_json.symbolize_keys).to eq( type: 'null' )
end
end
| 21.3 | 63 | 0.7277 |
39a06f136f1f6654d5e3cf83384d0278ba104bd3 | 1,227 | class ArtistsController < ApplicationController
def index
end
def show
@artist = Artist.find_by(id: params[:id])
@user = User.find_by(id: current_user)
if @user == @artist
@current_artist = @user
elsif Artist.find_by(id: @user)
@other_artist = @user
else
@client = Client.fi... | 20.79661 | 77 | 0.637327 |
79338dc3691626057da26b565f7220047d8a482e | 843 | require 'spec_helper'
describe 'ceilometer::policy' do
shared_examples_for 'ceilometer policies' do
let :params do
{
:policy_path => '/etc/ceilometer/policy.json',
:policies => {
'context_is_admin' => {
'key' => 'context_is_admin',
'value' => 'foo:bar... | 20.071429 | 74 | 0.567023 |
7a1906b3ef96a715b7cf50eaead97e025869f986 | 458 | # frozen_string_literal: true
module Ci
class RetryPipelineWorker # rubocop:disable Scalability/IdempotentWorker
include ::ApplicationWorker
include ::PipelineQueue
urgency :high
worker_resource_boundary :cpu
def perform(pipeline_id, user_id)
::Ci::Pipeline.find_by_id(pipeline_id).try do ... | 22.9 | 74 | 0.700873 |
e8eaf3bed98247f0abc485c9d9d73fc6aa283154 | 441 | require 'rspec'
require_relative "../lib/fighter"
describe Fighter do
subject { Fighter.new("Bob") }
it "should have a strike" do
subject.strike.should be_a(Move)
end
it "should have block" do
subject.block.should be_a(Move)
end
it "should have a name" do
Fighter.new("Mike Tyson").name.should eq("Mike Ty... | 19.173913 | 56 | 0.714286 |
394cfe4d37fae560653857bf8d68921434f87e53 | 483 | # frozen_string_literal: true
class NewsUpdate < ApplicationRecord
belongs_to :creator, class_name: "User"
belongs_to_updater
scope :recent, -> {where("created_at >= ?", 2.weeks.ago).order(created_at: :desc).limit(5)}
def self.visible(user)
if user.is_admin?
all
else
none
end
end
... | 23 | 94 | 0.689441 |
e9560a22fa8c9338d5a901f1d398ee2afa9cc257 | 60,518 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::Synthetics
module Types
# A structure that contains the con... | 35.24636 | 141 | 0.630936 |
7a31ad5f8d101a762a4fa72e66bed6cde74ac830 | 2,361 | module Searchlogic
module NamedScopes
# Adds the ability to create alias scopes that allow you to alias a named
# scope or create a named scope procedure, while at the same time letting
# Searchlogic know that this is a safe method.
module AliasScope
# The searchlogic Search class takes a hash a... | 36.890625 | 100 | 0.615417 |
33ae567d16ce6bf4dede1bc6b820ec4a38dcd54e | 1,685 | class QpidProton < Formula
desc "High-performance, lightweight AMQP 1.0 messaging library"
homepage "https://qpid.apache.org/proton/"
url "https://www.apache.org/dyn/closer.lua?path=qpid/proton/0.37.0/qpid-proton-0.37.0.tar.gz"
mirror "https://archive.apache.org/dist/qpid/proton/0.37.0/qpid-proton-0.37.0.tar.gz... | 33.7 | 99 | 0.622552 |
e815b497e1c34b7723b2592d5a9b8c91b13254c4 | 1,877 | class Variant < ApplicationRecord
include Moderated
include Subscribable
include Flaggable
include Commentable
include WithTimepointCounts
belongs_to :gene
belongs_to :secondary_gene, class_name: 'Gene', optional: true
has_many :evidence_items
has_many :assertions
has_many :variant_group_variants
... | 27.602941 | 83 | 0.706979 |
5d8f22c320b27db8013eabf7e24101f6afa69173 | 5,058 | class R < Formula
desc "Software environment for statistical computing"
homepage "https://www.r-project.org/"
url "https://cran.r-project.org/src/base/R-4/R-4.1.3.tar.gz"
sha256 "15ff5b333c61094060b2a52e9c1d8ec55cc42dd029e39ca22abdaa909526fed6"
license "GPL-2.0-or-later"
livecheck do
url "https://cran.... | 33.058824 | 117 | 0.654211 |
6139cd847b86cfa9261f723243c07b31a49c2b5a | 2,493 | #
# Copyright:: Copyright (c) 2018 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/LICENSE-2.... | 33.689189 | 101 | 0.720818 |
f88b0ec66b803aa4b6141e8df69826fff6218e5a | 1,700 | class Sonobuoy < Formula
desc "Kubernetes component that generates reports on cluster conformance"
homepage "https://github.com/vmware-tanzu/sonobuoy"
url "https://github.com/vmware-tanzu/sonobuoy/archive/v0.56.6.tar.gz"
sha256 "d2faffe1d68bcc554d201af8d763a2a820c0ed2df8a73732f5996475b94c05a7"
license "Apache... | 51.515152 | 126 | 0.780588 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.