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 |
|---|---|---|---|---|---|
1a2e531e0b0bc67dff2d3bce67a5ea0f7c69acaf | 1,204 | require 'spec_helper'
require 'pp'
require 'fakefs/safe'
module RailsEventStoreActiveRecord
RSpec.describe AddValidAtGenerator do
around(:each) do |example|
current_stdout = $stdout
$stdout = StringIO.new
example.call
$stdout = current_stdout
end
specify do
FakeFS.with_fres... | 29.365854 | 115 | 0.66196 |
5dd166c9908469db84b5bffad8201256b4977716 | 1,649 | class FixAzureStackAzFlavorStiClass < ActiveRecord::Migration[6.0]
class ExtManagementSystem < ActiveRecord::Base
include ActiveRecord::IdRegions
self.inheritance_column = :_type_disabled
end
class AvailabilityZone < ActiveRecord::Base
include ActiveRecord::IdRegions
self.inheritance_column = :_t... | 40.219512 | 133 | 0.758035 |
6a91b8d0b86746eb0401771ebf1d6ed053248fdc | 16,734 | # Author:: Tor Magnus Rakvåg (tm@intility.no)
# Author:: John McCrae (john.mccrae@progress.com)
# Copyright:: 2018, Intility AS
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain ... | 50.709091 | 390 | 0.633501 |
28ed000c505da18b7efa5b49e95c38d5e6b7dfe7 | 170 | namespace :asset do
desc 'Display asset path'
task paths: :environment do
Rails.application.config.assets.paths.each do |path|
puts path
end
end
end
| 17 | 56 | 0.694118 |
5df36a711bf085b611d55f0794332a40c168a2b8 | 1,908 | class OrderWalkthrough
def self.up_to(state)
# A payment method must exist for an order to proceed through the Address state
unless Spree::PaymentMethod.exists?
FactoryGirl.create(:check_payment_method)
end
# Need to create a valid zone too...
zone = FactoryGirl.create(:zone)
country = ... | 27.652174 | 114 | 0.698113 |
f77d9a689b2382e85f9faed949219abfb6e8b591 | 5,137 | class DnscryptProxy < Formula
desc "Secure communications between a client and a DNS resolver"
homepage "https://dnscrypt.org"
url "https://github.com/jedisct1/dnscrypt-proxy/archive/1.9.5.tar.gz"
sha256 "947000568f79ab4d036b259d9cf3fe6fdf8419860d9ad18004ac767db0dbd5ac"
revision 1
head "https://github.com/... | 34.709459 | 102 | 0.662644 |
916c313884213349db73cf3925174209fe3c7484 | 113,459 | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 43.571045 | 181 | 0.6389 |
289e745ffc71ab56730807285bc719dbdce4068d | 2,479 | # ActsAsVirtualAttribute
module Sixty4Bit
module Acts
module VirtualAttribute
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def acts_as_virtual_attribute(*args, &proc)
property = args[0]
property_class_name = self.reflections[prope... | 28.825581 | 120 | 0.578056 |
e95a7548973217bcfe5b1f9d00882df97b099b7d | 2,481 | require 'test/minirunit'
is_windows = RUBY_PLATFORM =~ /mswin/i || (RUBY_PLATFORM =~ /java/i && ENV_JAVA['os.name'] =~ /windows/i)
#test_check('test_bracket')
test_equal(nil, ENV['test'])
test_equal(nil, ENV['TEST'])
ENV['test'] = 'foo'
test_equal('foo', ENV['test'])
test_equal(is_windows ? 'foo' : nil, ENV['TEST']... | 25.57732 | 115 | 0.677952 |
e90d05576c614318462143183407cce6607c0ee2 | 2,500 | # -*- encoding: utf-8 -*-
# stub: ffi 1.12.2 ruby lib
# stub: ext/ffi_c/extconf.rb
Gem::Specification.new do |s|
s.name = "ffi".freeze
s.version = "1.12.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.metadata = { "bug_tracker_uri" => "https:... | 49.019608 | 401 | 0.6548 |
918e20858fe677f08a05f00ccb37c2fe851c2742 | 4,997 | $LOAD_PATH.delete_if { |path| path[/gems\/vanity-\d/] }
$LOAD_PATH.unshift File.expand_path("../lib", File.dirname(__FILE__))
RAILS_ROOT = File.expand_path("..")
require "test/unit"
require "mocha"
require "action_controller"
require "action_controller/test_case"
require "active_record"
require "initializer"
Rails.con... | 31.626582 | 119 | 0.693816 |
f7c17df0fc38b9edcb4073d32ca92a251dd908de | 234 | class Donation < ApplicationRecord
belongs_to :user
belongs_to :organization
validates :amount, presence: true
scope :recent, -> { order(date: :desc) }
accepts_nested_attributes_for :organization, reject_if: :all_blank
end
| 26 | 68 | 0.764957 |
5dfb6d687bfb105da6ec1dd1b0d7ae7637b05700 | 114 | require "daisybill_api/data/url"
require "daisybill_api/data/client"
module DaisybillApi
module Data
end
end
| 14.25 | 35 | 0.798246 |
e27ba2db8741a2c2912c86a2c86122a3122799c0 | 321 | require 'nokogiri'
require 'redcarpet'
require "redcarpet_markdown_to_prismjs/version"
require "redcarpet_markdown_to_prismjs/content_constructor"
require "redcarpet_markdown_to_prismjs/parser"
module RedcarpetMarkdownToPrismjs
def prism_html(string)
RedcarpetMarkdownToPrismjs::Parser.new(string).parse
end
end... | 26.75 | 59 | 0.853583 |
f8376e17751a59fe6e70f4ca82de6f625114c120 | 442 | RSpec.describe ModsulatorSheet do
describe "#rows" do
subject { ModsulatorSheet.new File.join(FIXTURES_DIR, "test_002.csv"), "test_002.csv" }
it "should use the right header row" do
expect(subject.headers).to include "druid", "sourceId"
end
it "should present each row as a hash" do
row =... | 27.625 | 91 | 0.667421 |
21e7b07d80028e947740593bcc43bd02263f2f51 | 422 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'entries/show', type: :view do
before(:each) do
view.extend TextHelper
user = FactoryGirl.create(:user)
@journal = FactoryGirl.create(:journal, user: user)
@entry = FactoryGirl.create(:entry, journal: @journal, user: user)
end
... | 23.444444 | 70 | 0.696682 |
0126ac6d7af450e2b373fc1d9532b12773078ed6 | 493 | module Okubo
module DeckMethods
def deck
d = Okubo::Deck.where(:user_id => self.id, :user_type => self.class.name).first_or_create
d.source_class.module_eval do
def stats
Okubo::Item.first(:conditions => {:source_id => self.id, :source_type => self.class.name})
end
end
... | 27.388889 | 99 | 0.616633 |
f798eb22563bcbda10ca60bdee9529df8dd6fb29 | 73,502 | # 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
require 'seahorse/client/plugins/content_length.rb'
require 'aws-sdk-core/plugins/credentials_configuration.rb'
... | 43.261919 | 664 | 0.667927 |
b9fe6055568e4e829a400c9e7ae5d54871c64147 | 835 | # frozen_string_literal: true
require 'apia/dsl'
require 'apia/helpers'
require 'apia/errors/scope_not_granted_error'
module Apia
module DSLs
class Authenticator < DSL
def type(type)
@definition.type = type
end
def potential_error(klass, &block)
if block_given? && klass.is_a?... | 21.410256 | 80 | 0.637126 |
5d9f7f87f43a4d653ea83cb0eeb66d3420d6b431 | 1,106 | class SalesInvoice < ActiveRecord::Base
before_create :update_sequences
## CONSTANTS ##
SEQUENCE_TYPE = 'LI'
def self.create_invoice(provider_id, provider_type, order_id, item_qty, net_amount)
invoice = self.where(:provider_id => provider_id.to_i,:provider_type => provider_type, :order_id => order_id).f... | 30.722222 | 133 | 0.73689 |
79837e3d4579bf48b021a11a206e19717c049d34 | 283 | class Oca::FileConverter
def initialize(options = {})
@name = options[:name]
@content = options[:content]
@format = options[:format] || 'pdf'
end
def convert
File.open("#{@name}.#{@format}", 'wb') { |file| file.write(Base64.decode64(@content)) }
end
end
| 23.583333 | 91 | 0.607774 |
210b1679a07bbd65fccff1f583ea862ee7960fcb | 885 | # (C) Copyright 2017 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 38.478261 | 85 | 0.767232 |
7a58fe920bc0d7255bd56dc4539c9f1293ad64b1 | 31 | module UsersSessionsHelper
end
| 10.333333 | 26 | 0.903226 |
28431e93da2155ceeb313c50e0b1a571c873f0d7 | 5,278 | ################################################################################
# (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the License.
# You may obtain a copy of the Licen... | 36.4 | 117 | 0.565555 |
625dc757c491cbdc635fbf7b1e775659cf84afd8 | 894 | #
# Configuration object for storing some parameters required for making transactions
#
module Dagjeweg::Config
class << self
# @return [String] Your Dagjeweg API Key
# @note The is a required parameter.
attr_accessor :api_key
# Set's the default value's to nil and false
# @return [Hash] configu... | 24.833333 | 83 | 0.661074 |
62a4430138884745333865db8483efef003e7e66 | 712 | # -*- coding: binary -*-
require 'msf/core'
module Msf::Payload::Python
#
# Encode the given python command in base64 and wrap it with a stub
# that will decode and execute it on the fly. The code will be condensed to
# one line and compatible with all Python versions supported by the Python
# Meterpreter s... | 29.666667 | 133 | 0.706461 |
5d66cf70ad19a2a7ef1769df88639b51a3f1556c | 182 | require_relative 'observer_set_shared'
module Concurrent
module Collection
RSpec.describe CopyOnNotifyObserverSet do
it_behaves_like 'an observer set'
end
end
end
| 18.2 | 45 | 0.78022 |
f8b210fe637e826edefed5c64a88ebdfe8b189c4 | 770 | Rails.application.routes.draw do
get 'password_resets/new'
get 'password_resets/edit'
root 'static_pages#home'
get '/help', to: 'static_pages#help'
get '/about', to: 'static_pages#about'
get '/contact', to: 'static_pages#contact'
get '/signup', to: 'users#new'
post '/signup', to: ... | 33.478261 | 67 | 0.653247 |
8764e3a3c88ccdb6ee27c74d55bfa84289e74310 | 3,622 | class User < ApplicationRecord
has_many :active_relationships, class_name: "Relationship",
foreign_key: "follower_id",
dependent: :destroy
has_many :passive_relationships, class_name: "Relationship",
foreign_ke... | 29.933884 | 78 | 0.680011 |
5d80523bcdacd81b89420efa2cd2cffbe973bb51 | 62 | class Passport < ActiveRecord::Base
belongs_to :company
end
| 15.5 | 35 | 0.790323 |
187b365f41a9be96a10c14bfd13514d1995ad7df | 806 | # encoding: utf-8
$:.push File.expand_path('../lib', __FILE__)
# Maintain your gem's version:
require 'apitome/version'
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = 'apitome'
s.version = Apitome::VERSION
s.authors = ['jejacks0n']
s.email = ['inf... | 35.043478 | 98 | 0.663772 |
ed16cb0ad2c907087afeb67a3484df5126f32915 | 126 | FactoryBot.define do
factory :user do
nickname { 'MyString' }
email { 'MyString' }
uid { 'MyString' }
end
end
| 15.75 | 27 | 0.611111 |
91cb4834668acc28034db2244f35e83ad2172009 | 1,933 | # 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::ContainerRegistry::Mgmt::V2017_10_01
module Models
#
# A request to check whether a container registry name is available.
#
... | 28.850746 | 78 | 0.533885 |
2807beb85e8ba00f6a0e231b8b7f8659841c4879 | 8,381 | =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... | 23.410615 | 177 | 0.579167 |
015cd15c414b6da939aaedc9ba9f8a4e543fdada | 5,833 | # frozen_string_literal: true
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... | 24.92735 | 87 | 0.584776 |
ffc84b5f251453d998b6b939c01d009e19fb7eb9 | 624 | require 'byebug'
require 'JSON'
def eliminate_red_hashes(data)
return if data.is_a?(String) || data.is_a?(Fixnum)
if data.is_a?(Hash) && (data.keys.include?('red') || data.values.include?('red'))
sum = data.to_s.scan(/-?\d+/).inject(0) { |sum, num| sum += num.to_i }
add_to_subtractor(sum)
return
end
... | 24.96 | 83 | 0.676282 |
b9b8acc7937691a0f03b5744058541eb4a5bc5aa | 1,368 | # frozen_string_literal: true
require_relative "lib/matchable/version"
Gem::Specification.new do |spec|
spec.name = "matchable"
spec.version = Matchable::VERSION
spec.authors = ["Brandon Weaver"]
spec.email = ["keystonelemur@gmail.com"]
spec.summary = "Pattern Matching in... | 39.085714 | 88 | 0.677632 |
e862e89f703ed288a5e65e63f62b28267cbf3a2e | 1,362 | # frozen_string_literal: true
require "git"
require "uri"
require "open-uri"
require "zip"
require "fileutils"
OFile = File
def download_method(str)
case OFile.extname(URI(str).path)
when ".git", "git"
"git"
when ".zip", "zip"
"zip"
else
return "git" if str.include?("github") || str.include?("git... | 25.222222 | 91 | 0.598385 |
1848cfac2b2ad1a8a82cd90d97de24f92040001a | 242 | class Listing < ActiveRecord::Base
validates :title, presence: true
belongs_to :user
# validates :price, :format => { :with => /\A\d+(?:\.\d{0,2})?\z/ }
has_many :features, dependent: :destroy
has_many :pictures, dependent: :destroy
end
| 30.25 | 68 | 0.681818 |
3806d20b7ee671213d9230623235790f79dd93d9 | 17,557 | # 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
require 'seahorse/client/plugins/content_length.rb'
require 'aws-sdk-core/plugins/credentials_configuration.rb'
... | 43.674129 | 201 | 0.66942 |
016579e00ecf9b26a930f9170519a83214b376d0 | 1,407 | require 'refinerycms-core'
require 'awesome_nested_set'
require 'globalize3'
require 'friendly_id'
require 'seo_meta'
module Refinery
autoload :PagesGenerator, 'generators/refinery/pages/pages_generator'
module Pages
require 'refinery/pages/engine'
require 'refinery/pages/tab'
require 'refinery/pages/... | 26.055556 | 84 | 0.656006 |
112edfcbbff3516f2d6b733f5c68a2efb8787a09 | 2,512 | require_relative './controller_logger'
class Controller
prepend ControllerLogger
attr_reader :voting_machine
class InvalidChoiceException < Exception;end
def self.run_controller(controller_name, machine)
raise InvalidChoiceException unless valid_controller_name?(controller_name)
# Find controller
... | 32.623377 | 79 | 0.749602 |
2816bb0ed36fc98fdf9d0563ac88a9e187e1f55b | 281 | cask :v1 => 'paw' do
version :latest
sha256 :no_check
url 'https://luckymarmot.com/paw/download'
homepage 'http://luckymarmot.com/paw'
license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder
app 'Paw.app'
end
| 25.545455 | 115 | 0.711744 |
08be4417bba5f4fb983a7e6691918c03d470bb8d | 170 | module ActiveModel
class Serializer
# @api private
class HasManyReflection < CollectionReflection
def macro
:has_many
end
end
end
end
| 15.454545 | 50 | 0.658824 |
4a762dbc0accf2d200538478aeebfe66b1ce1f90 | 2,313 | module SPARQL; module Algebra
class Operator
##
# The SPARQL Property Path `path` operator.
#
# [88] Path ::= PathAlternative
#
# @example SPARQL Grammar
# PREFIX : <http://www.example.org/>
# SELECT ?t
# WHERE {
# :a :p1|:p2/:p3|:p4 ?t
# }
#
# @exampl... | 29.653846 | 79 | 0.553394 |
01a2df4c0d907d782f7dad757ca95a1470f260c0 | 45 | module RezultVersion
VERSION = "0.2.0"
end
| 11.25 | 20 | 0.711111 |
bb5023a714b8d667f3c064dedb7bacde197145dc | 76 | # frozen_string_literal: true
module SimpleSauce
class Session
end
end
| 10.857143 | 29 | 0.789474 |
1a519b5474c950ae6694af3549bc3849e8cdbd1b | 3,586 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 41.218391 | 102 | 0.758784 |
088d4a4a28902a467aa4bfcbdb6a078546447ffb | 2,423 | require 'uri'
require 'net/http'
require 'cgi'
require 'json'
require 'net/http/digest_auth'
module PuppetX
module Wildfly
class APIClient
def initialize(address, port, user, password, timeout, secure)
@username = user
@password = password
@uri = if secure
URI.parse... | 31.467532 | 170 | 0.613702 |
1cd541c548328d05059bc3ff653d6544ede2c1e5 | 557 | require 'chefspec'
describe 'ifconfig::add' do
platform 'ubuntu'
describe 'adds a ifconfig with the default action' do
it { is_expected.to add_ifconfig('10.0.0.1') }
it { is_expected.to_not add_ifconfig('10.0.0.10') }
end
describe 'adds a ifconfig with an explicit action' do
it { is_expected.to a... | 27.85 | 74 | 0.682226 |
6206a35732de6a52c7f00b324c0582ae91626265 | 935 | module TaskEngine
module Tasks
class WaitingTask
PARAMETER_WAITING_TIME = 'waiting_time'
# @param [Hash] parameters
# @return [Hash, nil]
def execute(parameters)
sleep(parameters[PARAMETER_WAITING_TIME])
nil
end
end
class FailingTask
# @param [Hash] pa... | 21.25 | 55 | 0.618182 |
28be62b68d0e1434c6032a0274b3b4c8d0f0d8ad | 1,428 | module Pageflow
class PagesController < Pageflow::ApplicationController
respond_to :json
before_filter :authenticate_user!
def create
chapter = Chapter.find(params[:chapter_id])
page = chapter.pages.build(page_params)
authorize!(:create, page)
verify_edit_lock!(page.chapter.entr... | 23.409836 | 103 | 0.663165 |
4a7f8124c7269ed9d3504769a780fdf1ba86cc14 | 742 | #
# Cookbook Name:: download_zookeeper
# Recipe:: default
#
# Copyright 2016, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
#package 'hadoop-2.7.2' do
# action :install
#package_name 'hadoop-2.7.2'
#end
cookbook_file "/home/hhuser/zookeeper-3.5.1-alpha.tar.gz" do
source "zookeeper-3.5.1-alpha.ta... | 24.733333 | 77 | 0.739892 |
7a656034b83423227cb200d889bdbb3e7626ba68 | 1,072 | # rubocop:disable Metrics/LineLength
# == Schema Information
#
# Table name: quotes
#
# id :integer not null, primary key
# character_name :string(255) not null
# content :text not null
# likes_count :integer default(0), not null
# media_type :string ... | 30.628571 | 78 | 0.636194 |
5d0a0023fa7c8cbcc2223432557a736c7559ed59 | 8,655 | # frozen_string_literal: true
describe "Acceptance::AssessorList" do
include RSpecRegisterApiServiceMixin
let(:valid_assessor_request_body) do
{
firstName: "Someone",
middleNames: "Muddle",
lastName: "Person",
dateOfBirth: "1991-02-25",
searchResultsComparisonPostcode: "",
... | 34.209486 | 111 | 0.567187 |
18c96f0382b89022d2f34a4e25e52bfde99eb36b | 272 | name 'test_nginx_certs'
maintainer 'Tom Noonan II'
maintainer_email 'tom@tjnii.com'
license 'All rights reserved'
description 'Test fixture to provide SSL certs'
long_description 'Test fixture to provide SSL certs'
version '0.1.0'
| 34 | 52 | 0.680147 |
339167d6a220dc27611c2603a0e3ad855fa52bb8 | 2,201 | require 'spec_helper'
module Cellect::Server
describe API do
include_context 'API'
{ 'Ungrouped' => nil, 'Grouped' => 'grouped' }.each_pair do |grouping_type, grouping|
SET_TYPES.shuffle.each do |set_type|
context "#{ grouping_type } #{ set_type }" do
let(:workflow_type){ [grouping, ... | 35.5 | 101 | 0.585643 |
1cb278e912303af618a8e635e7c2d932b1150e6e | 6,918 | # frozen_string_literal: true
RSpec.describe "git base name" do
it "base_name should strip private repo uris" do
source = Bundler::Source::Git.new("uri" => "git@github.com:bundler.git")
expect(source.send(:base_name)).to eq("bundler")
end
it "base_name should strip network share paths" do
source = B... | 28.586777 | 96 | 0.605088 |
186c559b7a898cff95b2618b006e87212469660a | 1,705 | # This module points the FileSet to the location of the technical metdata.
# By default, the file holding the metadata is :original_file and the terms
# are listed under ::characterization_terms.
# Implementations may define their own terms or use a different source file, but
# any terms must be set on the ::characteri... | 30.446429 | 100 | 0.696188 |
abbf3258e7853a3addac8c5b24a5fe8eecebbaa5 | 503 | # frozen_string_literal: true
require File.expand_path("../compact_index", __FILE__)
Artifice.deactivate
class CompactIndexStrictBasicAuthentication < CompactIndexAPI
before do
unless env["HTTP_AUTHORIZATION"]
halt 401, "Authentication info not supplied"
end
# Only accepts password == "password"... | 23.952381 | 61 | 0.759443 |
4a9f1af986cb184b8507d1eab7fd13e2fcdc50ba | 64 | json.partial! "dispersions/dispersion", dispersion: @dispersion
| 32 | 63 | 0.8125 |
61adff7e221d3ce2f3729a5afe7b82f632b195fb | 2,445 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Atlassian::JiraConnect::Jwt::Symmetric do
let(:shared_secret) { 'secret' }
describe '#iss_claim' do
let(:jwt) { Atlassian::Jwt.encode({ iss: '123' }, shared_secret) }
subject { described_class.new(jwt).iss_claim }
it { is_expected.t... | 24.94898 | 114 | 0.640082 |
d510dc98d46b54bf5a34c28c818a7c9eecd249e6 | 62 | module Manabo
module Pusher
VERSION = "0.0.1"
end
end
| 10.333333 | 21 | 0.645161 |
ab5cf86e9a6ca39fd6cbe8f42d335bbec417917b | 204 |
class Shoutout
attr_reader :apikey
def initialize(apikey)
@apikey=apikey
end
def sendSms(from:,to:,body:)
return SMS.send(self.apikey,from,to,body)
end
end
require 'shoutout/sms' | 14.571429 | 47 | 0.691176 |
18beafc1b03c6dc081d564397db5f2620f860ece | 1,461 | require 'spec_helper'
describe Spree::WalletPaymentSource, type: :model do
subject { Spree::WalletPaymentSource }
describe "validation" do
context 'with a non-PaymentSource model' do
with_model 'NonPaymentSource', scope: :all do
model do
# We have to set this up or else `inverse_of` pr... | 31.085106 | 134 | 0.6564 |
5dc2f8aebc0900481971f27a04b92eedb837d7fd | 1,229 | Pod::Spec.new do |s|
s.name = "APNGKit"
s.version = "2.2.0"
s.summary = "High performance and delightful way to play with APNG format in iOS."
s.description = <<-DESC
APNGKit is a high performance framework for loading and displaying APNG images in iOS and macOS. It's bu... | 39.645161 | 140 | 0.615134 |
1d9d4aa41f73b27e0c298635f771a9a8a83733e9 | 823 | cask 'tower-beta' do
version '3.0.0-151,151-c0ce1e07'
sha256 'f3f9b7a0e4b3dd2f68920277f285a03ccba9f23ecbe76b5c7173a8866f146caa'
# amazonaws.com/apps/tower3-mac was verified as official when first introduced to the cask
url "https://fournova-app-updates.s3.amazonaws.com/apps/tower3-mac/#{version.after_comma}/To... | 37.409091 | 126 | 0.704739 |
edaeaf54f2ebcaf2895dda066a6de59bef266939 | 555 | # frozen_string_literal: true
RSpec.describe Hyrax::Admin::UserActivityPresenter do
let(:instance) { described_class.new }
describe "#to_json" do
subject { instance.to_json }
let(:users) do
instance_double(Hyrax::Statistics::Users::OverTime,
points: [['2017-02-16', '12']])
... | 25.227273 | 82 | 0.616216 |
f825975fef8d9e48c379b3e3b2acd4f9744be490 | 1,085 | class Api::V1::ProfilesController < Api::BaseController
before_action :set_user
def show; end
def update
if password_params[:password].present?
render_could_not_create_error('Invalid current password') and return unless @user.valid_password?(password_params[:current_password])
@user.update!(pas... | 21.7 | 139 | 0.704147 |
3823566056f80b1c4f4f1e02e497fd336f480b70 | 303 | #!/usr/bin/env ruby
$:.push File.expand_path('../../lib', __FILE__)
require 'celluloid/autostart'
module Enumerable
# Simple parallel map using Celluloid::Futures
def pmap(&block)
futures = map { |elem| Celluloid::Future.new(elem, &block) }
futures.map { |future| future.value }
end
end
| 23.307692 | 64 | 0.686469 |
081f05b2d7f848bc592ef3231687c0ecffc43e5f | 5,918 | # frozen_string_literal: true
require "active_support/deprecation"
require "active_support/core_ext/string/filters"
require "rails/command/environment_argument"
module Rails
class DBConsole
def self.start(*args)
new(*args).start
end
def initialize(options = {})
@options = options
end
... | 30.505155 | 125 | 0.599189 |
1c035925f59682c5020571a8cc11cdd712917949 | 152 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_sign-in-with-twitter_session'
| 38 | 90 | 0.802632 |
874d9abda84e177bb308f6cfece560468d3f2137 | 1,226 | require 'json'
module Berkshelf
class APIClient
# A representation of cookbook metadata indexed by a Berkshelf API Server. Returned
# by sending messages to a {Berkshelf::APIClient} and used to download cookbooks
# indexed by the Berkshelf API Server.
class RemoteCookbook
# @return [String]
... | 21.892857 | 87 | 0.583197 |
18aaabfc686c88f8d9c47bb612cbe8f07359dcd8 | 9,587 | # Only define freeze and unfreeze tasks in instance mode
unless File.directory? "#{RAILS_ROOT}/app"
namespace :bionic do
namespace :freeze do
desc "Lock this application to the current gems (by unpacking them into vendor/bionic)"
task :gems do
require 'rubygems'
require 'rubygems/gem_r... | 47.696517 | 182 | 0.616251 |
1abc20fbceeb15284c1b911e91d34c02bc807c11 | 14,783 | require 'rexml/document'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
# In NZ DPS supports ANZ, Westpac, National Bank, ASB and BNZ.
# In Australia DPS supports ANZ, NAB, Westpac, CBA, St George and Bank of South Australia.
# The Maybank in Malaysia is supported and the Citibank for Singapore.
... | 39.954054 | 130 | 0.656633 |
1ca4b7b57a329e598d2356c51aa10db5aafa1d85 | 277 | maintainer "VMware"
maintainer_email "support@vmware.com"
license "Apache 2.0"
description "Installs/Configures ACM Database"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version "0.0.1"
depends "postgresql"
| 30.777778 | 74 | 0.68231 |
877c0caaf0a38376ba239d8ec369b675834be823 | 990 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v7/services/hotel_performance_view_service.proto
require 'google/ads/googleads/v7/resources/hotel_performance_view_pb'
require 'google/api/annotations_pb'
require 'google/api/client_pb'
require 'google/api/field_behavior_pb'
requ... | 33 | 175 | 0.777778 |
ab1cb53ca5094024fa59af1c74ecb4db8796620a | 946 | ##
# This file is part of WhatWeb and may be subject to
# redistribution and commercial restrictions. Please see the WhatWeb
# web site for more information on licensing and terms of use.
# http://www.morningstarsecurity.com/research/whatweb
##
Plugin.define "Zeus-Traffic-Manager" do
author "Brendan Coles <bcoles@gmail... | 29.5625 | 248 | 0.739958 |
33e367f3776ba4eb6426bf0191c8c3ef33a8698a | 178 | # Superdigit
# Time Complexity - ?
# Space Complexity - ?
def super_digit(n)
end
# Time Complexity - ?
# Space Complexity - ?
def refined_super_digit(n, k)
end
| 11.866667 | 29 | 0.634831 |
03f3977d02857d769941ebb6c0737d3ac9311672 | 1,367 | $:.push File.expand_path("lib", __dir__)
require "openopus/core/people/version"
Gem::Specification.new do |spec|
spec.name = "openopus-core-people"
spec.version = Openopus::Core::People::VERSION
spec.authors = ["Brian J. Fox"]
spec.email = ["bfox@opuslogica.com"]
spec.homepage = "htt... | 48.821429 | 301 | 0.713241 |
d51df05a516dc44333d86fceaf0b5415f488c519 | 213 | class CreateCategories < ActiveRecord::Migration[6.0]
def change
create_table :categories do |t|
t.string :name
t.boolean :display_in_navbar, default: false
t.timestamps
end
end
end
| 19.363636 | 53 | 0.685446 |
e9ecdd558b0af17cde6b141861e44b74e0525b23 | 1,699 | # tests for ability to set defaults for Watir
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
require 'unittests/setup'
class TC_instance_options < Test::Unit::TestCase
tags :fails_on_firefox
def setup
@ie4 = Watir::IE.new
end
def test_using_default
@ie4.speed ... | 25.358209 | 110 | 0.695115 |
18b940993e850979b14e6ee7a6d590d4e3d39ae6 | 2,178 | require 'rails_helper'
RSpec.describe BulkAttendanceImporter do
let(:bulk_attendance_importer) { BulkAttendanceImporter.new }
describe '#import' do
context 'json' do
let(:file) { File.open("#{Rails.root}/spec/fixtures/kipp_nj_fixtures/fake_att.json").read }
let(:transformer) { JsonTransformer.new... | 33 | 97 | 0.606061 |
f7e7354760e28239ba652bb54ee70c822dc2799e | 2,337 | require 'test_helper'
require 'mailer_helpers'
class DbMailerHelperTest < ActionMailer::TestCase
include MailerHelpers
setup do
@user = {
full_name: "Ezra Bridger",
email: "ezra@therebellion.com"
}
end
test "can send a basic template email" do
assert true
end
test 'get this m... | 31.581081 | 92 | 0.749679 |
7a91887b405d74f244157839d3a82204a2218980 | 437 | #!/usr/local/bin/ruby -w
ENV['GEM_SKIP'] = 'ParseTree:RubyInline'
$:.push 'lib', '../../ParseTree/dev/lib', '../../RubyInline/dev', '../../ruby_to_c/dev'
require 'r2c_hacks'
class Example
def example(arg1)
return "Blah: " + arg1.to_s
end
end
e = Example.new
puts "Code (via cat):"
puts `cat #{$0}`
puts "sexp... | 18.208333 | 87 | 0.645309 |
87ccdeac9851ff1012019a2c01b776f4bb9ffefa | 91 | require "test/unit"
require "win-service"
class TestWinService < Test::Unit::TestCase
end
| 15.166667 | 43 | 0.769231 |
b934c9648d6ab3a122944f361d8e413f314a30c3 | 620 | # encoding: utf-8
# frozen_string_literal: true
require 'helper'
class TestFakerEducationCN < Test::Unit::TestCase
include DeterministicHelper
assert_methods_are_deterministic(FFaker::EducationCN, :degree, :major, :location, :school)
def setup
@tester = FFaker::EducationCN
end
def test_degree
ass... | 20 | 92 | 0.7 |
b98fd5c7513f80ccb288f4d14eb242b4d5f02266 | 1,076 | Given('there is an event called {string} that has an instance for the year {int}') do |event_name, year|
event = create(:event, name: event_name)
create(:event_instance, event: event, year: year)
end
When(/^I add an event instance with the following information:$/) do |table|
instance_info = table.raw.to_h
if... | 35.866667 | 104 | 0.732342 |
ff48650f3526320ef2bc892fa842c0484c3d2fa8 | 1,125 |
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "Nabeel_gem/version"
Gem::Specification.new do |spec|
spec.name = "Nabeel_gem"
spec.version = NabeelGem::VERSION
spec.authors = ["NabeelMustafa"]
spec.email = ["bitf14m016@pu... | 38.793103 | 87 | 0.651556 |
38d4412a98c46fe04f919942f13f1a797c82af30 | 1,546 | cask 'totalspaces' do
if MacOS.release <= :mountain_lion
version '1.2.11'
sha256 'fd54c6ea092f6fae2035745959ff6e080953e77ec6c76715e532b4b0352235d4'
url "http://downloads.binaryage.com/TotalSpaces-#{version}.zip"
appcast 'http://updates-s3.binaryage.com/totalspaces.xml',
:checkpoint => 'f5... | 37.707317 | 114 | 0.638422 |
e2caadf6768d73abdc005edbcda2f3807cf5e1c3 | 2,368 | # +-------------------------------------------------------------------------
# | Copyright (C) 2016 Yunify, Inc.
# +-------------------------------------------------------------------------
# | Licensed under the Apache License, Version 2.0 (the "License");
# | you may not use this work except in compliance with t... | 33.352113 | 95 | 0.556588 |
e9efa45fcc566fd7e8a4d0382b71a29cfeacc449 | 516 | cask 'people-plus-content-ip' do
version '1.0.1'
sha256 '4a29e7eb0901db45572e7dac108df74b52015c75d4aaa9fe774b5027b8bf9990'
url "http://www.polycom.co.uk/content/dam/polycom/common/documents/firmware/PPCIPmac_v#{version}.dmg.zip"
name 'People + Content IP'
homepage 'http://www.polycom.co.uk/products-services/... | 36.857143 | 144 | 0.775194 |
e8a9e3cec30cf58ac564f2c3d5b902180b537831 | 25 | module BillingHelper
end
| 8.333333 | 20 | 0.88 |
013798f8e8fb96284374e824473493aa227fa2d5 | 7,865 | require File.dirname(__FILE__) + '/test_helper'
class HashExtensionsTest < Test::Unit::TestCase
def test_to_query_string
# Because hashes aren't ordered, I'm mostly testing against hashes with just one key
symbol_keys = {:one => 1}
string_keys = {'one' => 1}
expected = '?one=1'
[symbol_keys, s... | 23.761329 | 89 | 0.65658 |
d51534fda49a009c80c2b370368f106cb91c3963 | 3,502 | require 'sequel'
require 'merb_global/plural'
module Merb
module Global
module MessageProviders
class Sequel #:nodoc: all
include Merb::Global::MessageProviders::Base
include Merb::Global::MessageProviders::Base::Importer
include Merb::Global::MessageProviders::Base::Exporter
... | 34.673267 | 86 | 0.488007 |
5dcb7369bac8fea64692a587895565ebc8ea7a87 | 1,547 | module Spree
class CustomUserGenerator < Rails::Generators::NamedBase
include Rails::Generators::ResourceHelpers
include Rails::Generators::Migration
desc "Set up a Spree installation with a custom User class"
def self.source_paths
paths = self.superclass.source_paths
paths << File.expa... | 27.140351 | 130 | 0.672915 |
037ca7ab2f0c478aad3dc464fb8c0623c8d04bb8 | 1,965 | Rails.application.routes.draw do
resources :user_sessions
resources :users
resources :groups do
member do
post :remove_permission
post :add_permission
end
resources :forms do
resources :responses
end
end
get 'login' => 'user_sessions#new', :as => :login
post 'logout' => '... | 26.2 | 84 | 0.64631 |
218dfd0621adb41e041e95805169dde00beba7e5 | 1,862 | describe 'API configuration (config/api.yml)' do
let(:api_settings) { Api::ApiConfig }
describe 'collections' do
let(:collection_settings) { api_settings.collections }
it "is sorted a-z" do
actual = collection_settings.keys
expected = collection_settings.keys.sort
expect(actual).to eq(ex... | 32.666667 | 106 | 0.626208 |
e246ad86cd202de858e251c83d8457aa464d65ed | 1,269 | class ProtectedFoodDrinkName < Document
validates :register, presence: true
validates :status, presence: true
validates :class_category, presence: true
validates :protection_type, presence: true
validates :country, presence: true
validates :traditional_term_grapevine_product_category, presence: true, allow_... | 30.214286 | 91 | 0.781718 |
6224d08248959fa65b0b0e5bcb61e113bdf6bb91 | 1,440 | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 34.285714 | 84 | 0.732639 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.