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 |
|---|---|---|---|---|---|
e9a46f9f813b430f55dc04700b53e6d9361f1b23 | 746 | cask 'font-monoid-tight-xtralarge-dollar-0-1-l' do
version :latest
sha256 :no_check
# github.com/larsenwork/monoid was verified as official when first introduced to the cask
url 'https://github.com/larsenwork/monoid/blob/release/Monoid-Tight-XtraLarge-Dollar-0-1-l.zip?raw=true'
name 'Monoid-Tight-XtraLarge-D... | 37.3 | 106 | 0.746649 |
21565046b7180cd44246d3bf812bfff3acfef47b | 8,442 | # coding: utf-8
# During build, the Gemfile is temporarily moved and
# we must manually define the project root
if ENV['MSF_ROOT']
lib = File.realpath(File.expand_path('lib', ENV['MSF_ROOT']))
else
# have to use realpath as metasploit-framework is often loaded through a symlink and tools like Coverage and debugger... | 41.792079 | 120 | 0.770434 |
b9b75e0b9f92564af7ff0db1ee755aae6098fd75 | 313 | class CellBlockDevice < ApplicationRecord
belongs_to :cell
has_many :volumes, class_name: "CellVolume", dependent: :destroy
enum status: %i[discovered accepted healthy unhealthy]
def serializable_hash(options = nil)
super (options || {}).merge except: %i[id cell_id], include: %i[volumes]
end
end
| 28.454545 | 76 | 0.738019 |
ab07b7dad7f4d105858e0012efa35891cc3d5d3b | 1,936 | module Databasedotcom
module Rails
module Controller
module ClassMethods
def dbdc_client
unless @dbdc_client
config = {}
if File.exists?(File.join(::Rails.root, 'config', 'databasedotcom.yml'))
config = YAML.load_file(File.join(::Rails.root, 'config', ... | 25.473684 | 94 | 0.525826 |
08e8c5ab6d4bece51720a66410496c2064d23348 | 401 | #
# Blacklist if the comment mentions viagra.
#
class ViagraPlugin < SpamPlugin
#
# Test the content of the message.
#
def is_spam?( obj )
#
# There should always be a body, but be defensive.
#
if ( obj && obj[:body] )
body = obj[:body]
if ( body =~ /viagra/i )
return tru... | 12.935484 | 54 | 0.543641 |
7923b745e365a5db7a4043873f283d3cd0cda928 | 1,557 | require 'test/test_helper'
class UnlockInstructionsTest < ActionMailer::TestCase
def setup
setup_mailer
Devise.mailer_sender = 'test@example.com'
end
def user
@user ||= begin
user = create_user
user.lock!
user
end
end
def mail
@mail ||= begin
user
ActionMa... | 24.714286 | 124 | 0.682723 |
62e4a5eb9a0713e11006096be8c5718d6c6df580 | 403 | class CreateEffectiveEmailTemplates < ActiveRecord::Migration[4.2]
def self.up
create_table :email_templates do |t|
t.string :template_name
t.string :subject
t.string :from
t.string :bcc
t.string :cc
t.string :content_type
t.text :body
t.ti... | 17.521739 | 66 | 0.612903 |
1d34384dfc9a063b4a556af63573d92645b46e10 | 3,658 | require 'tempfile'
require 'vagrant'
require_relative '../logger'
module VagrantPlugins
module ProxyConf
class Action
# Base class for proxy configuration Actions
class Base
def initialize(app, env)
@app = app
end
def call(env)
@machine = env[:machine]
... | 30.231405 | 92 | 0.576271 |
7ac557c12cbe68390fb811935f864d42080ac110 | 125 | class AddUserAgentToFeedbacks < ActiveRecord::Migration
def change
add_column :feedbacks, :user_agent, :text
end
end
| 20.833333 | 55 | 0.776 |
b958959c26caede04f1d349c22879fd60ca0facb | 3,718 | # frozen_string_literal: true
#--
# Copyright (c) 2007-2012 Nick Sieger.
# See the file README.txt included with the distribution for
# software license details.
#++
# Concatenate together multiple IO objects into a single, composite IO object
# for purposes of reading as a single stream.
#
# @example
# crio = Co... | 32.330435 | 95 | 0.60893 |
1826b8fc50b089b1a9e5e1db08f628868bf3ba52 | 1,101 | class Pngpaste < Formula
desc "Paste PNG into files"
homepage "https://github.com/jcsalterego/pngpaste"
url "https://github.com/jcsalterego/pngpaste/archive/0.2.3.tar.gz"
sha256 "6221201cb05191855f0d2707ce7f4055f6e1330de8efc09d386be2a6629f543b"
license "BSD-2-Clause"
bottle do
cellar :any_skip_relocati... | 34.40625 | 93 | 0.743869 |
d50af8967950c95d71c18ce0eb44599a9abf749f | 101 | require 'attributor/extras/field_selector'
require 'praxis/extensions/field_selection/field_selector' | 50.5 | 58 | 0.881188 |
5de73c735102570d0d7a0f963c770d95dd4b3900 | 3,159 | module Intrigue
module Task
class DnsRecurseSpf < BaseTask
include Intrigue::Task::Dns
def self.metadata
{
:name => "dns_recurse_spf",
:pretty_name => "DNS SPF Recursive Lookup",
:authors => ["@markstanislav","jcran"],
:description => "Check the SPF records of a domain (recursively) an... | 26.546218 | 122 | 0.552707 |
bb51fd2d69607f3c7b24efd180e0f73fd1fb9826 | 241 | Fabricator :profile do
name { Forgery::Name.first_name }
surname { Forgery::Name.last_name }
birth_date { Date.current }
end
Fabricator :profile_with_tags, :from => :profile do
tags!(:count => 3) { |profile, i| Fabricate :tag }
end
| 24.1 | 52 | 0.697095 |
f88ee12f10c0034844f452a37b7af87aceb55765 | 466 | module Fog
module Parsers
module AWS
module DNS
class GetChange < Fog::Parsers::Base
def reset
@response = {}
end
def end_element(name)
case name
when 'Id'
@response[name] = @value.sub('/change/', '')
... | 17.259259 | 58 | 0.437768 |
4ab4288e9b5f11e47529ae9518b6fe95da8f246e | 2,832 | # 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::SQL::Mgmt::V2017_03_01_preview
module Models
#
# Automatic tuning properties for individual advisors.
#
class AutomaticTunin... | 31.120879 | 79 | 0.543785 |
61d9d4feec36a37a32566f9a9d339b13c86a5b95 | 84 | # desc "Explaining what the task does"
# task :keyper do
# # Task goes here
# end
| 16.8 | 38 | 0.666667 |
91f5e74062170c4d0d02789a4e1ca2494df75726 | 10,406 | require 'rails_helper'
feature 'Courses Index', js: true do
include UserSpecHelper
include NotificationHelper
include MarkdownEditorHelper
include DevelopersNotificationsHelper
# Setup a course with a single founder target, ...
let!(:school) { create :school, :current }
let!(:course_1) { create :course,... | 32.018462 | 82 | 0.681434 |
6a7fea38d5955355433a5871d27725e631b44935 | 1,140 | module Spree
module Admin
class PaymentPaywayMarkersController < PaymentPaywayBaseController
include Spree::Backend::Callbacks
def update
reason = params[:updated_reason]&.strip
if(reason.blank?)
flash[:error] = Spree.t('vpago.payments.failed_require_updated_reason')
... | 31.666667 | 107 | 0.662281 |
bf3de7ce120cb03ee00e64e6d416ae4415de1d98 | 42 | class ProductData < ApplicationRecord
end
| 14 | 37 | 0.857143 |
333f6bbb275bd9e9a828d159db4f8f80bc1b5d06 | 2,404 | # Copyright (c) Universidade Federal Fluminense (UFF).
# This file is part of SAPOS. Please, consult the license terms in the LICENSE file.
require "spec_helper"
describe ResearchArea do
it { should be_able_to_be_destroyed }
it { should destroy_dependent :course_research_area }
it { should destroy_dependent :pr... | 33.388889 | 84 | 0.641431 |
d57c697ad7f11d80bf4a9cc4d5cdb9d5ea730f86 | 8,954 | # frozen_string_literal: true
require "helper"
describe "rake template" do
let(:template_lookup) { Toys::ModuleLookup.new.add_path("toys/templates") }
describe "unit functionality" do
let(:template_class) { template_lookup.lookup(:rake) }
let(:template) { template_class.new }
it "handles the gem_ver... | 36.847737 | 87 | 0.648537 |
7977c29a9e62d9950d7eb267a4f5cf2a342916cc | 2,733 | require File.dirname(__FILE__) + '/helper'
class ExtensionsTest < Test::Unit::TestCase
module FooExtensions
def foo
end
private
def im_hiding_in_ur_foos
end
end
module BarExtensions
def bar
end
end
module BazExtensions
def baz
end
end
module QuuxExtensions
... | 27.059406 | 106 | 0.711306 |
39f1247808177d7a35cb41fbd3fafc8e4764a84c | 1,336 | require "language/node"
class Serverless < Formula
desc "Build applications with serverless architectures"
homepage "https://serverless.com"
url "https://github.com/serverless/serverless/archive/v1.74.0.tar.gz"
sha256 "48af008f5b158ab23e019e49911d16ff7664b4e797e0a885427c92426e4de2ef"
bottle do
cellar :a... | 31.069767 | 94 | 0.741018 |
28ef3a3498e6bff2c30dbff43a3144434e62912f | 2,980 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2019_04_01
module Models
#
# Response for ListExpressRouteCrossConnection API service call.
#
class ExpressR... | 29.50495 | 80 | 0.55 |
aca9ad945422df8c17c7dfd8eddbf1a6e6df14d9 | 241 | class AddVaccineFieldsToUsers < ActiveRecord::Migration[5.2]
def change
add_column :users, :first_dose_date, :datetime
add_column :users, :second_dose_date, :datetime
add_reference :users, :vaccine, foreign_key: true
end
end
| 30.125 | 60 | 0.759336 |
f761c9d0306f8900ffa0c39935187cbf743cca12 | 279 | Given (/^I run my test$/) do
end
When (/^I capture some performance data$/) do
require 'honeycomb'
Honeycomb.perf_data.push( { 'perf_parameter_1' => rand(100), 'perf_parameter_2' => rand(1) } )
end
Then (/^It should associate with the correct test in res$/) do
end
| 21.461538 | 96 | 0.670251 |
e29a05b92f287414341e37f09adf6e912ee7baa0 | 555 | # Outputs the reading time
# Read this in “about 4 minutes”
# Put into your _plugins dir in your Jekyll site
# Usage: Read this in about {{ page.content | reading_time }}
module ReadingTimeFilter
def reading_time( input )
words_per_minute = 180
words = input.split.size;
minutes = ( words ... | 30.833333 | 80 | 0.672072 |
1c17ffa8e0735f54158c3d350a171aa742507976 | 403 | # = is used to assign value to variable
p 10 == 10 # compare the value at right and left hand side if they are equal. The value and data type must be the same
p 10 == 20 # false
p a = 10
p b = 5
p c = 10
p a == c # true
p b == c #false
p "5" == 5 #false
p "5" == "5" #true
# != not equal to
p 10.5.floor
p 10.5.cei... | 15.5 | 118 | 0.620347 |
ff22b04b91b7ec3e58b1f4ae7ee80fb5d57d271f | 277 | class CreateCollections < ActiveRecord::Migration[5.0]
def change
create_table :collections do |t|
t.integer :user_id, null: false
t.string :title, null: false
t.timestamps
end
add_index :collections, [:user_id, :title], unique: true
end
end
| 23.083333 | 60 | 0.67509 |
f8547cb348053a636f8fbc52c38de27068b04e95 | 987 | class CfTool < Formula
desc "Command-line tool for Codeforces contests"
homepage "https://github.com/xalanq/cf-tool"
url "https://github.com/xalanq/cf-tool/archive/v0.8.2.tar.gz"
sha256 "04eeb0ebfd2f15f81940012def95ec964498f7053029aa8b192d99c5a88bb98b"
bottle do
cellar :any_skip_relocation
sha256 "8c... | 32.9 | 93 | 0.726444 |
21c90a100750e7a234e6932f286faefb439cf9bc | 9,106 | #!/usr/bin/env ruby
# Copyright 2017 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 agre... | 34.362264 | 98 | 0.731935 |
b939a4778aaa11bc987321b8efc975e25672a0dc | 5,098 | feature 'Check table with tasks', js: true do
let(:first_task_due_date) { DateTime.parse('2016-07-30T12:07:59').in_time_zone }
let(:second_task_due_date) { DateTime.parse('2017-07-30T12:07:59').in_time_zone }
before(:each) do
order_type = FactoryBot.create(:order_type, :support_request)
FactoryBot.creat... | 39.215385 | 157 | 0.66222 |
7a1fcfb0374c50d41e342695fdd63607f4e3581b | 223 | class CreateProductTable < ActiveRecord::Migration[5.1]
def change
create_table :products do |t|
t.string :name
t.string :description
t.integer :quantity
t.integer :client_id
end
end
end
| 20.272727 | 55 | 0.668161 |
3834c29922a7f398ab209b889d99aba5a65e29d9 | 770 | # Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.
shared :template_spec do
behaves_like :rack_test
def spec_template(spec_engine)
it 'works on /' do
get('/').body.strip.
should =~ %r{<a href\s*=\s*... | 33.478261 | 140 | 0.61039 |
18ad228bb14b42e612c5d967aa39dfcf880142b2 | 744 | class User < ApplicationRecord
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
:omniauthable, omniauth_providers: ... | 37.2 | 72 | 0.711022 |
d59c65ae978eb993049d7761ebf3101453a535ea | 4,797 | require 'uri'
require 'openid/extensions/sreg'
require 'openid/store/filesystem'
module OpenIdAuthentication
OPEN_ID_AUTHENTICATION_DIR = RAILS_ROOT + "/tmp/openids"
def self.store
@@store
end
def self.store=(value)
@@store = value
end
self.store = :db
def store
OpenIdAuthentication.store... | 29.072727 | 127 | 0.685428 |
1dc5c9f6d39989862db00e1873c804098a32e87f | 902 | require File.join(File.dirname(__FILE__), "..", "spec_helper")
describe "Recognizing requests for deferred routes" do
before :each do
Merb::Router.prepare do
match("/deferred/:zoo").defer_to do |request, params|
params.merge(:controller => "w00t") if params[:zoo]
end
end
end
... | 29.096774 | 99 | 0.643016 |
01d6571f65d1322a3e9a06698b3b60dc89d361a2 | 5,331 | #
# Author:: Scott Bonds (scott@ggr.com)
# Copyright:: Copyright 2014-2016, Scott Bonds
# 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://... | 40.082707 | 173 | 0.61827 |
28623c1b3f0846f117f5d82c3681abb93b6d25ed | 321 | require 'spec_helper'
# describe Rubyfuri::ResponseParsers::String do
# let(:sentence) do
# '青い空と白い雲'
# end
# let(:ruby) do
# 'あおいそらとしろいくも'
# end
# let(:response) do
# open('spec/response.xml', &:read)
# end
# describe '#ruby' do
# it 'aaa' do
# p response
# end
# end
# end... | 14.590909 | 47 | 0.563863 |
288d41af177a18aef9f2c4881f989a17fed04bb3 | 1,245 | class Admin::IdentitiesController < Admin::ApplicationController
before_action :user
before_action :identity, except: [:index, :new, :create]
def new
@identity = Identity.new
end
def create
@identity = Identity.new(identity_params)
@identity.user_id = user.id
if @identity.save
redirec... | 21.101695 | 72 | 0.696386 |
b9f09647968bc0fefa77dde4f934d3e8457957fc | 5,148 | require 'active_support/core_ext/hash/keys'
require 'pathname'
# Parsing YAML frontmatter
require 'yaml'
# Parsing JSON frontmatter
require 'active_support/json'
# Extensions namespace
module Middleman::CoreExtensions
class FrontMatter < ::Middleman::Extension
YAML_ERRORS = [StandardError]
# https://githu... | 25.485149 | 107 | 0.596154 |
ac2d63ab26a73f212b61ac86347468f7e703d213 | 521 | require 'rails_helper'
RSpec.describe "redirects/new", type: :view do
before(:each) do
assign(:redirect, Redirect.new(
source: "MyString",
redirect: "MyString",
status: 1
))
end
it "renders new redirect form" do
render
assert_select "form[action=?][method=?]", redirects_path, ... | 20.84 | 71 | 0.635317 |
1dfa90a8fbfeb4bc0bb0aef2d00fd67df0b9a33e | 2,631 | # coding: utf-8
require File.dirname(__FILE__) + "/../spec_helper"
describe "Word", :word do
describe "opening the sample document" do
before :all do
@export_target = StringIO.new <<-eof
--- /Users/bryan/Projects/konjac/spec/office/bin/sample.docx
+++ /Users/bryan/Projects/konjac/spec/office/bin/sample.doc... | 20.395349 | 60 | 0.581528 |
bb0fd7fc786b60e565d2664ee3303e1fddc34305 | 629 | # frozen_string_literal: true
require "benchmark/ips"
require "coverage"
Coverage.start
# such meta, many wow
require_relative "../lib/simplecov"
require_relative "../test_projects/faked_project/lib/faked_project"
result = Coverage.result
class MyFormatter
def format(result)
result.files.map do |file|
"#... | 21.689655 | 71 | 0.756757 |
1c9d5c8c04c55868b83d857470c2a1168574e47e | 841 | require 'formula'
class Libfishsound < Formula
desc "Decode and encode audio data using the Xiph.org codecs"
homepage 'https://xiph.org/fishsound/'
url 'http://downloads.xiph.org/releases/libfishsound/libfishsound-1.0.0.tar.gz'
sha1 '5263dfaa12dce71e30c5d80f871d92869c6b5ce2'
bottle do
cellar :any
re... | 30.035714 | 81 | 0.712247 |
87b0f9a7443d159da46dac1ebaf5e349fb162bfb | 776 | class ApplicationController < ActionController::Base
rescue_from StandardError do |error|
Rails.logger.fatal "Something really bad happened. error: #{error.class} message: #{error.message}"
if Rails.env.development?
raise error
else
render status: :not_found, json: {
error: {
... | 25.866667 | 103 | 0.617268 |
62f6bd9be964e223980310008f1d128217096c28 | 261 | require File.dirname(__FILE__) + '/../../../spec/spec_helper'
describe TaxonDescribers::Eol do
before(:all) do
load_test_taxa
end
it "should describe Calypte anna" do
expect( TaxonDescribers::Eol.desc( @Calypte_anna ) ).not_to be_blank
end
end
| 23.727273 | 72 | 0.712644 |
11768ea85dc694a31dac7bd6a78117553eaea0dd | 290 | module Ubiquity::MediaSilo::API::V3::Client::Requests
class AssetGetById < BaseRequest
HTTP_METHOD = :get
HTTP_PATH = '/assets/#{arguments[:asset_id]}'
PARAMETERS = [
{ :name => :asset_id, :aliases => [ :id ], :send_in => :path, :required => true },
]
end
end | 20.714286 | 88 | 0.606897 |
1c2adb41926981738219f330252e36c0e5161f60 | 3,511 | # encoding: utf-8
usage 'show-data'
aliases :debug
summary 'show data in this site'
description <<-EOS
Show information about all items, item representations and layouts in the
current site, along with dependency information.
EOS
module Nanoc::CLI::Commands
class ShowData < ::Nanoc::CLI::CommandRunne... | 26.398496 | 117 | 0.617773 |
01a78a1947b1e42a580b143f9c06f0c497d635f7 | 311 | class CreateEnderecos < ActiveRecord::Migration
def change
create_table :enderecos do |t|
t.string :cidade
t.string :bairro
t.string :cep
t.string :rua
t.string :uf
t.references :contato, index: true, foreign_key: true
t.timestamps null: false
end
end
end
| 20.733333 | 59 | 0.643087 |
116c2f72622403da5ff2c7008a270fda02bf2fcf | 287 | class ApplicationPolicy
attr_reader :user
def initialize(user, _application)
@user = user
end
def see_reports_page?
user.supervisor? || user.casa_admin?
end
def see_import_page?
user.casa_admin?
end
def modify_organization?
user.casa_admin?
end
end
| 14.35 | 40 | 0.710801 |
f84e1dc68e5acd905030c4dae067db8266debebd | 17,472 | #
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Tim Hinderliter (<tim@chef.io>)
# Author:: Christopher Walters (<cw@chef.io>)
# Author:: Daniel DeLeo (<dan@chef.io>)
# Copyright:: Copyright 2008-2016 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the ... | 33.21673 | 135 | 0.659455 |
ac75c8361d021f93a9561029b112d3ce4df4cc38 | 2,980 | # encoding: UTF-8
#
# Cookbook Name:: openstack-block-storage
require_relative 'spec_helper'
describe 'openstack-block-storage::identity_registration' do
describe 'ubuntu' do
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
let(:chef_run) { runner.converge(described_reci... | 27.850467 | 78 | 0.620134 |
5d20c325082650faa6122f375cbe93b14e139c84 | 145 | require 'rake/testtask'
Rake::TestTask.new do |t|
t.libs << "lib" << "test"
t.test_files = FileList['test/*_test.rb']
t.verbose = true
end | 20.714286 | 43 | 0.648276 |
39dcebeba0cafe2e695f9b864ad3159c501f88a5 | 201 | require 'sinatra'
require 'json'
set :public_folder, proc { File.join(root) }
get '/time.json' do
headers 'Access-Control-Allow-Origin' => '*'
{ time: Time.now.to_s, city: "London" }.to_json
end
| 20.1 | 49 | 0.676617 |
21448af4cece5b9390de2080649ab1397f05d9f9 | 955 | class ArticlesController < ApplicationController
before_action :require_login, except: %i[show index]
include ArticlesHelper
def index
@articles = Article.all
end
def show
@article = Article.find(params[:id])
@comment = Comment.new
@comment.article_id = @article.id
end
def new
@artic... | 19.489796 | 57 | 0.677487 |
1142c71bba7d71034530092517a790939ed5ad2b | 1,505 | # (c) Copyright 2017 Ribose Inc.
#
require "active_model"
require "addressable"
module UriFormatValidator
module Validators
#
# TODO: documentation
#
class UriValidator < ::ActiveModel::EachValidator
attr_reader :accept_list, :reject_list
ALLOW_ALL_OPTION_HASH = {}.freeze
def ini... | 25.508475 | 74 | 0.653821 |
4a4dfc5157f2cccd4e4f503fa18e102e0baf56e2 | 1,619 | # Base Asset Class
# ---------------------------------------
# Available Attributes:
# :type
# :name
# :body
# :filename
# :checksum
# :path
# :content_type
# :file_size
# :width
# :height
# :duration
# :bit_rate
class Asset < ActiveRecord::Base
has_many :asset_attachments, :as => :assetable, :dependent => :destroy... | 23.128571 | 149 | 0.601606 |
ab208ac722800fae8149d7e476202a78eb10fdf5 | 309 | require "spec_helper"
describe "nodejs::v0_10" do
let(:facts) { default_test_facts }
it do
should include_class("nodejs::v0_10_26")
should contain_file("/test/boxen/nodenv/versions/v0.10").with({
:ensure => "link",
:target => "/test/boxen/nodenv/versions/v0.10.26"
})
end
end
| 20.6 | 67 | 0.653722 |
b95da2f03cd83bd0da289283663db52c7affa158 | 6,751 | RSpec::Support.require_rspec_support "fuzzy_matcher"
module RSpec
module Matchers
# Mixin designed to support the composable matcher features
# of RSpec 3+. Mix it into your custom matcher classes to
# allow them to be used in a composable fashion.
#
# @api public
module Composable
# Cr... | 36.690217 | 82 | 0.630129 |
089a105a6e7d6bdb14d789ed477562a7d8cb33b1 | 310 | # frozen_string_literal: true
module EE
module Ci
module PipelineSchedule
extend ActiveSupport::Concern
prepended do
include UsageStatistics
include Limitable
self.limit_name = 'ci_pipeline_schedules'
self.limit_scope = :project
end
end
end
end
| 17.222222 | 49 | 0.667742 |
01c0e0d4cf9db2cbc9c8b5ea1902e4026f335bce | 216 | # The Book of Ruby - http://www.sapphiresteel.com
a = [1,2,3]
a.freeze
if !(a.frozen?) then
a << [4,5,6]
end
p( a )
s = "Hello"
s << " world"
s.freeze
s << " !!!" # Error: "can't modify frozen string (TypeError)" | 15.428571 | 61 | 0.578704 |
f7dd46cb4e5863ed407155a80516fe4b7f467b6a | 474 | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# ... | 33.857143 | 115 | 0.698312 |
2876f762f00bd5c62a0b46ffb6c0e851d4a68695 | 14,338 | # 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 (the
# "License"); you may not u... | 23.856905 | 85 | 0.539197 |
26dfb4147dd861191dbb8fe2a824bf4a0fd690e4 | 169 | class AddSiblingOrderToDimensionsEdition < ActiveRecord::Migration[5.2]
def change
add_column :dimensions_editions, :sibling_order, :integer, null: true
end
end
| 28.166667 | 73 | 0.792899 |
1d8afa71377036022aeddc3edd4153b79e8db46a | 496 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe GroupCustomAttribute do
describe 'assocations' do
it { is_expected.to belong_to(:group) }
end
describe 'validations' do
subject { build :group_custom_attribute }
it { is_expected.to validate_presence_of(:group) }
it { is_expect... | 26.105263 | 75 | 0.739919 |
62e821105f3d39b8c75c54b0576ba2f727d3e87f | 37 | module Shaft
VERSION = "0.8.8"
end
| 9.25 | 19 | 0.648649 |
38e7c2fc215defc682044d50a5eaa89ac565aa54 | 2,608 | Pod::Spec.new do |s|
s.name = 'SDWebImage'
s.version = '4.5.0'
s.osx.deployment_target = '10.9'
s.ios.deployment_target = '7.0'
s.tvos.deployment_target = '9.0'
s.watchos.deployment_target = '2.0'
s.license = 'MIT'
s.summary = 'Asynchronous image downloader with cache support with an UIImageView categ... | 40.123077 | 100 | 0.658742 |
acb50c6421613d66c2b71b7fc6b55bb882b719dd | 5,092 | # encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative sou... | 33.946667 | 141 | 0.678712 |
bbbab7ea61158db03eb380a97570c7172caa5a52 | 368 | require "bundler/setup"
require "pretty_magic"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect_with... | 24.533333 | 66 | 0.755435 |
181961f5c5183cedd0466de3727726ee14c565fc | 881 | module ChartsHelper
# Generate an HTML string representing `version`, with each pair on a new line
#
# `version` will usually look like:
# {
# commit_sha: "b6589fc",
# commit_date: "2017-02-23T16:20:13.338Z",
# commit_message: "fix something",
# environment: "ruby 2.2.0dev"
# }
#
# and thi... | 24.472222 | 97 | 0.618615 |
1d1897934b3feb3e157c5c9a351d51861d06bae2 | 1,724 | # Copyright © 2011-2020 MUSC Foundation for Research Development~
# All rights reserved.~
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:~
# 1. Redistributions of source code must retain the above copyright notice, this l... | 61.571429 | 146 | 0.792343 |
e99272f05d832c081e8dcd502ce373d85ad83bb4 | 1,346 | #
# Be sure to run `pod lib lint String+Extensions.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'St... | 37.388889 | 211 | 0.670134 |
618712e0b8af6fa6b7c02324590216c0ba6bb273 | 186 | class CreateApplications < ActiveRecord::Migration
def change
create_table :applications do |t|
t.string :name, index: true
t.timestamps null: false
end
end
end
| 18.6 | 50 | 0.693548 |
037a6ad0455065d0d885921b8a43bd6e442bf761 | 69 | module OmniAuth
module AzureOauth2
VERSION = "0.1.0"
end
end
| 11.5 | 21 | 0.681159 |
1de7de97810d261acd9c55979a9cf8e426c85d5b | 237 | module Yamlr
module Errors
class EmptyFilenameError < StandardError; end
class EmptyInputError < StandardError; end
class InvalidInputError < StandardError; end
class InvalidFilenameError < StandardError; end
end
end
| 26.333333 | 51 | 0.772152 |
9163408d7407bfe606e3244fa0eaea4012c16cfd | 288 | class DeviseCreateUsers < ActiveRecord::Migration
def self.up
create_table(:users) do |t|
t.database_authenticatable :null => false
t.timestamps
end
add_index :users, :email, :unique => true
end
def self.down
drop_table :users
end
end
| 19.2 | 60 | 0.638889 |
916491aa25bb9178b853f46551d274a5dd6c5e5d | 7,044 | # frozen_string_literal: true
require 'tempfile'
require 'kubernetes-deploy/common'
require 'kubernetes-deploy/kubeclient_builder'
require 'kubernetes-deploy/kubectl'
require 'kubernetes-deploy/resource_cache'
require 'kubernetes-deploy/resource_watcher'
require 'kubernetes-deploy/kubernetes_resource'
require 'kuberne... | 36.309278 | 119 | 0.699035 |
f8b111c7d32bcf86f592d13f4a045d4bd9f7f65e | 1,574 | # encoding: utf-8
class AttachmentUploader < CarrierWave::Uploader::Base
# Include RMagick or MiniMagick support:
# include CarrierWave::RMagick
# include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
# storage :file
storage :aws
# def default_url
# '/assets/trans... | 28.107143 | 112 | 0.691233 |
f87d14e5605d7536364d40227cdc3afa9b332171 | 129 | module JazzLibs
module VERSION
MAJOR = 0
MINOR = 1
TINY = 0
STRING = [MAJOR, MINOR, TINY].join(".")
end
end | 14.333333 | 43 | 0.573643 |
ab57cdd56770c40f751cbbd58661455fb88eef46 | 3,503 | #! /usr/bin/env ruby
#
# metric-postgres-statsbgwriter
#
# DESCRIPTION:
#
# This plugin collects postgres database bgwriter metrics
#
# OUTPUT:
# metric data
#
# PLATFORMS:
# Linux
#
# DEPENDENCIES:
# gem: sensu-plugin
# gem: pg
#
# USAGE:
# ./metric-postgres-statsbgwriter.rb -u db_user -p db_pass -h db_h... | 31.558559 | 108 | 0.62889 |
d55b263a59d9afd4cc99888b158bb13fe0ff297e | 267 | class Pattern < ApplicationRecord
belongs_to :work
has_attached_file :pattern
validates_attachment :pattern, content_type: { content_type: "application/pdf" }
def pattern_full_url
URI.join(ActionController::Base.asset_host, self.pattern.url)
end
end
| 24.272727 | 83 | 0.779026 |
1a25da13bb3d3b62a37384425623b349feeef4a9 | 3,158 | class UserAgent
module Browsers
# Pocket Casts BMID/E678F58F21
# PocketCasts/1.0 (Pocket Casts Feed Parser; +http://pocketcasts.com/)
# Shifty Jelly Pocket Casts, Android v4.5.3
# Shifty Jelly Pocket Casts, iOS v4.3
# Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)... | 31.89899 | 121 | 0.60133 |
e25a37fab8a2d40e54535a286dda9e9dd330db10 | 395 | require 'spec_helper'
module Tracco
module Tracking
describe CardDoneTracking do
describe "#add_to" do
it "marks the card as done" do
card = TrackedCard.new
done_tracking = Tracking::Factory.build_from(notification_with_message("DONE"))
done_tracking.add_to(card)
... | 18.809524 | 89 | 0.637975 |
014a3411ee0ba07691085f80ad613d6b89b3488c | 2,427 | # encoding: utf-8
Puppet::Type.newtype(:snmp_user) do
@doc = 'Set the SNMP contact name'
apply_to_all
ensurable
newparam(:name, namevar: true) do
desc 'The name of the SNMP user'
validate do |value|
if value.is_a? String then super(value)
else fail "value #{value.inspect} is invalid, mus... | 23.563107 | 70 | 0.635764 |
91f484b9426e416394065f00ddb4d4d2ef1c64f9 | 46,954 | require "spec_helper"
require_relative "client_response"
require "stringio"
require "logger"
require "nokogiri/diff"
module VCloudSdk
vcd = VCloudSdk::Test::vcd_settings
logger = Config.logger
Config.configure({"logger" => logger,
"rest_logger" =>VCloudSdk::Test::rest_logger(logger),
"rest_throttle" => ... | 40.72333 | 78 | 0.615773 |
e88bba61959409185631d2e584df1231f706ff9c | 872 | module Wzs
module Model
module Multilang
#----------------------------------------------------------------------------------------------------------------
# Hook Method for include
#----------------------------------------------------------------------------------------------------------------
... | 34.88 | 121 | 0.255734 |
bfb68e833c8a65dd2908b95e80c37627c39976c2 | 6,337 | require 'spec_helper'
module StashEngine
describe UserMailer do
attr_reader :title
attr_reader :doi
attr_reader :doi_value
attr_reader :request_host
attr_reader :request_port
attr_reader :user
attr_reader :resource
attr_reader :mailer
attr_reader :tenant
attr_reader :sender_ad... | 37.946108 | 108 | 0.637841 |
acfca0f5462d9fa923e2fef27955154c42a19b08 | 187 | name "play2"
maintainer "Saad Ahmed"
license "Apache 2.0"
description "Installs Play Framework on Linux"
version "0.2.0"
depends "java"
| 23.375 | 51 | 0.550802 |
03b003586b7335c2d700baf0b296699f5ff0235e | 2,546 | #
# Author:: John Keiser (<jkeiser@chef.io>)
# Copyright:: Copyright 2013-2016, 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
#
# ... | 33.5 | 203 | 0.635507 |
9132a581c16e9a4a5abe0241076fdaae71338165 | 706 | cask :v1_1 => 'docker-compose' do
version '1.5.2'
sha256 '6815ae29762450bec438285b60157873be9714922cfb424614d39d1fa24c3500'
# github.com is the official download host per the vendor homepage
url "https://github.com/docker/compose/releases/download/#{version}/docker-compose-Darwin-x86_64"
appcast 'https://git... | 32.090909 | 99 | 0.743626 |
4a102b13c7f728a1c5faf14889828be841ed332f | 17,132 | describe "Build Manager" do
describe ".truncate_changelog" do
it "Truncates Changelog" do
changelog = File.read("./pilot/spec/fixtures/build_manager/changelog_long")
changelog = Pilot::BuildManager.truncate_changelog(changelog)
expect(changelog).to eq(File.read("./pilot/spec/fixtures/build_manag... | 40.887828 | 149 | 0.665246 |
0832bd1402f367aacac315f5099c74887f715de6 | 434 | # frozen_string_literal: true
require "#{Rails.root}/lib/wiki_preferences_manager"
class SetPreferencesWorker
include Sidekiq::Worker
sidekiq_options unique: :until_executed
def self.schedule_preference_setting(user:)
perform_async(user.id)
end
def perform(user_id)
user = User.find(user_id)
pr... | 22.842105 | 64 | 0.785714 |
e9060baaf370f96a04f18259c4be61df03e9430f | 5,352 | require "active_support/core_ext/integer/time"
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 applica... | 44.231405 | 114 | 0.766069 |
21899697b9c605568759c1b6befa6d3a38fbbcd5 | 187 | Puppet::Type.type(:splunk_alert_actions).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
) do
def self.file_name
'alert_actions.conf'
end
end
| 20.777778 | 59 | 0.737968 |
f8ae5e702ffa29fd137eb28f6110465013d86a4d | 1,391 | require_relative '../../../validation_test'
module USCoreTestKit
module USCoreV311
class PatientValidationTest < Inferno::Test
include USCoreTestKit::ValidationTest
id :us_core_v311_patient_validation_test
title 'Patient resources returned during previous tests conform to the US Core Patient P... | 34.775 | 101 | 0.712437 |
1dcfd7cc45b9c23d6ac69e7dbd44359189f331ad | 3,674 | require_relative "../lib/scraper.rb"
require_relative "../lib/opportunity.rb"
require_relative "../config/environment.rb"
RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
# assertion/expectation library such as wrong or the stdlib/minitest
# assertions if you prefer.
... | 44.26506 | 129 | 0.738432 |
1c73856b2752ca9029e02247cb58c9b47dd6dbac | 5,070 | # frozen_string_literal: true
require "rails_helper"
RSpec.describe RemoveDataAttributes::Processor do
let(:processor) { described_class.new(data_attributes) }
describe "#call" do
let(:described_method) { -> { processor.call(hash) } }
let(:data_attributes) { %w(data-foo-bar) }
context %q{when `hash`... | 26.40625 | 92 | 0.55069 |
e9fd668d56d31067e9f720d12109734b54ed5f23 | 396 | class Reports::CholesterolRiskController < ApplicationController
def index
@results = Consultation.includes(:patient)
.fuzzy_where(ldl_cholesterol: :ldl_hight,
hdl_cholesterol: :hdl_risk,
triglycerides: :tri... | 39.6 | 76 | 0.530303 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.