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 |
|---|---|---|---|---|---|
26ae2d9396a38661514ae70faa06410709d01e82 | 880 | module ID3Tag
module Frames
module V2
class FrameFabricator
class << self
def fabricate(id, content, flags, major_version_number)
new(id, content, flags, major_version_number).fabricate
end
end
def initialize(id, content, flags, major_version_number... | 23.783784 | 97 | 0.540909 |
0881f7a9552a3519de81ce03cb621dec095656d6 | 621 | require_relative 'game'
require_relative 'user'
include Codebreaker
# a = Game.new
# i.start
# # puts "Attempts: #{count}"
# # puts "secret code: #{i.start}"
# puts "user code: #{i.input_user_code}"
# # puts "user code: #{i.valid_input}"
# # puts "count plus : #{i.count_plus}"
# # puts "count minus : #{i.count_minus}... | 24.84 | 59 | 0.68438 |
3318dff4e54f4bbc91bd094e0e8574f0b0f24b3e | 2,231 | # frozen_string_literal: true
require 'dry/struct'
require 'middleman/docsite/types'
module Middleman
module Docsite
class Project < Dry::Struct
Types = Middleman::Docsite::Types
transform_keys(&:to_sym)
transform_types do |type|
if type.default?
type.constructor do |value|... | 22.31 | 86 | 0.561183 |
391a29cb6b8033de150b8c6dcf1c31aebe60a9b8 | 2,555 | exclude :test_arity , "needs investigation"
exclude :test_arity2 , "needs investigation"
exclude :test_binding , "needs investigation"
exclude :test_binding2 , "needs investigation"
exclude :test_binding_receiver , "needs investigation"
exclude :test_bound_parameters , "needs investigation"
exclude :test_curry , "needs... | 54.361702 | 71 | 0.836399 |
f775223d4926dc97f02679f9f1caa4329711a3aa | 118 | require 'test_helper'
class BeltTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 14.75 | 40 | 0.694915 |
ed50c17815d70446ed001c994f9795ef11f28df6 | 12,179 | # frozen_string_literal: true
require "excon"
require "toml-rb"
require "open3"
require "dependabot/dependency"
require "dependabot/errors"
require "dependabot/shared_helpers"
require "dependabot/python/file_parser"
require "dependabot/python/file_parser/python_requirement_parser"
require "dependabot/python/file_updat... | 35.820588 | 80 | 0.617703 |
1a1235c3b0609513f48ded2bb17a85cf39d44298 | 151 | require 'rails_helper'
RSpec.describe "static_pages/search.html.haml", :type => :view do
pending "add some examples to (or delete) #{__FILE__}"
end
| 25.166667 | 65 | 0.735099 |
0117c9f5d72a38c85179f42c981737119597e568 | 6,863 | ########################################################
# Defines the main methods that are necessary to filter out reads based on similarity with an entry in a given database
########################################################
class PluginUserFilter < Plugin
#Returns an array with the errors due to parameter... | 43.99359 | 214 | 0.673029 |
b946657e4faedb89495459cf3ded3c7ed6a5cea9 | 88 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'best_hiking_trails'
| 29.333333 | 58 | 0.761364 |
6101c0aa166d43766de65ff3379e9d30dd92a79b | 1,639 | module ApHelper
def action_type_text(ap)
if ap.action_type == 0 then return "花壇の世話"
elsif ap.action_type == 1 then return "庭園の散策"
elsif ap.action_type == 2 then return "島の探検"
elsif ap.action_type == 3 then return "練習戦"
end
end
def progress_text(ap)
if ap.p... | 25.609375 | 62 | 0.541184 |
d5cfe7d3aba3bb3962567a82d0beadf8ab13fcaa | 6,725 | class EventsController < ApplicationController
before_action :authenticate_user!, except: [:calendar, :index, :archive, :fullcalendar]
before_action :set_item, only: [:show, :edit, :update, :destroy]
def index
@events = Instance.published.future.order(:start_at)
end
def archive
@events = Instanc... | 37.361111 | 237 | 0.623048 |
18e30fcfdece8f46400b187ad0d6dea9a3a22458 | 9,498 | # encoding: utf-8
# author: Dominik Richter
# author: Christoph Hartmann
require 'uri'
require 'openssl'
require 'tempfile'
require 'open-uri'
module Fetchers
class Url < Inspec.fetcher(1)
MIME_TYPES = {
'application/x-zip-compressed' => '.zip',
'application/zip' => '.zip',
'application/x-gzip... | 35.177778 | 133 | 0.617498 |
bbccdf70a2cdb51cf18ac0d65bcf83121f33c88a | 559 | require 'active_model'
module CreditCardChecker
# Validator for credit card numbers using the Luhn algorithm
class CardNumberValidator
include ActiveModel::Validations
attr_reader :number_array
def initialize(number)
@number_array = number.chars.map(&:to_i)
end
def number_valid?
... | 22.36 | 76 | 0.685152 |
e9ba868c53fba86d7fca5c42ffb5b03dd653ccae | 584 | require "base64"
module TerraspacePluginAzurerm::Interfaces::Helper
class Secret
extend Memoist
include TerraspacePluginAzurerm::Logging
include TerraspacePluginAzurerm::Clients::Options
def initialize(mod, options={})
@mod, @options = mod, options
@base64 = options[:base64]
end
... | 21.62963 | 60 | 0.667808 |
914d63b6db5127981a8a7cba83159dfbd993f316 | 2,989 | # (c) Copyright 2017 Ribose Inc.
#
# This is a middleware to check for invalid user's request path and request
# parameters.
module Rack
class Cleanser
class InvalidURIEncoding
include Regexps
# Escapes lone percent signs, that is percent sign characters which are
# not followed by two hex dig... | 30.191919 | 83 | 0.578789 |
799b6149ca61a94a2f7ae2b46b8751977c1d7807 | 147 | require File.expand_path('../../../../spec_helper', __FILE__)
describe "Net::HTTP#trace" do
it "needs to be reviewed for spec completeness"
end
| 24.5 | 61 | 0.707483 |
5d9c29522f7c8d0da309aea79fd00e198eaf8ff1 | 24,955 | #
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Chris Read <chris.read@gmail.com>
# Copyright:: Copyright (c) 2008-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.
#... | 39.053208 | 246 | 0.602645 |
e88c70ac63b2d529c08b2974fe917299e7ece648 | 6,375 | module Citron
# Test Case encapsulates a collection of
# unit tests organized into groups of contexts.
#
class TestCase < World
class << self
# Brief description of the test case.
attr :label
# Symbol list of tags. Trailing element may be Hash
# of `symbol => object`.
attr ... | 20.901639 | 82 | 0.504471 |
1de3f6043d975a3d4fb987345cafbc6504e169a6 | 986 | # 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.
#
# This file is the source Rails uses to define your schema when running `bin/rai... | 42.869565 | 86 | 0.766734 |
e2cf85216830d5a9e2d7d7f523db580d264cba25 | 158 | # This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Rails318::Application
| 31.6 | 67 | 0.772152 |
266be35211ac89dc8375ad1f71e6bc6b0fd61b26 | 354 | module Merb
VERSION = '0.9.6' unless defined?(Merb::VERSION)
# Merb::RELEASE meanings:
# 'dev' : unreleased
# 'pre' : pre-release Gem candidates
# nil : released
# You should never check in to trunk with this changed. It should
# stay 'dev'. Change it to nil in release tags.
RELEASE = 'dev' u... | 29.5 | 68 | 0.661017 |
d5c4fef3d02cf698822e077ce62636085127e1d3 | 8,127 | # encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require 'azure_mgmt_storagecache'
module Azure::Profiles::Latest
module StorageCache
module Mgmt
Operations = Azure::StorageCache::Mg... | 46.706897 | 139 | 0.677003 |
61bbbbb9030cb39eefd87ea02e0aa79f766c37c0 | 118 | class ListensController < ApplicationController
def index
@listens = Listen.recent.page params[:page]
end
end
| 19.666667 | 47 | 0.762712 |
1c8fcdd185c8a3036dd6dee04e59a10d5306859b | 758 | require 'logger'
class DigestAuthServlet < WEBrick::HTTPServlet::AbstractServlet
htpd = nil
Tempfile.open 'digest.htpasswd' do |io|
htpd = WEBrick::HTTPAuth::Htdigest.new(io.path)
htpd.set_passwd('Blah', 'user', 'pass')
end
@@authenticator = WEBrick::HTTPAuth::DigestAuth.new({
:UserDB => htpd,
... | 22.294118 | 63 | 0.654354 |
08bb29ec9a2efb303a9f56f91568605a2221512f | 4,256 | # frozen_string_literal: true
class Fisk
module Instructions
# Instruction CMOVP: Move if parity (PF == 1)
CMOVP = Instruction.new("CMOVP", [
# cmovp: r16, r16
Form.new([
OPERAND_TYPES[7],
OPERAND_TYPES[8],
].freeze, [
Class.new(Fisk::Encoding) {
def encode b... | 28.373333 | 55 | 0.469925 |
ed0ba2d82580fa5c9ecb5b77d5c2ca02a5231c71 | 1,457 | # encoding: ascii-8bit
# frozen_string_literal: true
require 'heapinfo/cache'
describe HeapInfo::Cache do
before(:all) do
@prefix = 'testcx1dd/'
end
after(:each) do
FileUtils.rm_rf File.join(HeapInfo::Cache::CACHE_DIR, @prefix)
end
it 'handle unwritable' do
org = HeapInfo::Cache::CACHE_DIR
H... | 29.14 | 83 | 0.66232 |
39c6b6e3f983cd3d62aaa7935a2f617bbde9ef72 | 2,647 | module SuperDiff
module RSpec
module OperationalSequencers
class CollectionContainingExactly < SuperDiff::OperationalSequencers::Base
def self.applies_to?(expected, actual)
SuperDiff::RSpec.collection_containing_exactly?(expected) &&
actual.is_a?(::Array)
end
d... | 27.010204 | 80 | 0.589346 |
0864f4bb4be2349731f8d53a3bb6a1861e5a5d72 | 34,406 | #-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2015 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 ... | 34.578894 | 143 | 0.602046 |
03311883d12ecb42f970c2aa382e36b526ce0987 | 1,002 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'kaba/version'
Gem::Specification.new do |spec|
spec.name = 'kaba'
spec.version = Kaba::VERSION
spec.authors = ['Genki Sugawara']
spec.email = ['sugawara@cookp... | 33.4 | 74 | 0.647705 |
f8314a869352c239f45b9393e7e376f38bea9d9c | 368 | # frozen_string_literal: true
# A curator is allowed to create and edit common resources
class CuratorPolicy < ApplicationPolicy
def create?
user&.curator?
end
def destroy?
user.curator?
end
def edit?
user.curator?
end
def update?
user.curator?
end
# class Scope < Scope
# def ... | 13.62963 | 58 | 0.652174 |
e28c5a23cbc756bb6364c7b576e979a33396e5a9 | 142 | # frozen_string_literal: true
FactoryBot.define do
factory :user do
email { "#{Faker::Internet.unique.user_name}@mail.com" }
end
end
| 17.75 | 60 | 0.71831 |
e83165e5a0aad756978d166bf728f61a7cf46a98 | 155,195 | # 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/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::LexModelsV2
# @api private
module ClientApi
include Seaho... | 80.662682 | 197 | 0.774187 |
1c9d1cd0eb72ac36c6ed34eac62e4a3103af87eb | 2,364 | # 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... | 35.283582 | 116 | 0.725465 |
1d9fa06d32c297d0d5d35c5eb932bf05937c0a54 | 1,021 | module TestsHelper
def test_result_summary_rows(test_result)
rows = [
{
key: { text: "Date of test" },
value: { text: test_result.date.to_s(:govuk) }
},
{
key: { text: "Product tested" },
value: { html: link_to(test_result.product.name, product_path(test_result.pr... | 23.744186 | 93 | 0.563173 |
5daae207d44d397e91ae22695bc44d1eba1089c7 | 1,142 | class Pmd < Formula
desc "Source code analyzer for Java, JavaScript, and more"
homepage "https://pmd.github.io"
url "https://github.com/pmd/pmd/releases/download/pmd_releases/6.46.0/pmd-bin-6.46.0.zip"
sha256 "04981da7163141300ec44a4dcc51dca205e7a83c0c39545a09a5d4724602e80a"
license "BSD-4-Clause"
bottle d... | 27.190476 | 112 | 0.661996 |
382ac34e9e962f0e00aca428a760f1c2465a47df | 495 | # Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'
# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
# Initialize Twilio Client
@client = Twilio::REST::Client.new(account_sid, auth_token)
# Loop over ... | 30.9375 | 61 | 0.757576 |
1c93c04af628f41753948fc2025665ed1e66690f | 2,693 | =begin
namespace :slices do
namespace :sunflower_comments do
desc "Run slice specs within the host application context"
task :spec => [ "spec:explain", "spec:default" ]
namespace :spec do
slice_root = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
tas... | 39.602941 | 122 | 0.589306 |
6a8e49d7143b2f6796e6551cac363487369712ef | 3,001 | describe "ProMotion::TestMapScreen functionality" do
tests PM::TestMapScreen
# Override controller to properly instantiate
def controller
rotate_device to: :portrait, button: :bottom
@map ||= TestMapScreen.new(nav_bar: true)
@map.will_appear
@map.navigation_controller
end
after do
@map =... | 28.311321 | 97 | 0.694768 |
08e1159b1b5683525dcbb701796366b424200959 | 689 | Pod::Spec.new do |s|
s.name = "RemoteImageServiceForMDCDemos"
s.version = "100.1.0"
s.summary = "A helper image class for the MDC demos."
s.description = "This spec is made for use in the MDC demos. It gets images via url."
s.homepage = "https://github.com/material-components/material-c... | 53 | 124 | 0.661829 |
f8b463959413d3231724f77eb730d2a289c02e04 | 697 | # frozen_string_literal: true
class AddForeignKeyToCiPipelinesMergeRequests < ActiveRecord::Migration[4.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :ci_pipelines, :merge_request_id, where: 'merge_request_id IS NOT NULL'
add_conc... | 30.304348 | 109 | 0.789096 |
62a72db579aca24173c40cd61e85d936ba1f67c4 | 74 | json.extract! @attempt, :id, :user_id, :quiz_id, :created_at, :updated_at
| 37 | 73 | 0.72973 |
039662ae40b1868d96a534c83dfc50260ab5ee39 | 648 | require 'test_helper'
require 'fixtures/sample_mail'
class ComplianceTest < ActiveSupport::TestCase
include ActiveModel::Lint::Tests
def setup
@model = SampleMail.new
end
test 'model_name exposes singular and human name' do
assert_equal 'sample_mail', @model.class.model_name.singular
assert_equal... | 24 | 66 | 0.714506 |
6a58c5244ebe1260bf9ed0cc2bbff5e272930cdb | 408 | class UserSessionsController < ApplicationController
def new
@user = User.new
end
def create
@user_session = UserSession.new params.require(:user)
.permit(:login, :password)
if @user_session.save
redirect_to root_path
else
redirect_to new_user_session_path
end
end
def d... | 19.428571 | 57 | 0.720588 |
01e07d8b2cb0208954ef6804f6fd4fcb7ce4e14e | 469 | module ThreeScaleToolbox
module Commands
module PlansCommand
module Export
class ReadPlanLimitsStep
include Step
##
# Reads Application Plan limits
# add metric system_name out of metric_id
def call
result[:limits] = plan.limits.map do |l... | 23.45 | 72 | 0.560768 |
79181114adf5fdea5e04740e929c3f6cd304d47a | 2,799 | #! /usr/bin/ruby
require 'rubygems'
require 'treetop'
require 'liquid'
require 'optparse'
require_relative 'objc'
require_relative 'scribe'
require_relative 'AST/scribe'
parameters = { :source => [], :destination => Dir.pwd }
OptionParser.new do |opts|
opts.banner = "Usage: objctemplar [options]"
opts.on('-s [AR... | 37.32 | 163 | 0.624151 |
5ded765759a0e859d44f4ddf1e3253ccd04aa884 | 2,182 | require 'run_cl'
include RunCl::ActAsRun
module ApplicationHelper
def set_active(opt)
if controller_name == opt
return 'active'
end
end
def get_role_name(opt)
if opt == 'admin'
return 'Administrador'
elsif opt == 'provider'
return 'Proveedor'
elsif opt == 'owner'
retu... | 24.516854 | 132 | 0.636572 |
915ba6525a4933889069dc2b811a834f2c7a8010 | 4,121 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 40.009709 | 105 | 0.760495 |
e2b09a880f47a024953a36e22621c72078dba4b9 | 3,525 | class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::ConfigurationScriptSource < ManageIQ::Providers::EmbeddedAutomationManager::ConfigurationScriptSource
FRIENDLY_NAME = "Ansible Automation Inside Project".freeze
REPO_DIR = Rails.root.join("tmp", "git_repos")
validates :name, :presence => t... | 28.658537 | 164 | 0.671206 |
1c59f45a614f1a6bdf823f48570e818b6e6933c2 | 1,523 | class AddStudentForm < Form
set_attributes_for :child, :first_name, :last_name, :dob_day, :dob_month, :dob_year, :school_type
validates_presence_of :first_name, message: proc { I18n.t('validations.first_name') }
validates_presence_of :last_name, message: proc { I18n.t('validations.last_name') }
validates :schoo... | 35.418605 | 121 | 0.709783 |
7a0d8c004a3b024b4db3bb10b695d0de32353e9b | 723 | class OpenStudio::Model::ThermalStorageChilledWaterStratified
def maxWaterFlowRate
if useSideDesignFlowRate.is_initialized
useSideDesignFlowRate
else
autosizedUseSideDesignFlowRate
end
end
def maxWaterFlowRateAutosized
if useSideDesignFlowRate.is_initialized
# Not autosized if h... | 27.807692 | 92 | 0.759336 |
b9aba29e314c0d8ec057f5753b8b7ba43c1c7d7d | 10,942 | module Csvlint
module Csvw
class Table
include Csvlint::ErrorCollector
attr_reader :columns, :dialect, :table_direction, :foreign_keys, :foreign_key_references, :id, :notes, :primary_key, :row_title_columns, :schema, :suppress_output, :transformations, :url, :annotations
def initialize(url, c... | 44.299595 | 243 | 0.595961 |
1c37317f37a5ddbbc898df71efd0089f44cc9d36 | 1,304 | require_relative "./fastlane_test_runner_helpers/fastlane_ci_output"
require_relative "./fastlane_test_runner_helpers/fastlane_output_to_html"
module FastlaneCI
# Represents the test runner responsible for loading and running
# fastlane Fastfile configurations
class FastlaneTestRunner < TestRunner
def run(pl... | 31.047619 | 84 | 0.680215 |
617621d8610b2627dbf191785507b0647855bd5a | 1,129 | # 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.
#
# This file is the source Rails uses to define your schema when running `bin/rai... | 41.814815 | 86 | 0.76705 |
ed34794a91ccc59f9a968b0503819f221b042a55 | 44,401 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ApiManagement::Mgmt::V2018_01_01
#
# ApiManagement Client
#
class AuthorizationServer
include MsRestAzure
#
# Creates and initializes a new... | 53.302521 | 233 | 0.693025 |
f751643925f0915247a2e333f53b3aeb2446d907 | 570 | class CharCounter
# La interfaz que se pide del diccionario no me parece adecuada
# Se supone que es un diccionario que me dice cuántas veces apareció un char, con lo cual, si pregunto por un
# char que no estaba, debería devolver 0, que es exactamente la cantidad de veces que apareció, no nil!
# Porque nil ni... | 33.529412 | 111 | 0.663158 |
393122a1d04ac977f291c4a35741aa23de04bac8 | 55 | Spree.user_class.class_eval do
has_many :invoice
end
| 13.75 | 30 | 0.818182 |
3397fe086b7571b9dbb742785cd3d12e20e3ca92 | 29 | require 'rblineprof/fluentd'
| 14.5 | 28 | 0.827586 |
282a1db4ff59bc02d7e066ff3f800508319142e9 | 1,186 | #
# 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
#
# ... | 27.581395 | 74 | 0.693929 |
f7230fe7c55e9c2b64b1c1c4775f9dd1ab1a58b3 | 477 | class CreateSendgridEvents < ActiveRecord::Migration
def change
create_table :sendgrid_events do |t|
t.integer :notification_id, null: false, foreign_key: false
t.integer :notification_user, null: false
t.text :notification_type, null: false
t.text :template_name, null: false
t.text... | 28.058824 | 65 | 0.679245 |
26c4c474c6b8152c437fc63786e6b66b976779b3 | 376 | class CreatePayments < ActiveRecord::Migration
def self.up
create_table :payments do |t|
t.column :order_id, :integer
t.column :amount, :float
t.column :method, :integer
t.column :created_by_id, :integer
t.column :created_at, :datetime
t.column :updated_at, :datetime
end
... | 22.117647 | 46 | 0.664894 |
1a8ff7b1c8b87fd0a16104e9546239cd789b1641 | 282 | require 'owmo'
api_key = ""
weather = OWMO::Weather.new api_key
# Kelvin
puts weather.get :current, city_name: "London,UK"
# Imperial
puts weather.get :current, city_name: "London,UK", units: :imperial
# Metric
puts weather.get :current, city_name: "London,UK", units: :metric
| 18.8 | 67 | 0.723404 |
1852d7ff1e083ac9a192ff7d6e27c94f8dea844f | 2,426 | # frozen_string_literal: true
require "spec_helper"
describe EveOnline::ESI::Models::Constellation do
it { should be_a(EveOnline::ESI::Models::Base) }
let(:options) { double }
subject { described_class.new(options) }
describe "#initialize" do
its(:options) { should eq(options) }
end
describe "#as_... | 26.659341 | 124 | 0.654163 |
793c4cf4b2e3c70ab723a2e80607645fa2e5783b | 1,672 | module Seek
module Creators
extend ActiveSupport::Concern
included do
has_many :assets_creators, dependent: :destroy, as: :asset, foreign_key: :asset_id
accepts_nested_attributes_for :assets_creators, allow_destroy: true
has_many :creators, class_name: 'Person', through: :assets_creators,
... | 33.44 | 107 | 0.662081 |
e943abc85df9ce531638cb8da655263279833c16 | 390 | cask "upm" do
version "1.15.1"
sha256 "eea01028ff6bf4bbcd857dcf9191905a59a6e7c9ea3914c35ca0275417724cef"
url "https://downloads.sourceforge.net/upm/upm-#{version}/upm-mac-#{version}.tar.gz",
verified: "downloads.sourceforge.net/upm/"
name "Universal Password Manager"
desc "Password manager"
homepage ... | 30 | 87 | 0.735897 |
bfd24b07cf45e5877f90b7543556a23cd665eb15 | 122 | class AddPaytmToPayments < ActiveRecord::Migration[5.1]
def change
add_column :payments, :paytm, :decimal
end
end
| 20.333333 | 55 | 0.745902 |
08d55375ac18abd4622edaed423dcf2f0577fd3c | 1,105 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'weasel/version'
Gem::Specification.new do |spec|
spec.name = 'weasel'
spec.version = Weasel::VERSION
spec.authors = ['Agustin Cavilliotti']
spec.email = ['cav... | 35.645161 | 104 | 0.647059 |
4a4d69490a32aa1e81045cbb58656868000484b4 | 3,417 | require "spec_helper"
describe Gitlab::Git::Tree, :seed_helper do
let(:repository) { Gitlab::Git::Repository.new('default', TEST_REPO_PATH, '', 'group/project') }
context :repo do
let(:tree) { Gitlab::Git::Tree.where(repository, SeedRepo::Commit::ID) }
it { expect(tree).to be_kind_of Array }
it { exp... | 38.829545 | 107 | 0.634475 |
e27344c56bd588d6a397e04d5fe5a1db6c06b511 | 1,196 | require 'base/base'
class BaseTests
module Options
LOGGER = Logger.new(STDOUT)
NATS_URI = "nats://localhost:4222"
IP_ROUTE = "127.0.0.1"
NODE_TIMEOUT = 5
PLAN = "free"
CAPACITY = 200
def self.default(more=nil)
options = {
:logger => LOGGER,
:plan => PLAN,
... | 19.606557 | 48 | 0.605351 |
abc506c7af183244835fc74648617077e1195375 | 982 | # 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
module Aws::LambdaPreview
# This class provides a resource oriented interface for LambdaPreview.
# To create... | 31.677419 | 107 | 0.697556 |
4a2ca452ff2028755570456645ade97ab6491b3b | 2,434 | ##
# $Id: ccproxy_telnet_ping.rb 9179 2010-04-30 08:40:19Z jduck $
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com... | 27.977011 | 91 | 0.580937 |
08ea814d89b3dbe7211d179db7cb4c8c88a70057 | 908 | require_relative '../../spec_helper'
require_relative 'fixtures/classes'
require_relative 'shared/push'
describe "Array#<<" do
it "pushes the object onto the end of the array" do
([ 1, 2 ] << "c" << "d" << [ 3, 4 ]).should == [1, 2, "c", "d", [3, 4]]
end
it "returns self to allow chaining" do
a = []
... | 21.116279 | 82 | 0.582599 |
d58df4e3123246af329bc34f0fae394dcae29b7b | 2,463 | module Jaspion
module Kilza
# Represents a single Class property
class Property
# Normalized property name
# Starts with _ or alphanumeric character
# and doesn't contain any special character
attr_accessor :name
# Original JSON property name
attr_accessor :original_name
... | 24.147059 | 72 | 0.574097 |
ac0a105d0fe1ef4aa5159dc6398663f21c18342c | 484 | class AccountActivationsController < ApplicationController
def edit
user = User.find_by(email: params[:email])
if user && !user.activated? && user.authenticated?(:activation, params[:id])
user.activate
# user.update_attribute(:activated, true)
# user.update_attribute(:activated_at, Time.zone.now)
log_... | 25.473684 | 78 | 0.727273 |
61cbcaff27991f3922777c3794d5eea8675ce65c | 8,590 | # frozen_string_literal: true
require "active_support/xml_mini"
require "active_support/time"
require "active_support/core_ext/object/blank"
require "active_support/core_ext/object/to_param"
require "active_support/core_ext/object/to_query"
require "active_support/core_ext/array/wrap"
require "active_support/core_ext/... | 32.537879 | 116 | 0.584517 |
28286e5d9b1565a436e312d83e64adc069b0e783 | 2,057 | require "test_helper"
class ApiKeyTest < ActiveSupport::TestCase
should belong_to :user
should validate_presence_of(:name)
should validate_presence_of(:user)
should validate_presence_of(:hashed_key)
should "be valid with factory" do
assert build(:api_key).valid?
end
should "be invalid when name is ... | 27.797297 | 84 | 0.700535 |
084b103ee3bc3a85aaa6e7d70c7bcedbae90b258 | 4,016 | # frozen_string_literal: true
module Admin
class PropagateIntegrationService
BATCH_SIZE = 100
delegate :data_fields_present?, to: :integration
def self.propagate(integration:, overwrite:)
new(integration, overwrite).propagate
end
def initialize(integration, overwrite)
@integration ... | 28.083916 | 114 | 0.698954 |
1c81a5b71bcbba59ab7dea9bc66d17fc44eac360 | 3,466 | require 'set'
module ActiveRecord
module AttributeMethods
module PrimaryKey
extend ActiveSupport::Concern
# Returns this record's primary key value wrapped in an Array if one is
# available.
def to_key
sync_with_transaction_state
key = self.id
[key] if key
e... | 27.728 | 80 | 0.596365 |
331bddecbf7f482913e1d143387c90eefd86011e | 1,006 | require "rdcl/apps/crouton/framework/plugin_base.rb"
require "rdcl/apps/crouton/framework/sidebar_icon.rb"
module RDCL
class InfoPlugin < PluginBase
attr_accessor :icon
attr_accessor :text
attr_accessor :app
def initialize(parent, workarea, id, app)
super(parent, workarea, app)
@... | 26.473684 | 142 | 0.668986 |
6160dafb177e5d740bb52d417ffaaf865600a1e0 | 1,662 | # frozen_string_literal: true
class Projects::CycleAnalyticsController < Projects::ApplicationController
include ActionView::Helpers::DateHelper
include ActionView::Helpers::TextHelper
include CycleAnalyticsParams
include GracefulTimeoutHandling
include RedisTracking
extend ::Gitlab::Utils::Override
bef... | 28.655172 | 135 | 0.770758 |
394b2b9772a9abbd55d3309c3d30cad806df6f4e | 1,524 | # encoding: utf-8
require File.expand_path('../lib/rails_admin/version', __FILE__)
Gem::Specification.new do |spec|
# If you add a dependency, please maintain alphabetical order
spec.add_dependency 'nested_form', '~> 0.2'
spec.add_dependency 'sass-rails', '~> 3.1'
spec.add_dependency 'bootstrap-sass', '~> 2.1'... | 47.625 | 122 | 0.675197 |
1c8096bdface76efbed29aa43b2c83241a41b2ad | 100,871 | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 64.86881 | 361 | 0.682912 |
1c55f187fa9a3375ac9d2e0ed156cc66a58aa684 | 44 | module ZipGenerator
VERSION = "0.0.1"
end
| 11 | 19 | 0.704545 |
6a07b9470d9b7df6993806fd18eaed3b71e60bc2 | 139 | class AddSingletonToIntroduction < ActiveRecord::Migration[5.1]
def change
add_column :introductions, :singleton, :decimal
end
end
| 23.166667 | 63 | 0.776978 |
e9d3575c365568545e8362b4de64859f3b943853 | 972 | # 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.
#
# This file is the source Rails uses to define your schema when running `rails
#... | 42.26087 | 86 | 0.765432 |
623e600ddd465cc8792a58b3f12fe608bf1922b2 | 1,389 | #
# Copyright:: 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/LICENSE-2.0
#
# Unless requir... | 30.195652 | 95 | 0.720662 |
e9afd35c91b822de01f5703f95c366b266498e0a | 1,695 | cask "corsair-icue" do
version "3.35.152"
sha256 "1df9913bd1391766840d71ae399dc59e681c02d58fe5021a0b09bb0a305b5171"
url "https://downloads.corsair.com/Files/CUE/iCUE-#{version}-release.dmg"
appcast "https://www.corsair.com/us/en/downloads/search?searchCategory=Cor_Products_iCue_Compatibility"
name "Corsair i... | 35.3125 | 105 | 0.612389 |
61ffdf9f0157fd07e73cbb6eb45f747dd02edb50 | 241 | class SubmissionsAddSubmissionVersionUsed < ActiveRecord::Migration[4.2]
def self.up
add_column :submissions, :submission_version_used, :boolean
end
def self.down
remove_column :submissions, :submission_version_used
end
end
| 24.1 | 72 | 0.788382 |
d580a5ff87a6ab34bc25c6b3fe2da181f8a182dd | 1,046 | require 'helper'
class TestZoneFactory < Test::Unit::TestCase
context "ZoneFactory" do
setup do
@dynect = Dynectastic.session(DYNECT_CUST_NAME, DYNECT_USER_NAME, DYNECT_USER_PASS)
@factory = @dynect.zones
@zone = @factory.build(
:name => "dynectastictests.com",
:conta... | 25.512195 | 99 | 0.617591 |
b949a80b0b4e028f741cef6c11aecbf92b8187df | 678 | Pod::Spec.new do |spec|
spec.name = 'GradientView'
spec.version = '2.3.4'
spec.authors = {'Sam Soffes' => 'sam@soff.es'}
spec.homepage = 'https://github.com/soffes/GradientView'
spec.summary = 'Easily use gradients in UIKit.'
spec.description = 'Gradient View is a simple UIView wrapper around CGGradient.'
... | 37.666667 | 98 | 0.668142 |
38f0cfbb317d44cb6500e599a2f9e4eca7de0d11 | 1,183 | module Noir::Base
class Command
class << self # class methods
def description
if @description.nil?
raise "Undefined description : " + self.to_s
else
puts self.to_s.split(':').last.downcase.ljust(15) + " : " + @description
end
end
def execute *args... | 25.717391 | 91 | 0.587489 |
bffcddef1706cbd916894a9594da9ef718bf9d7e | 5,460 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 44.390244 | 114 | 0.759524 |
4a31c812f619f3f1625d1cdc836859c72b788f68 | 116 | require 'rails_helper'
module OurnaropaPlanner
RSpec.describe CoursesController, type: :controller do
end
end
| 14.5 | 56 | 0.801724 |
5d43017958d7045176bfd8a3d1e05b8619837bf9 | 523 | cask 'fredm-fuse' do
version '1.3.7'
sha256 'c86c2820ca65af064bb9971cfb7cdff81f2f974c3492ea10d7cc7d0c82493a08'
url "https://downloads.sourceforge.net/fuse-for-macosx/fuse-for-macosx/#{version}/FuseForMacOS-#{version}.zip"
appcast 'https://sourceforge.net/projects/fuse-for-macosx/rss?path=/fuse-for-macosx',
... | 40.230769 | 112 | 0.770554 |
0837dd7ffcf9c8591773bfb2d02da1c3af4cb937 | 1,725 | class NewrelicCli < Formula
desc "Command-line interface for New Relic"
homepage "https://github.com/newrelic/newrelic-cli"
url "https://github.com/newrelic/newrelic-cli/archive/v0.36.8.tar.gz"
sha256 "a8fb1a60e39fc46e8bd97465b2d5287a462dd9506b5b15bd8011055525252638"
license "Apache-2.0"
head "https://githu... | 41.071429 | 122 | 0.751304 |
62a0763f6859db5258dfe62fd8829d3d0f574d91 | 913 | require "language/node"
class AngularCli < Formula
desc "CLI tool for Angular"
homepage "https://cli.angular.io/"
url "https://registry.npmjs.org/@angular/cli/-/cli-6.1.2.tgz"
sha256 "72be54e8777b1d9328164fa8274c979bff8e2c37b25e8b53c6d1c419f3a52e37"
bottle do
sha256 "55ddb4c10b8aaba9781cc6993cfaabca8c6a... | 33.814815 | 102 | 0.762322 |
1d7f1fbdc88ffa042d4b8b9f35a3c8a2ab92bf86 | 176 | class CreateUsers < ActiveRecord::Migration[5.0]
def change
create_table :users do |t|
t.string :name
t.string :surname
t.timestamps
end
end
end
| 16 | 48 | 0.642045 |
334e9c0de60c7620fb1e5a87a22118a74d7c834a | 525 | Rails.application.routes.draw do
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
root to: "users#welcome"
resources :notes
resources :courses do
resources :notes, only: [:index, :new, :create]
end
get "/login", to: "sessions#new"
post "/login", t... | 21 | 102 | 0.674286 |
7a9fc304c16e1df5e0970bf9dcb867e6491fb9ea | 3,753 | module ActiveRecord
module ConnectionAdapters
class JdbcConnection
module ConfigHelper
attr_reader :config
def config=(config)
@config = config.symbolize_keys!
end
def configure_connection
config[:retry_count] ||= 5
config[:connection_alive_sql... | 29.551181 | 98 | 0.576072 |
bbca083abf65ef93cb51f3e55a86efef3091553c | 802 | # frozen_string_literal: true
require 'spec_helper'
if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
describe 'Stdlib::IP::Address::V6::Nosubnet::Compressed' do
describe 'accepts ipv6 addresses in compressed format without subnets' do
[
'1080::8:800:200C:417A',
'FF01::101'... | 23.588235 | 77 | 0.563591 |
aca6d9d95d5045479064d274b1be6a791ba4c174 | 20,813 | =begin
#DocuSign REST API
#The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
OpenAPI spec version: v2
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
=end
require 'date'
module DocuSign_eSign
... | 36.707231 | 580 | 0.646567 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.