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 |
|---|---|---|---|---|---|
ab8c15b5cca8165446323be60a6d49eb7b81a6c6 | 59 | module Jrac
module Rails
VERSION = "0.0.1"
end
end
| 9.833333 | 21 | 0.627119 |
f7706a65a7ee9a7a31a80e2091323b8e76cb554a | 594 | # frozen_string_literal: true
require 'rails_helper'
describe 'sitenotice', type: :feature do
before :each do
ENV['sitenotice'] = notice
end
context 'set in the environment' do
let(:notice) { 'NOTICE: The system will go down for maintenance soon.' }
it 'is displayed if set' do
visit root_path... | 22 | 76 | 0.666667 |
08bbb2119de5256bc401077c46035f3bac37500c | 362 | # frozen_string_literal: true
require "bundler/setup"
require "rspec"
require "rack/test"
require "omniauth"
require "omniauth/test"
require "omniauth/idcat_mobil"
RSpec.configure do |config|
config.include Rack::Test::Methods
config.extend OmniAuth::Test::StrategyMacros, type: :strategy
config.expect_with :rsp... | 22.625 | 63 | 0.759669 |
ab3d167c198e52f49da55f9b9696b23435a96bdb | 577 | cask "alfaview" do
version "8.29.0"
sha256 "3f069759d2ee5135353c2b40f27a0bf10b500233e73ba55501f784ad79e7358d"
url "https://assets.alfaview.com/stable/mac/alfaview-mac-production-#{version}.dmg"
name "Alfaview"
desc "Audio video conferencing"
homepage "https://alfaview.com/"
livecheck do
url "https:/... | 27.47619 | 85 | 0.722704 |
ffe7133edcaeda30e63d16d35b52ec8ac696eaec | 454 | # frozen_string_literal: true
activate :blog do |blog|
blog.sources = 'blog/:year-:month-:day-:title.html'
blog.permalink = 'blog/:year-:month-:day-:title.html'
blog.calendar_template = 'calendar.html'
blog.tag_template = 'tag.html'
# blog.paginate = true
blog.per_page = 5
... | 25.222222 | 63 | 0.618943 |
217503a52e1e5b94579cd708fc01ffe17c9773ee | 15,322 | require "active_job/base"
require "active_job/arguments"
module RSpec
module Rails
module Matchers
# Namespace for various implementations of ActiveJob features
#
# @api private
module ActiveJob
# rubocop: disable Metrics/ClassLength
# @private
class Base < RSpec::... | 32.879828 | 125 | 0.560893 |
18677498dde5f92bb7e5547ff6065ac1e40af675 | 8,942 | require 'test_helper'
class MysqlPtOscAdapterTest < ActiveSupport::TestCase
class TestConnection < ActiveRecord::Base; end
context 'a pt-osc adapter' do
setup do
TestConnection.establish_connection(test_spec)
@adapter = TestConnection.connection
# Silence warnings about not using an ActiveRe... | 36.647541 | 165 | 0.62335 |
1af62f58651006d17c6498241c43e83698b84451 | 12,588 | =begin
Copyright (c) 2017 Vantiv eCommerce
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 rights to use,
copy, modify, merge, publish, distrib... | 35.459155 | 125 | 0.665157 |
33db82beef7f31e7a24ea1eac5b69ae34845ae53 | 2,304 | module Fog
module DNS
class Rage4
class Real
# Updates an existing record
# ==== Parameters
# * record_id <~Integer> The id of the record you wish to update
# * name <~String> Name of record, include domain name
# * content <~String> IP address or Domain name
... | 34.38806 | 94 | 0.552083 |
2866081a6c05f9bbb08192f208b2fe31d03d611e | 2,183 | # Copyright:: Copyright 2022 Trimble Inc.
# License:: The MIT License (MIT)
# The DimensionRadial class represents radius and diameter dimensions on
# arcs and circles.
#
# @version SketchUp 2014
class Sketchup::DimensionRadial < Sketchup::Dimension
# Instance Methods
# The arc_curve method returns the ArcCurve ... | 24.806818 | 81 | 0.684837 |
62179d29993db61c1832ed4e2d61d9ffa476a5e9 | 1,631 | # frozen_string_literal: true
module RuboCop
module Cop
module Style
# This cop checks for optional arguments to methods
# that do not come at the end of the argument list.
#
# @safety
# This cop is unsafe because changing a method signature will
# implicitly change behavi... | 27.183333 | 90 | 0.591662 |
e864bad88320edc77b2b01faf4fe9b13215a9947 | 644 | #!/usr/bin/env rspec
require 'spec_helper'
require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/validator/ipv6address_validator.rb'
module MCollective
module Validator
describe "#validate" do
it "should raise an exception if the supplied value is not an ipv6 address" do
expect{
... | 32.2 | 105 | 0.694099 |
ab0ac63af3ce55196b0b6f2f1415470313d661bb | 654 | class Validator
class << self
def validate_params_user(params)
params.all? { |key, value| !value.empty? && value.in_range?(3, 15) }
end
def validate_params_patent(params)
params.all? { |key, value| !value.empty? } &&
params[:title].in_range?(6, 25) && params[:background].in_range?(20,... | 22.551724 | 82 | 0.643731 |
f8cca9854efda08ba1c15e033ceb2fc7831b42fc | 99 | class ToneSerializer < ActiveModel::Serializer
attributes :id, :name
has_many :adjectives
end
| 16.5 | 46 | 0.777778 |
1af030282482211c8068763c377dc63d916683d7 | 118 | desc "Restart app by touching tmp/restart.txt"
task restart: :environment do
FileUtils.touch('tmp/restart.txt')
end
| 23.6 | 46 | 0.771186 |
b90aee6d3fe9daf865bbc52035df45f95bed504f | 271 | class Jabref < Cask
version '2.10'
sha256 'c63a49e47a43bdb026dde7fb695210d9a3f8c0e71445af7d6736c5379b23baa2'
url 'https://downloads.sourceforge.net/project/jabref/jabref/2.10/JabRef-2.10-OSX.zip'
homepage 'http://jabref.sourceforge.net/'
app 'JabRef.app'
end
| 27.1 | 88 | 0.774908 |
f8728aef025af410ca7c352ea3089b9e6499641f | 132 | class UsdJpyM1CandleJob < CandleJob
@queue = :normal
def self.perform(params = {})
super(UsdJpyM1Candle, params)
end
end
| 16.5 | 35 | 0.704545 |
d5b74e450ae73992b193b1f10e995deaf0d5ce79 | 818 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/logging/type/log_severity.proto
require 'google/protobuf'
require 'google/api/annotations_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("google/logging/type/log_severity.proto", :syntax => :proto3) do
add_enum "g... | 25.5625 | 124 | 0.695599 |
334ad6179b446b8bc9c2dd7a86d7fc6b22a11e19 | 1,811 | #
# Be sure to run `pod lib lint SVSwiftHelpers.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 https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'SVSw... | 39.369565 | 113 | 0.655991 |
010b8b3571ec283bba54046c6f877a5687d85754 | 4,744 | require File.dirname(__FILE__) + '/gmo/gmo_errors'
require File.dirname(__FILE__) + '/gmo/gmo_common'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class GmoGateway < GmoCommon
include GmoErrors
self.supported_countries = ['JA']
self.supported_cardtypes = [:visa, :master, :jcb, :ameri... | 29.465839 | 97 | 0.596332 |
01463fed038c76a38e7b25297c7f75ae697f762f | 682 | require File.expand_path('../../../spec_helper', __FILE__)
ruby_version_is "1.9" do
describe "ENV.assoc" do
after(:each) do
ENV.delete("foo")
end
it "returns an array of the key and value of the environment variable with the given key" do
ENV["foo"] = "bar"
ENV.assoc("foo").should == [... | 26.230769 | 96 | 0.608504 |
0835d0188850b7cb7f01613aa018deb1be4cab97 | 1,470 | class ZshSyntaxHighlighting < Formula
desc "Fish shell like syntax highlighting for zsh"
homepage "https://github.com/zsh-users/zsh-syntax-highlighting"
url "https://github.com/zsh-users/zsh-syntax-highlighting.git",
:tag => "0.6.0",
:revision => "434af7b11dd33641231f1b48b8432e68eb472e46"
head "https://... | 39.72973 | 105 | 0.760544 |
61d42e4da1d02ea06be13d5d1289f5133592a52c | 903 | require "active_support/core_ext/hash"
require "tender_hash"
require "global_settings/version"
require "global_settings/yml_settings"
module GlobalSettings
@settings = {}
class << self
def load!(env, options={}, &block)
raise ArgumentError.new("Expected block with TenderHash mapping") unless block_give... | 18.06 | 91 | 0.655592 |
1d27b3cbca0a37799a71216ab598c278e3477bc3 | 49,405 | require 'spec_helper'
require 'request_spec_shared_examples'
module VCAP::CloudController
RSpec.describe 'Organizations' do
let(:user) { User.make }
let(:user_header) { headers_for(user) }
let(:admin_header) { admin_headers_for(user) }
let!(:organization1) { Organization.make name: 'Apocalypse World'... | 40.232085 | 180 | 0.563162 |
87b54a9816a117b08c93fb771027158f6be79e16 | 2,786 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'Service History API endpoint', type: :request, skip_emis: true do
include SchemaMatchers
let(:token) { 'token' }
let(:jwt) do
[{
'ver' => 1,
'jti' => 'AT.04f_GBSkMkWYbLgG5joGNlApqUthsZnYXhiyPc_5KZ0',
'iss' => 'https://ex... | 35.265823 | 105 | 0.669777 |
21e5c7e38fa0cc611b9b0c185961de337404b43b | 370 | require 'sanatio/skippable'
module Sanatio
class BlockValidator
include Skippable
def initialize(validation_block)
@validation_block = validation_block
end
def valid?(object)
object.instance_eval(&@validation_block)
end
def reason=(reason)
@reason = reason
end
de... | 14.8 | 46 | 0.667568 |
03dfa7066321f3ed8d3d7cc808ca55470896dea6 | 1,990 | class HasteClient < Formula
desc "CLI client for haste-server"
homepage "https://hastebin.com/"
head "https://github.com/seejohnrun/haste-client.git"
stable do
url "https://github.com/seejohnrun/haste-client/archive/v0.2.3.tar.gz"
sha256 "becbc13c964bb88841a440db4daff8e535e49cc03df7e1eddf16f95e2696cbaf... | 35.535714 | 93 | 0.732663 |
08e380d2fc5665531504f31f766d2cc14f8b3c4d | 1,815 | require 'rubygems'
require 'simplecov'
SimpleCov.start do
add_filter "/spec"
add_filter "/features"
# internet_connection mostly contains logic copied from the ruby 1.8.7
# stdlib for which I haven't written tests.
add_filter "internet_connection"
end
SimpleCov.at_exit do
File.open(File.join(SimpleCov.co... | 23.881579 | 109 | 0.719008 |
330034a97dc0991f60b11a6576ff827b66b29cfb | 667 | class SitemapGeneratePeriodicJob < ApplicationJob
def perform
setup
generate
ping_search_engines
end
private
def setup
# require inline so it's not loaded in web environment
require "sitemap_generator"
require "aws-sdk"
SitemapGenerator::Sitemap.adapter = SitemapGenerator::AwsSd... | 22.233333 | 144 | 0.766117 |
ff54bca67f4bae7c0bd53289cbe30805607585b4 | 498 | #!/usr/bin/env ruby
require 'yaml'
class Quote
def initialize(q, book)
@q = q
@book = book
end
def display
puts "\"#{@q['content']}\""
puts "\nFrom page #{@q['page']} of \"#{@book['title']}\" by #{@book['author']}."
end
end
books = YAML.load_file('data/finished.yaml')
quotes = []
books.each... | 16.6 | 84 | 0.594378 |
ff9012cb02c963c8be262a42ef50ad4fda878e82 | 311 | class ChangeSoundLocationData < ActiveRecord::Migration[5.2]
def change
change_table :sounds do |s|
s.change :latitude, :float, default: 0, null: false
s.change :longitude, :float, default: 0, null: false
end
add_column :sounds, :file_name, :string, default: "", null: false
end
end
| 31.1 | 69 | 0.681672 |
e9bfd997716a897668bc73e61c8f45c9fefe9f65 | 1,735 | # Specify gemfile Location and general variables
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
# Perform requiring gem that we need
######################################################################
# basic
require 'rubygems'
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
r... | 30.438596 | 86 | 0.561383 |
031d357219715360176763313653b29d99bde75c | 497 | # frozen_string_literal: true
module Types
module Packages
module Pypi
class MetadatumType < BaseObject
graphql_name 'PypiMetadata'
description 'Pypi metadata'
authorize :read_package
field :id, ::Types::GlobalIDType[::Packages::Pypi::Metadatum], null: false, description: ... | 27.611111 | 125 | 0.690141 |
38404a9b3ea58ec797b98b7832458e902e12f0c7 | 439 | # frozen_string_literal: true
class AddSpIdToShareButton < ActiveRecord::Migration[4.2]
def change
add_column :share_buttons, :sp_id, :string
add_column :share_buttons, :campaign_page_id, :integer
add_column :share_buttons, :sp_type, :string
add_column :share_facebooks, :sp_id, :string
add... | 33.769231 | 115 | 0.753986 |
1c475e81c8c4b1f4e7e59c4e26758b730758719b | 963 | class Chromark
class JsonFormat
include BookmarkFile
class Node
def initialize(json, file, parent)
if json["type"] == "url"
e = BookmarkFile::Entry.new(json["url"], json["date_added"], json["name"], parent)
file.entries << e
end
cate = BookmarkFile::Category... | 26.027027 | 106 | 0.563863 |
08987d1718aa0fd1f56eedb14e8efcc9ef2fff84 | 341 | module JsTestDriver
module CLI
class StartServer
attr_reader :jstd_jar_command, :runner
def initialize(jstd_jar_command, runner)
@jstd_jar_command = jstd_jar_command
@runner = runner
end
def run(opts = {})
runner.run(jstd_jar_command.start_server.to_s)
end... | 16.238095 | 54 | 0.648094 |
1c80cbfb89ce1bd619924d9669166ba2b9793d81 | 101 | class RemoveSurveyEncountersView < ActiveRecord::Migration[4.2]
def change
# Nothing
end
end
| 16.833333 | 63 | 0.752475 |
38ae2e1015ed2a79712daf30e029240874e88cf4 | 127 | module Pod
# The version of the CocoaPods command line tool.
#
VERSION = '1.0.0'.freeze unless defined? Pod::VERSION
end
| 21.166667 | 55 | 0.708661 |
1c6668b1e44f3267335d721cfd973f6c8f2184bc | 2,492 | module Rails
module Jquery
module Validation
module ActiveModel
module NumericalityValidator
def prepare_jquery_validation_rules(validation_rules, record, attribute, form_options, field_options)
if options[:greater_than].present?
validation_rules[:rule_min] = opt... | 57.953488 | 195 | 0.691413 |
62a19bb6c64c97d019bbb7c1d07ef42e71406bd2 | 174 | class ActiveSqlCallNumber < ActiveRecord::Base
has_and_belongs_to_many :active_sql_people,
:join_table => 'active_sql_call_numbers_active_sql_people' # for Rails 4
end
| 34.8 | 76 | 0.821839 |
d5b227548e0371f065f84d833a338af07f8575ce | 1,187 | module MiqAeMethodService
class MiqAeServiceMiqRequest < MiqAeServiceModelBase
require_relative "mixins/miq_ae_service_miq_request_mixin"
include MiqAeServiceMiqRequestMixin
expose :miq_request_tasks, :association => true
expose :requester, :association => true
expose :resource, ... | 32.081081 | 123 | 0.68155 |
aceea589f7d7f4e79f7ff46d5300389c9468b033 | 1,123 | # action to install from repository
action :install do
execute "install R package" do
command r_install(new_resource.package)
not_if r_is_installed(new_resource.package)
end
end
action :remove do
execute "remove R package" do
command r_remove(new_resource.package)
not_if r_is_removed(new_resource... | 24.413043 | 69 | 0.707035 |
384cb3285fc0c34cf68971a5e8fb5c6efd8e2741 | 1,223 | # frozen_string_literal: true
module Ci
class BuildPresenter < ProcessablePresenter
def erased_by_user?
# Build can be erased through API, therefore it does not have
# `erased_by` user assigned in that case.
erased? && erased_by
end
def erased_by_name
erased_by.name if erased_by_... | 22.236364 | 83 | 0.670482 |
037d14dba9243d346cc2b34688d278db70cc6d87 | 3,302 | require 'simplecov'
SimpleCov.start
require "jekyll"
require "jekyll-lilypond"
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
e... | 37.101124 | 92 | 0.735918 |
f73d9b74d8727da340ed93e0c0ade00397059904 | 1,561 | # Copyright (c) 2018 Public Library of Science
# 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 rights to use, copy, modify, merge, pub... | 39.025 | 76 | 0.761051 |
ff18b52f65c485eb54fd599ecaa73e684e4083c8 | 17,912 | # encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
require 'new_relic/agent/transaction'
require 'new_relic/agent/transaction/segment'
require 'new_relic/agent/transaction/datastore_segment'
require... | 35.121569 | 122 | 0.573805 |
e80c79afd1e9c59200f95def158c7c1f9c03b036 | 16,586 | # frozen_string_literal: true
module Faker
class Company < Base
flexible :company
class << self
##
# Produces a company name.
#
# @return [String]
#
# @example
# Faker::Company.name #=> "Roberts Inc"
#
# @faker.version 1.6.0
def name
pars... | 28.498282 | 164 | 0.544013 |
186e6018feef54e6678527d5a734dc6101a803d0 | 19,831 | # frozen_string_literal: true
require "open3"
require "dependabot/dependency"
require "dependabot/python/requirement_parser"
require "dependabot/python/file_fetcher"
require "dependabot/python/file_parser"
require "dependabot/python/file_parser/python_requirement_parser"
require "dependabot/python/update_checker"
requ... | 36.588561 | 118 | 0.604559 |
edaadb19392e1b3fa788b75c68aa449f788b8a58 | 1,049 | class SearchBuilder < Blacklight::SearchBuilder
include Blacklight::Solr::SearchBuilderBehavior
include BlacklightRangeLimit::RangeLimitBuilder
# Required by Find It / umlaut
include BlacklightCql::SearchBuilderExtension
include BlacklightAdvancedSearch::AdvancedSearchBuilder
self.default_processor_chain ... | 32.78125 | 95 | 0.807436 |
03cf54162530fa2dae079b0d4b28f09b8e78798e | 3,367 | #-- 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, which is a fork of ... | 29.278261 | 91 | 0.707752 |
6a92fe423adb601752557f1734553cda75413980 | 5,881 | # Copyright 2017 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 applicable law or agreed to in writing, ... | 33.605714 | 111 | 0.583574 |
f7b7af16dd864ee72d612158fc71f063589338ae | 419 | # frozen_string_literal: true
module AcaEntities
module Medicaid
module Contracts
# Contract for TaxDependent
class TaxDependentContract < Dry::Validation::Contract
params do
required(:role_reference).filled(:hash)
optional(:claimed_by_custodial_parent_indicator).filled(:... | 24.647059 | 72 | 0.682578 |
62e9097666861e736457f0e61f29be10e09b4936 | 515 | class SchemeReportPresenter < ReportPresenter
attr_accessor :scheme
delegate :name, to: :scheme
def initialize(scheme:,
report_form: ReportForm.new(from_date: scheme.created_at, to_date: Date.current))
self.scheme = scheme
self.report_form = report_form
end
def defects
@defects ... | 25.75 | 98 | 0.691262 |
28bedabd30da794fddb5993ff5ceb66a16d788c1 | 115 | RSpec.describe Tictactoe do
it "has a version number" do
expect(Tictactoe::VERSION).not_to be nil
end
end
| 16.428571 | 44 | 0.730435 |
289a006d3c231bf6b55fdd023dae5ecc13697ed2 | 1,655 | require 'spec_helper'
describe "sys_users", type: :feature, dbscope: :example do
shared_examples "shows sys/sns error page" do
it do
expect(page).to have_title(title)
within "#head" do
expect(page).to have_css(".ss-logo-application-name", text: "SHIRASAGI")
expect(page).to have_css("n... | 28.050847 | 108 | 0.641692 |
33a658863ec1ce8713ade380b5376e58afa9d537 | 2,264 | # frozen_string_literal: true
require_relative "../create_has_many_record"
module Fixably
module ActiveResource
class PaginatedCollection < ::ActiveResource::Collection
class << self
def paginatable?(value)
collection = attributes(value)
return false unless collection.is_a?(Has... | 24.608696 | 76 | 0.613074 |
abf5c3799d7088b490dcb545e6aab03c4644f434 | 1,623 | module OmniAuth
module LoginDotGov
class IdTokenRequest
attr_reader :code, :client
def initialize(code:, client:)
@code = code
@client = client
end
def request_id_token
response = Faraday.post(
client.idp_configuration.token_endpoint,
client_as... | 28.982143 | 90 | 0.634627 |
f8b4b2720c7d94746506d8e0871e82e688062c27 | 613 | Pod::Spec.new do |s|
s.name = "MHPrettyDate"
s.version = "1.0.1"
s.summary = "An iOS framework that provides a simple mechanism to get \"Pretty Dates\" (\"Yesterday\", \"Today\", etc.) from NSDate objects."
s.homepage = "https://github.com/bobjustbob/MHPrettyDate"
s.license = 'MIT'... | 43.785714 | 149 | 0.597064 |
acb5179742461bb1ddf5d3a69d9f0ec0efd95d82 | 980 | #
# responsive-youtube-jekyll-tag.rb
#
# by Jeffrey Morgan
# https://jeffreymorgan.io/
#
# Use Twitter Bootstrap's CSS to embed responsive YouTube videos.
#
# Usage:
#
# 1. Copy this file into your Jekyll _plugins folder
#
# 2. Add the youtube tag with a YouTube video ID where you
# want to embed the video
#
#... | 23.333333 | 146 | 0.697959 |
4a6f232ffaec508241c5f32a276aec4db6af35be | 910 | cask 'slite' do
version '1.0.19'
sha256 'ceaab1c064e43f770f9cf3822fa19a363dc44309abfc9caba9f669fb3b02ec65'
# storage.googleapis.com/slite-desktop was verified as official when first introduced to the cask
url "https://storage.googleapis.com/slite-desktop/mac/Slite-#{version}.dmg"
appcast 'https://www.corecod... | 41.363636 | 135 | 0.68022 |
287db0b02c50da3a4397c21e5f5ffb65e4f83272 | 1,544 | #
# Be sure to run `pod lib lint EJToast.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 https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'EJToast'
... | 36.761905 | 103 | 0.634715 |
1aac31852d59da1784b9874db837abd71389176f | 6,527 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Search::SnippetService do
include SearchResultHelpers
include ProjectHelpers
include AdminModeHelper
using RSpec::Parameterized::TableSyntax
it_behaves_like 'EE search service shared examples', ::Gitlab::SnippetSearchResults, ::Gitlab::Elas... | 42.383117 | 159 | 0.654972 |
3358af83fad3dcd71fdbcd7873f74c8608ef961a | 2,187 | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# This cop checks for duplicate elements in Regexp character classes.
#
# @example
#
# # bad
# r = /[xyx]/
#
# # bad
# r = /[0-9x0-9]/
#
# # good
# r = /[xy]/
... | 28.038462 | 98 | 0.588935 |
289ca12b5e8ab1d005b4796c21293f681d08c28f | 5,808 | require 'date'
class DateTime
class << self
# Returns <tt>Time.zone.now.to_datetime</tt> when <tt>Time.zone</tt> or
# <tt>config.time_zone</tt> are set, otherwise returns
# <tt>Time.now.to_datetime</tt>.
def current
::Time.zone ? ::Time.zone.now.to_datetime : ::Time.now.to_datetime
end
en... | 33.767442 | 111 | 0.662018 |
5ddbfa560dd601eab1b822b98c5d1a96600a44c9 | 1,787 | # frozen_string_literal: true
# encoding: utf-8
# Copyright (C) 2016-2020 MongoDB 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
#
# Un... | 28.365079 | 74 | 0.622272 |
bb6a6396f4a161103ccc7b9313a461972f16f208 | 2,591 | require 'spec_helper'
describe Listen::TCP do
let(:port) { 4000 }
let(:broadcaster) { Listen.to(Dir.pwd, forward_to: port) }
let(:recipient) { Listen.on(port) }
let(:callback) { ->(modified, added, removed) {
add_changes(:modified, modified)
add_changes(:added, added)
add_changes(:removed, remov... | 17.993056 | 60 | 0.484369 |
91ccca14fa6fc672d2a9b1d84abd5ad1caf93ab4 | 1,556 | require_relative '../../spec_helper'
describe FiguresIntersection::StraightLineSegmentComparator do
describe '.intersect' do
context 'when segment is vertical' do
it 'returns Point when it has intersection' do
expect(
described_class.intersect(
straight_line: FiguresIntersecti... | 33.826087 | 80 | 0.592545 |
387ac036c038eb8feed4f8c73b3a6aba1101aa57 | 1,152 | # frozen_string_literal: true
$LOAD_PATH.push File.expand_path('lib', __dir__)
require 'blueprints_boy/version'
Gem::Specification.new do |s|
s.name = 'blueprints_boy'
s.version = BlueprintsBoy::VERSION
s.authors = ['Andrius Chamentauskas']
s.email = ['andrius.chamentauskas@gmail.com']
s.homepage = 'http://... | 36 | 110 | 0.727431 |
115f72a9a0bb3c421ac1edc7bec6e3cca6409b6d | 4,872 | describe Travis::Yml, 'accept deploy', slow: true do
subject { described_class.schema }
xit { puts JSON.pretty_generate(subject[:definitions][:boxfuse]) }
describe 'boxfuse' do
describe 'user' do
it { should validate deploy: { provider: :boxfuse, user: 'str' } }
it { should_not validate deploy: ... | 54.741573 | 92 | 0.621511 |
d5b9bd1472b5d527dd3a6ca766fe1122b59e44b9 | 216 | FactoryBot.define do
factory :ecm_rbac_role_permission, class: Ecm::Rbac::RolePermission do
association :role, factory: :ecm_rbac_role
association :permission, factory: :ecm_rbac_permission
end
end
| 30.857143 | 72 | 0.763889 |
4a673e64537c95eb8417bc7cbe6222cf0c95f5fd | 1,208 | # frozen_string_literal: true
# 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
Gem::Specification.new do |spec|
spec.name = 'aws-sdk-identitystore'
... | 37.75 | 132 | 0.672185 |
793b647551f9e36d138e605f2ebf1fd5dc42bc62 | 663 | class CreateExibition < ActiveRecord::Migration
def self.up
create_table :exibitions, force: true do |t|
t.string :uuid, limit: 36
t.references :user
t.integer :assigned_to
t.string :name, limit: 64, null: false, default: ""
t.string :access, limit: 8, default: "Public" # %w(Priv... | 26.52 | 79 | 0.642534 |
916d510f21a85f338a6263d6f2f213fbe270c44c | 6,330 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'metasploit/framework/login_scanner/glassfish'
require 'metasploit/framework/credential_collection'
class MetasploitModule < Msf::Auxiliary
include Msf... | 32.461538 | 124 | 0.627646 |
e2fc35f437b08eb54420de34a9729b07eac9b0f2 | 2,110 | # -*- encoding: utf-8 -*-
# stub: sass-rails 5.0.6 ruby lib
Gem::Specification.new do |s|
s.name = "sass-rails".freeze
s.version = "5.0.6"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["wycats".fre... | 43.958333 | 112 | 0.620379 |
b976937d8386c5b7e1c92a61c351e8d7afb1b6eb | 1,140 | require "spec/spec_helper"
module CIMaestro
module Configuration
describe DefaultDirectoryStructure do
before(:each) do
@out = DefaultDirectoryStructure.new TESTS_BASE_PATH, "SYSTEM_NAME", "MAINLINE"
end
it "should build the correct standard paths" do
@out.system_base_path.shou... | 45.6 | 109 | 0.699123 |
332552866755a99a49396cde7c0959aa4eab1971 | 1,963 | # Licensed to Elasticsearch B.V under one or more agreements.
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information
module Elasticsearch
module XPack
module API
module MachineLearning
module Actions
# TO... | 39.26 | 169 | 0.659705 |
4aa963b2ccbab990ca8d4501884d450196e94b7c | 9,227 | #encoding: utf-8
require 'faker'
ad = Address.create(city: 'Münster' , postal_code: '48149', street: 'Corrensstraße', house_number: '25', country: 'Germany' )
admin = User.create(:email => "admin@beer.com", :password => 'Admin123', :password_confirmation => 'Admin123', :first_name => 'Admin', :last_name => 'Admin', :... | 86.233645 | 260 | 0.71746 |
e2d1a033efdc8c30d2a10e4336e5d5bc9bb3e3f5 | 1,704 | # 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 applicable law or agreed to in writing, ... | 32.769231 | 88 | 0.713028 |
6ac8e65231c50c757f42ff954c5cc610d48ad36f | 10,792 | #
# Copyright:: Copyright (c) 2014-2018 Chef Software Inc.
# 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 a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | 31.648094 | 127 | 0.652242 |
e80ac830bc0b7b6d3d13a9c89b794e960b2172a1 | 175 | # frozen_string_literal: true
# Load the rails application
require File.expand_path("application", __dir__)
# Initialize the rails application
Rails.application.initialize!
| 21.875 | 48 | 0.817143 |
879ee6f4b9b0d93643bab93bc879da66d700cd59 | 9,906 | require 'spec_helper'
feature 'Environments page', :js do
given(:project) { create(:project) }
given(:user) { create(:user) }
given(:role) { :developer }
background do
project.team << [user, role]
sign_in(user)
end
describe 'page tabs' do
it 'shows "Available" and "Stopped" tab with links' do... | 30.20122 | 112 | 0.608116 |
01a989402477086c95893f15170c57c1cbcb5639 | 2,062 | # frozen_string_literal: true
RSpec.describe RgGen::SystemVerilog::RAL::Feature do
let(:configuration) do
RgGen::Core::Configuration::Component.new(nil, 'configuration', nil)
end
let(:register_map) do
RgGen::Core::RegisterMap::Component.new(nil, 'register_map', nil, configuration)
end
let(:componen... | 38.185185 | 109 | 0.700776 |
61d7914af53052e383d2b771a20ba1d3e3beb231 | 1,897 | #
# Be sure to run `pod lib lint SPNetWorkCore.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 https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'SPNet... | 36.480769 | 107 | 0.641012 |
fff6baa616d64cdd20f048bf0f0a09fc6046c018 | 1,679 |
class Scraper
def self.scrape_url
url = "https://solidarityapothecary.org/category/plant-allies/"
index_page = Nokogiri::HTML(open(url))
index_page.css("div.post-header h2 a").each do |website_element|
Herb.new(website_element.children.text.gsub(" Plant Profile", "").dow... | 39.97619 | 127 | 0.573556 |
ffc3e241cf7aeecef21d9854d853b19b64a667a4 | 2,180 | # frozen_string_literal: true
require "paco"
module JsonParser
extend Paco
module_function
def parse(io)
spaced(value).parse(io)
end
def value
memoize { alt(null, bool, number, str, array, object) }
end
def null
memoize { string("null").result(nil) }
end
def bool
memoize do
... | 18.166667 | 76 | 0.473394 |
6a66354ea311da18bc60f54e2f47002e9f8b69ca | 447 | cask "praat" do
version "6.1.56"
sha256 "7449914af507357c4271b67b32574e7198ff3941df8ec30cb9961e0dfc30767c"
url "https://github.com/praat/praat/releases/download/v#{version}/praat#{version.no_dots}_mac.dmg",
verified: "github.com/praat/praat/"
name "Praat"
desc "Doing phonetics by computer"
homepage "... | 31.928571 | 101 | 0.733781 |
1cc6a10347380349795a05ca393116aee193bf49 | 141 | class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
def hello
render html: "Hello!"
end
end
| 17.625 | 52 | 0.765957 |
61fc0410177ff1249166a56058b1dc8b2cd6dc34 | 503 | module UnittestJS
module Browser
class Chrome < Abstract
def initialize(path = nil)
@path = path || File.join(
ENV['UserPath'] || "C:/Documents and Settings/Administrator",
"Local Settings",
"Application Data",
"Google",
"Chrome",
"Applicat... | 18.62963 | 71 | 0.497018 |
5d4540179ab12b2bf54b26eb706033e67c988f5c | 1,023 | # frozen_string_literal: true
require 'vk/api/methods'
module Vk
module API
class Pages < Vk::Schema::Namespace
module Methods
# Returns HTML representation of the wiki markup.
class ParseWiki < Schema::Method
# @!group Properties
self.open = false
self.method... | 31.96875 | 120 | 0.616813 |
18be2b6879b26c172d9573fdd53730319572f2eb | 4,860 | ###############################################################################
# Copyright (c) 2014 Jeremy S. Bradbury, Joseph Heron
#
# 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... | 35.474453 | 91 | 0.533951 |
284161f9fb65c34608ce0a90e550c0097948a2c2 | 305 | require 'test_helper'
require 'test/unit'
require 'dtm'
class TestDtm < Test::Unit::TestCase
def test_parameterize
params = Dtm::Dtm.parameterize(:a_a => 'a', :b_b => {:c => true}, :d_d => [{:e_e => 'e'}, '/FF:f'])
assert_equal("/AA:a /BB:/C:true /DD { /EE:e } /DD { /FF:f }", params)
end
end | 30.5 | 103 | 0.593443 |
7a000c7b392de906c50b5ac33eee125c074c6bd2 | 35,443 | require 'faraday' # HTTP Client
require 'faraday-cookie_jar'
require 'faraday_middleware'
require 'logger'
require 'tmpdir'
require 'cgi'
require 'tempfile'
require 'fastlane/version'
require_relative 'babosa_fix'
require_relative 'helper/net_http_generic_request'
require_relative 'helper/plist_middleware'
require_rel... | 39.120309 | 244 | 0.640719 |
875931c3b43a7f9579b15476b920850aa4b4af9b | 1,569 | =begin
A Tree in an Array
To store a Binary Tree in an Array, we just need to determine the order that we store the Nodes in. A good order is "breadth-first" where we store the items in order top-down and left-to-right of the tree.
Here's a tree represented as an array:
And this is the tree 'unfolded':
Notice that... | 30.764706 | 207 | 0.680051 |
e948473922cf059302f45319f64fb53554cc9b52 | 454 | # frozen_string_literal: true
class Admin
class BaseController < ApplicationController
before_action :allow_only_admin, :set_locale
layout 'admin'
private
def allow_only_admin
raise AdminAccessDeniedException unless admin_signed_in?
end
def set_locale
I18n.locale = current_loca... | 18.16 | 62 | 0.693833 |
bfdf0ca6b89e957eba699d6fca2a0133889f77f9 | 2,041 | # frozen_string_literal: true
# Body content assertions for all endpoints -- signed out
module SignedOutAssertions
def assert_header
assertions = ['<a class="nav-link" href="/">',
'<a class="nav-link" href="/help">',
'<a class="nav-link" href="/about">',
'<a ... | 34.016667 | 104 | 0.580598 |
6aabcf6cc8caa85537b545151b77ff79ddacb071 | 1,302 | # frozen_string_literal: true
module RuboCop
module Cop
module Style
# This cop checks for cases when you could use a block
# accepting version of a method that does automatic
# resource cleanup.
#
# @example
#
# # bad
# f = File.open('file')
#
# ... | 25.038462 | 68 | 0.502304 |
b906cb5962ec10f5bdb7ca24cdfbc98c5ac68a99 | 223 | require_relative '../lib/rudash'
require 'test/unit'
class IsNilTest < Test::Unit::TestCase
def test_nil
assert_equal R_.is_nil?(nil), true
end
def test_not_nil
assert_equal R_.is_nil?(0), false
end
end
| 17.153846 | 38 | 0.70852 |
330ee6a863a966d2720b0fb368cdacfcb2d53f01 | 196 | class ExternalPost < Post
validates :external_id, uniqueness: true
alias_attribute :body, :body_html
def username
self.user_display_name
end
def number_of_comments
0
end
end
| 15.076923 | 42 | 0.744898 |
911205005dae384a890cc75d9fde29a39ddf2947 | 1,662 | class MinioMc < Formula
desc "Replacement for ls, cp and other commands for object storage"
homepage "https://github.com/minio/mc"
url "https://github.com/minio/mc.git",
:tag => "RELEASE.2019-01-10T00-38-22Z",
:revision => "0854af6e6d3e9f79e8d9c98db5e0d133a527923b"
version "20190110003822"
b... | 31.961538 | 109 | 0.656438 |
62f6080d401fe33e0b1e99020ef53f3c408be299 | 6,215 | # frozen_string_literal: true
module Grape
module Cache
class Verifier
# @param endpoint[Grape::Endpoint]
# @param middleware[Grape::Cache::Middleware]
# @param raw_options[Hash]
def initialize(endpoint, middleware, raw_options)
@endpoint = endpoint
@raw_options = raw_opti... | 27.995495 | 98 | 0.615929 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.