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 |
|---|---|---|---|---|---|
d531c09623c6d3556d2d53fe20ba28aa7ea3275c | 546 | # frozen_string_literal: true
# Thrown when we can't find a Gemfile
class NoGemfileException < StandardError
def initialize(msg = 'Unable to find a Gemfile')
super
end
end
# Thrown when we can't find a Lockfile (Gemfile.lock)
class NoLockfileException < StandardError
def initialize(msg = 'Unable to find a L... | 23.73913 | 91 | 0.734432 |
f8cc7328c1651951d79d83374ef8a2d162212c01 | 4,759 | #--
# Copyright (c) 2019 Fuyuki Academy
#
# 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,
... | 35.514925 | 147 | 0.695314 |
268e77ba9ebf0987e4bcb036bf8484cd4be55dd2 | 8,875 | module RSpec
module Mocks
# @private
class MethodDouble < Hash
# @private
attr_reader :method_name, :object
# @private
def initialize(object, method_name, proxy)
@method_name = method_name
@object = object
@proxy = proxy
@method_stasher = InstanceMetho... | 33.364662 | 138 | 0.636282 |
62ba84f8bc242f8ced3efb23a2760669b3758f78 | 4,153 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HttpClient
include Msf::Auxiliary::Report
include Msf::Auxiliary::Scanner
def initialize
super(
... | 31.462121 | 138 | 0.605827 |
182093519511fdb7f359e97eb0a4d37e27a99bfc | 422 | class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_action :set_locale
def admin_only
unless current_user.admin?
redirect_to root_path, :alert => t('a... | 24.823529 | 57 | 0.727488 |
1a7e26c420eef757df521ce8059a8ea1dd8a3e0c | 2,657 | require "rails_helper"
RSpec.describe "insured/families/purchase.html.erb" do
let(:employee_role){FactoryGirl.create(:employee_role)}
let(:plan){FactoryGirl.create(:plan)}
let(:benefit_group){ FactoryGirl.build(:benefit_group) }
let(:hbx_enrollment){ HbxEnrollment.new(benefit_group: benefit_group, employee_ro... | 44.283333 | 212 | 0.716974 |
f75512a870c31aecaf120f3034fd188413a2ef3f | 1,600 | # -*- encoding: utf-8 -*-
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require 'beaker-pe/version'
Gem::Specification.new do |s|
s.name = "beaker-pe"
s.version = Beaker::DSL::PE::Version::STRING
s.authors = ["Puppetlabs"]
s.email = ["qe-team@puppetlabs.com"]
s.homepage = "h... | 36.363636 | 83 | 0.676875 |
180d63508c51428bc1b0120ee6741215cf7870a5 | 532 | dir = File.dirname(__FILE__)
dir = File.dirname(__FILE__)
require "#{dir}/plugin_migrations/migrator"
if ActiveRecord::ConnectionAdapters::SchemaStatements.instance_methods.include?('initialize_schema_information')
require "#{dir}/plugin_migrations/1.2/migrator"
require "#{dir}/plugin_migrations/1.2/extensions/sch... | 40.923077 | 112 | 0.798872 |
28bff7affa84b7b7390a865c738495ff8be9c64c | 220 | module Leggy
module Mapping
class Crawl
include Kartograph::DSL
kartograph do
mapping Leggy::Crawl
property *Leggy::Crawl.attr_accessors, scopes: [ :read ]
end
end
end
end
| 15.714286 | 64 | 0.622727 |
1a1d4191633ae3e6df2081ac58f1bdaf30c710c2 | 389 | cask "font-sf-compact" do
version "17.1d1e1"
sha256 :no_check
url "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg"
name "San Francisco Compact"
name "SF Compact"
desc "Compact variant of \"San Francisco\" by Apple"
homepage "https://developer.apple.com/fonts/"
pkg "SF Compact... | 25.933333 | 80 | 0.730077 |
620ffb82cb91ba8003f3f14eb0f7eae493d79d35 | 430 | require_relative '../src/shared/opcodes.rb'
puts '// Autogenerated from /src/shared/opcodes.rb'
puts
puts 'const DabOpcodeInfo g_opcodes[] = {'
format = " {OP_%s, \"%s\", {%s}},\n"
REAL_OPCODES.each_value do |opcode|
name = opcode[:name]
args = opcode[:args] || [opcode[:arg]].compact
args = args.map { |arg... | 22.631579 | 58 | 0.637209 |
33e340d9bcd28c3819e89e1e7e8f6a562ef04c53 | 45 | module HadoopJobKill
VERSION = "0.1.0"
end
| 11.25 | 20 | 0.711111 |
3341f492acd78a055034d41d2160fe909d759ac4 | 2,234 | require 'linguist/file_blob'
module Linguist
# A Repository is an abstraction of a Grit::Repo or a basic file
# system tree. It holds a list of paths pointing to Blobish objects.
#
# Its primary purpose is for gathering language statistics across
# the entire project.
class Repository
# Public: Initial... | 24.021505 | 75 | 0.602059 |
115836fbb1812ade017bd839414ab354ad05892d | 974 | class Factory
cattr_accessor :factories, instance_writer: false
self.factories = Hash.new { |hash, key| hash[key] = {} }
def self.define(name, options = {}, &block)
self.factories[name][:options] = options
self.factories[name][:definition] = block
end
def self.build(name, attributes = {})
ne... | 24.35 | 59 | 0.666324 |
edac79f28c5c27c68ed0c9712f328c550866e57d | 1,552 | # encoding: UTF-8
control 'PHTN-30-000051' do
title 'The Photon operating system package files must not be modified.'
desc "Protecting the integrity of the tools used for auditing purposes is a
critical step toward ensuring the integrity of audit information. Audit
information includes all information (e.g., audi... | 33.021277 | 79 | 0.702964 |
bbae036ec4a09876fdcc8e26d73a5c962a26e4f5 | 116,021 | require 'sass/script/value/helpers'
module Sass::Script
# YARD can't handle some multiline tags, and we need really long tags for function declarations.
# Methods in this module are accessible from the SassScript context.
# For example, you can write
#
# $color: hsl(120deg, 100%, 50%)
#
# and it wi... | 39.719617 | 129 | 0.618888 |
1d1ca383fa8bb59429f0f20717ed2db2b7fe597e | 481 | # require 'rails_helper'
# RSpec.describe "restaurants/new", type: :view do
# before(:each) do
# assign(:restaurant, Restaurant.new(
# name: "MyString",
# city: "MyString"
# ))
# end
# it "renders new restaurant form" do
# render
# assert_select "form[action=?][method=?]", restauran... | 21.863636 | 75 | 0.602911 |
018f804fad61c89fdbd09eedea9a44428835bede | 21,707 | require 'semantic_logger'
# Module: Java Messaging System (JMS) Interface
module JMS
# Every JMS session must have at least one Connection instance
# A Connection instance represents a connection between this client application
# and the JMS Provider (server/queue manager/broker).
# A connection is distinct fro... | 42.814596 | 163 | 0.662643 |
797a0d96542049a70f36609bbdf0e53048ad01c2 | 291 | actions :cask, :uncask, :install, :uninstall
default_action :install
attribute :name,
name_attribute: true,
kind_of: String,
regex: /^[\w-]+$/
attribute :options,
kind_of: String
def casked?
shell_out('/usr/local/bin/brew cask list 2>/dev/null').stdout.split.include?(name)
end
| 19.4 | 84 | 0.71134 |
ff5f0af57cd67d5f1b797d0acbea7e499f87c260 | 2,866 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# dat... | 33.717647 | 95 | 0.707606 |
fff6f1941909b216aa72f9fe4d98c07242d019c0 | 145 | class RenameTypeToFeedbackType < ActiveRecord::Migration[6.0]
def change
rename_column :platform_feedback, :type, :feedback_type
end
end
| 24.166667 | 61 | 0.786207 |
919c4df64f0f84be33d60ade45cf0ed63108431b | 388 | module EntityStore
module Controls
module Message
def self.example
first
end
def self.first
Example.build :number => 1
end
def self.second
Example.build :number => 11
end
class Example
include Messaging::Messa... | 16.166667 | 37 | 0.510309 |
e2e10f0b667745703469e39c3fb105323ce93b9d | 190 |
require 'rest-graph/core'
require 'rest-graph/config_util'
require 'rest-graph/facebook_util'
require 'rest-graph/version'
require 'rest-graph/rails_util' if Object.const_defined?(:Rails)
| 23.75 | 64 | 0.794737 |
189462b3f7b2f48f73ee34cdb66ebaae401c57db | 1,338 | require 'spec_helper'
describe Forem::ModerationController do
use_forem_routes
before do
allow(controller).to receive_messages :forum => stub_model(Forem::Forum)
allow(controller).to receive_messages :forem_admin? => false
end
it "anonymous users cannot access moderation" do
get :index, forum_id:... | 30.409091 | 84 | 0.715994 |
f8216edc73e227455e78662fe53352d52f10b496 | 547 | class CreateClients < ActiveRecord::Migration[6.0]
def change
create_table :clients do |t|
t.integer :clientable_id, null: false
t.string :clientable_type, null: false
t.string :ip_address, limit: 45
t.string :platform, default: "web", null: false
t.string :device
t.text :user_... | 28.789474 | 58 | 0.672761 |
289046350731884ac12ab539d4dc0c3653d1e6f9 | 214 | class BoxroomAddColumnsMessageUserIdToShareLinks < ActiveRecord::Migration[5.0]
def change
add_column :boxroom_share_links, :message, :text
add_column :boxroom_share_links, :user_id, :integer
end
end
| 30.571429 | 79 | 0.785047 |
1c2d3d2ed394f4a9552efd8b0166b6328db9331e | 456 | # frozen_string_literal: true
RSpec.shared_context 'with GraphQL Result' do
let(:query_name) { described_class.graphql_name.camelcase(:lower) }
let(:result_errors) { result['errors'] }
let(:result_error) { result_errors&.first || {} }
let(:result_error_message) { result_error['message'] }
let(:result_data) {... | 38 | 69 | 0.703947 |
87e7db09a0876d032867edcf58f53844c877f971 | 1,733 | require 'qingting/api/base'
module Qingting
module Api
module Podcaster
# extend self
def self.included(base)
base.send :extend, ClassMethods
end
# Class methods
module ClassMethods
def podcasters_guides
url = eval("Base.v6_podcasters_guides")
... | 23.418919 | 75 | 0.572995 |
39cfb63cbad5316593f60f1580e5b4603bf3fce3 | 773 | #
# Cookbook Name:: cookbook-openshift3
# Recipe:: adhoc_redeploy_certificates
#
# Copyright (c) 2015 The Authors, All Rights Reserved.
server_info = OpenShiftHelper::NodeHelper.new(node)
is_certificate_server = server_info.on_certificate_server?
is_first_master = server_info.on_first_master?
include_recipe 'cookbook... | 36.809524 | 129 | 0.831824 |
6a7393a9921728a1dcc04e72a1c9c9bf5da915ee | 3,988 | module MergeRequests
class BuildService < MergeRequests::BaseService
def execute
merge_request = MergeRequest.new(params)
# Set MR attributes
merge_request.can_be_created = true
merge_request.compare_commits = []
merge_request.source_project = project unless merge_request.source_pro... | 33.233333 | 114 | 0.683801 |
18690cc2cf788b0fd79e44c53a241491270cd203 | 2,155 | # frozen_string_literal: true
class ETDIndexer < ObjectIndexer
def thumbnail_path
ActionController::Base.helpers.image_path(
"fontawesome/black/png/256/file-text.png"
)
end
def generate_solr_document
super.tap do |solr_doc|
solr_doc[Solrizer.solr_name("member_ids", :symbol)] = object.mem... | 25.05814 | 77 | 0.634803 |
ab72354edcf08866393e941b3326bb60d59bacbd | 718 | # frozen_string_literal: true
require 'spec_helper'
describe Banzai::Pipeline::PostProcessPipeline do
context 'when a document only has upload links' do
it 'does not make any Gitaly calls', :request_store do
markdown = <<-MARKDOWN.strip_heredoc
[Relative Upload Link](/uploads/e90decf88d8f96fe9e138... | 26.592593 | 84 | 0.703343 |
1d97c6059ea72324581b1921963ebfc5663c180b | 1,526 | class SkillLevel
MATRIX = {
1 => ['I understand and can explain the difference between data types (strings, booleans, integers)',
'I have heard of the MVC (Model View Controller) pattern',
'I am comfortable creating and deleting files from the command line'],
2 => ['I am confident... | 44.882353 | 107 | 0.636959 |
1c934e2b438aed25204599781776efd7010224e4 | 335 | module Level4
def solve_level_4
@current_health = warrior.health
@previous_health = @current_health unless @previous_health
if warrior.feel.enemy?
warrior.attack!
else
if need_rest?(@current_health, @previous_health)
warrior.rest!
else
warrior.walk!
end
end
@previous_health = @current_... | 19.705882 | 60 | 0.737313 |
f8ac7e634e735c26ace54baefba95abd5a925959 | 140 | require 'mxx_ru/cpp'
MxxRu::Cpp::exe_target {
required_prj 'so_5/prj_s.rb'
target 'sample.so_5.convert_lib_s'
cpp_source 'main.cpp'
}
| 14 | 35 | 0.735714 |
eddb3d9bc3b319aec3db40806a00be924a2f5925 | 1,167 | class CreateUserActivities < ActiveRecord::Migration
# Set this constant to true if this migration requires downtime.
DOWNTIME = true
# When a migration requires downtime you **must** uncomment the following
# constant and define a short and easy to understand explanation as to why the
# migration requires d... | 41.678571 | 87 | 0.755784 |
f885a8cbc01a2b1f38bb30bf62835d5d6b5c558d | 8,064 | require "cases/helper"
require 'models/default'
require 'models/entrant'
class DefaultTest < ActiveRecord::TestCase
def test_nil_defaults_for_not_null_columns
column_defaults =
if current_adapter?(:MysqlAdapter) && (Mysql.client_version < 50051 || (50100..50122).include?(Mysql.client_version))
{ 'i... | 37.506977 | 194 | 0.714038 |
b93120f73e4d29a383648b89952adbc7d712d256 | 110 | json.set! :keep_alerts, false
json.set! :flash, {
notice: "Товар `#{ @product.title }` успешно обновлен"
}
| 18.333333 | 56 | 0.663636 |
1de99027259871fccd29ac9330284c3e5ffd661e | 235 | module Interfaces
class FtpSink < FtpSinkBase
include FtpSession
def put! session, local, remote
session.put local, remote
end
def rename! session, from, to
session.rename tmp, file
end
end
end
| 16.785714 | 35 | 0.659574 |
18c7a8458e9949f9d35ef3ae67c1c04e444eb8ca | 14,332 | # consent date < 4/24/2018
#
# OR
#
# consent date > 6/7/2018
require 'csv'
namespace :ehr do
desc "Validate consents"
task(validate_consents: :environment) do |t, args|
subject_template = { pmi_id: nil, ehr_consent_date: nil, status: nil }
vibrent_subjects_file = CSV.new(File.open('lib/setup/data/new_i... | 55.984375 | 451 | 0.727114 |
6187cd04b25965ac1ba36077fba3aba88f522fb0 | 46 | module InformantRails
VERSION = '1.1.0'
end
| 11.5 | 21 | 0.717391 |
bf3c0f3d923d680698bacf35ceca368cc40d468e | 255 | module SlideCaptchaHelper
def slide_captcha_tags
session = SlideCaptchaCode.random.create_session
render :partial => 'slide_captcha/tags', :locals => {:id => session.id}
end
def slide_captcha_styles
stylesheet_link_tag('slide_captcha')
end
end | 25.5 | 73 | 0.780392 |
f838fb7211394d493b7ff5359d280fa1870306b9 | 34 | 10.downto(0) do |i|
puts i
end
| 8.5 | 19 | 0.588235 |
bfb032fa0777edd372422d3d392d9c2bc94bd38d | 1,197 | =begin
#Accounting API
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 2.0.0
Contact: api@xero.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.0.3
=end
require 'spec_helper'
require 'json'
... | 24.9375 | 107 | 0.7335 |
87103448f38633000c1dff7e0eacdba107a25a47 | 4,173 | #***********************************************************
#* Copyright (c) 2006 - 2012, Zhimin Zhan.
#* Distributed open-source, see full license in MIT-LICENSE
#***********************************************************
require "rubygems"
gem "activesupport" #, "~> 3.2.17"
require 'active_support'
requir... | 27.82 | 97 | 0.654445 |
ed084c3f3f664e13eebab3bdc48abde4deb79d09 | 400 | # coding: utf-8
# MiniTerm needs to put text on the screen! (ANSI Specific Code)
module MiniTerm
# Put some text onto the screen.
def self.print(text)
STDOUT.print(text)
self
end
# Sound a beep
def self.beep
STDERR.write(BELL)
STDERR.flush
self
end
# Clear the screen and home the c... | 15.384615 | 64 | 0.66 |
03a71335787fa38c9aca8b0bc037b2fe72496ebd | 226 | class CreateAccounts < ActiveRecord::Migration
def self.up
create_table :accounts do |t|
t.column :username, :string
t.column :email, :string
end
end
def self.down
drop_table :accounts
end
end
| 17.384615 | 46 | 0.672566 |
91eebd090af95770dfcd3830144af13e8f46733f | 999 | require 'test_helper'
class ScansControllerTest < ActionController::TestCase
setup do
@scan = scans(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:scans)
end
test "should get new" do
get :new
assert_response :success
end
test "s... | 19.98 | 64 | 0.677678 |
ac0ea8ea3f97733b7caed2a54b8e931b8f3804c3 | 155 | class CreateTopics < ActiveRecord::Migration[5.2]
def change
create_table :topics do |t|
t.string :title
t.timestamps
end
end
end
| 15.5 | 49 | 0.658065 |
4a64726b8b472f0cfa9e9140b1e893f0d13ae0bf | 1,612 | if ENV["COVERAGE"]
require "simplecov"
SimpleCov.start "rails"
end
ENV["RAILS_ENV"] = "test"
require File.expand_path("../../config/environment", __FILE__)
require "rspec/rails"
require "webmock/rspec"
require "email_spec"
require "paperclip/matchers"
Dir[Rails.root.join("spec/support/**/*.rb")].each { |file| r... | 24.8 | 73 | 0.743176 |
0187de458eb23baf99fffa15dcbd084137a27363 | 58 | module TokyoMetro::Factory::Save::Api::MlitRailwayLine
end | 29 | 54 | 0.827586 |
1874349d8001883e8c26b39410e267e9bca5051c | 398 | class CreateCollaborators < ActiveRecord::Migration[5.1]
def change
create_table :collaborators do |t|
t.integer :disponibilidad
t.references :city, foreign_key: true
t.references :zone, foreign_key: true
t.boolean :mobilidad
t.string :herramientas
t.references :skill, foreign_... | 24.875 | 56 | 0.68593 |
e262bab2feb3952134efbcf605687e068c376473 | 1,267 | # 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::CostManagement::Mgmt::V2019_01_01
module Models
#
# Error response indicates that the service is not able to process the
# incom... | 25.857143 | 74 | 0.560379 |
289d030de1578714808988215d960bbd193af7e2 | 2,605 | # Commonly used email steps
#
# The available methods are:
#
# deliveries, all_email
# current_email
# current_email_address
# reset_mailer
# last_email_sent
# inbox, inbox_for
# open_email, open_email_for
# find_email, find_email_for
# email_links
# email_links_matching
#
#
# A couple methods to handle some words in ... | 23.258929 | 92 | 0.652591 |
03f2e08fb41197b747d2371d23324119378b470f | 1,178 | module Pechkin
# Rack application to handle requests
class App
DEFAULT_CONTENT_TYPE = { 'Content-Type' => 'application/json' }.freeze
DEFAULT_HEADERS = {}.merge(DEFAULT_CONTENT_TYPE).freeze
attr_accessor :handler, :logger
def initialize(logger)
@logger = logger
end
def call(env)
... | 26.177778 | 75 | 0.640917 |
1c162393a38e1a2bce2ba3712d8f9cc4af85e09b | 1,458 | class Kahip < Formula
desc "Karlsruhe High Quality Partitioning"
homepage "https://algo2.iti.kit.edu/documents/kahip/index.html"
url "https://algo2.iti.kit.edu/schulz/software_releases/KaHIP_2.12.tar.gz"
sha256 "b91abdbf9420e2691ed73cea999630e38dfaf0e03157c7a690a998564c652aac"
revision 1
bottle do
sha2... | 40.5 | 106 | 0.754458 |
39bf0315201aaa60f57fe8b2aa789a0c7455a5d0 | 231 | class CreateWebhooks < ActiveRecord::Migration[5.0]
def change
create_table :webhooks do |t|
t.string :title, null: false, default: ''
t.string :url, null: false, default: ''
t.timestamps
end
end
end
| 21 | 51 | 0.640693 |
4a23881e764a913b7054fd14e3335dae5b9b3bf0 | 2,304 | require 'marketingcloudsdk'
require_relative 'sample_helper'
begin
stubObj = MarketingCloudSDK::Client.new auth
NameOfAttribute = 'RubySDKTesting'
p '>>> Retrieve Profile Attribute'
getProfileAttribute = ET_ProfileAttribute.new
getProfileAttribute.authStub = stubObj
getResponse = getProfileAttribute.... | 40.421053 | 220 | 0.744358 |
3877068a451130d931d362ecc7d77729c01adcf7 | 2,899 | Capybara::SpecHelper.spec '#window_opened_by', requires: [:windows] do
before(:each) do
@window = @session.current_window
@session.visit('/with_windows')
end
after(:each) do
(@session.windows - [@window]).each do |w|
@session.switch_to_window w
w.close
end
@session.switch_to_window... | 34.511905 | 98 | 0.676785 |
6114d43dd9848a19cd5325c4c1243fb0120f6e65 | 7,061 | require 'spec_helper'
module VCAP::CloudController
RSpec.describe RestagesController do
let(:app_event_repository) { Repositories::AppEventRepository.new }
before { CloudController::DependencyLocator.instance.register(:app_event_repository, app_event_repository) }
describe 'POST /v2/apps/:id/restage' do... | 32.995327 | 118 | 0.595808 |
039b3dd0405f280b4d7ec3a274947c887ee01fac | 122 | class AddFlatUserIdToUsers < ActiveRecord::Migration[5.2]
def change
add_column :users, :flat_id, :string
end
end
| 20.333333 | 57 | 0.745902 |
4a0f2860e8fdc11e466ceab695f632ea085af024 | 239 | require 'spec_helper'
[22, 80, 443].each do |port|
describe port(port) do
it { is_expected.to be_listening }
end
end
[3000, 3306, 4000].each do |port|
describe port(port) do
it { is_expected.not_to be_listening }
end
end
| 17.071429 | 42 | 0.682008 |
397ca70f4a103172360cc05e2d6a79528de2ee68 | 1,405 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Merge request > User edits MR' do
include ProjectForksHelper
before do
stub_licensed_features(multiple_merge_request_assignees: false)
end
context 'non-fork merge request' do
include_context 'merge request edit context'
it_behav... | 27.019231 | 82 | 0.739502 |
b9b608d2f5257335c34ed9ea87624110e77785fe | 550 | require "spec_helper"
describe "Git recipe" do
Vito::Tests::VagrantTestBox.boxes(:ubuntu10, :ubuntu12).each do |box|
it "tests on #{box.name}" do
setup_vagrant(box)
assert_installation(box, "git --version").should be_false
Vito::DslFile.new.run do
server do
connection :ssh, ... | 26.190476 | 129 | 0.650909 |
87487e03199f91d3377ed0fe76aca0f7d1b3c82c | 1,135 | require 'rails_helper'
RSpec.describe Paper, type: :model do
it "should fail validation without a title" do
paper_authors = FactoryGirl.build_list :author, 1
paper = Paper.new(venue: "Mgz", year: 2017, authors: paper_authors)
expect(paper).not_to be_valid
end
it "should fail validation without a ve... | 34.393939 | 106 | 0.720705 |
33126080341a4f1c53b33deb4b799dd574573ecc | 5,579 | # frozen_string_literal: true
module Ftpd
class Session
include Error
include ListPath
attr_accessor :command_sequence_checker
attr_accessor :data_channel_protection_level
attr_accessor :data_server
attr_accessor :data_server_factory
attr_accessor :data_type
attr_accessor :logged_in... | 24.469298 | 81 | 0.655315 |
2870c47d77354354b8120a06f15a8734557881d5 | 263 | cask 'font-nova-flat' do
version :latest
sha256 :no_check
url 'https://github.com/google/fonts/raw/master/ofl/novaflat/NovaFlat.ttf'
name 'Nova Flat'
homepage 'http://www.google.com/fonts/specimen/Nova%20Flat'
license :ofl
font 'NovaFlat.ttf'
end
| 21.916667 | 76 | 0.726236 |
e90536aee4cab89190ad657b47869f42db253c45 | 4,572 | # lang_ca.rb
# Catalan translation file.
# Translation by Andrés Cirugeda andres.cirugeda(at)gmail.com
module LocalizationSimplified
About = {
:lang => "ca",
:updated => "2007-02-01"
}
class ActiveRecord
# ErrorMessages to override default messages in
# +ActiveRecord::Errors::@@default_error_... | 39.413793 | 114 | 0.590114 |
91f952f48efb454f3a40e583373663b16c21062d | 2,248 | # frozen_string_literal: true
module Vedeu
module Coercers
# Coerces a colour options hash into: an empty hash, or a hash
# containing either or both background and foreground keys.
#
# @api private
#
class ColourAttributes
include Vedeu::Common
# @param value [Hash]
# @... | 18.276423 | 66 | 0.548932 |
01a297057d8d455f6cb14ebf3165641315d6fbb3 | 530 | module FindAStandard
class ResultsPresenter
def initialize(result)
@result = result
end
def title
@result['_source']['title']
end
def url
@result['_source']['url']
end
def description
@result['_source']['description']
end
def body
if !@result['hig... | 15.588235 | 64 | 0.530189 |
ac0ee5018e60f30910a12d9c5ac29156dea88a13 | 3,939 | # frozen_string_literal: true
class AddIndexToTable < ActiveRecord::Migration[6.1]
def change
add_index :users, :email, name: 'index_users_on_email'
add_index :users, :password, name: 'index_users_on_password'
add_index :users, :first_name, name: 'index_users_on_first_name'
add_index :users, :last_na... | 60.6 | 118 | 0.784971 |
11610bf934c9683da08984877a66693fab5cfbd8 | 2,361 | class Terraform < Formula
desc "Tool to build, change, and version infrastructure"
homepage "https://www.terraform.io/"
url "https://github.com/hashicorp/terraform/archive/v0.12.16.tar.gz"
sha256 "ccdcbce56c70a5d23272692320f49d48cd821a9d91b900f538a37069f31be731"
head "https://github.com/hashicorp/terraform.gi... | 30.662338 | 98 | 0.657772 |
2620377871f227d3fdd3cdf62a785d8f345edfde | 1,594 | # frozen_string_literal: true
module OnlineMigrations
# @private
class IndexDefinition
attr_reader :table, :columns, :unique, :opclasses, :where, :type, :using
def initialize(**options)
@table = options[:table]
@columns = Array(options[:columns]).map(&:to_s)
@unique = options[:unique]
... | 30.075472 | 105 | 0.642409 |
d5b156496baf1a9bf75f53705c09d939b38c742a | 825 | cask "font-iosevka-curly-slab" do
version "11.2.7"
sha256 "a3c9001b60808376dbf4fa20f08328ef1e6e1abf94d21b8db67c55eb47ff1f83"
url "https://github.com/be5invis/Iosevka/releases/download/v#{version}/ttc-iosevka-curly-slab-#{version}.zip"
name "Iosevka Curly Slab"
desc "Sans-serif, slab-serif, monospace and quas... | 33 | 111 | 0.755152 |
1d2895a69aa829697dfb9a2ec6840211a7f5dfcf | 3,820 | require 'rails_helper'
require 'support/simple_calendar_date_chooser'
include SimpleCalendarDateChooser
RSpec.describe 'Accompaniment leader viewing and reporting on accompaniments', type: :feature do
let(:community) { create :community, :primary }
let(:region) { community.region }
let(:team_leader) { create(:us... | 37.821782 | 139 | 0.703403 |
388e14e94ced3960b71339825013dbe194d1c195 | 1,708 | #
# Cookbook Name:: nomad
# Recipe:: manage
#
# Copyright 2015-2018, Nathan Williams <nath.e.will@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | 32.846154 | 79 | 0.735948 |
bb97036cf385ab40cd1f5f534fd1379094dfcbec | 92 | # frozen_string_literal: true
module Cms
def self.table_name_prefix
'cms_'
end
end
| 11.5 | 29 | 0.73913 |
61c7fe3e40fb4663b11fb7ba7b10b055cfc42f40 | 9,222 | # frozen_string_literal: true
require_relative "lib/bugcrowd_client"
module Kenna
module Toolkit
class BugcrowdTask < Kenna::Toolkit::BaseTask
def self.metadata
{
id: "bugcrowd",
name: "Bugcrowd",
description: "Pulls assets and findings from Bugcrowd",
option... | 39.579399 | 233 | 0.577749 |
b9312ce9c87b5d0d2d825b6f1dc2621f33691699 | 186 | require "govuk_tables/version"
require "govuk_tables/table"
require "govuk_tables/railtie"
require "govuk_tables/table_helper"
module GovukTables
class Error < StandardError; end
end
| 20.666667 | 35 | 0.822581 |
4a7e12fc27b781975f7c95aabd432c375dad707b | 32 | module ConfigurationsHelper
end
| 10.666667 | 27 | 0.90625 |
1aead464be131d81e265ff1617e5182856881323 | 6,154 | =begin
#Cloudsmith API
#The API to the Cloudsmith Service
OpenAPI spec version: v1
Contact: support@cloudsmith.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.2.3
=end
require 'date'
module CloudsmithApi
class PackagesUploadComposer
# The primary file for the p... | 28.623256 | 153 | 0.621222 |
f8f28adedaf0be8b00139c72887fe91afbb60585 | 8,370 | module Danger
# Lint files of a gradle based Android project.
# This is done using the Android's [Lint](https://developer.android.com/studio/write/lint.html) tool.
# Results are passed out as tables in markdown.
#
# @example Running AndroidLint with its basic configuration
#
# android_lint.lint
... | 31.115242 | 119 | 0.623895 |
79eab5d80cec1626eba35b11d67e52f87e8690ce | 2,525 | module AppEarnings::Amazon
# Generates a report based on the data provided
class Reporter
AVAILABLE_FORMATS = %w(json text)
attr_accessor :data
def initialize(data)
@data = data
@payments_data = @data.find { |r| r[:report_type] == :payments }
@earnings_data = (@data - [@payments_data]... | 28.370787 | 78 | 0.585743 |
e8d763225eac1dc1cab4ad7f24d8a52bb082cee1 | 1,815 | # frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "s... | 39.456522 | 85 | 0.773554 |
395f75747494eb8807c2a893e341897e97cadb5a | 930 | class LtcTools < Formula
desc "Tools to deal with linear-timecode (LTC)"
homepage "https://github.com/x42/ltc-tools"
url "https://github.com/x42/ltc-tools/archive/v0.6.4.tar.gz"
sha256 "8fc9621df6f43ab24c65752a9fee67bee6625027c19c088e5498d2ea038a22ec"
revision 1
head "https://github.com/x42/ltc-tools.git"
... | 30 | 92 | 0.746237 |
9123fddcdcf71465fc44895bbf0d4f5407f90db6 | 683 | # -*- encoding: utf-8 -*-
require 'json'
package = JSON.parse(File.read('bower.json'))
Gem::Specification.new do |gem|
gem.name = "handlebars-source"
gem.authors = ["Yehuda Katz"]
gem.email = ["wycats@gmail.com"]
gem.date = Time.now.strftime("%Y-%m-%d")
gem.description = %q... | 29.695652 | 86 | 0.612006 |
01679cc5b05a7363a3a3ecedcfebe31e63ec41e2 | 8,381 | require_relative "./visitor"
require_relative "./code"
module MTS
# on separe le traitement a faire sur chaque node de la maniere dont les parcourir
class PrettyPrinter < Visitor
attr_accessor :code
def initialize
@code = Code.new
end
def visitRoot node
puts "root"
@code << "... | 22.055263 | 130 | 0.501253 |
ed8478caa6bf9f6d46f7daf7142b2c8e0c5cb643 | 761 | Pod::Spec.new do |spec|
spec.name = "ShazamLite"
spec.version = "1.0.0"
spec.swift_version = "4.2"
spec.summary = "An asynchronous, easy-to-use, and rapid HTTP Networking framework for iOS."
spec.description = "ShazamLite is Networking framework built on top of URLSession that provides cus... | 54.357143 | 196 | 0.675427 |
385fe41ebe1e977c0b30485730a52ae24d4e2462 | 3,755 | class Rabbitmq < Formula
desc "Messaging broker"
homepage "https://www.rabbitmq.com"
url "https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.7.18/rabbitmq-server-generic-unix-3.7.18.tar.xz"
sha256 "30a8439671f44f0fc9611782fdfaabba5c1773da85fca279e2850ad28442a2d5"
bottle :unneeded
depends_on ... | 35.424528 | 136 | 0.667377 |
e8fdb48e2d0f5ca5959acde495561ae97b890fda | 2,017 | class Asio < Formula
desc "Cross-platform C++ Library for asynchronous programming"
homepage "https://think-async.com/Asio"
url "https://downloads.sourceforge.net/project/asio/asio/1.12.0%20%28Stable%29/asio-1.12.0.tar.bz2"
sha256 "2c350b9ad7e266ab47935200a09194cbdf6f7ce2e3cabeddae6c68360d39d3ad"
head "https:... | 31.515625 | 116 | 0.691125 |
6a4742194f6afa77a848775af1a880f0405743a0 | 486 | require 'spec_helper'
describe SportsDataApi::Mlb::Season, vcr: {
cassette_name: 'sports_data_api_mlb_season',
record: :new_episodes,
match_requests_on: [:host, :path]
} do
context 'results from schedule fetch' do
let(:season) do
SportsDataApi.set_access_level(:mlb, 't')
SportsDataA... | 24.3 | 50 | 0.662551 |
260491e493736bef038b3e47cfce496a96de740c | 13,175 | ##
# This code was generated by
# \ / _ _ _| _ _
# | (_)\/(_)(_|\/| |(/_ v1.0.0
# / /
#
# frozen_string_literal: true
module Twilio
module REST
class IpMessaging < Domain
class V2 < Version
class ServiceContext < InstanceContext
class BindingList < ListResource
... | 37.642857 | 120 | 0.529412 |
62e1e9b0329d8b6bc253e65802aa486662e5a2ff | 131 | class AddCategoryIdToRecipes < ActiveRecord::Migration[5.1]
def change
add_column :recipes, :category_id, :integer
end
end
| 21.833333 | 59 | 0.763359 |
fff99c772b2db892d27319e7d7f959010acb2ac9 | 1,235 | require 'json'
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
Pod::Spec.new do |s|
s.name = 'EXUpdates'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.license = package['license']
s.aut... | 33.378378 | 188 | 0.636437 |
e83d3a27bfa45d2dff2d6213e78404b15f487427 | 271 | Rails.application.routes.draw do
root 'static_page#home'
get 'static_page/home'
get 'static_page/help'
get 'static_page/about'
get 'static_page/contact'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
| 24.636364 | 101 | 0.756458 |
2672c5556855fef438f4028390af65bd6c429afc | 687 | require 'spec_helper'
describe Spree::Api::V2::Platform::PropertySerializer do
include_context 'API v2 serializers params'
subject { described_class.new(resource, params: serializer_params).serializable_hash }
let(:type) { :property }
let(:resource) { create(type) }
it do
expect(subject).to eq(
... | 24.535714 | 88 | 0.63901 |
79e7589d8a08b90d3a4f7542432d810976b4299f | 1,528 | Gem::Specification.new do |s|
s.name = 'logstash-input-rss2'
s.version = '6.2.3'
s.licenses = ['Apache-2.0']
s.summary = 'Extended RSS/Atom input plugin for Logstash'
s.description = 'This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $... | 41.297297 | 205 | 0.586387 |
79d94c805157895a9f7846a61a60c535f6eb2d29 | 676 | #
# Cookbook:: build_cookbook
# Recipe:: functional
#
# Copyright:: 2018, ConvergeOne
#
# 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... | 35.578947 | 74 | 0.761834 |
280bcc7d5ae825159d8429fd40489273fe3b77e5 | 922 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v9/services/click_view_service.proto
require 'google/ads/google_ads/v9/resources/click_view_pb'
require 'google/api/annotations_pb'
require 'google/api/client_pb'
require 'google/api/field_behavior_pb'
require 'google/api/resourc... | 30.733333 | 153 | 0.761388 |
bbbbcf5aa0f95177e5445e38e50ce8832b4d74d8 | 3,959 | require File.dirname(__FILE__) + '/../../../spec_helper'
describe "Array::Iterator#next for a forward iterator" do
before :each do
ScratchPad.record []
@iter = [1, 2, 3, 4].to_iter
end
it "sets the iterator to the start of the array on the first call" do
@iter.next
@iter.item.should == 1
@i... | 23.017442 | 88 | 0.618338 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.