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 |
|---|---|---|---|---|---|
3922ecf33a02216c6f8d4eae01931252bffface3 | 69 | describe 'One', :wip do
it 'passes' do end
it 'fails' do end
end
| 13.8 | 23 | 0.637681 |
6a30b3190c3cdbaaf89776f9ce40094026b59f8e | 1,456 |
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "kansuji/version"
Gem::Specification.new do |spec|
spec.name = "kansuji"
spec.version = Kansuji::VERSION
spec.authors = ["Lê Hoàng Tâm"]
spec.email = ["tamlh@atmarkcafe.org"]... | 39.351351 | 113 | 0.664835 |
793aabe6c6d66903fd974a44bef33b264e05d7fe | 1,198 | customers = Customer.all
staff_members = StaffMember.where(suspended: false).all
s = 2.years.ago
23.times do |n|
m = CustomerMessage.create!(
customer: customers.sample,
subject: 'これは問い合わせです。' * 4,
body: "これは問い合わせです。\n" * 8,
created_at: s.advance(months: n)
)
r = StaffMessage.create!(
custome... | 23.490196 | 55 | 0.610184 |
91345063e09f8f9acdbb94683efe1c58997725bf | 1,318 | RSpec.describe Admin::GroupUsersController, faketenant: true do
let(:group) { FactoryBot.create(:group) }
context 'as an anonymous user' do
describe 'GET #index' do
subject { get :index, params: { group_id: group.id } }
it { is_expected.to redirect_to root_path }
end
end
context 'as an ad... | 29.288889 | 77 | 0.61912 |
79c2b128c4ba6b26b3099d87aa2c6f2f611e93c5 | 22,972 | # encoding: utf-8
require 'helper'
describe T::List do
before do
rcfile = RCFile.instance
rcfile.path = fixture_path + "/.trc"
@list = T::List.new
@old_stderr = $stderr
$stderr = StringIO.new
@old_stdout = $stdout
$stdout = StringIO.new
Timecop.freeze(Time.utc(2011, 11, 24, 16, 20, 0... | 46.596349 | 197 | 0.626023 |
03b980f34008812176d3aa3611436704d25704f9 | 889 | require 'rails_helper'
feature 'Visitor tries to acess car categories and' do
after :each do
expect(current_path).to eq(new_user_session_path)
expect(page).to have_content('Para continuar, efetue login ou registre-se.')
end
scenario 'cannot view index unless logged in' do
visit root_path
expect... | 27.78125 | 80 | 0.755906 |
287cf5abbe7c41245daecc9c5d9dbde3281fc47f | 1,120 | Openlectures::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the ... | 37.333333 | 85 | 0.773214 |
012a4d115a235715292574ad3b8dc3a65aa5e506 | 331 | class ContactSerializer
include JSONAPI::Serializer
attributes :id, :first_name, :last_name, :email, :mobile_phone, :office_phone, :affiliation, :notes, :disabled_at, :created_at, :updated_at
attribute :is_enabled do | object |
object.enabled?
end
attribute :full_name do | object |
object.full_name
... | 23.642857 | 141 | 0.734139 |
6afe98fd57de6cec2b3039c00923d31d580f4a64 | 315 | module Urpi
class Builder
def initialize(pass='')
@pass=pass
end
def superpass(length=n)
__chars = '$abcdefghijklmñopqrstuvwxyz.ABCDEFGHIJKLMNÑOPQRSTUVWXYZ_1234567890='
length.times {(@pass << __chars[rand(__chars.size)])} * Math.sqrt(__chars.size).to_i
puts @pass
end
end
end | 24.230769 | 88 | 0.688889 |
ed5daf7457b276e042ee765994bd42b794150690 | 1,313 | class Gofumpt < Formula
desc "Stricter gofmt"
homepage "https://github.com/mvdan/gofumpt"
url "https://github.com/mvdan/gofumpt/archive/v0.1.0.tar.gz"
sha256 "802c92d3df222c9b266d785305107c58a26ea186c4dbb5989b0db97b9bce0367"
license "BSD-3-Clause"
bottle do
sha256 cellar: :any_skip_relocation, arm64_bi... | 29.840909 | 122 | 0.714395 |
7a866c385d7b90daf1d0d1ddeec11ea5daecc10a | 419 | Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
namespace :api do
namespace :v1 do
resources :users
resources :artists
resources :albums
resources :favorites
post "/auth", to: "auth#create"
... | 20.95 | 101 | 0.675418 |
d557bd66058b6d7cf50af84cf0ea474f9972e7b0 | 11,990 | # frozen_string_literal: true
class Gitlab::Client
# Defines methods related to groups.
# @see https://docs.gitlab.com/ce/api/groups.html
module Groups
# Gets a list of groups.
#
# @example
# Gitlab.groups
# Gitlab.groups({ per_page: 40, page: 2 })
#
# @param [Hash] options A cus... | 36.333333 | 129 | 0.652127 |
2633abc635c675c33435ffa5dfa736882625f35d | 403 | # frozen_string_literal: true
title 'rider archives profile'
control 'rider archive' do
impact 1.0
title 'should be installed'
describe file('/etc/default/rider.sh') do
it { should exist }
end
# describe file('/usr/local/jetbrains/rider-*/bin/rider.sh') do
# it { should exist }
# end
describe ... | 21.210526 | 65 | 0.682382 |
11684af64fb52a493da2cb0564e7dbd2c5fa4e5d | 167 | Dummy::Application.routes.draw do
match "/home(.:format)", :to => "home#index", :as => :home
match "/another(.:format)", :to => "home#another", :as=> :another
end
| 33.4 | 67 | 0.616766 |
26be618904f1dd0a6f1368e31af6671b0e1bb446 | 467 | module Fog
module Sql
class AzureRM
# Mock class for Sql Request
class Real
def check_database_exists(resource_group, server_name, name)
msg = "Checking SQL Database #{name}"
Fog::Logger.debug msg
# This module needs to be updated to azure sdk
end
en... | 21.227273 | 68 | 0.584582 |
7afb3b806fc5689fcf739c0facbff41e982a41e6 | 702 | namespace :db do
desc "Create default admin account (admin@example.com:aA1aaaa)."
task create_default_admin: :environment do
puts 'email: admin@example.com; pwd: aA1aaaa'
admin = User.new(email: "admin@example.com",
password: "aA1aaaa",
password_confirmation... | 33.428571 | 66 | 0.619658 |
18f169ea2928b87bab1ef11effa31907fc10187f | 1,432 | require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
require 'capybara/rspec'
# Put your acceptance spec helpers inside /spec/acceptance/support
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
# RSpec.configure do |config|
# end
def sign_up_new_user
user = User.make
visit "/... | 19.351351 | 69 | 0.722067 |
bb0cba8ab4cfd97afe50d85184bd9a3557858275 | 1,156 | # coding: utf-8
require 'rails_helper'
RSpec.describe AttachmentsController, :type => :controller do
describe 'POST #create' do
before do
Attachment.destroy_all
@user = create(:user)
sign_in @user
end
it 'saves the new attachment in the database' do
expect {
post :create, ... | 34 | 90 | 0.675606 |
3328700b6ae59ef3961eb90d8bb2944c4b40f6b2 | 1,886 | require 'ihasa/lua'
module Ihasa
# Bucket class. That bucket fills up to burst, by rate per
# second. Each accept? or accept?! call decrement it from 1.
class Bucket
class << self
def create(*args)
new(*args).tap(&:save)
end
REDIS_VERSION_WITH_REPLICATE_COMMANDS_SUPPORT = 3.2
... | 26.56338 | 76 | 0.634146 |
26b9a88babf92e46d1a3c44548a185fd6472b1d1 | 1,567 | # frozen_string_literal: true.
$LOAD_PATH.unshift(File.dirname(__FILE__) + "/lib")
require "version"
Gem::Specification.new do |s|
s.name = %q(cfndsl-pipeline)
s.authors = [
"Cam Maxwell"
]
s.homepage = 'https://github.com/cmaxwellau/cfndsl-pipeline.git'
s.author = 'Cam Maxwe... | 38.219512 | 256 | 0.641991 |
6abc5c6c29033a13b1e2a84c93657c455c6e4c36 | 300 | module Truepill
module Resources
class Patient < RestfulResource
public :list, :read
def create(data)
put(resource_base, data)
end
def get_prescriptions(data)
path = "#{resource_path(data)}/prescriptions"
get(path)
end
end
end
end
| 16.666667 | 53 | 0.61 |
bfba97fe61db47f9e3ab269a3b3f04e05aebeac8 | 1,538 | require 'spec_helper'
describe DryRunnable do
class Agents::SandboxedAgent < Agent
default_schedule "3pm"
can_dry_run!
def check
log "Logging"
create_event payload: { test: "foo" }
error "Recording error"
create_event payload: { test: "bar" }
self.memory = { last_status: "... | 26.982456 | 124 | 0.619636 |
7ab20115b015a85b6d3d4ec3ed3c0838a0f9ef85 | 1,925 | class ProjectsController < ApplicationController
before_action :set_project, only: [:show, :edit, :update, :destroy]
# GET /projects
# GET /projects.json
def index
@projects = Project.all
end
# GET /projects/1
# GET /projects/1.json
def show
end
# GET /projects/new
def new
@project = Pro... | 26.013514 | 93 | 0.661818 |
08a88f0b6f29baf0c4fba9f8119eafed39e9b8e9 | 1,652 | require 'test_helper'
class FollowingTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
def setup
@user = users(:takuya)
@other = users(:kasumi)
log_in_as(@user)
end
test "following page" do
get following_user_path(@user)
assert_not @user.following.empt... | 27.533333 | 77 | 0.697337 |
e83aa8b3f4905cfd29824a5f18bde83ed7ab5a4b | 1,201 | =begin
#Datadog API V1 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://openapi-generator.tech
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product... | 31.605263 | 107 | 0.777685 |
0182cf4cf93b831f80e51cf6b4a21909f917ea4f | 96 | # frozen_string_literal: true
module GraphQL
module AnyCable
VERSION = "1.1.3"
end
end
| 12 | 29 | 0.708333 |
d50ea48a59b4661c521e1c0ec899dc07c8c259e5 | 505 | class AddPipelineExecutionStrategyToSamples < ActiveRecord::Migration[5.1]
def change
add_column :samples, :pipeline_execution_strategy, :string, default: "directed_acyclic_graph", comment: "A soft enum (string) describing which pipeline infrastructure to run the sample on."
add_column :pipeline_runs, :pipeli... | 72.142857 | 212 | 0.80396 |
e8ee75d34166176a9875a02a69ea56b99e114bbe | 3,950 | # frozen_string_literal: true
module ApplicationHelper
def markdown(body, opts = {})
opts[:format] = "markdown"
raw BlueDoc::HTML.render(body, opts)
end
def logo_tag(href: "/")
site_logo = Setting.site_logo
if site_logo&.start_with?("data:")
style = "background: none; padding: 0"
li... | 28.623188 | 144 | 0.651392 |
11616f5f426da40c9801f05ef3874c23c6f176c8 | 273 | require 'twilio-ruby'
ACCOUNT_SID = ''
AUTH_TOKEN = ''
FROM_NUMBER = ''
def send_sms(phone_number, body_text)
client = Twilio::REST::Client.new(ACCOUNT_SID, AUTH_TOKEN)
client.messages.create(
from: FROM_NUMBER,
to: phone_number,
body: body_text
)
end
| 17.0625 | 60 | 0.703297 |
7902415609139a8864bc6632b74977aae436c672 | 3,059 | class Thrift < Formula
desc "Framework for scalable cross-language services development"
homepage "https://thrift.apache.org/"
license "Apache-2.0"
stable do
url "https://www.apache.org/dyn/closer.lua?path=thrift/0.15.0/thrift-0.15.0.tar.gz"
mirror "https://archive.apache.org/dist/thrift/0.15.0/thrift-... | 34.370787 | 142 | 0.675057 |
1aacc57f20f17136b11ab3d6c2039cd047300bea | 1,043 | require "matrix"
require "kablammo"
require_relative "./cell"
require_relative "./danger_score"
module Scaredy
class DangerMatrix
include Strategy::Constants
attr_accessor :matrix
def self.score(board, me, opponents)
danger_matrix = DangerMatrix.new()
danger_matrix.score_cells(me, board, o... | 19.679245 | 62 | 0.623202 |
ac0c373603ba30c2fbdf64b59c3a6fd6745bf2a3 | 2,285 | # frozen_string_literal: true
require "action_policy/testing"
module ActionPolicy
module RSpec
# Authorization matcher `be_authorized_to`.
#
# Verifies that a block of code has been authorized using specific policy.
#
# Example:
#
# # in controller/request specs
# subject { patch... | 25.388889 | 94 | 0.61663 |
e9f58701e957faafdc750c7181e6a491ce8bdd2a | 3,481 | module QuickbooksWebConnector
class Job
attr_accessor :response_xml
def initialize(payload)
@payload = payload
end
# Creates a job by placing it on the queue. Expects a request builder class
# name, a response handler class name, and an optional array of arguments to
# pass to the cla... | 28.532787 | 88 | 0.658719 |
bfa1ab319d65d77a326886b2d8a6705de89c5548 | 58 | module Spree
def self.version
'4.2.0.rc5'
end
end
| 9.666667 | 18 | 0.637931 |
e82d8d1841241581d5515562b5c90eb4162a4fc9 | 823 | module Idv
module DocumentCaptureSessionValidator
extend ActiveSupport::Concern
included do
validates :session_uuid, presence: { message: 'session missing' }
validate :session_exists, if: :session_uuid_present?
validate :session_not_expired, if: :session_uuid_present?
end
private
... | 24.205882 | 86 | 0.72661 |
18628ae0503817afc0f11ea2cec9edc7a059254b | 4,321 | # 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::Compute::Mgmt::V2020_06_01
module Models
#
# The source user image virtual hard disk. The virtual hard disk will be
# copied bef... | 30.864286 | 77 | 0.469104 |
5db17438163cc345ca0dbac81e0b3a328fcc77c8 | 1,420 | class TranslateShell < Formula
desc "Command-line translator using Google Translate and more"
homepage "https://www.soimort.org/translate-shell"
url "https://github.com/soimort/translate-shell/archive/v0.9.6.12.tar.gz"
sha256 "4c4843a8c66276190535b8435775ecb5d9c8286083a33cdbe2db608eba93ca97"
license "Unlicens... | 33.023256 | 120 | 0.748592 |
08ce98762798476d33bd89a9b4c497b520234bcf | 2,539 | # -*- encoding: utf-8 -*-
#
require 'spec_helper'
RSpec.describe Brcobranca::Retorno::Cnab400::Bradesco do
before do
@arquivo = File.join(File.dirname(__FILE__), '..', '..', '..', 'arquivos', 'CNAB400BRADESCO.RET')
end
it 'Ignora primeira linha que é header' do
pagamentos = described_class.load_lines(@... | 43.033898 | 128 | 0.730209 |
5de41f6fbf0f8736f04693b4f384826b99690b7b | 645 | # frozen_string_literal: true
module EE
# GroupProjectsFinder
#
# Extends GroupProjectsFinder
#
# Added arguments:
# params:
# with_security_reports: boolean
module GroupProjectsFinder
extend ::Gitlab::Utils::Override
override :filter_projects
def filter_projects(collection)
co... | 22.241379 | 97 | 0.717829 |
d5ca520b41cb53133176d2202c0ba72e4cc44d80 | 133 | #coding: utf-8
#同城快运-返款清单
class LocalTownRefundsController < BaseRefundsController
defaults :resource_class => LocalTownRefund
end
| 22.166667 | 56 | 0.827068 |
e8b289fb9bf852a8874aa7a4ef6e9e85eed13af2 | 3,772 | # Quote History routines
#
require 'ib-ruby'
module PryIb
class History
DURATIONS = { sec1: '1 S',
day1: '1 D',
week1: '1 W',
month1: '1 M',
year1: '1 Y',
}
def initialize( ib )
@ib = ib
@market = {}
@request_id ... | 31.966102 | 152 | 0.525186 |
1a2a9e7431874f694973da3bdd1949e4f5088f24 | 115 | require 'capistrano/net_storage/s3/base'
class Capistrano::NetStorage::S3
class Error < StandardError
end
end
| 16.428571 | 40 | 0.782609 |
bbe50598f7609a16006a3f88bd046b2736a2aaf7 | 3,758 | #
# params_lookup.rb
#
# This function lookups for a variable value in various locations
# following this order (first match is returned)
# - Hiera backend (if present) for modulename::varname
# - Hiera backend (if present) for modulename_varname
# - Hiera backend (if present) for varname (if second argument is 'global... | 37.207921 | 85 | 0.649282 |
795b3a078b9bb89e3d165086cc78d9fb73c959fd | 1,058 | FactoryBot.define do
factory :user do
association :team
slack_id { "U#{generate(:slack_id)}" }
name { Faker::Name.name }
username { Faker::Internet.username }
image_url { Faker::Avatar.image }
deactivated { false }
team_admin { false }
transient do
with_sparkles { 0 }
end
... | 28.594595 | 175 | 0.665406 |
bf8dab245555b32b7cc988430e78df91a968573c | 20,417 | require 'spec_helper'
describe 'monit' do
context 'supported operating systems' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) { facts }
case facts[:osfamily]
when 'Debian'
config_file = '/etc/monit/monitrc'
config_dir = '/etc/monit/co... | 37.393773 | 144 | 0.480972 |
9111a80968d93a1d22bac5e5ade41e5d24aeaf8e | 1,976 | require 'spec_helper'
describe DownloadsController do
render_views
before(:each) do
@item_id = 'bpl-dev:h702q6403'
@datastream_id = 'access800'
@first_image_pid = 'bpl-dev:h702q641c'
end
describe "GET 'show'" do
describe 'file object (single item download)' do
it 'should be successfu... | 29.939394 | 123 | 0.668522 |
f736c85f5a45b626a5540dd7f9fd238840c7b87d | 300 | require 'test/unit'
require_relative '../leetcode/905_Sort_Array_By_Parity'
class SortArrayByParityTest < Test::Unit::TestCase
def setup
@arr = [1, 3]
@sort = SortArrayByParity.new
end
def test_solution
sol = @sort.sort_array_by_parity(@arr)
assert_equal sol, [3, 1]
end
end
| 21.428571 | 55 | 0.713333 |
1a201f8c487ce8ec78b4d41cbcdc97cac3e54aa2 | 468 | $:.unshift File.dirname(__FILE__)
if ENV['APP_ENV']!="production"
require 'byebug'
require 'dotenv'
Dotenv.load
end
require 'aws-sdk'
require 'json'
require 'mechanize'
require 'celluloid'
# Classes
require "classes/downloader.rb"
require "classes/web_page.rb"
require "classes/link_extractor.rb"
# Facades
re... | 20.347826 | 39 | 0.764957 |
0111cdfff1c29819a5f73c2a55554a6a92b462cb | 872 | # frozen_string_literal: true
class UsersController < ApplicationController
def new
@user = User.new
end
def create
# @user = User.new(username: params[:username], email: params[:email], password: params[:password]) #form tags
@user = User.new(user_params) # form_for
if @user.save
redirec... | 20.27907 | 115 | 0.641055 |
26a75d5888cdee6d6a6623c51b135b73cafcc2ee | 1,425 | require 'spec_helper'
module Resync
describe XML do
describe '#element' do
it 'returns an element unchanged' do
elem = REXML::Element.new('foo')
expect(XML.element(elem)).to be(elem)
end
it 'returns the root element of a string document' do
xml_str = '<?xml version="1.0... | 29.6875 | 64 | 0.58807 |
1124b98056c9ed4c4df334967f2dfcb5dce1aba3 | 128 | Sequel.migration do
change do
add_column(:versions, :order, Integer)
self[:versions].update(:order => :id)
end
end
| 16 | 42 | 0.671875 |
b91c002624048537f2c5a2b984571dac7f978fe8 | 2,943 | require 'net/http'
require 'net/https'
require 'uri'
module RubySms
module Gateway
class Sms77
class Parameters < Hash
def initialize(options)
merge!(options)
symbolize_keys!
end
def symbolize_keys!
inject({}){|h,(k,v)| h.merge({ k.to_sym => v}) }
... | 30.340206 | 86 | 0.608902 |
e287001f90109211e34c41b3d5ba64e7a91b94ed | 276 | class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
self.window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
self.window.backgroundColor = UIColor.whiteColor
self.window.makeKeyAndVisible
true
end
end
| 27.6 | 75 | 0.804348 |
e2a494a13f632af0cb5a67947a5424f9317a9eb3 | 180 | class DeityCharacterSibling < ApplicationRecord
include HasContentLinking
belongs_to :deity
belongs_to :character_sibling, class_name: Character.name
belongs_to :user
end
| 22.5 | 59 | 0.827778 |
4a11fb941618498bad3e918f88de5950b84bf7ef | 572 | require 'rails_helper'
RSpec.describe Web::LocalesController do
describe 'GET #toggle' do
before { request.session[:locale] = current_locale }
context 'when english locale is enabled' do
let(:current_locale) { :en }
it 'changes locale to russian' do
get :toggle
expect(session[:l... | 22 | 56 | 0.627622 |
bf45e4cc68a73f605223d9ac53d4c6c71c864654 | 324 | #!/usr/bin/env ruby
# Copyright (c) 2004-2020 Microchip Technology Inc. and its subsidiaries.
# SPDX-License-Identifier: MIT
require "pp"
require "json"
require_relative 'libeasy/et'
meta = {
"owner" => "anielsen",
"desc" => "Reboot, load new SW, and start mesa-demo",
}
$ts = get_test_setup("mesa_pc_b2b_2x... | 19.058824 | 73 | 0.685185 |
7a1df7a17920244dd3fe0bacf819bb57173bc7a2 | 263 | require "rarma/server"
class Rarma::CLI::Subcommand::Server
attr_reader :opts
def initialize
@opts = nil
end
def main
@opts = Trollop::options do
opt :port, "Port number", :default => 31337
end
Rarma::Server.start(@opts)
end
end
| 16.4375 | 49 | 0.646388 |
33d37776fabdc29eaab4e08e9770ae558a109e7c | 195 | class Helper
include Singleton
include ActionView::Helpers::TagHelper
include ActionView::Helpers::UrlHelper
include ActionView::Helpers::NumberHelper
#include ActionView::Partials
end
| 24.375 | 43 | 0.805128 |
2671f286d396dcb626166c0b3becb997a6173c87 | 116 | module MiqAeMethodService
class MiqAeServiceConfigurationScript < MiqAeServiceModelBase
expose :run
end
end
| 19.333333 | 63 | 0.827586 |
d56e8a24b13b2c9269166a8024d470210f2a4e24 | 7,565 | # Windows helper functions
#### Windows stuff
require_relative "RubyCommon.rb"
require_relative "Helpers.rb"
# Converts unix path to windows path
def convertPathToWindows(path, doubleEscape = false)
if doubleEscape
path.gsub /\//, "\\\\"
else
path.gsub /\//, "\\"
end
end
def runningAsAdmin?
(`reg qu... | 31.65272 | 94 | 0.651818 |
b9b997bf3a704465894a11bdc78c2ca76b92908a | 5,557 | # 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::DataFactory::Mgmt::V2018_06_01
module Models
#
# Azure Databricks Delta Lake linked service.
#
class AzureDatabricksDeltaLak... | 32.688235 | 79 | 0.476336 |
7a07f76feddfdc2228817a68cb2d42e83064a8a0 | 856 | cask 'qqlive' do
version '2.3.1.43012'
sha256 '503a89359032692d5651c75073c20705e95da6c6b94e86c3e98120d442490f3c'
url "https://dldir1.qq.com/qqtv/mac/TencentVideo_V#{version}.dmg"
appcast 'https://v.qq.com/download.html#mac'
name 'QQLive'
name '腾讯视频'
homepage 'https://v.qq.com/download.html#mac'
auto_u... | 32.923077 | 83 | 0.642523 |
e9558bfd03d76f5444a14ee33555096a0e779b0b | 3,693 | # frozen_string_literal: true
class ConferenceSerializer < ActiveModel::Serializer
include ApplicationHelper
attributes :short_title, :title, :description, :start_date, :end_date, :picture_url,
:difficulty_levels, :event_types, :rooms, :tracks,
:date_range, :revision
def difficulty_lev... | 53.521739 | 161 | 0.375846 |
ed6849aa16d61ecf442be9c63237a1fffd9087ef | 450 | cask :v1 => 'font-mountains-of-christmas' do
# version '1.002'
version :latest
sha256 :no_check
url 'https://github.com/w0ng/googlefontdirectory/trunk/fonts/mountainsofchristmas',
:using => :svn,
:revision => '50',
:trust_cert => true
homepage 'http://www.google.com/fonts/specimen/Mo... | 28.125 | 85 | 0.697778 |
01edfbec32b067955bd22f983e2de28073494b18 | 1,554 | class Links < Formula
desc "Lynx-like WWW browser that supports tables, menus, etc."
homepage "http://links.twibright.com/"
url "http://links.twibright.com/download/links-2.16.tar.bz2"
sha256 "82f03038d5e050a65681b9888762af41c40fd42dec7e59a8d630bfb0ee134a3f"
bottle do
cellar :any
sha256 "8e70c80765c2... | 33.06383 | 94 | 0.705277 |
262846adffd69b7db33f0ba4e4744557dae1e9b2 | 126 | require 'test_helper'
class SubjectgroupTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 15.75 | 48 | 0.714286 |
4aa15c5b9a9f4bffc725274c1f08f6d81c9c77dc | 1,958 | $VERBOSE = ENV['VERBOSE'] || false
require 'rubygems'
ENGINE_RAILS_ROOT = File.join(File.dirname(__FILE__), '../') unless defined?(ENGINE_RAILS_ROOT)
# Configure Rails Environment
ENV["RAILS_ENV"] ||= 'test'
if ENV['TRAVIS']
require 'coveralls'
Coveralls.wear!
end
require File.expand_path("../dummy/config/envi... | 30.123077 | 95 | 0.74668 |
f85a0b14199bb916c49f642c88624265831f3c11 | 24,543 | #-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject... | 32.166448 | 110 | 0.675997 |
e934c486c7534e5166f243707d5026e788897bf6 | 11,540 | # NotificationService class
#
# Used for notifying users with emails about different events
#
# Ex.
# NotificationService.new.new_issue(issue, current_user)
#
class NotificationService
# Always notify user about ssh key added
# only if ssh key is not deploy key
#
# This is security email so it will be sent
... | 32.691218 | 126 | 0.749133 |
7af223310969ee077e6e56c5a550070423acd85d | 5,432 | #!/opt/puppetlabs/puppet/bin/ruby
require 'json'
require 'puppet'
require 'openssl'
def delete_apps_v1_collection_namespaced_replica_set(*args)
header_params = {}
params=args[0][1..-1].split(',')
arg_hash={}
params.each { |param|
mapValues= param.split(':',2)
if mapValues[1].include?(';')
mapV... | 31.581395 | 135 | 0.652982 |
2801ec94dc0df8e569583bae59a84e13f0f8580b | 2,853 |
###
# This Ruby source file was generated by test-to-ruby.xsl
# and is a derived work from the source document.
# The source document contained the following notice:
=begin
Copyright (c) 2001-2004 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut National de
Recherche en Informatique et en A... | 30.677419 | 113 | 0.706625 |
91ebe133a13b1af4bddf6b43299be966c98b03a3 | 47 | require "booqmail/engine"
module Booqmail
end
| 9.4 | 25 | 0.808511 |
1dd7547a7fc41498896579b619c7f1b7e66340bd | 10,644 | require 'spec_helper'
feature 'Expand and collapse diffs', :js do
let(:branch) { 'expand-collapse-diffs' }
let(:project) { create(:project, :repository) }
before do
# Set the limits to those when these specs were written, to avoid having to
# update the test repo every time we change them.
allow(Git... | 33.683544 | 131 | 0.649004 |
87474892684e82d1e0bdc8b8f5881c9edf8dc376 | 413 | module XRBP
module WebSocket
# MultiConnection strategy where connections are tried
# sequentially until one succeeds
class Prioritized < MultiConnection
def next_connection(prev=nil)
return nil if prev == connections.last
return super if prev.nil?
connections[connections.ind... | 29.5 | 58 | 0.7046 |
21b6ff652acc1c32d04cd92c99ddd6684704e058 | 1,316 | # 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::ApiManagement::Mgmt::V2018_06_01_preview
module Models
#
# Properties specific to the Backend Type.
#
class BackendPropertie... | 26.857143 | 78 | 0.588906 |
f7ad1ae2e8d2cddf7b12e7b651b5b64b34c59770 | 3,479 | require "logstash/event"
require "insist"
describe LogStash::Event do
before :each do
@event = LogStash::Event.new
@event.timestamp = "2013-01-01T00:00:00.000Z"
@event.type = "sprintf"
@event.message = "hello world"
@event.tags = [ "tag1" ]
@event.source = "/home/foo"
end
subject { @even... | 39.089888 | 97 | 0.584363 |
3314baea64a62fac5620240085258ec2aa7f3a36 | 2,954 | require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
ruby_version_is "1.9" do
describe "Method#source_location" do
before(:each) do
@method = MethodSpecs::SourceLocation.method(:location)
end
it "returns nil for built-in methods" do
... | 28.960784 | 97 | 0.64218 |
abfce78c6d6e3e74b1a984f80d8c0e4bf31eadb4 | 374 | cask 'healthi' do
version '3.1.1'
sha256 '03b4187a432fb8f7d24c0286403f75f243fa1653eda3362fe459ea4d54229f15'
url "https://github.com/pablopunk/healthi-app/releases/download/#{version}/healthi.app.zip"
appcast 'https://github.com/pablopunk/healthi-app/releases.atom'
name 'healthi'
homepage 'https://github.co... | 31.166667 | 93 | 0.770053 |
ff61a80a2e69034206fb04b36ece847f22b9ab58 | 170 | FactoryBot.define do
klass = Struct.new(:stock_available)
factory :stock_level, class: klass do
stock_available { Faker::Number.between(1, 1000).to_i }
end
end
| 24.285714 | 59 | 0.735294 |
03adfef695b5f6040e73ba21db6bbb09e65d8ed5 | 420 | require 'bundler'
begin
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__)... | 22.105263 | 66 | 0.752381 |
f73a0b9c147e7a304131c0de41d5e744b04d3ffa | 286 | # frozen_string_literal: true
# == Schema Information
#
# Table name: pages_tags
#
# id :integer not null, primary key
# page_id :integer
# tag_id :integer
#
class PagesTag < ApplicationRecord
belongs_to :tag, optional: true
belongs_to :page, optional: true
end
| 17.875 | 50 | 0.692308 |
1d47c708f4000e9c92a6a3f87435c22cc8fcab7e | 581 | cask 'trash-it' do
if MacOS.version <= :snow_leopard
version '5.2'
sha256 '2428fcf10f8641488e1a43f8d64dfa7256129aab9813c1f841c72bf75f11c821'
url "http://nonamescriptware.com/wp-content/uploads/TrashIt#{version.no_dots}.zip"
app "TrashIt #{version}/Drag content to Desktop/Trash It!.app"
else
vers... | 32.277778 | 86 | 0.726334 |
013a241447b87eeee397aebbb722f7dd43f06369 | 2,852 | class LessonsController < ApplicationController
before_action :set_lesson, only: [:show, :edit, :update, :destroy, :delete_video]
def delete_video
authorize @lesson, :edit?
@lesson.video.purge
@lesson.video_thumbnail.purge
redirect_to edit_course_lesson_path(@course, @lesson), notice: 'Video succes... | 27.960784 | 116 | 0.678822 |
392dc940510903a94d4a6e48f3abf584bfda87e7 | 1,670 | module Leveret
# Handles the acknowledgement or rejection of messages after execution
class ResultHandler
extend Forwardable
attr_accessor :incoming_message
def_delegators :Leveret, :log, :delay_queue
# @param [Message] incoming_message Contains delivery information such as the delivery_tag
d... | 28.305085 | 109 | 0.702994 |
6abc635302a39e047d8b10c25ac1ef1dae45790f | 851 | require "#{File.join(File.dirname(__FILE__),'..','spec_helper.rb')}"
describe 'ssmtp::revalias' do
let(:title) { 'ssmtp::revalias' }
let(:node) { 'rspec.example42.com' }
let(:facts) { { :ipaddress => '10.42.42.42',
:revaliases_template => 'ssmtp/revaliases.erb',
:revaliases_f... | 38.681818 | 169 | 0.587544 |
080a3bf29cc3cffa28a03a50fda186e7aca5adda | 1,143 | require 'veewee/config/component'
require 'veewee/definition'
require 'ostruct'
module Veewee
class Config
class Definition
attr_accessor :components
attr_reader :env
def initialize(config)
@env=config.env
@components=Hash.new
end
# Currently not used, this is in... | 25.4 | 108 | 0.663167 |
7961637aa58258146c02f92dc92e64a5bcf85e1f | 5,115 | require_relative 'test_helper'
describe "Set Command" do
include TestDsl
describe "setting to on" do
temporary_change_hash_value(Debugger::Command.settings, :autolist, 0)
it "must set a setting to on" do
enter 'set autolist on'
debug_file 'set'
Debugger::Command.settings[:autolist].must... | 28.575419 | 108 | 0.653177 |
fffe85480cab8536f640bd4b47cc9b204b0fa588 | 321 | TensorStream::OpMaker.define_operation :sigmoid do |op|
op.what_it_does "Computes sigmoid of x element-wise."
op.parameter :input_a, "tensor X", validate: 'FLOATING_POINT_TYPES'
op.option :name, "Optional name", :nil
op.define_gradient do |grad, _node, params|
i_op(:sigmoid_grad, params[0], grad)
end
en... | 32.1 | 69 | 0.735202 |
5dc4bb902d5c500d33c35034e2b640f560b8143b | 10,248 | require 'spec_helper'
module RubySpeech
describe SSML do
describe "#draw" do
let(:doc) { Nokogiri::XML::Document.new }
it "should create an SSML document" do
expected_doc = SSML::Speak.new doc
SSML.draw.should == expected_doc
SSML.draw.document.xpath('ns:speak', ns: 'http://w... | 32.951768 | 123 | 0.523322 |
384b01bf8a2df1ef01371f95f3995388180c6574 | 1,674 | require 'rails_helper'
RSpec.describe 'User signup API', type: :request do
describe 'POST /api/signup' do
context 'Valid request' do
let(:valid_user_attributes) {
{
user: {
username: Faker::Internet.user_name,
email: Faker::Internet.email,
password: "... | 27.9 | 78 | 0.566308 |
39a08b255aab1857511fb58f6b08321857b7c173 | 326 | class CreatePhLabels < ActiveRecord::Migration[4.2]
def change
create_table :ph_labels do |t|
t.references :piece_head, index: true, foreign_key: true, null: false
t.references :company, index: true, foreign_key: true, null: false
t.string :catalog_no
t.timestamps null: false
end
en... | 27.166667 | 75 | 0.693252 |
01f3f2cb561e4bb4f49ebddfa8f28bcfd7e934a7 | 822 | require 'test_helper'
class MicropostsControllerTest < ActionDispatch::IntegrationTest
def setup
@micropost = microposts(:orange)
end
test "should redirect create when not logged in" do
assert_no_difference 'Micropost.count' do
post microposts_path, params: { micropost: { content: "lorem ipsum" }... | 25.6875 | 77 | 0.738443 |
ff802329da7dfd5e6a84bb395806aff6ac78d670 | 2,460 | class Seexpr < Formula
desc "Embeddable expression evaluation engine"
homepage "https://wdas.github.io/SeExpr/"
url "https://github.com/wdas/SeExpr/archive/v3.0.1.tar.gz"
sha256 "1e4cd35e6d63bd3443e1bffe723dbae91334c2c94a84cc590ea8f1886f96f84e"
license "Apache-2.0"
livecheck do
url :stable
regex(/^... | 34.647887 | 93 | 0.355691 |
337c28d12ad27056d969f899b8ea15406a686d0f | 1,230 | require "language/node"
class FirebaseCli < Formula
desc "Firebase command-line tools"
homepage "https://firebase.google.com/docs/cli/"
url "https://registry.npmjs.org/firebase-tools/-/firebase-tools-3.18.2.tgz"
sha256 "58942556c82c600cfa1dee340ae221550e01c8a968352c6a49eeb015ee150b1a"
head "https://github.co... | 35.142857 | 94 | 0.760163 |
d5b00cd60aeba0f14ad918ec8c57cd9d9f0b7254 | 143 | class AddArchivedOntoCurrentlyInked < ActiveRecord::Migration[5.1]
def change
add_column :currently_inked, :archived_on, :date
end
end
| 23.833333 | 66 | 0.783217 |
915112222d71370ef1b8a8406c781d5952f3dcd3 | 336 | # See http://doc.doggohub.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for DoggoHub.
class AddIndexOnRunnersLocked < ActiveRecord::Migration
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
def change
add_concurrent_index :ci_runners, :l... | 25.846154 | 71 | 0.803571 |
398d4db6d50fa6a7fc3f95abe5f83a9154eae579 | 1,483 | require 'spec_helper'
describe RSpec::Mocks::AnyInstance::MessageChains do
let(:chains) { RSpec::Mocks::AnyInstance::MessageChains.new }
let(:stub_chain) { RSpec::Mocks::AnyInstance::StubChain.new }
let(:expectation_chain) { RSpec::Mocks::AnyInstance::PositiveExpectationChain.new }
it "knows if a method does ... | 36.170732 | 93 | 0.731625 |
39a57055c17e2fe3f72ee0c0258b04e2113efe34 | 71 | module Jekyll
module Archives
VERSION = "2.1.0".freeze
end
end
| 11.833333 | 28 | 0.676056 |
7a06596b35eb33a3344c056daa6c02a1095a6a48 | 1,016 | module VzaarApi
class Video
class Subtitle < Abstract
ENDPOINT = Proc.new do |video_id, subtitle_id|
File.join 'videos', video_id.to_s, 'subtitles', subtitle_id.to_s
end
ATTR_READERS = [:id,
:code,
:title,
:language,
... | 26.051282 | 79 | 0.562008 |
f7d63863dc9583832d070b22506570b78766e94d | 66 |
module FifaRankings
end
require_relative '../config/environment' | 13.2 | 40 | 0.818182 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.