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 |
|---|---|---|---|---|---|
e85c56a7156486e77e1f478579c166897eb3e397 | 1,728 | require "spec_helper"
describe Endpoints::Heroku::Resources do
include Rack::Test::Methods
def app
Endpoints::Heroku::Resources
end
before do
authorize ENV['HEROKU_USERNAME'], ENV['HEROKU_PASSWORD']
header "Content-Type", "application/json"
end
describe "POST /heroku/resources" do
let(:r... | 28.8 | 98 | 0.679398 |
7a62df3c823d88a79496d0b267b926c7d9506ac2 | 2,662 | # frozen_string_literal: true
class SeasonHash < BaseHash
class << self
def already_created
Dir.glob(FixtureDataTask::SEASONS_PATH)
.map { |path| YAMLFile.open(path).merge(file_path: path) }
.sort_by(&:fixture_no)
end
def on_air
target_titles = YAMLFile.open(FixtureDataTask::... | 29.577778 | 119 | 0.74568 |
bf23c7c3857aaaff070801c5b486421c5335bb2c | 5,235 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2018_11_01
module Models
#
# Outbound pool of the load balancer.
#
class OutboundRule < SubResource
i... | 32.515528 | 79 | 0.50277 |
39450ad1eb18470b14cdf42bc2de5d3c26329f07 | 2,159 | require 'spec_helper'
RSpec.describe 'Abucoins integration specs' do
let(:client) { Cryptoexchange::Client.new }
let(:btc_usd_pair) { Cryptoexchange::Models::MarketPair.new(base: 'btc', target: 'usd', market: 'abucoins') }
let(:eth_btc_pair) { Cryptoexchange::Models::MarketPair.new(base: 'ETH', target: 'BTC', ma... | 32.712121 | 111 | 0.709588 |
0334a40e6bdf3c2a9d094b90e798dff88fc21003 | 1,299 | #
# Be sure to run `pod lib lint ActionClosurable.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 = "Act... | 40.59375 | 108 | 0.676674 |
1d48d23c30828a3e577088997c84c730f1af1479 | 3,553 | class TagsController < ApplicationController
before_action { authorize! }
responders :flash
layout 'assignment_content'
def index
@assignment = Assignment.find_by(id: params[:assignment_id])
respond_to do |format|
format.html
format.json do
parent = @assignment || current_course
... | 27.757813 | 119 | 0.639741 |
113664835fa3b8896feebaf2f0ef18ccd1eb6fdc | 665 | require 'rails_helper'
describe 'BiocurationClassifications', type: :feature do
# !! This should act more or less the same as AlternateValue features,
context 'resource routes' do
# before {
# sign_in_user_and_select_project
# }
# The scenario for creating biocuration classifications is in p... | 25.576923 | 134 | 0.711278 |
5dfce17609a17c2f10764507abd62bb0f8b5e8d7 | 780 | RSpec.describe ActiveStatus::Configuration do
let(:config) { described_class.new }
describe '#verbose' do
it 'is false by default' do
expect(config.verbose).to be(false)
end
end
describe '#error_code' do
it 'is 503 by default' do
expect(config.error_code).to be(503)
end
end
de... | 20.526316 | 55 | 0.633333 |
e96251846bab06324f593ee424d019aad98da571 | 1,672 | name 'chef-client'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@chef.io'
license 'Apache-2.0'
description 'Manages client.rb configuration and chef-client service'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '11.0.5'
re... | 53.935484 | 130 | 0.75 |
d533972fe75f2fda1478674b7f4d0c4a78b57cd2 | 99 | class VisitorsController < ApplicationController
def index
@products = Product.all
end
end
| 16.5 | 48 | 0.767677 |
e238c74a4119fbb9d205efdc0d750cdc6c3b6a33 | 866 | cask "iina-plus" do
version "0.5.25,21121217"
sha256 "ab870d939856f93c8524a8e54c3ae33afa5bb5d696f95e6a6e7a9bdca7648ddc"
url "https://github.com/xjbeta/iina-plus/releases/download/#{version.csv.first}(#{version.csv.second})/iina+.#{version.csv.first}.dmg"
name "IINA+"
desc "Extra danmaku support for iina (iin... | 29.862069 | 136 | 0.669746 |
399e14e59d860ea015d9bfc2f11547c2d22ad03b | 282 | require_relative 'node'
class LinkedList
attr_reader :head
def initialize
@head = nil
end
def add_first(value)
end
def get_first
end
def length
return 0
end
def add_last(value)
end
def get_last
end
def get_at_index(index)
end
end
| 8.057143 | 25 | 0.659574 |
e98a929b3abebd37eaa98aaca0e3a6ccba6b90f0 | 1,474 | require 'io/console'
module MovementInDungeon
def movement_loop
# state = `stty -g`
# `stty raw -echo -icanon isig`
while true
c = read_char
@last_pos = @current_pos.clone
unless @current_pos.move( c )
if c == 'k'
kill_monsters
elsif c == 'd'
disar... | 21.676471 | 80 | 0.616689 |
e95c66156060fa3f2cff204f909c3d073796a520 | 17,582 | #
# File: XmlRuleVisitor.rb
#
# This class is used to visit XML guideline elements
#
#
require 'rexml/document'
require 'rexml/streamlistener'
require 'logger'
require 'xmlutils/xmlvisitor'
require 'xmlutils/gdltemplate'
#################################################
#
# class XmlRuleVisitor
#
###... | 24.939007 | 112 | 0.429985 |
7a7a2ad27bb5adc12c8edd7feb4f19644cb79594 | 48 | class UndergroundLines < ActiveRecord::Base
end
| 16 | 43 | 0.833333 |
331377de5583c6c2422b820725c7687b4012e0a5 | 4,606 | # frozen_string_literal: true
# This file was auto-generated by lib/tasks/web.rake
desc 'AdminUsersSession methods.'
command 'admin_users_session' do |g|
g.desc 'Clear user-specific session settings—the session duration and what happens when the client closes—for a list of users.'
g.long_desc %( Clear user-specifi... | 58.303797 | 188 | 0.732523 |
622dd203dc7dfb7fceb7ef587c7e2751ed7a6d53 | 812 | # frozen_string_literal: true
##
# Componentizes cards.
class CardComponent < ViewComponent::Base
include Mixins::UtilityMixins
CARD_CLASS_LIST = 'p-0 max-w-lg mx-auto my-4 bg-white dark:bg-gray-700 rounded-xl shadow-md items-center'
CARD_HEADER_CLASS_LIST = 'flex justify-between flex-row flex-wrap text-sm px-2... | 28 | 107 | 0.705665 |
ab365e7f3e8f3634353fc6f4803afb429555477a | 552 | module Notifications
class NotificationsController < Notifications::ApplicationController
def index
@notifications = current_user.notifications.includes(:actor).order('id desc').page(params[:page])
unread_ids = []
@notifications.each do |n|
unread_ids << n.id unless n.read?
end
... | 27.6 | 103 | 0.710145 |
21293679a7446ceab80f1a32a0273294b8e25a07 | 443 | require './config/environment'
class ApplicationController < Sinatra::Base
configure do
set :public_folder, 'public'
set :views, 'app/views'
enable :sessions
set :session_secret, "fwitter_secret"
end
get '/' do
erb :index
end
helpers do
def logged_in?
!!current_user
end... | 16.407407 | 80 | 0.65237 |
01b8036b8fbec9cd054fa72d1bf0a26902888c2f | 4,899 | require 'faker'
require 'factory_bot'
require 'csv'
namespace :drafts do
desc 'Load full draft into database'
task load_full: :environment do
draft = FactoryBot.build(:full_collection_draft)
found_draft = Draft.where(native_id: draft.native_id)
if found_draft.empty?
new_draft = FactoryBot.create... | 40.487603 | 186 | 0.571137 |
b9bc3e10820501dbdf39ce94bf4e3c73ed91548b | 3,814 | class Libmodplug < Formula
desc "Library from the Modplug-XMMS project"
homepage "https://modplug-xmms.sourceforge.io/"
url "https://downloads.sourceforge.net/project/modplug-xmms/libmodplug/0.8.9.0/libmodplug-0.8.9.0.tar.gz"
sha256 "457ca5a6c179656d66c01505c0d95fafaead4329b9dbaa0f997d00a3508ad9de"
livecheck... | 41.456522 | 140 | 0.658102 |
1cd1e112a69735ec9c95061c9b8963636b5ac1e9 | 749 | require 'logger'
module CfnVpn
module Log
def self.colors
@colors ||= {
ERROR: 31, # red
WARN: 33, # yellow
INFO: 0,
DEBUG: 32 # grenn
}
end
def self.logger
if @logger.nil?
@logger = Logger.new(STDOUT)
@logger.level = Logger::INFO
... | 19.205128 | 71 | 0.540721 |
f7ec86ad19bd18e196a8e3cd90af7793841ec8c5 | 464 | cask 'natron' do
version '2.3.15'
sha256 '9ac24bb154aea1d65813c2a8451237f02b77dd68a39619c91a671ab897eebde9'
# github.com/NatronGitHub/Natron/ was verified as official when first introduced to the cask
url "https://github.com/NatronGitHub/Natron/releases/download/v#{version}/Natron-#{version}-OSX-64.dmg"
appc... | 35.692308 | 105 | 0.771552 |
0820da148e9693b7662c74478516bf408518c409 | 291 | FactoryBot.define do
# Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them.
#
# Example adding this to your spec_helper will load these Factories for use:
# require 'spree_stalnoy_import_export/factories'
end
| 41.571429 | 130 | 0.797251 |
7a71c64472707cf4f915a158a981e74df391bf3b | 86 | RSpec.describe "13" do
it do
sleep 13 / 100.0
expect(13).to eq 13
end
end
| 12.285714 | 23 | 0.604651 |
4a991d0c71056b89fd6bbc64efc3a93ccb50736c | 1,058 | # 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... | 42.32 | 86 | 0.759924 |
b9947954290c3c45499cddaa2ee846b48b7dfd7e | 5,126 | #! /usr/bin/env ruby -S rspec
require 'spec_helper'
describe Puppet::Parser::AST::CaseStatement do
before :each do
@scope = Puppet::Parser::Scope.new
end
describe "when evaluating" do
before :each do
@test = stub 'test'
@test.stubs(:safeevaluate).with(@scope).returns("value")
@option... | 31.066667 | 107 | 0.617831 |
4aff75b3009c3c2be3117589fb31e44234ee7d57 | 164 | class CreateFreckles < ActiveRecord::Migration[6.0]
def change
create_table :freckles do |t|
t.integer :marker_id
t.timestamps
end
end
end
| 16.4 | 51 | 0.676829 |
91a404f7585a2bde9e7a728a42871052f2f3b3c6 | 773 | require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::Spec.new do |s|
s.name = "SnapchatLogin"
s.version = package["version"]
s.summary = package["description"]
s.description = <<-DESC
SnapchatLogin
DESC
s.homepage ... | 30.92 | 100 | 0.580854 |
f7a9285575f5fd1786d4bb9654fe7fce0136133d | 12,782 | # encoding: UTF-8
require 'csv'
module Sources
module Strategies
class Pixiv < Base
attr_reader :zip_url, :ugoira_frame_data, :ugoira_content_type
MONIKER = '(?:[a-zA-Z0-9_-]+)'
TIMESTAMP = '(?:[0-9]{4}/[0-9]{2}/[0-9]{2}/[0-9]{2}/[0-9]{2}/[0-9]{2})'
EXT = "(?:jpg|jpeg|png|gif)"
... | 32.858612 | 134 | 0.588171 |
03140dee52fb806623e7cb196903803aa8b0d5de | 414 | require 'spec_helper'
# docker package should be installed when a repository is enabled
describe package('docker-engine') do
it { should be_installed }
end
# docker package should be installed from the docker-experimental repo
describe command('apt-cache madison docker-engine') do
its(:stdout) { should contain('h... | 31.846154 | 72 | 0.758454 |
39a4911b443804c4cba5806bfaad8b284a0fc6f1 | 378 | T1, T2 = gets.chomp.split(" ").map(&:to_i)
A1, A2 = gets.chomp.split(" ").map(&:to_i)
B1, B2 = gets.chomp.split(" ").map(&:to_i)
R1 = A1 - B1
R2 = A2 - B2
DR1 = R1 * T1
DR2 = R2 * T2
DR = DR1 + DR2
if DR.zero?
puts "infinity"
exit
end
if DR1 * DR > 0
puts 0
exit
end
n, m = DR1.divmod(DR)
if m.zero?
puts 1 ... | 14.538462 | 42 | 0.544974 |
7a5c7a61ed31f6f2bac080d65be7eb741d62470f | 9,981 | # encoding: UTF-8
#
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
require_relative '../metadata'
require_relative 'metadata'
module GoodData
class Report < GoodDat... | 37.104089 | 179 | 0.661156 |
5defe0375c60302fbaf178436e39a41b375c612a | 1,316 | # -*- encoding: utf-8 -*-
# stub: formatador 0.2.5 ruby lib
Gem::Specification.new do |s|
s.name = "formatador".freeze
s.version = "0.2.5"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["geemus (Wes... | 34.631579 | 112 | 0.664134 |
d53126a0f5a54f6888e9e32f5cd74993a388f6a3 | 16,396 | Pod::Spec.new do |s|
s.name = "QMUIKit"
s.version = "4.4.2"
s.summary = "致力于提高项目 UI 开发效率的解决方案"
s.description = <<-DESC
QMUI iOS 是一个致力于提高项目 UI 开发效率的解决方案,其设计目的是用于辅助快速搭建一个具备基本设计还原效果的 iOS 项目,同时利用自身提供的丰富控件及兼容处理, 让开发者能专注于业务需求而无需耗费精力在基础代码的设计上。不管是新项目的创建,或是已有项目的维... | 41.720102 | 180 | 0.738778 |
abe39e82d058cf814e259130eeb2d6b70e4c7354 | 9,522 | require 'rexml/document'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class VerifiGateway < Gateway
class VerifiPostData < PostData
# Fields that will be sent even if they are blank
self.required_fields = [ :amount, :type, :ccnumber, :ccexp, :firstname, :lastname,
:comp... | 39.841004 | 120 | 0.564377 |
f7f48ea7b292ef18366a18ee20979cbb16d5e731 | 23,096 | # 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... | 50.538293 | 133 | 0.545419 |
d53fc48fb27457378d7bf3f4e4096d67b44bd66f | 109 | # frozen_string_literal: true
require_relative './config/boot'
require_relative './web_app'
run WebApp.new
| 15.571429 | 32 | 0.788991 |
bb9540abbb9dd565024757703206c155952792bb | 1,051 | Pod::Spec.new do |s|
s.name = 'qr_mobile_vision'
s.version = '0.0.1'
s.summary = 'Plugin for reading QR codes using Firebase's Mobile Vision API.'
s.description = <<-DESC
Plugin for reading QR codes using Google's Mobile Vision API.
DESC
... | 40.423077 | 105 | 0.607992 |
01b44263996fdbe68d65e89496469181598b0777 | 1,027 | class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable
validates :name, presence: true, length: { maximum: 20... | 38.037037 | 113 | 0.748783 |
ed563402c146b5e32d788ee81ed06c0ec63e67e5 | 385 | # 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::V2020_08_01
module Models
#
# Defines values for ConnectionMonitorEndpointFilterType
#
module ConnectionMonit... | 24.0625 | 70 | 0.74026 |
ac04de0962f63f8f4adfe6c16d3eb04370fe834a | 398 | name 'meniscus-configdb'
maintainer 'Steven Gonzales'
maintainer_email 'steven.gonzales@rackspace.com'
license 'Apache 2.0'
description 'Installs/Configures meniscus-configdb'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.2.0'
supports 'ubu... | 33.166667 | 72 | 0.718593 |
03ccc80cf3e2f0d897b0d34e8f00694f71e033e6 | 4,711 | require_relative '../fixtures/classes'
require_relative '../fixtures/encoded_strings'
describe :array_inspect, shared: true do
it "returns a string" do
@subject.new([1, 2, 3]).send(@method).should be_an_instance_of(String)
end
it "returns '[]' for an empty Array" do
@subject.new([]).send(@method).should... | 34.896296 | 129 | 0.656973 |
2615f9fa1ca8057c5addc552536de5acca060937 | 429 | require 'r'
class Main
def init
@instance = TestDir.new()
@instance.init
end
def match
if @instance != nil
@instance.match("1.1.1.1 abc")
else
puts "initial config not loaded"
end
end
end
puts "push to load read and load configuration"
char = STDIN.gets
instance = Main.new()
instance.init
puts... | 13.40625 | 47 | 0.699301 |
1152a9d261cb9b817554082e2503e7f4b50e0909 | 1,190 | # -*- encoding: utf-8 -*-
=begin
#Accounting API
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 2.0.0
Contact: api@xero.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.0.3
=end
$:.push Fi... | 29.75 | 107 | 0.644538 |
08597f1cb04b8897834f81f7c17d910f5ed66b80 | 2,613 | 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... | 34.381579 | 87 | 0.753923 |
18b55cd52be59b4d7792df70737d50859cfbe1da | 1,261 | # -*- encoding: utf-8 -*-
=begin
#OpenAPI Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator v... | 32.333333 | 176 | 0.659794 |
08b7033f0e219758fa2c0d6900846015912ba8fe | 356 | class FontNotoSansHatran < Formula
head "https://github.com/google/fonts/raw/main/ofl/notosanshatran/NotoSansHatran-Regular.ttf", verified: "github.com/google/fonts/"
desc "Noto Sans Hatran"
homepage "https://fonts.google.com/specimen/Noto+Sans+Hatran"
def install
(share/"fonts").install "NotoSansHatran-Reg... | 32.363636 | 133 | 0.752809 |
f8bb70e882e268cae2dd13a5c4d27eed7c5f49a2 | 249 | class CreateTableCriteriakeys < ActiveRecord::Migration
def up
create_table :criteriakeys do |t|
t.string :criterianame
t.integer :scalevalue
t.text :textvalue
end
end
def down
drop_table :criteriakeys
end
end
| 17.785714 | 55 | 0.694779 |
28af3b387ec3bca7d929e07796861b1c969ea7df | 916 | module Coconductor
module Projects
module Project
DIRS = ['./', './docs/', './.github/'].freeze
def code_of_conduct
code_of_conduct_file.code_of_conduct if code_of_conduct_file
end
def code_of_conduct_file
return @code_of_conduct_file if defined? @code_of_conduct_file
... | 24.105263 | 70 | 0.635371 |
ab2272dd66b2014df7926059af59b1a4b6794bca | 1,918 | describe :hash_store, :shared => true do
it "associates the key with the value and return the value" do
h = new_hash(:a => 1)
h.send(@method, :b, 2).should == 2
h.should == new_hash(:b=>2, :a=>1)
end
it "duplicates string keys using dup semantics" do
# dup doesn't copy singleton methods
key =... | 26.638889 | 95 | 0.614703 |
b9158b1b35d7c935c4dc87d3cf94217cfd894727 | 627 | require 'spec_helper'
describe "uploader_files" do
subject(:site) { cms_site }
subject(:node) { create_once :uploader_node_file, name: "uploader" }
subject(:item) { Uploader::File.last }
subject(:index_path) { uploader_files_path site.host, node }
it "without login" do
visit index_path
expect(curren... | 21.62069 | 70 | 0.698565 |
2608b240f7e45db561149f556c6560401ff7b833 | 237 | class CollectionsController < ApplicationController
include CurationConcerns::CollectionsControllerBehavior
include CurationConcerns::CollectionsControllerBehaviorEnhancements
def presenter_class
CollectionPresenter
end
end
| 26.333333 | 69 | 0.869198 |
8727baa4f09c57651ffa2bebfe8c82141b71780e | 8,587 | class CamaleonCms::SiteDecorator < CamaleonCms::TermTaxonomyDecorator
delegate_all
def the_description
the_content
end
# return logo url for this site
# default: this url will be returned if logo is not present.
def the_logo(default = nil)
object.get_option("logo") || (default || "#{h.asset_url("c... | 42.721393 | 215 | 0.72109 |
ed2e16d3ace6b624f2cc599548434a6fc4538fb5 | 100 | FactoryGirl.define do
factory :repo do
sequence(:name) { |n| "SomeUser/repo_#{n}" }
end
end
| 16.666667 | 48 | 0.65 |
bb7202ec6bf147c1795a8772d1b9f6c8147b88b1 | 183 | Merb::Config[:framework] = {
application: Merb.root / "application.rb",
config: [Merb.root / "config", nil],
public: [Merb.root / "public", nil],
view: Merb.root / "views"
}
| 22.875 | 44 | 0.622951 |
ede8eeeb0a5edb24a77d5ce5ac1b6da92115aeaf | 397 | name "sys_krb5_test"
description "Use to test the [sys::krb5] recipe."
run_list( "recipe[sys::krb5]" )
default_attributes(
"sys" => {
"krb5" => {
# this is upcased in the recipe
"realm" => "example.com",
"admin_server" => "kdc1.h5l.example.com",
"master" => "kdc1.h5l.example.com",
"s... | 24.8125 | 49 | 0.574307 |
d5da858ee8264e45cc7ebc8a91c6ae487e04e2ea | 299 | class CreateProjections < ActiveRecord::Migration[5.0]
def change
create_table :projections do |t|
t.date :due_date
t.decimal :amount, :precision => 8, :scale => 2
t.integer :user_id
t.string :description
t.boolean :cash
t.timestamps
end
end
end
| 21.357143 | 54 | 0.628763 |
11530d86c7b0b143f3fd793d842e84c946f08e22 | 3,239 | # -*- ruby encoding: utf-8 -*-
require 'color'
require 'minitest_helper'
module TestColor
class TestGrayScale < Minitest::Test
def setup
@gs = Color::GrayScale.from_percent(33)
end
def test_brightness
assert_in_delta(0.33, @gs.brightness, Color::COLOR_TOLERANCE)
end
def test_darken... | 30.271028 | 75 | 0.649583 |
0138852c0a0647b93ba861b83a3184a48316e4d9 | 2,614 | # "File" is a reserved class name
class FileFormula < Formula
desc "Utility to determine file types"
homepage "https://darwinsys.com/file/"
url "https://astron.com/pub/file/file-5.41.tar.gz"
sha256 "13e532c7b364f7d57e23dfeea3147103150cb90593a57af86c10e4f6e411603f"
# file-formula has a BSD-2-Clause-like licens... | 37.884058 | 123 | 0.700459 |
abb6dbbfa76e9c9e1ac8fb589ccb95f4d4976cdb | 628 | class ApiController < ApplicationController
before_action :check_sign_in
protect_from_forgery except: []
rescue_from CanCan::AccessDenied, with: :not_authorized
def not_authorized
render status: 401, json: { error: 'Not authorized.' }
end
def check_sign_in
not_authorized unless user_signed_in?
... | 22.428571 | 76 | 0.756369 |
bf2d0a6afd3875089d4c4711e8a095f7c9658a5d | 150 | default['one_password']['version'] = '3.5.7'
default['one_password']['checksum'] = "fecb10ad40af614d15be2bac4e7a9ea35e57724dc608c34f8b95f464dc6c3224"
| 50 | 104 | 0.8 |
79b8d303af01f9c2846d03a03d48010a4e013fb3 | 89 | # frozen_string_literal: true
module Pico
module Case
VERSION = "0.1.0"
end
end
| 11.125 | 29 | 0.685393 |
7a29055f5ece8291708410b839393aa910da85c9 | 1,823 | ##
# This part of the module defines classes and methods
# related to variables.
module Cobaya::Combinators
##
# This abstract class defines the common parts
# of the variables combinators.
class Var < Combinator
def initialize(context, vars)
super context
@vars = vars
end
def gene... | 19.602151 | 77 | 0.65661 |
1108334ffec7a61c272464db3bb93f023c1f48ca | 839 | =begin
#Tatum API
## Authentication <!-- ReDoc-Inject: <security-definitions> -->
OpenAPI spec version: 3.9.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 3.0.31
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for Tatum::OneOfv3SubscriptionBody
# ... | 23.971429 | 85 | 0.75447 |
9168e3d79ba7b274f1e031a0f94f5222cb2e35ec | 1,034 | require File.expand_path("../../Abstract/abstract-php-extension", __FILE__)
class Php54MysqlndMs < AbstractPhp54Extension
init
homepage "http://pecl.php.net/package/mysqlnd_ms"
url "http://pecl.php.net/get/mysqlnd_ms-1.5.2.tgz"
sha1 "b7b3ddd1f40ffec75a48456edf053c28fc5aad83"
head "https://svn.php.net/reposit... | 31.333333 | 95 | 0.750484 |
33954f810810465ac83dba6ba29142477bba9279 | 1,202 | require 'spec_helper'
describe ProtectedController do
describe 'get :index' do
with :client
with :user
before do
@token = Devise::Oauth2Providable::AccessToken.create! :client => client, :user => user
end
context 'with valid bearer token in header' do
before do
@request.env['... | 27.953488 | 93 | 0.609817 |
798ddde58767bc0ac91652a99ba1062809cb6e0b | 3,617 | module HealthSeven::V2_7
class PglPc6 < ::HealthSeven::Message
attribute :msh, Msh, position: "MSH", require: true
attribute :sfts, Array[Sft], position: "SFT", multiple: true
attribute :uac, Uac, position: "UAC"
attribute :pid, Pid, position: "PID", require: true
class PatientVisit < ::HealthSeven::SegmentGr... | 52.42029 | 121 | 0.687863 |
01b5cb1edd9a4214a11847df5110aea6183d5d17 | 901 | # frozen_string_literal: true
require "test_helper"
class ConfigTest < ActiveSupport::TestCase
def setup
@klass = Class.new {
extend Authlogic::Config
def self.foobar(value = nil)
rw_config(:foobar_field, value, "default_foobar")
end
}
@subklass = Class.new(@klass)
end
d... | 23.102564 | 71 | 0.722531 |
acf6eac1bd19041a7bbcbf4ad7f685ecfcc67101 | 1,396 | module SessionsHelper
# 渡されたユーザーでログインする
def log_in(user)
session[:user_id] = user.id
end
# ユーザーのセッションを永続的にする
def remember(user)
user.remember
cookies.permanent.signed[:user_id] = user.id
cookies.permanent[:remember_token] = user.remember_token
end
# 渡されたユーザーがログイン済みユーザーであればtrueを返す
def ... | 21.476923 | 75 | 0.691977 |
1d27b5995dac9f61240e3b39250b5d41c3b0e360 | 2,446 | =begin
This file is part of Viewpoint; the Ruby library for Microsoft Exchange Web Services.
Copyright © 2011 Dan Wanek <dan.wanek@gmail.com>
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 ... | 31.766234 | 87 | 0.665576 |
d520ad9a3c4732a5e4b38815c829dbd3343f2010 | 866 | # frozen_string_literal: true
require 'rails_helper'
include Warden::Test::Helpers
RSpec.describe 'Password protect non production instances', type: :system do
let(:login) { 'admin' }
let(:password) { 'whatever' }
before do
ENV['HTTP_USERNAME'] = login
ENV['HTTP_PASSWORD'] = password
end
context 'v... | 25.470588 | 81 | 0.670901 |
e23d8c5686be5209cdecfd4e90c603c260f90a0f | 819 | class TalksController < ApplicationController
before_filter :login_required, :except => :index
def index
@talks = Talk.all
respond_to do |format|
format.json {}
end
end
def new
@talk = Talk.new
end
def create
@talk = Talk.create(params[:talk])
if @talk.s... | 17.804348 | 50 | 0.593407 |
18375e5ec74a13728234a68000e9fd867a54ef34 | 4,546 | module Strongspace::Command
class Auth < Base
attr_accessor :credentials
def client
@client ||= init_strongspace
end
def init_strongspace
client = Strongspace::Client.new(user, password, host)
client
end
# just a stub; will raise if not authenticated
def check
cl... | 23.193878 | 96 | 0.604927 |
e2ef8aa4827036de6361a59290232ad7bfeca0f5 | 2,592 |
require 'cuba'
require 'da99_rack_protect'
require 'multi_json'
require 'www_app'
PATH = File.expand_path(File.dirname(__FILE__) + '../../..')
Rack::Mime::MIME_TYPES.merge!({".map" => "application/json"})
Cuba.use Da99_Rack_Protect do |c|
c.config :host, :localhost if ENV['IS_DEV']
end
Cuba.use Rack::ShowExcept... | 20.571429 | 102 | 0.524691 |
218421b3a381bd9b561b4b0e10f79c0d432668e1 | 33 | module FantasyManagersHelper
end
| 11 | 28 | 0.909091 |
ffd57718a69ca1fc542867597fb75d311c90b936 | 3,755 | # encoding: UTF-8
# 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 sou... | 39.114583 | 119 | 0.701198 |
aba60a118e80752d6782d0c81b1a6abd4a7c8061 | 3,493 | class Libgxps < Formula
desc "GObject based library for handling and rendering XPS documents"
homepage "https://wiki.gnome.org/Projects/libgxps"
url "https://download.gnome.org/sources/libgxps/0.3/libgxps-0.3.2.tar.xz"
sha256 "6d27867256a35ccf9b69253eb2a88a32baca3b97d5f4ef7f82e3667fa435251c"
license "LGPL-2.1... | 35.642857 | 127 | 0.691955 |
bbcd055fc6cabc5b6cb77a02d136760de7625f16 | 59 | module GEPUB
# GEPUB gem version
VERSION = "1.0.4"
end
| 11.8 | 21 | 0.661017 |
1c4a07274abeb0e83b7aea7bd60ad4b2cf1f1fc5 | 682 | class API::V1::PartnerApprovalsController < ApplicationController
skip_before_action :verify_authenticity_token
skip_before_action :authenticate_user!
skip_before_action :authorize_user
respond_to :json
def create
return head :forbidden unless api_key_valid?
@partner = Partner.find(approval_params[:... | 25.259259 | 79 | 0.756598 |
ff8d30258c3b5ee272c79c763f0d4f9a977e8bea | 239 | # frozen_string_literal: true
require 'spec_helper'
require_relative '../../app/models/test'
RSpec.describe Test do
let(:object) { described_class.new }
describe '#call' do
it 'processes' do
object.call
end
end
end
| 14.9375 | 40 | 0.686192 |
3945939bcd029103bbdb75d8f64f41c269849a09 | 883 | Rails.application.routes.draw do
devise_for :admin_users
mount RailsAdmin::Engine => '/admin', as: 'rails_admin'
get 'password_resets/new'
get 'password_resets/edit'
get 'sessions/new'
root 'static_pages#home'
get '/about', to: 'static_pages#about'
get '/signup', to: 'users#new'
get ... | 27.59375 | 71 | 0.661382 |
d5149defa2edd483e5b40a06ec6aecb6e6befcf5 | 307 | require 'securerandom'
Fabricator(:workflow_task_metadata, from: :open_struct) do
namespace 'test-namespace'
id { sequence(:workflow_task_id) }
task_token { SecureRandom.uuid }
attempt 1
workflow_run_id { SecureRandom.uuid }
workflow_id { SecureRandom.uuid }
workflow_name 'TestWorkflow'
end
| 25.583333 | 58 | 0.76873 |
188dd7a0a76901f6fcd58d3aa5f55e9025678fe9 | 460 | class AddRequiredInformation < ActiveRecord::Migration
def change
add_column :checkins, :full_name, :string
add_column :checkins, :address, :text
add_column :checkins, :interview_location, :string
add_column :checkins, :interview_date, :string
add_column :checkins, :interview_time, :string
... | 28.75 | 66 | 0.736957 |
f8ad10abe64f3966c1638ff74f0cd9ddf64504ba | 290 | require './config/environment.rb'
class Student < ActiveRecord::Base
has_many :lessons
has_many :notes
has_many :topics, through: :lessons
# returns an array of instances of the Note class that belong to a student
def get_all_notes
Note.where(student_id: self.id)
end
end
| 22.307692 | 76 | 0.744828 |
18983245a4ba4d7a46d230a8543bd424ef8c3c0a | 8,141 | require "spec_helper"
class PageAttachment < ActiveRecord::Base
end
describe Irwi::Helpers::WikiPagesHelper do
it { is_expected.not_to be_nil }
context "included in class" do
subject do
ActionView::Base.new.tap do |v|
v.send :extend, ERB::Util
v.send :extend, described_class
end
... | 41.535714 | 178 | 0.70409 |
ed906e3f54c8edc3a922827fdbaf5c0011481b63 | 11,959 | require "test_helper"
class AttachableTest < ActiveSupport::TestCase
include ActionDispatch::TestProcess
test "allows attachment" do
assert build(:publication).allows_attachments?
end
test "allows different attachment types" do
attachable = Publication.new
assert attachable.allows_attachment_type... | 36.129909 | 149 | 0.731667 |
ac5cdd73d30d6a560be87579791942f89d721d2a | 584 | cask 'intensify-pro' do
version '1.2.3_952'
sha256 '147cc6db790e3ea6d7d51fbbcde5c27957cc4df24120b1ec79afde2d70d44dd5'
# amazonaws.com/IntensifyCK was verified as official when first introduced to the cask
url "https://creativekit.s3.amazonaws.com/IntensifyCK/IntensifyCK_Distribution_v#{version.dots_to_undersco... | 41.714286 | 117 | 0.80137 |
b99c50b8957a8c765452b5f821dc4adbd0081add | 247 | class CreateScenarioMemberships < ActiveRecord::Migration[4.2]
def change
create_table :scenario_memberships do |t|
t.integer :agent_id, :null => false
t.integer :scenario_id, :null => false
t.timestamps
end
end
end
| 22.454545 | 62 | 0.688259 |
e9147b23cc3ec9c669d5bb62173cd8cc4f754339 | 12,142 | require 'dyio/lookup_hashes'
module Bowler
BOWLER_VERSION = 3
# Handles sending commands to the dyio, validating Bowler packets,
# and parsing Bowler packets into ruby data structures.
# All parsed packets have a :raw_res key containing the raw packet metadata and data with minimal processing
# (see {#parse... | 36.136905 | 189 | 0.571734 |
1caf5770247f03cf7976e9eb54e13cdbe7461d63 | 9,306 | #!/usr/bin/ruby
# -*- coding: utf-8 -*-
require 'csv'
require 'nokogiri'
require 'open-uri'
#require 'awesome_print'
class String
def to_nil
self.empty? ? nil : self
end
end
base_url = 'http://stats.njcaa.org/sports/bsb'
#http://stats.njcaa.org/sports/bsb/2013-14/div1/teams/connorsstatecollege?view=lineup... | 26.4375 | 167 | 0.57017 |
61c06f99cfc4ac5f2adc26d5a13338ea5fe875e9 | 306 | Deface::Override.new(:virtual_path => "spree/admin/shared/_menu",
:name => "affiliate_admin_tab",
:insert_bottom => "[data-hook='admin_tabs']",
:text => "<%= tab(:affiliates, :icon => 'icon-group') %>",
:disabled => false) | 61.2 | 79 | 0.480392 |
e894eabbe6b0c8fe2cd60c09d64a7b5720061030 | 464 | # -*- encoding : utf-8 -*-
module Snippr
module SegmentFilter
class Base
def initialize(filter_value)
@filter_value = filter_value
end
def self.filters
@available_filters
end
def self.inherited(subclass)
@available_filters ||= []
@available_filters ... | 18.56 | 74 | 0.609914 |
6114ba318141ddd42490aed7c76fe5a6505bfc62 | 83 | require 'test_helper'
class TeamImprovementsHelperTest < ActionView::TestCase
end
| 16.6 | 55 | 0.843373 |
1d645c63ed9204c959110f4d523e2ca2802ef077 | 3,138 | #
# Author:: Daniel DeLeo (<dan@kallistec.com>)
# Author:: Tim Hinderliter (<tim@chef.io>)
# Author:: Seth Falcon (<seth@chef.io>)
# Copyright:: Copyright 2009-2016, Daniel DeLeo
# Copyright:: Copyright 2010-2016, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, ... | 28.527273 | 131 | 0.604207 |
6ad9712235e6392cf4e2bf141be90b61cd4bde36 | 1,948 | #!/usr/bin/env ruby
require "date"
p Date.today
def usage
puts "usage: #{$PROGRAM_NAME} [domain name]"
exit 1
end
usage if ARGV.size != 1
domain = ARGV[0]
Signal.trap(:INT) {
puts "recv sigint"
exit()
}
srv = {
LOCAL: ["192.168.1.1"],
AdGuard: ["94.140.14.14", "94.140.15.15", "94.140... | 30.920635 | 78 | 0.51848 |
5dbfcc819997ddc99813af329f85a995baaf05ce | 3,861 | require 'oga'
require 'ostruct'
REQUIRED_ATTRIBUTES = "".freeze
module OGP
class OpenGraph
# Accessor for storing all open graph data
attr_accessor :data
# Required Accessors
attr_accessor :title, :type, :url
attr_accessor :images
# Optional Accessors
attr_accessor :description, :deter... | 33 | 136 | 0.622119 |
339dcf51033caf5d77ca37d40b0295d32a96c8cb | 525 | cask 'vitamin-r' do
if MacOS.version <= :el_capitan
version '2.58'
sha256 'c6c631430b44359aa022d9ca5ca6e98dbdf7258f2ceae0353f344a035682661e'
else
version '3.05'
sha256 '685de0390b0b80c517320a853c7e2f2c6a30e5c49c50ae0c342268cb9ebba632'
end
url "http://www.publicspace.net/download/signedVitamin#{... | 30.882353 | 77 | 0.754286 |
39c61eaa9f7ce0c4f6754dc7e8814e5cf9221e70 | 7,476 | module Diplomat
# Methods for interacting with the Consul event API endpoint
class Event < Diplomat::RestClient
@access_methods = %i[fire get_all get]
# Send an event
# @param name [String] the event name
# @param value [String] the payload of the event
# @param service [String] the target serv... | 44.766467 | 116 | 0.640316 |
ab0196c6d07fcf56cae73e1e708f7040b3535a56 | 1,981 | class Libtar < Formula
desc "C library for manipulating POSIX tar files"
homepage "https://repo.or.cz/libtar.git"
url "https://repo.or.cz/libtar.git",
tag: "v1.2.20",
revision: "0907a9034eaf2a57e8e4a9439f793f3f05d446cd"
bottle do
cellar :any
rebuild 2
sha256 "7424cf8229c7aea825592a... | 42.148936 | 107 | 0.722867 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.