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 |
|---|---|---|---|---|---|
01594036864363b889f44dc750a226b043da2c5f | 158 | Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
resources :todos
end
| 31.6 | 101 | 0.78481 |
bf8faa853d43e9ff8d116c8fcc9e8e6c71660fa2 | 1,226 | class Ykclient < Formula
desc "Library to validate YubiKey OTPs against YubiCloud"
homepage "https://developers.yubico.com/yubico-c-client/"
url "https://developers.yubico.com/yubico-c-client/Releases/ykclient-2.15.tar.gz"
sha256 "f461cdefe7955d58bbd09d0eb7a15b36cb3576b88adbd68008f40ea978ea5016"
bottle do
... | 33.135135 | 93 | 0.744698 |
e2d131b1572bdfaa5e4bf8cceffa156a8cd334d7 | 593 | # This file is autogenerated. Instead of editing this file, please use the
# migrations feature of ActiveRecord to incrementally modify your database, and
# then regenerate this schema definition.
ActiveRecord::Schema.define(:version => 2) do
create_table "categorias", :force => true do |t|
t.column "nombre", :... | 28.238095 | 79 | 0.699831 |
bfccc4105aedb12470fe4ca8bd008d516c2873a6 | 149 | require "mediaarts_scraper"
require "json"
require_relative "common"
open(CORRECT_ANSWER_PATH, "w") do |f|
f.puts JSON.pretty_generate(check)
end
| 18.625 | 37 | 0.778523 |
e9cb137d42f5713756986d7193f2662a2ad3381a | 4,205 | require "pathname"
require "tempfile"
require "rtesseract/errors"
require "rtesseract/mixed"
class RTesseract
VERSION = '0.0.9'
attr_accessor :options
attr_writer :lang
attr_writer :psm
attr_reader :processor
def initialize(src = "", options = {})
@uid = options.delete(:uid) || nil
@sou... | 24.590643 | 105 | 0.61308 |
3996b92bb06f47ff6405610c46a720d5aa5922e0 | 1,358 | # frozen_string_literal: true
require "rails_helper"
describe "Sign up", type: :system do
before do
driven_by(:selenium)
end
before(:each) do
visit "/users/sign_up"
end
it "should not sign-up when no credentials" do
click_button "Sign up"
expect(page).to have_text("Email can't be blank")
... | 24.690909 | 80 | 0.675994 |
87b8b3ca9f92cf13613621f7cef50166abbd4046 | 777 | # frozen_string_literal: true
module Stripe
class Order < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save
OBJECT_NAME = "order".freeze
custom_method :pay, http_verb: :post
custom_method :return_order, http_verb: :post, ... | 22.2 | 71 | 0.669241 |
1a1ed3829ff1d921f21a7bc7a3afe6c4d83a9c5e | 195 | require 'itamae-mitsurin/version'
require 'itamae-mitsurin/mitsurin/cli'
require 'itamae-mitsurin/mitsurin/creators'
require 'aws-sdk'
module ItamaeMitsurin
module Mitsurin
# TODO
end
end
| 17.727273 | 43 | 0.789744 |
1dca890f9c7cde14a4b01cd2e6f01c2a4d4b5115 | 16,021 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2017_10_01
#
# A service client - single point of access to the REST API.
#
class NetworkManagementClient < MsRestAzur... | 41.721354 | 154 | 0.730416 |
62506741836cf425415ab3bdf274c652e9d13acb | 1,163 | # -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = "net-dns"
s.version = "0.8.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Marco Ceresa", "Simone Carletti"]
s.date = "2013-05-08"
s.description = "Net::DNS is a pure R... | 34.205882 | 105 | 0.638865 |
1141a14e9371b8d880d0a5f26a4a11823b405cc9 | 615 | # Definition for a binary tree node.
# class TreeNode
# attr_accessor :val, :left, :right
# def initialize(val)
# @val = val
# @left, @right = nil, nil
# end
# end
# @param {TreeNode} root
# @return {Integer}
def diameter_of_binary_tree(root)
return 0 if root.nil?
def height_of_btree(tr... | 27.954545 | 86 | 0.692683 |
019261d8a5df0c71d2a93ea77abf339caaa9a3aa | 389 | require_relative 'solver'
require_relative 'utils/tree'
class Day06 < Solver
def get_data
File.read(file_name).split
end
def tree
@tree ||= Tree.new(data, edge_separator=')')
end
def names
@test_data ? %w(L D) : %w(YOU SAN)
end
def run_one
tree.nodes.values.map(&:number_of_ancestors).s... | 14.961538 | 52 | 0.673522 |
8767ddbaa62702a9dccf441b61e4d317de85d104 | 2,328 | # 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... | 32.788732 | 96 | 0.590206 |
335ccab83e7394d9ac5e2ba7b847157efab9adfd | 1,236 | # 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
#... | 35.314286 | 86 | 0.7411 |
6148494fb3f19ea3ade4f3e9de1192fcb704098b | 810 | # frozen_string_literal: true
module Const
GITHUB_PHRASEAPP_PR_TITLE = '[PhraseApp] Update locales'
GITHUB_PHRASEAPP_PR_BODY = 'Update locales from PhraseApp'
GIT_PHRASEAPP_COMMIT_MSG = '[skip ci] Update translations from PhraseApp'
GIT_PHRASEAPP_BRANCH_BASE = 'master'
PHRASEAPP_PROJECT_ID = '9036e89959d471e... | 27.931034 | 75 | 0.701235 |
38bbddefb42fbaf1bffef28839ac02cec776a908 | 455 | # Time complexity: O(n)
# Space Complexity: O(n)
def newman_conway(num)
raise ArgumentError if num < 1
sequence = []
n = 1
while n <= num
sequence.push(get_newman_num(n))
n += 1
end
return sequence.join(" ")
end
def get_newman_num(num)
if num < 3
return 1
else
num = get_newman_num(get_... | 19.782609 | 97 | 0.617582 |
abb181cf49898f88e50ed9d0b202cb3678b05f01 | 939 | $:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "blogo/version"
require 'blogo/constants'
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "blogo"
s.version = Blogo::VERSION
s.authors = ["Sergey Potapov"]
s.email ... | 34.777778 | 139 | 0.664537 |
1dde93aea33b949851fc29528514be12e5561950 | 446 | # frozen_string_literal: true
module Metanorma; module Document; module Devel; module ClassGen; class Generator
# Generates Ruby files for DataTypes
class DataType < Generator
def generate_part
module_block([::Class, @item.name, :"Core::Node::DataType"]) do
# For the current understanding, DataTy... | 31.857143 | 81 | 0.70852 |
ab0ed39e990bcd06c8445082293a97904be3ab16 | 83 | module TokyoMetro::Modules::ToFactory::Api::Convert::Customize::TrainTimetable
end
| 27.666667 | 78 | 0.819277 |
7a4356d181f781087929de12703a0a17de36b33f | 1,562 | module QBIntegration
class CreditMemo < Base
attr_accessor :flowlink_credit_memo
def initialize(message = {}, config)
super
@flowlink_credit_memo = payload[:credit_memo] ? payload[:credit_memo] : {}
end
def create
if credit_memo = credit_memo_service.find_by_number(@flowlink_credit... | 38.097561 | 159 | 0.711268 |
285327c0fd15e8019d2d86d3ea10ae5896c87e8a | 3,913 | require 'spec_helper'
describe Spree::Api::ShipmentsController do
render_views
let!(:shipment) { create(:shipment) }
let!(:attributes) { [:id, :tracking, :number, :cost, :shipped_at, :stock_location_name, :order_id, :shipping_rates, :shipping_methods] }
before do
stub_authentication!
end
let!(:resour... | 32.608333 | 138 | 0.646307 |
ed62a08181ccd71950b24bd9cf62bff962258ab5 | 145 | class AddClassificaToSenders < ActiveRecord::Migration[5.2]
def change
add_column :senders, :classifica, :boolean, default: true
end
end
| 24.166667 | 61 | 0.758621 |
1a990394cd3378db2c2e422f054f49273d4dc77e | 266 | class SurplusMeter < Cask
url 'http://www.skoobysoft.com/downloads/SurplusMeterv203.dmg'
homepage 'http://www.skoobysoft.com/utilities/utilities.html#surplusmeter'
version '2.0.3'
sha1 '737fea8d51f1879f85ba65d4081808e023234445'
link 'SurplusMeter.app'
end
| 33.25 | 76 | 0.789474 |
878deefcc2396cca205bfc0d6dad0564fb6a457e | 534 | package 'nginx' do
action :install
end
service 'nginx.service' do
supports :status => true, :restart => true, :reload => true
action [ :enable, :start ]
end
cookbook_file '/opt/edit_nginx_config.rb' do
source 'nginx.rb'
owner 'root'
group 'root'
mode '755'
end
execute "edit nginx config" do
comma... | 19.071429 | 94 | 0.700375 |
e9ca1fdf2c758c33957389db9650e65d93117480 | 279 | class Freezer < Cask
version 'latest'
sha256 :no_check
url 'http://download.mrgeckosmedia.com/Freezer.zip'
appcast 'https://mrgeckosmedia.com/applications/appcast/Freezer'
homepage 'https://mrgeckosmedia.com/applications/info/Freezer'
app 'Freezer/Freezer.app'
end
| 25.363636 | 66 | 0.763441 |
33dc42d6614fb5e71e1bbf3ab088ac8280cc71ff | 1,374 | class Benthos < Formula
desc "Stream processor for mundane tasks written in Go"
homepage "https://www.benthos.dev"
url "https://github.com/Jeffail/benthos/archive/v3.25.0.tar.gz"
sha256 "65c458bfba9a115c1898ca00968d24006ae23f033fc6ec7155bd7d18f11cd174"
license "MIT"
bottle do
cellar :any_skip_relocatio... | 28.040816 | 94 | 0.686317 |
18d36d643f813de00cc6bdf998183638330cef2e | 509 | RSpec.describe Field do
include_context "shared api instance"
it "can list" do
fields = cm.field.list
first_result = fields.first
expect(fields.count).to be > 1
expect(first_result['TrimType']).to eq('FieldDefinition')
expect(first_result).to include('Uri' => a_kind_of(Integer))
end
it "c... | 24.238095 | 64 | 0.701375 |
e9da30c70ca12e2d95a0c90aa9d2a940d9d4ed4f | 3,327 | # frozen_string_literal: true
# Adapted from https://github.com/eric/metriks-graphite/blob/master/lib/metriks/reporter/graphite.rb
require 'metriks'
module Dyndnsd
class TextfileReporter
# @return [String]
attr_reader :file
# @param file [String]
# @param options [Hash{Symbol => Object}]
def i... | 26.616 | 100 | 0.532011 |
ed81cc9e7f629c7d69b3ff7704b857a98bc8778e | 658 | require_relative "models/base"
require_relative "models/course"
require_relative "models/course_configuration"
require_relative "models/course_import"
require_relative "models/destination"
require_relative "models/dispatch"
require_relative "models/dispatch_registration_count"
require_relative "models/dispatch_zip"
req... | 41.125 | 58 | 0.886018 |
336573270abe20922de585fb299830513ea0cfa3 | 65 | User.create([{name:'admin',email:'twang33@ncsu.edu', role_id:3}]) | 65 | 65 | 0.707692 |
5d16526c7faefe9a56b137912f4c8f6d713abdd8 | 1,389 | require 'set'
module NewRelic
module Binding
class Metric
attr_reader :component, :name, :value, :count, :min, :max, :sum_of_squares
def initialize(component, name, input_value, options = {} )
value = input_value.to_f
@component = component
@name = name
@value = value
... | 27.78 | 168 | 0.565875 |
088f2f6631428e48c0a526a40316a3a6f8bf986b | 1,578 | # frozen_string_literal: true
class UnauthorizedController < ActionController::Metal
include ActionController::UrlFor
include ActionController::Redirecting
include AbstractController::Rendering
include ActionController::Rendering
include ActionController::Renderers::All
include ActionController::Conditiona... | 31.56 | 106 | 0.712928 |
1a9cafddcdcb93a269120a68c9beb68f15a27d72 | 1,631 | require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
describe "Hash#default" do
it "returns the default value" do
h = new_hash 5
h.default.should == 5
h.default(4).should == 5
new_hash.default.should == nil
new_hash.default(4).should... | 29.125 | 91 | 0.664623 |
edde93c4c15fcb14beb7e230eee6dd4043b0ba4e | 1,046 | require "language/node"
class Heroku < Formula
desc "Command-line client for the cloud PaaS"
homepage "https://cli.heroku.com"
url "https://registry.npmjs.org/heroku-cli/-/heroku-cli-6.16.12.tgz"
sha256 "934395c3aa9ddfcd9ab4c160674e32019234bc87a1376da7e5a921c6651031b8"
head "https://github.com/heroku/cli.git... | 32.6875 | 93 | 0.736138 |
ffc2f4480166a02dfcc7f92f72945352520981c6 | 313 | class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
before_action :authenticate_user!
before_action :configure_permitted_parameters, if: :devise_controller?
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: [:name])
end
end
| 31.3 | 72 | 0.821086 |
b99af4d47ba03343a78e29a1acba8f5aecdeac1e | 9,057 | require 'fileutils'
require 'rdoc/generator'
require 'rdoc/markup/to_html'
##
# We're responsible for generating all the HTML files from the object tree
# defined in code_objects.rb. We generate:
#
# [files] an html file for each input file given. These
# input files appear as objects of class
# ... | 24.412399 | 77 | 0.63796 |
e807bb4d775c807989a1efffcbbe6f8a4118d12b | 466 | require "smart_answer_flows/shared/redundancy_pay_flow"
module SmartAnswer
class CalculateEmployeeRedundancyPayFlow < Flow
def define
start_page_content_id "a5b52037-1712-4544-a3d1-a352ce8a8287"
flow_content_id "04cbc84c-ad73-4f49-b5a0-ba4906b37e3b"
name "calculate-employee-redundancy-pay"
... | 27.411765 | 66 | 0.766094 |
3346b5c21ba98cad9f64d5645658d1b23f0834e1 | 1,285 | require './lib/random_quoter.rb'
class CommandWatcher
def self.parse(text)
args = text.split(' ')
if args[0].include?('/start')
<<-MESSAGE
Hello, nice yo meet you!
- ask me for a quote by typing /quote
- type /help whenever you are confused
- type /info if you want to find out more
:)
MESSAGE
... | 30.595238 | 155 | 0.684047 |
7acd79e0ea8ee3e9bad74a9db979c56c3c7cf400 | 1,248 | class DeviseCreateDanvanthiriCorePatients < ActiveRecord::Migration
def change
create_table(:danvanthiri_core_patients) do |t|
## Database authenticatable
t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""
## Recoverable
t.s... | 26.553191 | 77 | 0.657853 |
396e8f5080a783bdba7f0931a3bd99a8f9fedf6b | 2,847 | # This file is copied to spec/ when you run 'rails generate rspec:install'
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rail... | 45.190476 | 86 | 0.752722 |
7a5b9684dff18c3a3d79f84daab1ec37e8a2d7f9 | 2,152 | Rails.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 web serv... | 37.103448 | 85 | 0.765335 |
7a235af649f59ad47af64832d610a0156c679f39 | 4,566 | require 'spec_helper'
describe 'vswitch::ovs' do
let :default_params do {
:package_ensure => 'present',
:dkms_ensure => true,
}
end
let :redhat_platform_params do {
:ovs_package_name => 'openvswitch',
:ovs_service_name => 'openvswitch',
:provider => 'ovs_redhat',... | 25.651685 | 99 | 0.626369 |
610b3fb102b4988bc5d82b0eb46719174421c15e | 1,464 | # NOTE: the rspec should be test alonely.
describe WeixinAuthorize::Client do
describe "#get access_token" do
it "return a access_token nil value before authenticate" do
expect($client.access_token).to eq(nil)
end
it "appid and appsecret shoud be valid" do
valid_info = $client.is_valid?
... | 33.272727 | 83 | 0.703552 |
fff71b2fb4a161b764e829b25d7690505d347e22 | 6,691 | =begin
#Selling Partner API for Fulfillment Inbound
#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network.
OpenAPI spec version: v0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Co... | 30.834101 | 237 | 0.630548 |
f85e96bd8722a0e41b026c672b2e7e6a3553e659 | 357 | class CreateDoctors < ActiveRecord::Migration
def self.up
create_table :doctors do |t|
t.column :name, :string
t.column :in_network, :boolean
t.column :address, :string
t.column :copay, :integer
t.column :comments, :text
t.column :specialty, :string
end
end
def self.do... | 21 | 45 | 0.647059 |
ab36d82fabc6685f2b34e92afe6bd2f870fd1f67 | 517 | # frozen_string_literal: true
class Brokers::SessionsController < Devise::SessionsController
before_action :configure_sign_in_params, only: [:create]
# GET /resource/sign_in
def new
super
end
# POST /resource/sign_in
def create
super
end
# DELETE /resource/sign_out
def destroy
super
... | 18.464286 | 69 | 0.73501 |
f820256ba7e2311f916f72c829b91f81ba81971f | 54 | module HerokuSsl
module ApplicationHelper
end
end
| 10.8 | 26 | 0.814815 |
ed1e0e5b720f59501004365312e931773889153f | 3,599 | # -*- encoding: utf-8 -*-
# stub: eventmachine 1.2.6 ruby lib
# stub: ext/extconf.rb ext/fastfilereader/extconf.rb
Gem::Specification.new do |s|
s.name = "eventmachine".freeze
s.version = "1.2.6"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.r... | 81.795455 | 781 | 0.729369 |
33f5491450749233d1e3389a64e0dd16b732c494 | 479 | # WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::Batch
class Resource
# @param options ({})
# @option options [Client] :client
def in... | 19.16 | 74 | 0.665971 |
d5080ad0e5a8fdbecb8dd9ebf2a542d78553b635 | 964 | Pod::Spec.new do |s|
s.name = "QCButton" # 项目名称
s.version = "0.0.2" # 版本号 与 你仓库的 标签号 对应
s.license = "MIT" # 开源证书
s.license = { :type => "MIT", :file => "FILE_LICENSE" }
s.summary = "这是一个可以调整Button图片显示方向的SDK" # 项目简介
s.description = <<-DESC
... | 43.818182 | 114 | 0.56639 |
abb17c5494bea2d1708681ed5367738571cad7a6 | 1,519 | =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... | 30.38 | 107 | 0.750494 |
91d1f236bfe244471415e8b6544e36e47d65a5fa | 2,001 | #-- 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,... | 34.5 | 94 | 0.67916 |
18f66fe2e721e247a114150c1a7f442e5032befc | 4,798 | # encoding: UTF-8
# frozen_string_literal: true
require_dependency 'authorization/bearer'
class ApplicationController < ActionController::Base
include Authorization::Bearer
extend Memoist
helper_method :current_user, :is_admin?, :current_market, :gon
before_action :set_language, :set_gon
private
def cu... | 30.367089 | 105 | 0.642559 |
393cb73ffcbe9f471c12155c2c0f364a9a1859ff | 142 | class UserMailer < ApplicationMailer
def reset_password(user)
@user = user
mail to: user.email, subject: 'Password reset'
end
end
| 20.285714 | 50 | 0.71831 |
1a94c4577148614223fc20d7181ab381bcfee874 | 1,999 | require 'spec_helper'
describe User do
it { should validate_presence_of(:email) }
it { should validate_presence_of(:password) }
it 'is valid' do
user = FactoryGirl.build(:user)
expect(user).to be_valid
end
it 'is saved' do
user = FactoryGirl.create(:user)
expect(user).to be_persisted
end
... | 24.378049 | 64 | 0.66033 |
114d99843554f865926bcb26916c9ef248ba9e8d | 69 | # current version of gem
module Auth0
VERSION = '5.5.0'.freeze
end
| 13.8 | 26 | 0.710145 |
03fd6d8ad50b2ae4aef876346f5378217e21531d | 338 | require 'spec_helper'
describe "Fetches" do
it "bundler" do
Dir.mktmpdir do |dir|
Dir.chdir(dir) do
fetcher = LanguagePack::Fetcher.new(LanguagePack::Base::VENDOR_URL)
fetcher.fetch_untar("#{LanguagePack::Ruby::BUNDLER_GEM_PATH}.tgz")
expect(`ls bin`).to match("bundle")
end
... | 21.125 | 75 | 0.647929 |
1a0ec0b8d4abba4ba436b6b071f712596c4c771d | 2,409 | # encoding: UTF-8
require File.expand_path("helper", File.dirname(__FILE__))
require "lint/strings"
class TestCommandsOnStrings < Test::Unit::TestCase
include Helper::Client
include Lint::Strings
def test_mget
r.set("foo", "s1")
r.set("bar", "s2")
assert_equal ["s1", "s2"] , r.mget("foo", "ba... | 24.09 | 67 | 0.575342 |
212653224e9f77de89f07d39d55b180a9a9e78d6 | 156 | # encoding: utf-8
require 'spec/expectations'
require 'cucumber/formatter/unicode'
$:.unshift(File.dirname(__FILE__) + '/../../lib')
require 'kalkulator'
| 22.285714 | 50 | 0.717949 |
33705eb12b6ccd6b4f286f168243e62a625bd117 | 1,444 | class InvalidHerokuGovernatorConfigError < StandardError
def initialize(msg)
super
end
end
module HerokuJobGovernator
class Config
attr_accessor :queue_adapter, :workers, :default_worker
REQUIRED_SETTINGS = %i[queue_adapter workers default_worker].freeze
REQUIRED_WORKER_SETTINGS = %i[workers_min ... | 30.083333 | 108 | 0.702216 |
625baefe6b288579035a94aa934458511ec0ff6c | 367 | require_relative "test_helper"
describe "CHANGELOG" do
it "should have an entry for the current version" do
changelog_contents = File.read(File.expand_path("../CHANGELOG.md", __dir__))
assert_match(
/^#+\s*#{Regexp.escape(Slimmer::VERSION)}/,
changelog_contents,
"No entry for #{Slimmer::VE... | 26.214286 | 80 | 0.683924 |
1cdf6bc89cab1a6081e64359bfe4f1c04ce6fa62 | 1,451 | # frozen_string_literal: true
Encoding.default_external = 'UTF-8'
require_relative '../lib/gitlab'
require_relative '../lib/gitlab/utils'
require_relative '../config/initializers/0_inject_enterprise_edition_module'
require_relative 'lib/gitlab'
require_relative '../config/bundler_setup'
Bundler.require(:default)
m... | 24.59322 | 76 | 0.604411 |
ffc72cebaa6caf52fa80b41790c1680a8c9e4206 | 136 | class AddCustombbfeeToInstances < ActiveRecord::Migration[5.0]
def change
add_column :instances, :custom_bb_fee, :float
end
end
| 22.666667 | 62 | 0.772059 |
e857f931a065460f4561e6b3f677cb8dbb4eb124 | 1,261 | # frozen_string_literal
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../config/environment', __dir__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
require 'rspec/rails'
begin
Act... | 31.525 | 86 | 0.746233 |
3974e7d4ebb69e9976a55d7b05813a1cfd363a60 | 215 | class AddIndicesToSipityAdditionalAttributes < ActiveRecord::Migration[4.2]
def change
add_index :sipity_additional_attributes, :work_id
add_index :sipity_additional_attributes, [:work_id, :key]
end
end
| 30.714286 | 75 | 0.8 |
ab41e7095759002f63eb10c85f4ad23ae0b51eea | 2,315 | module Intrigue
module Task
class WordpressEnumeratePlugins < BaseTask
def self.metadata
{
:name => "wordpress_enumerate_plugins",
:pretty_name => "Wordpress Enumerate Plugins",
:authors => ["jcran"],
:description => "If the target's running Wordpress, this'll enumerate the plugins",
... | 28.580247 | 118 | 0.63067 |
5d44ba6e697d0a4d3bd93f98345d3fc8926d08b5 | 4,021 | module Doorkeeper
module AccessTokenMixin
extend ActiveSupport::Concern
include OAuth::Helpers
include Models::Expirable
include Models::Revocable
include Models::Accessible
include Models::Scopes
included do
belongs_to :application,
class_name: 'Doorkeeper::Applic... | 29.785185 | 99 | 0.621736 |
0357032c671b92022411adceba89b8ad87c427b6 | 7,899 | require 'download_utils'
RSpec.describe ActiveStorage::Service::CloudinaryService do
let(:subject) { ActiveStorage::Service::CloudinaryService.new(config) }
let(:key) { 'some-resource-key' }
let(:file) { double }
let(:download_util) { double }
let(:checksum) { 'zyxddfs' }
let(:config) do
{
cloud... | 28.11032 | 82 | 0.644639 |
ab50d40cf44265e21bcede8de1fdb86cdffce2cf | 428 | ENV['RACK_ENV'] = 'test'
require 'minitest/autorun'
require 'minitest/color'
require 'rack/test'
require 'sequel'
require 'sinatra'
DB = Sequel.connect(
adapter: 'postgres',
database: 'vocational-test_test',
host: 'testdb',
user: 'unicorn',
password: 'magic')
class Minitest::HooksSpec
def around
DB... | 23.777778 | 68 | 0.71028 |
182c566df9c5faaf23b473aee55c06dacc113f17 | 116 | class AddModeToCategory < ActiveRecord::Migration
def change
add_column :categories, :mode, :string
end
end
| 19.333333 | 49 | 0.758621 |
e21b7549b3c01685c32bf0f8df70ee5908b3b0b8 | 1,232 | # 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... | 36.235294 | 74 | 0.778409 |
e871f14255e72847cf488f6801d0641380ab782f | 614 | require "rails_helper"
RSpec.describe Section do
[:name, :description, :image, :item_id, :order, :caption, :showcase, :item, :updated_at, :created_at].each do |field|
it "has the field #{field}" do
expect(subject).to respond_to(field)
expect(subject).to respond_to("#{field}=")
end
end
[:show... | 27.909091 | 119 | 0.684039 |
39068027ee454aeba50cbed7fa5a6dbd8e0467a8 | 46 | module PlaybillGemCli
VERSION = "0.1.0"
end
| 11.5 | 21 | 0.717391 |
621e8543e15a6658c3a929d787413b56e9908172 | 7,650 | =begin
PureCloud Platform API
With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.
OpenAPI spec version: v2
Contact: DeveloperEvangelists@genesys.com
Generated by: https://github.com/swagger-ap... | 22.904192 | 177 | 0.56183 |
037ba013c9a7fb107ba1fd607418f580e6f1e9c5 | 2,516 | require File.dirname(__FILE__) + '/test_helper'
class MyHighlightingObject
include Widgets::Highlightable
end
class HighlightableTest < Test::Unit::TestCase
EXPECTED_INSTANCE_METHODS = %w{highlights highlights= highlighted? highlights_on}
def setup
@obj = MyHighlightingObject.new
end... | 33.105263 | 107 | 0.662957 |
d56b21bebc3f50b5e205ae0eca410159515368f9 | 1,748 | # frozen_string_literal: true
require("config")
require("data_structures/linked_list")
require("ctci/ctci_c2_p6")
module CTCI
module C2
class TestP6 < Minitest::Test
LinkedList = DataStructures::LinkedList.dup.class_exec {
include(P6)
}
def setup
@list = LinkedList.new
... | 23 | 70 | 0.597826 |
218c168767e63f81e935a5aaba603b53d0e7a2e3 | 1,932 | require 'set'
require 'warp/dir/errors'
require 'warp/dir/formatter'
require 'singleton'
module Warp
module Dir
class Commander
include Singleton
attr_reader :commands
attr_accessor :command_map
def initialize
@commands ||= Set.new # a pre-caution, normally it would already by de... | 26.833333 | 104 | 0.600932 |
b9b171b01b86c83bfe209ff3fd560b363aeb8f94 | 402 | ENV['RAILS_ENV'] ||= 'testrailrali'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require "minitest/reporters"
Minitest::Reporters.use!
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
include A... | 28.714286 | 82 | 0.758706 |
1d45b20513f6300a11a946127cc1cf8d64d59494 | 5,502 | require "banter/errors"
require "banter/query"
require "thread_safe"
module Banter
class Channel
attr_reader :name, :prefix
alias_method :to_s, :name
alias_method :to_str, :to_s
# Public: Initializes the channel.
#
# name - The channel name String.
# network - The Banter::Network.
... | 27.373134 | 81 | 0.594511 |
3837a6775c38105d2f19d1e3612f27ade0a2f251 | 2,007 | =begin
#DPN API
#Digital Preservation Network
OpenAPI spec version: 2.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
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://... | 27.875 | 103 | 0.742402 |
d5a79ad72d827900667c1269fb5790f6214a2668 | 3,071 | # frozen_string_literal: true
module SCA
class LicenseCompliance
include ::Gitlab::Utils::StrongMemoize
SORT_DIRECTION = {
asc: -> (items) { items },
desc: -> (items) { items.reverse }
}.with_indifferent_access
def initialize(project, pipeline)
@project = project
@pipeline =... | 30.71 | 101 | 0.69326 |
d5bfddb99b1744e70d070d623604d72d7c880fe9 | 395 | class UserPolicy < ApplicationPolicy
def lockable?
return false unless role = user.person && user.person.hbx_staff_role
return false unless role.permission
role.permission.can_lock_unlock
end
def reset_password?
return false unless role = user.person && user.person.hbx_staff_role
return fals... | 24.6875 | 72 | 0.764557 |
210e36558799fa8e51b40b392ac56489f764f098 | 504 | process_is_foreground do
with_feature :readline do
require 'readline'
describe "Readline.completion_append_character" do
it "returns not nil" do
Readline.completion_append_character.should_not be_nil
end
end
describe "Readline.completion_append_character=" do
it "returns th... | 26.526316 | 62 | 0.718254 |
28ddc6138cb9616de7784f8f328b90c566e377d6 | 204 | require "gds_api/content_store"
module Services
def self.content_store
@content_store ||= GdsApi::ContentStore.new(
Plek.new.find("content-store"),
disable_cache: true,
)
end
end
| 18.545455 | 48 | 0.691176 |
7a1594c792ef785793739418746c0324238443f0 | 111 | module Spina
module AttachmentsHelper
def file_url(file)
main_app.url_for(file)
end
end
end | 12.333333 | 28 | 0.693694 |
38b960b3bde35f76387833f57183e62a6f3e1d7a | 2,208 | #-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork ... | 38.068966 | 91 | 0.713768 |
628d4e2b6637ae63cdb9a36b8fecd175653b9971 | 2,603 | module Fog
module Storage
class InternetArchive
class Real
# Get headers for an object from S3
#
# @param bucket_name [String] Name of bucket to read from
# @param object_name [String] Name of object to read
# @param options [Hash]:
# @option options [String]... | 41.983871 | 163 | 0.605839 |
e28a9878acdde5deae0e2ac40f8d211d0c2960df | 1,341 | module PDF
module Core
class DocumentState #:nodoc:
alias __initialize initialize
def initialize(options)
normalize_metadata(options)
if options[:template]
@store =
if options[:print_scaling]
PDF::Core::ObjectStore.new(
template: opt... | 29.8 | 70 | 0.539896 |
e90175fc9d3406540d1e3efda6364cf55c6cd979 | 3,522 | # This is a parser based on the "Handling Bounced Email" section of the "Rails Recipes" book.
# Not all e-mail servers follow RFC-1892 perfectly (i.e. some don't include the original message,
# some show the original message header inline rather than as a separate part of content, etc.)
#
# This module is designed to... | 40.022727 | 132 | 0.614708 |
e2a277ef0dd2d19e79e242299f6084640912a508 | 63 | class Account::Revenue < Account
ACCOUNT_TYPE = :revenue
end
| 15.75 | 32 | 0.761905 |
1db8ecb1fd8dfb2e682b073c45a296d3b3b02e52 | 504 | # Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary atta... | 63 | 178 | 0.835317 |
ffcc7ae5b403c216393c097bef32ec8f7a2f2157 | 27,799 | #
# Author:: Adam Jacob (<adam@opscode.com>)
# Author:: Christopher Walters (<cw@opscode.com>)
# Author:: Tim Hinderliter (<tim@opscode.com>)
# Author:: Seth Chisamore (<schisamo@opscode.com>)
# Copyright:: Copyright (c) 2008-2011 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache Licen... | 38.080822 | 128 | 0.705133 |
ab2eee9e1600e95c3862a0274848c6eba8731d74 | 2,193 | Rails.application.routes.draw do
get 'home/me'
resources :subscriptions
resources :stories do
member do
post 'approve'
post 'unapprove'
end
end
resources :letters
get '/subscribe', to: 'subscriptions#new', as: :subscribe
get '/logout', to: 'sessions#destroy', as: :logout
get '/login', to: '... | 27.4125 | 84 | 0.649339 |
281fac0387537851b8fd237892c35e2d5507559a | 467 | require 'spec_helper'
provider_class = Puppet::Type.type(:postgres_version).provider(:v1)
describe provider_class do
context 'postgres_version operations' do
it 'lists postgres_version instances' do
VCR.use_cassette('postgres_version_list') do
instances = provider_class.instances
expect(in... | 29.1875 | 92 | 0.736617 |
bf9dcdb3bf22bbfa97017693d52d4b6c312e197f | 169 | cask :v1 => 'radi' do
version :latest
sha256 :no_check
url 'http://radiapp.com/Radi.zip'
homepage 'http://radiapp.com/'
license :closed
app 'Radi.app'
end
| 15.363636 | 35 | 0.656805 |
33bc73d42e399b57737d1382ae92de08110fe469 | 36 | module Gcal
VERSION = "0.0.3"
end
| 9 | 19 | 0.638889 |
91cae1c61f76fdb266d87d2dd3970099483810d9 | 135 | module Fog
module Compute
class Ecloud
class Real
basic_request :get_physical_device
end
end
end
end
| 11.25 | 42 | 0.637037 |
790dd67e87881fa24bc249723d96bcd6ec56490d | 116 | class MyPoroAddress2
include ActiveModel::Model
attr_accessor :zipcode
validates_correios_cep_of :zipcode
end
| 19.333333 | 36 | 0.836207 |
bb4350728d211cba79c7036422f929defa32a057 | 59,693 | require 'hashie'
module Plaid
module Models
# Internal: Base model for all other models.
class BaseModel < Hashie::Dash
include Hashie::Extensions::Dash::IndifferentAccess
include Hashie::Extensions::Dash::Coercion
@ignored_properties = []
def self.property_ignored?(property)
... | 26.998191 | 80 | 0.616756 |
bfeeb0e15ea12f449c0af88bc70c30e31cfac44e | 1,278 |
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "png/version"
Gem::Specification.new do |spec|
spec.name = "libpng-ruby"
spec.version = PNG::VERSION
spec.authors = ["Hiroshi Kuwagata"]
spec.email = ["kgt9221@gmail.com"]
... | 31.170732 | 74 | 0.63615 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.