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 |
|---|---|---|---|---|---|
d5e414e2fe5d9c7435d4efcb8980286be68000a4 | 1,072 | class Librsync < Formula
desc "Library that implements the rsync remote-delta algorithm"
homepage "https://librsync.github.io/"
url "https://github.com/librsync/librsync/archive/v2.3.1.tar.gz"
sha256 "dbd7eb643665691bdf4009174461463737b19b4814b789baad62914cabfe4569"
license "LGPL-2.1"
bottle do
sha256 ... | 35.733333 | 92 | 0.772388 |
33669e940fdf8348a28441fa8598e1617c9be4c2 | 1,638 | describe Graphlyte do
it "should support integers" do
query = Graphlyte.query do
arguments(int: 1) do
id
end
end
expect(query.to_s).to eql(<<~STRING)
{
arguments(int: 1) {
id
}
}
STRING
end
it "should support floats" do
query = Graphlyte.que... | 18 | 59 | 0.503663 |
180b97a32ff6ac88efe483d165c5d8c3fdd0224d | 2,104 | # frozen_string_literal: true
require 'set'
require 'middleman-core/core_extensions/data/proxies/base'
module Middleman
module CoreExtensions
module Data
module Proxies
class ArrayProxy < BaseProxy
WRAPPED_LIST_METHODS = Set.new %i[each each_with_index select sort shuffle reverse rotate ... | 27.324675 | 107 | 0.515684 |
5d1dcaeba203a713900e36e96c0a1a04eec9f54c | 7,493 | require './enums'
describe Enumerable do
array = %w[Sharon Leo Leila Brian Arun]
num_array = [10, 20, 30, 5, 7, 9, 3]
hash = { min: 2, max: 5 }
describe '#my_each' do
context 'if block not given' do
it 'returns enum' do
expect(array.my_each).to be_an Enumerator
end
end
context... | 31.75 | 108 | 0.583344 |
d5949a25d6e3a700540d005810bd76c76bb5f35e | 1,961 | # This should probably be multiple patches
class PatchFixCollectorNumbers < Patch
def call
each_set do |set|
fix_numbers(set)
end
end
private
def fix_numbers(set)
set_code = set["code"]
set_name = set["name"]
cards = cards_by_set[set_code]
case set_code
when "van"
card... | 33.237288 | 94 | 0.594085 |
1c4de201351da52bf38d35dbb9eecfccafd18647 | 1,142 | class Api::V1::Widget::ConversationsController < Api::V1::Widget::BaseController
include Events::Types
protect_from_forgery with: :null_session
def index
@conversation = conversation
end
def update_last_seen
head :ok && return if conversation.nil?
conversation.contact_last_seen_at = DateTime... | 22.392157 | 109 | 0.718914 |
1c527601dbc0741bc19bfc5e32ec72156a63b441 | 1,994 | # frozen_string_literal: true
namespace :pgdump_scrambler do
default_config_path = 'config/pgdump_scrambler.yml'
desc 'create config from database'
task config_from_db: :environment do
config =
if File.exist?(default_config_path)
puts "#{default_config_path} found!\nmerge existing config with ... | 33.233333 | 93 | 0.700602 |
e970cbe068400f960e323c1e739e1ef0725503a0 | 2,459 | # Small Worlds Discord Bot
require 'discordrb'
require 'yaml'
# Constants
require './rolesconfig.rb'
# App files
require './app/admin.rb'
require './app/bearing_plotter.rb'
require './app/context.rb'
require './app/countdown.rb'
require './app/custom_commands.rb'
require './app/deaths.rb'
require './app/emoji_role.rb... | 28.929412 | 153 | 0.661244 |
03acda5f16b6b0fff1e7e0950b57efec5522b7ab | 252 | require 'spec_helper'
describe Virtus::Coercion::Integer, '.to_float' do
subject { object.to_float(fixnum) }
let(:object) { described_class }
let(:fixnum) { 1 }
it { should be_instance_of(Float) }
it { should eql(1.0) }
end
| 19.384615 | 50 | 0.638889 |
5d6805a991acef8bca9e9360fc69fd83c8ae91e4 | 94 | # NOTE: here for Bundler to auto-load the gem unless :require => false
require 'arjdbc/hsqldb' | 47 | 70 | 0.755319 |
ed95af364cfef83300d2d49a05871b49d468d783 | 1,521 | require "helper"
require "bundles/inspec-supermarket/target"
require "bundles/inspec-supermarket/api"
describe "Inspec::Fetcher" do
it "loads the local fetcher for this file" do
res = Inspec::Fetcher::Registry.resolve(__FILE__)
_(res).must_be_kind_of Inspec::Fetcher::Local
end
describe "without a source... | 33.065217 | 144 | 0.670611 |
d52a7913fa11c7309770034b305cbffd0baef30e | 1,536 | # -*- encoding: utf-8 -*-
# stub: rspec-expectations 2.14.5 ruby lib
Gem::Specification.new do |s|
s.name = "rspec-expectations"
s.version = "2.14.5"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Steven Baker", "David Chelimsky"]
s.date... | 36.571429 | 105 | 0.617188 |
e24e81e6e68fd8cb4dcc7fb7fe477d650fbbfb8c | 341 | module PViewer
module Web
module Commands
class DisplayScheme < Basic
REQUIRED_ARGS = [
*REQUIRED_ARGS,
:data,
:details
].freeze
ALLOWED_ARGS = ALLOWED_ARGS.merge(
details: Hash,
data: Array
).freeze
end
... | 17.947368 | 43 | 0.495601 |
ab054f31ec76101aea7c1ff8fe2acb3336ad9f68 | 10,407 | # frozen_string_literal: true
require 'spec_helper'
# maps AIX release major fact value to the known AIX version
AIX_VERSION = {
'6100': '6.1',
'7100': '7.2',
'7200': '7.2',
}.freeze
def redhat_familly_supported_os
on_supported_os(
supported_os: [
{
'operatingsystem' => 'RedHat',
"o... | 34.121311 | 125 | 0.570193 |
ab8b8f7c3f1d1efdbf2265ab869d068f51283785 | 636 | class DjangoCompletion < Formula
desc "Bash completion for Django"
homepage "https://www.djangoproject.com/"
url "https://github.com/django/django/archive/3.2.3.tar.gz"
sha256 "854da43b18bade10f5d0c3a01919fa396037f4630b142ad81aa365295b3bb733"
license "BSD-3-Clause"
head "https://github.com/django/django.git... | 27.652174 | 85 | 0.716981 |
4aab8530903ce43b1fcc9958614c880318cd5cde | 1,814 | # Matt Pruitt
# Ruby Library for working with Vimeo
# Based on the sample PHP Vimeo API
require 'digest/md5'
require 'net/http'
require 'rexml/document'
require File.join(File.dirname(__FILE__), %w[Video])
module RBVIMEO
class Vimeo
attr_accessor :api_key, :api_secret
@@API_REST_URL = "http://www.vimeo.... | 29.737705 | 90 | 0.634509 |
b9bb686eff4dc319a9874f02e0244f6189bee856 | 8,554 | require 'spectator/clock'
require 'spectator/counter'
require 'spectator/distribution_summary'
require 'spectator/gauge'
require 'spectator/http'
require 'spectator/meter_id'
require 'spectator/timer'
module Spectator
# Registry to manage a set of meters
class Registry
attr_reader :config, :clock, :publisher, ... | 28.608696 | 80 | 0.638649 |
5dd8b1ac04d0a024409c28d6be85784accb4e1cf | 556 | require 'spec_helper'
describe 'classroom::course::virtual::intro' do
context "applied to master" do
let(:pre_condition) {
"service { 'pe-puppetserver':
ensure => running,
}" + GLOBAL_PRE
}
let(:node) { 'master.puppetlabs.vm' }
let(:facts) { {
:servername => 'master.pup... | 19.857143 | 47 | 0.579137 |
183c87af7f067dcad5276c489e41c36fa8fdd18b | 7,641 | # This file is a tool extension to simply stored. Its intention is to not
# change anything of an existing implementation, but to hugely speedup existing
# implementations. I will illustrate this given the example relation types:
# Person has_many posts and belongs to a group, Post has many comments, Comment belongs ... | 47.75625 | 246 | 0.664573 |
33b3f7eca00eccc56c1454090bef2df03d62ed01 | 1,251 | require 'rails_helper'
describe Reports::SpUserQuotasReport do
subject { described_class.new }
let(:issuer) { 'foo' }
let(:app_id) { 'app_id' }
it 'is empty' do
expect(subject.call).to eq('[]')
end
it 'runs correctly if the current month is before the fiscal start month of October' do
expect_rep... | 34.75 | 96 | 0.740208 |
7aa5c29c4a56043e5d2a2b23261742c1053de44a | 1,156 | # 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,... | 33.028571 | 76 | 0.737889 |
384ec83a4af6d3637eda326e4c7eff714016be69 | 11,843 | # 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... | 37.477848 | 190 | 0.717132 |
f8a0d7206217dc0ca6c9ff23f108de7e7d53e030 | 193 | Rails.application.routes.draw do
root "home#index"
resources :reviews
devise_for :users, controllers: {
registrations: "users/registrations",
sessions: "users/sessions"
}
end
| 17.545455 | 41 | 0.715026 |
11614ce4045c937bc06b3560820e8acbb8775915 | 50 | require "log_format/engine"
module LogFormat
end
| 10 | 27 | 0.82 |
ed41ff7a0fae08cc8ea216a64bb20d3fdd2781e5 | 20,193 | require 'spec_helper'
describe Commit do
let(:project) { create(:project, :public, :repository) }
let(:commit) { project.commit }
describe 'modules' do
subject { described_class }
it { is_expected.to include_module(Mentionable) }
it { is_expected.to include_module(Participable) }
it { is_expec... | 32.727715 | 159 | 0.660377 |
e8fa394aed26c883930f0f51eda00869b47e9531 | 1,479 | # frozen_string_literal: false
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic ... | 32.152174 | 112 | 0.555105 |
918e8a4e7b5eaf54925b33b1782a667446425577 | 4,910 | require 'spec_helper'
shared_examples_for 'the first before max_id page' do
it 'returns a default sized array' do
expect(subject.size).to eq(25)
end
it 'returns the appropriate first object' do
expect(subject.first.name).to eq('user100')
end
end
shared_examples_for 'blank page' do
it 'returns an a... | 30.308642 | 94 | 0.611202 |
ffa71582cac18dc17af7ee8bd0757764c5d76e07 | 1,073 | class Site::ArticlesController < Site::BaseController
def index
query = Article.published.latest
if params.key?( :category )
@category = Category.find_by_slug( params[:category] )
return not_found if @category.nil?
query = query.in( @category )
end
@articles = query.paginate(... | 17.883333 | 112 | 0.657968 |
28c14d537569ea57955eaec750d1985a8670f6a7 | 505 | json.code @code
json.message @message
if @posts.length != 0
json.post @posts.each do |p|
json.pid p.id
json.ptitle p.title
json.pleixing p.leixing
json.passets p.postimgs, :asset
time = p.created_at.strftime("%Y-%m-%d %T").to_s
json.updatetime time
json.uid p.user.id
j... | 26.578947 | 76 | 0.653465 |
e28672417f9ba515770f3351bd0baf8affaf4a16 | 7,707 | =begin
#MailSlurp API
#MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more. ## Resources - [Homepage](https://www.mailslurp.com) - G... | 34.10177 | 470 | 0.65966 |
387015e602cb616b43ab4fa2956b2118d7bc7159 | 4,921 | require "simplecov"
SimpleCov.start
# This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need t... | 47.317308 | 92 | 0.743142 |
39c21467c09db5ceb8d44b50d7718d5012d7a6a4 | 1,143 | #
# Cookbook Name:: nagios
# Recipe:: default
#
# Copyright (C) 2015 Wanelo, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rig... | 43.961538 | 72 | 0.769904 |
e840a7895cf3fba484711078d515f595d3d92605 | 5,530 | # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... | 34.347826 | 245 | 0.667812 |
623f53b2746b1363a35d226d451a3c3351557536 | 23,344 | require "rbs"
module TypeProf
class RBSReader
def initialize
@env, @builtin_env_json = RBSReader.get_builtin_env
end
@builtin_env = @builtin_env_json = nil
def self.get_builtin_env
unless @builtin_env
@builtin_env = RBS::Environment.new
loader = RBS::EnvironmentLoader.ne... | 33.588489 | 139 | 0.589273 |
d501764f9f27cd199fafb87d762a419979bfb969 | 529 | class Api::V1::RoomsController < ApplicationController
def create
@room = Room.create(room_params)
if @room.valid?
render json: { room: RoomSerializer.new(@room) }, status: :created
else
render json: { error: 'failed to create room' }, status: :not_acceptable
end
end
def destroy
... | 22.041667 | 90 | 0.661626 |
e906d19517c2c3d4d369b4c3005b7a64c3531e0a | 659 | Pod::Spec.new do |s|
s.name = "POP+SnapKit"
s.version = "3.0.2"
s.summary = "Use SnapKit with the Facebook Pop animation framework."
s.homepage = "https://github.com/wxxsw/POP-SnapKit"
s.license = "MIT"
s.author = { "GeSen" => "i@gesen.me" }
# Swift code is built as ... | 29.954545 | 98 | 0.582701 |
384ecc3b580abdaf66095e9bf0548cedf2ceecd5 | 47 | # typed: true
case foo; in A[] then true; end
| 11.75 | 31 | 0.638298 |
3967a5956f796d62d2ce1c698fbd08c8220036c1 | 2,851 | module Mandrill
class API
# Blank Slate
instance_methods.each do |m|
undef_method m unless m.to_s =~ /^__|object_id|method_missing|respond_to?|to_s|inspect|kind_of?|should|should_not/
end
# Mandrill API Documentation: http://mandrillapp.com/api/docs
API_VERSION = "1.0"
API_URL = "ht... | 35.6375 | 120 | 0.641179 |
e9dc2d0aa539a8997e56ab07a713eab48eaddf8a | 1,589 | if ENV["UI_TEST"]
require 'selenium-webdriver'
require 'page-object'
require 'csv'
require 'json'
require_relative '../ui_selenium/pages/cal_central_pages'
Dir[Rails.root.join('spec', 'ui_selenium', 'util', "**.rb")].each { |f| require f }
require_relative '../ui_selenium/pages/api_my_academics_page'
... | 40.74359 | 92 | 0.757709 |
f8b6daea5a3b90e395bc73a6cd6d8cf6c82aa1e1 | 21,267 | require 'date'
require 'set'
require 'bigdecimal'
require 'bigdecimal/util'
module ActiveRecord
module ConnectionAdapters #:nodoc:
# Abstract representation of an index definition on a table. Instances of
# this type are typically created and returned by methods in database
# adapters. e.g. ActiveRecord:... | 37.050523 | 160 | 0.614849 |
1d273c2a49f36a1d5af97df1e51c02c7e02e3f30 | 790 | require "spec_helper"
describe HarvesterCore::Modifiers::Truncator do
let(:klass) { HarvesterCore::Modifiers::Truncator }
describe "#initialize" do
it "assigns the original value and the length" do
truncator = klass.new(["Value"], 300)
truncator.original_value.should eq ["Value"]
truncato... | 29.259259 | 79 | 0.670886 |
7a2c2b4ae90c44425afc175dcf00921b9a70b21d | 2,831 | # frozen_string_literal: true
module QA
RSpec.describe 'Verify', :runner, quarantine: {
type: :flaky,
issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/351994'
} do
describe 'Run pipeline with manual jobs' do
let(:project) do
Resource::Project.fabricate_via_api! do |project|
... | 28.59596 | 131 | 0.508301 |
26a59fa349035cb6281abedae045e6006dafe5cd | 1,179 | #!/usr/bin/env ruby
#
module MIDIMessage
# this is a helper for converting nibbles and bytes
module TypeConversion
def self.hex_chars_to_numeric_byte_array(nibbles)
nibbles = nibbles.dup
# get rid of last nibble if there's an odd number
# it will be processed later anyway
nibbles.... | 25.085106 | 82 | 0.585242 |
33e4964e33a370f6f23c54592de70b07cb5ffad4 | 645 | User.create!(name: "Example User",
email: "example@railstutorial.org",
password: "foobar",
password_confirmation: "foobar",
admin: true)
#オリジナル
User.create!(name: "Toshi",
email: "z18098to@aiit.ac.jp",
password: "f... | 32.25 | 48 | 0.527132 |
017e5cb2cea26c666a8be64f8e110c64e5460125 | 180 | # coding: utf-8
module ONIX; module CodeLists
LIST_14 = {
"00" => "Undefined",
"01" => "Sentence case",
"02" => "Title case",
"03" => "All capitals"
}
end; end | 18 | 29 | 0.538889 |
617b3b77e1e8df993f9ca3b395d0d6a203aefcc7 | 188 | class AddAuthSourcesFilter < ActiveRecord::Migration
def self.up
add_column :auth_sources, :filter, :string
end
def self.down
remove_column :auth_sources, :filter
end
end
| 18.8 | 52 | 0.744681 |
33721b9ffe0da7966f640486467bc8e8968edf88 | 36 | module I18n
VERSION = "0.4.2"
end
| 9 | 19 | 0.638889 |
b9f90fc4c62a19c9e6b8f864f171e26bf78178d5 | 1,631 | module BackendClient
class Provider
module Transactions
Transaction = Struct.new(:cinstance, :usage, :timestamp)
def latest_transactions
transactions = account.services.flat_map { |service| ThreeScale::Core::Transaction.load_all(service.backend_id).to_a }
process_transactions(transac... | 33.979167 | 145 | 0.676885 |
79684c7b28dbcb6e7342a99d067e8ef7bab6cd6a | 3,793 | 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.228261 | 102 | 0.757712 |
ed9aa80b7356e7f0dacd38b7a28a4e7010b0da76 | 516 | # frozen_string_literal: true
require 'vcr'
require 'webmock'
VCR.configure do |config|
config.ignore_localhost = true
config.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
config.hook_into :webmock
config.configure_rspec_metadata!
config.allow_http_connections_when_no_cassette = true
config.filter... | 30.352941 | 141 | 0.790698 |
289033c71d876b037bc53504b9b2a55e573ad93f | 2,226 | describe AwayCommand do
it "should set IRC connection's AWAY message" do
irc_connection = double(:irc_connection, :authenticated? => true, :registered? => true,
:nick => 'Otto')
expect(irc_connection).to receive(:send_reply).with(/You have been marked as being away/)
expect(irc_connection).to receiv... | 37.1 | 97 | 0.696765 |
e29115987fd6b40e1c7430782d9b5423a578b2bc | 889 | require 'spec_helper'
describe Weather::Cache do
context 'when cache is implemented' do
before(:all) do
Weather.reset_configuration!
Weather.configuration.set_cache_store(:file_store, 'tmp/cache')
@key = SecureRandom.hex
@timestamp = Time.now
end
it '#write' do
expect( Wea... | 20.674419 | 72 | 0.614173 |
f8a6ca53c0d13f86a91c9562a2fc9b6e1af383c6 | 106 | RSpec.describe Jscop do
it 'has a version number' do
expect(Jscop::VERSION).not_to be nil
end
end
| 17.666667 | 40 | 0.716981 |
5d907e66c42552581b5f63deff42e2591e2aaf80 | 795 | cask 'aliwangwang' do
version '7.03.01-7790'
sha256 '48f400006987ecb3b9f46eaa3add78a4e22304ff15c684ce637a1c087f08f0bd'
# dbison.alicdn.com was verified as official when first introduced to the cask
url "https://dbison.alicdn.com/updates/macww-nosandbox-#{version}.dmg"
name 'Ali Wangwang'
homepage 'https://... | 36.136364 | 86 | 0.680503 |
08235013eabdf108a59b39ab0ee946851cd8d00a | 1,006 | # frozen_string_literal: true
require 'rails_helper'
require 'mvi/responses/find_candidate'
describe MVI::Responses::Base do
let(:klass) do
Class.new(MVI::Responses::Base) do
mvi_endpoint :PRPA_IN201306UV02
end
end
let(:faraday_response) { instance_double('Faraday::Response') }
let(:body) { File.... | 28.742857 | 82 | 0.705765 |
79c7baf3b4dd6725a656730c442e1e6a854e5ba0 | 78 | class HomeController < ApplicationController
def index
end
end
| 6.5 | 44 | 0.692308 |
33eb691b173dedc94078e8ecf6a6b90c318b9e1c | 4,162 | # Phusion Passenger - https://www.phusionpassenger.com/
# Copyright (c) 2010-2017 Phusion Holding B.V.
#
# "Passenger", "Phusion Passenger" and "Union Station" are registered
# trademarks of Phusion Holding B.V.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software an... | 39.264151 | 97 | 0.730899 |
6adf2050a8f3c8fe0bb15c60480febd113303d59 | 2,927 | RSpec.shared_examples 'rack examples' do
include Warden::Test::Helpers
let(:endpoint) { 'https://api.airbrake.io/api/v3/projects/113743/notices' }
before do
stub_request(:post, endpoint).to_return(status: 200, body: '')
Airbrake::Config.instance.merge(performance_stats: false)
end
after { Warden.te... | 26.369369 | 82 | 0.592415 |
acd24a5a86d68a51874fc63aebb0d54925e633de | 477 | #!C:/Ruby/bin/ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired... | 43.363636 | 113 | 0.75891 |
7aeabb39304b55e982e520249aafa55fed5ba4de | 144 | class Location < ActiveRecord::Base
belongs_to :region
has_many :people
def self.ordered_by_name
Location.all.order(:name)
end
end
| 16 | 35 | 0.743056 |
6afab51529249f4cb25fd34e44b2bae92af0d084 | 2,675 | require 'rails_helper'
describe InternalAttribute, type: :model do
let(:internal_attribute) { InternalAttribute.new }
let(:otu) { FactoryBot.build(:valid_otu) }
let(:predicate) { FactoryBot.create(:valid_controlled_vocabulary_term_predicate) }
context 'validation' do
before(:each) {
internal_attribu... | 33.860759 | 142 | 0.703925 |
7957943b7d463741392cbc4cd5a6a3a73061508b | 1,991 | class Mosquitto < Formula
desc "Message broker implementing the MQTT protocol"
homepage "https://mosquitto.org/"
url "https://mosquitto.org/files/source/mosquitto-1.5.2.tar.gz"
sha256 "7e90ccfe95179cfe6bf7d7f725281dd83041f241a8f093c9d3883b926584de9c"
bottle do
sha256 "9f8a48f1841e761956a31628e8aff3ea3852... | 30.166667 | 106 | 0.691612 |
bb215d59c45f24f0808259d46fbe4490f7925fa1 | 12,914 | require 'puppet/file_serving/content'
require 'puppet/file_serving/metadata'
require 'puppet/file_serving/terminus_helper'
require 'puppet/http'
module Puppet
# Copy files from a local or remote source. This state *only* does any work
# when the remote file is an actual file; in that case, this state copies
# ... | 35.872222 | 186 | 0.651928 |
1cf6f85cc56b88306ef37377654e0428dfe5a0f7 | 507 | require 'spec_helper'
describe Nominatim::Polygon do
let(:polygon) { Nominatim::Polygon.new([[-1.816513, 52.5487566], [-1.8164913, 52.548824], [-1.8164685, 52.5488213]]) }
it 'sets coordinates correctly' do
polygon.coordinates.first.lat.should eq -1.816513
polygon.coordinates.first.lon.should eq 52.54875... | 26.684211 | 120 | 0.692308 |
bf91f0a773800c228e673bced9ede28cbf1403b3 | 381 | #
# hazel/collection_base.rb
# vr 1.0
module Hazel
class CollectionBase
def initialize
@objs = []
end
def add_obj(new_object)
@objs.push(new_object)
return self
end
def rem_obj(new_object)
@objs.delete(new_object)
return self
end
def objs
return @obj... | 12.7 | 30 | 0.593176 |
f7afa6f7466938e8eeaaaae54bf88643d709f41c | 2,713 | require "lib/tag_cloud"
module BlogHelpers
def _get_path(current_page)
"https://developer.mypurecloud.com/blog#{current_page.url}"
end
def email_share_link(current_page)
"mailto:?&subject=#{current_page.metadata[:page][:title]}&body=#{_get_path(current_page)}"
end
def twitter_share... | 34.341772 | 209 | 0.632879 |
915ab64fa032e5764e174b88b6e03977335fa1ff | 3,375 | require 'msf/core'
###
#
# This class is here to implement advanced features for osx-based
# payloads. OSX payloads are expected to include this module if
# they want to support these features.
#
###
module Msf::Payload::Osx
#
# This mixin is chained within payloads that target the OSX platform.
# It provides spec... | 28.601695 | 75 | 0.397926 |
e98f0dad5c8afddc0040068f1daf5313d85eaf1b | 9,505 | # encoding: utf-8
require 'test_helper'
# All remote tests require Canada Post development environment credentials
class RemoteCanadaPostPWSPlatformTest < Minitest::Test
include ActiveShipping::Test::Credentials
include ActiveShipping::Test::Fixtures
def setup
@login = credentials(:canada_post_pws_platform... | 36.278626 | 109 | 0.678906 |
e2383ea337bfd29147904bda4fa78d61b4a26616 | 265 | # frozen_string_literal: true
require "faraday"
require "json"
require_relative "sentilink/client"
require_relative "sentilink/configuration"
require_relative "sentilink/version"
module Sentilink
class Error < StandardError; end
# Your code goes here...
end
| 18.928571 | 42 | 0.796226 |
b91dea53ea6e1de4ed39f5e339f4e3899b575ff1 | 696 | class NewRelic::MetricParser::Frontend < NewRelic::MetricParser::MetricParser
=begin
def action_name
if segments[-1] =~ /^\(other\)$/
'(template only)'
else
segments[-1]
end
end
=end
def developer_name
url
#"#{controller_name}##{action_name}"
end
def short_name
# s... | 16.97561 | 77 | 0.609195 |
5dc852c7948ac99857b5c53f939ec02201a4e308 | 151 | require 'spec_helper'
describe 'simplib::sudoers' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to create_class('sudo') }
end
| 16.777778 | 45 | 0.735099 |
8741af18be8dd58b0eb62645b2310a506f3e811d | 704 | class PermissionRequest < ApplicationRecord
## PermissionRequests have...
## - user
## - level_requested (admin or editor)
## - reviewed (boolean)
## - granted (boolean)
## - reviewed_by (user)
## - reviewed_on (datetime)
## - created_at (datetime)
## - updated_at (datetime)
belongs_to :user
... | 22 | 61 | 0.677557 |
5d8d3c3b36d2943ec8cb7dd2cf37c35c777865ce | 1,743 | require 'abstract_unit'
class TestTestMailer < ActionMailer::Base
end
class ClearTestDeliveriesMixinTest < ActiveSupport::TestCase
include ActionMailer::TestCase::ClearTestDeliveries
def before_setup
ActionMailer::Base.delivery_method, @original_delivery_method = :test, ActionMailer::Base.delivery_method
... | 26.014925 | 109 | 0.794607 |
26624842722c588b669fe2e775a3d1613f986879 | 997 | # Challenge name: Add Digits
#
# Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.
#
# Example:
#
# Input: 38
# Output: 2
# Explanation: The process is like: 3 + 8 = 11, 1 + 1 = 2.
# Since 2 has only one digit, return it.
#
# Follow up:
# Could you do it w... | 16.080645 | 102 | 0.637914 |
1ce78a3705300c3c97c6e822e1e4bf4934723a7e | 46 | module LazopApiClient
VERSION = "1.2.6"
end
| 11.5 | 21 | 0.717391 |
01b68268d79de5dfc0fc2c3c9d60d78f4d52b7a7 | 2,733 | module Sorcery
module Controller
module Submodules
# The Remember Me submodule takes care of setting the user's cookie so that he will
# be automatically logged in to the site on every visit,
# until the cookie expires.
# See Sorcery::Model::Submodules::RememberMe for configuration options... | 37.958333 | 129 | 0.612514 |
e89a8849694589ca7f9153fe20744efc8692e1a0 | 1,425 | require 'test_helper'
module Enumerize
class AttributeMapTest < MiniTest::Spec
subject { AttributeMap.new }
def make_attr(name)
Attribute.new(nil, name, :in => %[a b])
end
it 'empty when no attrs' do
subject.must_be_empty
end
it 'not empty when attr added' do
subject << m... | 20.652174 | 48 | 0.600702 |
d561ce34c7786e5e54fba8e3cb74b2361a2bfe95 | 531 | # Recall that hashes are collections of key-value pairs,LHS is key,RHS is value
breakfast = {
"bacon" => "tasty",
"eggs" => "tasty",
"oatmeal" => "healthy",
"OJ" => "juicy"
}
# Remember that keys must be unique, but values can repeat.
# That’s why we can have more than one key share the value “tasty.”... | 29.5 | 80 | 0.664783 |
032a9e4d571a6a911c638ccffc2b65738aba7f6a | 1,734 | # frozen_string_literal: true
require_relative 'lib/rubocop/version'
Gem::Specification.new do |s|
s.name = 'rubocop'
s.version = RuboCop::Version::STRING
s.platform = Gem::Platform::RUBY
s.required_ruby_version = '>= 2.5.0'
s.authors = ['Bozhidar Batsov', 'Jonas Arvidsson', 'Yuji Nakayama']
s.description... | 39.409091 | 100 | 0.679931 |
ff3d56b5da52d0106eb33ffe54fd13e5612226fc | 1,033 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'tofulcrum/version'
Gem::Specification.new do |spec|
spec.name = "tofulcrum"
spec.version = Tofulcrum::VERSION
spec.authors = ["Zac McCormick"]
spec.email = ["... | 34.433333 | 74 | 0.663117 |
4a40ec0f421aa055f40e86ee1437822943d91ad5 | 17,591 | require 'puppet/util'
require 'puppet/util/cacher'
require 'monitor'
require 'puppet/parser/parser_factory'
# Just define it, so this class has fewer load dependencies.
class Puppet::Node
end
# Puppet::Node::Environment acts as a container for all configuration
# that is expected to vary between environments.
#
# ## ... | 33.570611 | 125 | 0.680575 |
1c71aa4ec7101f30b84564305447a92d9344b909 | 12,732 | require 'rails_helper'
RSpec.describe CandidateMailer, type: :mailer do
include TestHelpers::MailerSetupHelper
subject(:mailer) { described_class }
let(:application_form) do
build_stubbed(:application_form, first_name: 'Fred',
candidate: candidate,
... | 38.00597 | 144 | 0.636349 |
1a25777fc595c3b440a70ce406c17957a1281246 | 4,087 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Bibliography do
subject(:bibliography) { described_class.new(bibtex) }
context 'rendering bibliography as HTML' do
context 'phdthesis' do
let(:bibtex) { Pathname('spec/fixtures/bibliography/phdthesis.bib') }
it '#to_html' do
... | 36.168142 | 100 | 0.655738 |
91069e8641d1f6d2324ee5147c2eaac0720b64e1 | 3,495 | # vim: syntax=ruby:expandtab:shiftwidth=2:softtabstop=2:tabstop=2
# Copyright 2013-present Facebook
#
# 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/LIC... | 27.519685 | 77 | 0.684692 |
6a61a707a1ec8b7cde9b12383f189e7d87ec9f2f | 17,966 | require 'cocoapods-core/specification/consumer'
require 'cocoapods-core/specification/dsl'
require 'cocoapods-core/specification/linter'
require 'cocoapods-core/specification/root_attribute_accessors'
require 'cocoapods-core/specification/set'
require 'cocoapods-core/specification/yaml'
module Pod
# The Specificati... | 29.30832 | 107 | 0.602583 |
b9fdf991d1a73c31c7fd7869aff0463f37b58f77 | 1,333 | module RedditKit
class Client
# Methods for voting on links and comments.
module Voting
# Upvotes a link or comment.
#
# @param link_or_comment [String, RedditKit::Comment, RedditKit::Link] The link or comment to upvote.
def upvote(link_or_comment)
vote link_or_comment, 1
... | 31.738095 | 129 | 0.654914 |
2605ed77771f554ea3e1d48b46073d0046a372a4 | 1,362 | # Encoding: UTF-8
require File.expand_path('../../core/lib/refinery/version', __FILE__)
version = Refinery::Version.to_s
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = %q{refinerycms-resources}
s.version = version
s.summary = %q{Resources exte... | 40.058824 | 97 | 0.604993 |
03aa7385204dc245593ebebc6bca459e0b7e0fbd | 3,109 | require_relative 'ionoscloud_base'
class Chef
class Knife
class IonoscloudContractList < Knife
include Knife::IonoscloudBase
banner 'knife ionoscloud contract list'
attr_reader :description, :required_options
def initialize(args = [])
super(args)
@description =
... | 59.788462 | 128 | 0.69733 |
91e90315b3e55088f6db6ec378416b4f5f9a3455 | 1,170 | # frozen_string_literal: true
require 'spec_helper'
describe Gitlab::Graphql::FindArgumentInParent do
describe '#find' do
def build_node(parent = nil, args: {})
props = { irep_node: double(arguments: args) }
props[:parent] = parent if parent # The root node shouldn't respond to parent
double(... | 26 | 99 | 0.626496 |
7a878ac978cf5a566222381bd2e1ff1ebb6104cb | 66 | Signal.trap('INT') do
puts self
exit
end
p Process.pid
sleep
| 8.25 | 21 | 0.69697 |
e22b4355b3e82191b0cf4db0e2b05993e99d331e | 795 | require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
Pod::Spec.new do |s|
s.name = "react-native-kustomerv2-sdk"
s.version = package["version"]
s.summary = package["description"]
s.description = <<-DESC
react-native-kustomerv2-sdk
... | 31.8 | 120 | 0.6 |
f8c0e0db76ea37c01fb040b0c533dbf9053dafc1 | 857 | require 'xsd/qname'
# {http://www.jin.gr.jp/~nahi/xmlns/sample/Person}Person
class Person
@@schema_type = "Person"
@@schema_ns = "http://www.jin.gr.jp/~nahi/xmlns/sample/Person"
@@schema_element = [["familyname", ["SOAP::SOAPString", XSD::QName.new(nil, "familyname")]], ["givenname", ["SOAP::SOAPString", XSD::QN... | 37.26087 | 345 | 0.65811 |
bb6bedd2923d19dad37945967dfcc9cc7f781ae1 | 570 | ################################################################################
# mp3 ファイルのタグを扱うテストです。
################################################################################
require "mp3info"
# 作業ディレクトリのパス
WORKING_DIRECTORY_PATH = __dir__.encode("UTF-8").freeze
# 作業ディレクトリと同階層にあるすべての mp3 ファイルに対して処理を行う
Dir.... | 23.75 | 89 | 0.454386 |
18d6f3f9d324c78dd4a515edc169a06090cc527b | 162 | module WiMP
class SimpleArtist < Struct.new(:name, :id)
#
# @return String
#
def url
"http://wimpmusic.se/artist/#{id}"
end
end
end
| 14.727273 | 45 | 0.567901 |
b9de1baf440fb46321ff61e9329976428a44fcfd | 5,769 | #-- 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... | 40.626761 | 126 | 0.723349 |
ac0f595f14434e31380daed929b1d548809d9a99 | 1,240 | #!/usr/bin/env ruby
# <bitbar.title>Your time on earth</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Tim Regener</bitbar.author>
# <bitbar.author.github>timlapluie</bitbar.author.github>
# <bitbar.desc>Displays the time you are already living.</bitbar.desc>
# <bitbar.image>http://i.imgur.com/... | 31 | 117 | 0.606452 |
790011fa4facb686a98e51da2ebc48597e6a01f2 | 931 | class Article < ApplicationRecord
belongs_to :creator, class_name: 'User', foreign_key: :user_id
belongs_to :category, class_name: 'Category', foreign_key: :category_id
has_many :comments, dependent: :destroy
has_many :votes, dependent: :destroy
has_one_attached :image
validates :title, length: { minimum: ... | 32.103448 | 73 | 0.669173 |
28d2dc4a1b839e62e5b00c89e38601a92c60043c | 2,297 | # 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::ServiceFabric::V6_4_0_36
module Models
#
# Information about load reported by replica.
#
class LoadMetricReportInfo
i... | 28.012195 | 77 | 0.516326 |
01854e90188aed868233303285a07c47fb2b883c | 181 | class AddModeratorToUsers < ActiveRecord::Migration
def change
add_column :users, :moderator, :boolean, null: false, default: false
add_index :users, :moderator
end
end
| 25.857143 | 72 | 0.745856 |
e89a4040665ca616918dca590611f74857b00c02 | 184 | class Api::V1::IpoEventsController < ApplicationController
def index
ipo_events = IpoEvent.recent.pending.limit(15)
render json: IpoEventSerializer.new(ipo_events)
end
end
| 26.285714 | 58 | 0.777174 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.