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 |
|---|---|---|---|---|---|
380922dd54295318f140aa4f3b0d5b0e743a63fd | 12,181 | require 'active_support/duration'
module ActiveSupport #:nodoc:
module CoreExtensions #:nodoc:
module Time #:nodoc:
# Enables the use of time calculations within Time itself
module Calculations
def self.included(base) #:nodoc:
base.extend ClassMethods
base.class_eval do
... | 39.937705 | 141 | 0.599704 |
acf212ccef860f9928bd4dcdb4895a2c701b7e84 | 1,884 | =begin
#SendinBlue API
#SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/or... | 43.813953 | 803 | 0.715499 |
ff1b6ace133c0bfc795e8beaa15b2c310deda4e3 | 266 | task :help do
puts ''
puts 'Tasks:'
put_separator
verbose(false) do
sh 'rake -T'
end
puts ''
puts 'Options:'
put_separator
print_available_options
# verbose(false) do
# end
end
# task :help do
# run_sh_cmd_quiet("rake -T", 'no')
# end
| 12.666667 | 37 | 0.62782 |
26e6bd767f02910e1d526ecfabee635066550931 | 462 | ############################################
# Setup Server
############################################
set :stage, :production
set :stage_url, 'http://www.domain.com'
set :theme, 'v1'
server 'domain.com', user: 'user', roles: %w{web app db}
set :deploy_to, '/home/user/domains/domain.com/public_html'
set :tmp_dir, '/... | 25.666667 | 59 | 0.422078 |
e802d6251e6f8a324b0c0406c0d0de9266b316ae | 40 | module Bettertabs
VERSION = "1.4"
end
| 10 | 17 | 0.7 |
1d32dbc716676c425c1a4972d97cefccdd0f7b40 | 1,935 | class OpenAdventure < Formula
include Language::Python::Virtualenv
desc "Colossal Cave Adventure, the 1995 430-point version"
homepage "http://www.catb.org/~esr/open-adventure/"
url "http://www.catb.org/~esr/open-adventure/advent-1.9.tar.gz"
sha256 "36466882af195d402b62deaa08e4cef26d1646cf1329f14503ea06fdc5c7... | 36.509434 | 136 | 0.747287 |
7a599b20dd97a09f6537beb3aee27cd7187d5101 | 138 | # Sample code from Programing Ruby, page 628
t = Time.now
t.utc?
t = Time.gm(2000,"jan",1,20,15,1)
t.utc?
| 23 | 44 | 0.514493 |
e222f5fa7af85898914662d3a19d517c98937c63 | 1,085 | require 'net/http'
require 'uri'
require 'json'
uri = URI('http://challenge.code2040.org/api/prefix') # Parse challenge URI
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json') # Create request
request.body = {token: '641d2efd555c4fd6426096e66b040e8d'}.to_json # JSON on body with token
response =... | 37.413793 | 137 | 0.734562 |
e2f26442c6b5d76eacb9599a81064b05318a0881 | 574 | class StylesheetsController < ApplicationController
#caches_action :show, :for => 24.hours
respond_to :css
def show
@wallpaper = YAML.load_file(File.join([Rails.root, "config/wallpaper.yml"]))
stylesheet_filename = File.join([Rails.root, 'app', 'stylesheets', "#{params[:name]}.less"])
if File.exists?(s... | 28.7 | 94 | 0.695122 |
ed3f441bbbdbb89b4c44b0140b457eb25462415c | 4,700 | class RubyAT24 < Formula
desc "Powerful, clean, object-oriented scripting language"
homepage "https://www.ruby-lang.org/"
url "https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.9.tar.xz"
sha256 "0c4e000253ef7187feeb940a01a1c7594f28d63aa16f978e892a0e2864f58614"
bottle do
sha256 "f0fb7c1d2d72dbcb46f3963a3f... | 29.375 | 93 | 0.616383 |
ab45dc1d5da0c648e7a45a5606c3ec14e72c6d34 | 2,463 | # Copyright (c) 2005 David Heinemeier Hansson
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, pub... | 36.220588 | 128 | 0.735282 |
e8e7b68261ed18ac4ecf69016e976e5950fe26ce | 422 | cask 'font-shadows-into-light-two' do
version :latest
sha256 :no_check
# github.com/google/fonts was verified as official when first introduced to the cask
url 'https://github.com/google/fonts/raw/master/ofl/shadowsintolighttwo/ShadowsIntoLightTwo-Regular.ttf'
name 'Shadows Into Light Two'
homepage 'https:... | 35.166667 | 106 | 0.779621 |
bbeaa5f6dec95ac53c39fb606e7954e3df98f80a | 4,445 | # Copyright 2011-2012 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 37.352941 | 108 | 0.7991 |
1c04800cc13350d7228596295cbdc6d02ec4bb05 | 63 | load File.expand_path("../tasks/rbenv_install.rake", __FILE__)
| 31.5 | 62 | 0.777778 |
0357b8c9f9700f7e8f60b782290434001f530877 | 1,137 | # frozen_string_literal: true
module GitStats
module GitData
class CommentStat
attr_reader :commit, :insertions, :deletions
def initialize(commit)
@commit = commit
calculate_stat
end
def changed_lines
insertions + deletions
end
def escape_characters_... | 27.731707 | 106 | 0.55321 |
e22743fb004c084c4f8e689eaa8e9d0468b1a146 | 47 | module Cauterize
VERSION = "0.0.1.pre14"
end
| 11.75 | 25 | 0.702128 |
0831051a235837a27cbb693e656ee98da4be9158 | 485 | require 'chefspec'
describe 'passenger::daemon' do
let(:chef_run) {
ChefSpec::SoloRunner.new(platform: 'ubuntu', version: '16.04') do |node|
node.normal['cloud']['local_ipv4'] = '1.2.3.4'
node.normal['identity_ruby']['rbenv_root'] = '/opt/ruby_build'
stub_command("test -e /opt/nginx/sbin/nginx... | 30.3125 | 76 | 0.676289 |
d5ecb8257bad561129c9911c04a10ac46df55be4 | 988 | class NotesController < ApplicationController
before_action :set_note, only: %i[show update destroy]
# GET /notes
def index
@notes = Note.all
render json: @notes
end
# GET /notes/1
def show
render json: @note
end
# POST /notes
def create
@note = Note.new(note_params)
if @note.... | 18.641509 | 71 | 0.662955 |
ed6d173f4019322a8525ff2030f7ae869b020b9a | 4,426 | #!/usr/bin/env ruby
# encoding: utf-8
BEGIN {
require 'pathname'
basedir = Pathname.new( __FILE__ ).dirname.parent.parent
libdir = basedir + 'lib'
$LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
$LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
}
require 'rspec'
require 'b... | 27.6625 | 97 | 0.630366 |
794a108887bda6074468917c0243be146a880a90 | 474 | require 'spec_helper'
module Alf
module Algebra
describe Minus, 'keys' do
let(:left){
an_operand.with_heading(:id => Integer, :name => String).with_keys([ :id ])
}
let(:right){
an_operand.with_heading(:id => Integer, :name => String)
}
let(:op){
a_lispy.minu... | 17.555556 | 83 | 0.527426 |
ab3112d3824c76eeaaa5e2fd5233ef43ebd934f6 | 6,277 | # frozen_string_literal: true
require "dependabot/hex/version"
require "dependabot/hex/update_checker"
require "dependabot/hex/native_helpers"
require "dependabot/hex/file_updater/mixfile_sanitizer"
require "dependabot/shared_helpers"
require "dependabot/errors"
module Dependabot
module Hex
class UpdateChecker
... | 34.11413 | 96 | 0.625777 |
9127bc7f0e9655725dcf69726033d1e22f7225b7 | 2,439 | require 'source/why/example_page'
module Views
module Why
class Index < Views::Why::ExamplePage
def example_body
standard_text_row {
bang_intro
examples_setup
link_to_next_example
}
end
def bang_intro
p %{There is exactly one overwhelming ... | 28.034483 | 91 | 0.600246 |
4aa50dbf5480acf0e054c744979a0fe623e499bc | 508 | module RecruiterLint
module Rules
class Spam < Rule
name "Newsletter"
desc "Don't spam candidates with canned emails"
def run(spec, result)
canned_words = [
'unsubscribe',
]
canned_mentions = spec.contains?(canned_words)
if canned_mentions.any?
... | 24.190476 | 88 | 0.641732 |
385c43a599210d19c6fd4654342c8f1d756081a7 | 572 | require 'rails/generators/base'
module SecureAttachment
module Generators
class InstallGenerator < Rails::Generators::Base
desc 'Creates a SecureAttachment cipher keys configuration yml file at config/secure_attachment.yml'
def self.source_root
File.expand_path('../templates', __FILE__)
... | 30.105263 | 106 | 0.716783 |
d566bb63c3d615d569e6ff63e9d2d3ac84615436 | 4,207 | module Pione
module Model
class TaskWorkerBrokerModel < Rootage::Model
attr_accessor :task_workers
attr_accessor :tuple_space
attr_reader :tuple_space_lock # lock for tuple space table
def initialize
super
@spawnings = 0 # number of current spawning t... | 30.933824 | 105 | 0.612313 |
1c8e01b9200bd64e54fc8f56b6b1011076c89391 | 1,132 | require "spec_helper"
RSpec.describe SpreeShopifyImporter::DataParsers::StockLocations::BaseData, type: :service do
subject { described_class.new(shopify_location) }
before do
expect(Spree::Country).to receive(:find_by).with(iso: "CA", name: "Canada").and_return(country)
expect(Spree::State).to receive(:f... | 32.342857 | 104 | 0.681095 |
bfb67b3f946f123a2e237d4e6e9d36ab1aa05422 | 330 | test_cask 'invalid-gpg-type' do
version '1.2.3'
sha256 '9203c30951f9aab41ac294bbeb1dcef7bed401ff0b353dcb34d68af32ea51853'
url TestHelper.local_binary_url('caffeine.zip')
homepage 'http://example.com/invalid-gpg-type'
gpg 'http://example.com/gpg-signature.asc',
no_such_parameter: :value
app 'Caffeine... | 27.5 | 75 | 0.763636 |
33873d6421be4c826704fa2335ad2b51092993d7 | 690 | Pod::Spec.new do |s|
s.name = "HMSegmentedControl"
s.version = "1.5.1"
s.summary = "A drop-in replacement for UISegmentedControl mimicking the style of the one in Google Currents and various other Google products."
s.homepage = "https://github.com/HeshamMegid/HMSegmentedControl"
s.licens... | 49.285714 | 150 | 0.63913 |
87fef61154d6697c19457a02215ad14d02a3a444 | 12,960 | # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... | 43.344482 | 245 | 0.690586 |
f8978fc24fbc613746b1b6acf5183e57f1f68901 | 228 | class UserGroupAssignment < ApplicationRecord
acts_as_paranoid
belongs_to :user
belongs_to :user_group
validates :user, uniqueness: {scope: %i[user_group deleted_at]}
validates :user, :user_group, presence: true
end
| 22.8 | 65 | 0.780702 |
d596494a98759aef5ef0d485d7278348d3bbb08d | 95,297 | # frozen_string_literal: true
require 'spec_helper'
module Gitlab
module Ci
RSpec.describe YamlProcessor do
include StubRequests
subject { described_class.new(config, user: nil).execute }
shared_examples 'returns errors' do |error_message|
it 'adds a message when an error is encounte... | 35.308262 | 158 | 0.506637 |
21470149bb5ccb25f009b3c8e6018a93e2633236 | 5,177 | class Poretools < Formula
desc "Tools for working with nanopore sequencing data"
homepage "http://poretools.readthedocs.org/"
url "https://github.com/arq5x/poretools/archive/v0.5.1.tar.gz"
sha256 "7cd55a8f30290992dcf8d7792401e7f21efadfde02b3f4604d6680d2f8300479"
head "https://github.com/arq5x/poretools.git"
... | 36.978571 | 135 | 0.74464 |
0315ca47362fc68601a0335762a486f6fbe5ad4e | 2,237 | # frozen_string_literal: true
lib = File.expand_path("lib", __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "sidekiq_unique_jobs/version"
Gem::Specification.new do |spec|
spec.name = "sidekiq-unique-jobs"
spec.version = SidekiqUniqueJobs::VERSION
spec.authors = ["Mikael ... | 35.507937 | 116 | 0.689763 |
879093a909edf4ba2267283bf2f0b9627dcbe7e9 | 195 | module RbBCC
autoload :Plugin, 'rbbcc/plugin'
end
require "rbbcc/fiddle_ext"
require "rbbcc/bcc"
require "rbbcc/clib"
require "rbbcc/usdt"
require "rbbcc/symbol_cache"
require "rbbcc/version"
| 17.727273 | 34 | 0.774359 |
187b81d4c1736333eabd3d1ee0a43af0a801cce6 | 155 | def new_game(name, year = nil, system = nil)
{
name: name,
year: year,
system: system
}
end
game = new_game("Street Figher II")
puts game
| 14.090909 | 44 | 0.619355 |
6174a2a3a4e98c799a7eb12c4a0411dce339c9d6 | 1,682 | # 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::Redis::Mgmt::V2017_02_01
module Models
#
# The resource model definition for a ARM proxy resource. It will have
# everything oth... | 26.28125 | 74 | 0.477408 |
b9107b78b6dc549860a2d4ccb21273cb2a4d76b3 | 2,629 | # frozen_string_literal: true
require "logger"
require "hanami/utils/shell_color"
module Hanami
class Logger < ::Logger
# Null colorizer for logger streams that aren't a TTY (eg. files)
#
# @since 1.2.0
# @api private
class NullColorizer
# @since 1.2.0
# @api private
def call(a... | 24.801887 | 85 | 0.554583 |
ff5c2a331549dd61fb7b43655dfa1e91e01055e0 | 1,597 | # frozen_string_literal: true
require File.expand_path('lib/licensee/version', __dir__)
Gem::Specification.new do |gem|
gem.name = 'licensee'
gem.version = Licensee::VERSION
gem.summary = 'A Ruby Gem to detect open source project licenses'
gem.description = <<-DESC
Licensee automates the process of re... | 33.978723 | 67 | 0.676268 |
21277bf681d178d27d7f1b0faaabc737d304a780 | 2,528 | module SixSaferpay
module SixTransaction
class Initialize
attr_accessor(
:request_header,
:config_set,
:terminal_id,
:payment,
:payment_means,
:payer,
:return_urls,
:styling,
:wallet,
:payment_methods,
:card_form
... | 32.831169 | 98 | 0.596123 |
212c5149d1a38eb7aa28948c54c6b3af71bd6440 | 72 | class Uglifier
# Current version of Uglifier.
VERSION = "4.1.6"
end
| 14.4 | 32 | 0.694444 |
1a3fd98c72d9d14d9e77db09f078bc1c93417557 | 2,311 | #--
# Copyright (c) 2014 Patricio Zavolinsky
#
# 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, publ... | 33.985294 | 79 | 0.697101 |
f7823fb1a1e4920d459d1898dd202a354b08d568 | 7,762 | =begin
#Xero Payroll UK
#This is the Xero Payroll API for orgs in the UK region.
Contact: api@xero.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.1
=end
require 'time'
require 'date'
module XeroRuby::PayrollUk
require 'bigdecimal'
class BankAccount
# Bank account name (max... | 30.801587 | 210 | 0.628575 |
0333e7fb7f6ace3be2a2e4c525f91739c7f64ccf | 170 | # frozen_string_literal: true
module ControllerHelper
require 'devise_token_auth'
def login(admin)
request.headers.merge! admin.create_new_auth_token
end
end
| 17 | 54 | 0.794118 |
b952906efcc8625d25356c3a2041063c87e3a988 | 488 | name 'varnish'
maintainer 'Rackspace'
maintainer_email 'rackspace-cookbooks@rackspace.com'
license 'Apache 2.0'
description 'Installs and configures varnish'
version '2.4.0'
recipe 'varnish', 'Installs and configures varnish'
recipe 'varnish::repo', 'Adds the official varnish project repository'
%w(ubuntu debian redh... | 24.4 | 70 | 0.75 |
6a2c40ea0156b4a8d93633f86244abf26adf9c7e | 1,733 | # frozen_string_literal: true
require 'spree/core'
require 'solidus_marketplace'
require 'solidus_marketplace/permitted_attributes'
module SolidusMarketplace
class Engine < Rails::Engine
include SolidusSupport::EngineExtensions
isolate_namespace ::Spree
engine_name 'solidus_marketplace'
# use rsp... | 32.092593 | 104 | 0.679746 |
876b8f49770ac94572424c0c1d736db6ffb708f5 | 5,445 | # Copyright (C) 2015-2019 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 30.418994 | 91 | 0.645363 |
3303081a765f2032c4867d70697d93a8761a0408 | 365 | class GroupMember < ApplicationRecord
belongs_to :group
belongs_to :user
validates :group, presence: true
validates :user, presence: true
validates :user_id, uniqueness: { scope: [:group_id],
message: "cannot be added to a group multiple times" }
# Accessors
# ------... | 24.333333 | 90 | 0.619178 |
f8ab724f9a329cb64e7cd180bf01ddab1c5dd71b | 10,967 | require "rails_helper"
describe StructuredDataHelper, type: "helper" do
include ERB::Util
include EventsHelper
include Webpacker::Helper
let(:image_path) { "media/images/getintoteachinglogo.svg" }
describe ".structured_data" do
subject(:script_tag) { Nokogiri::HTML.parse(html).at_css("script") }
l... | 28.120513 | 91 | 0.586943 |
ab3a4f12a2614a0fb9dc64afbe4c9b6d0d99900d | 1,073 | require 'rails_helper'
RSpec.describe 'Admin V1 System Requirements without authentication', type: :request do
context 'GET /system_requirements' do
let(:url) { '/admin/v1/system_requirements' }
let!(:system_requirements) { create_list(:system_requirement, 10) }
before(:each) { get url }
include_exam... | 34.612903 | 87 | 0.716682 |
b92e38be9220ce1c9061d8bc31457780236b8cf3 | 2,668 | # depends on: class.rb hash.rb argf.rb
##
# Stores global variables and global variable aliases.
class GlobalVariables
def initialize
load_path = %w[.]
loaded_features = []
@internal = LookupTable.new
@internal[:$;] = nil
@internal[:$/] = "\n" # Input record separator
@internal[... | 26.156863 | 74 | 0.562219 |
6139f2468062b23c7d277447c2a62b64e2c3252a | 484 | class BlocksController < ApplicationController
before_action :authenticate_user!, only: [:create, :destroy]
def create
user = User.find(params[:blocked_id])
current_user.block(user)
# Shouldn't make notifications but consider it
redirect_back(fallback_location: root_path)
end
... | 26.888889 | 64 | 0.688017 |
bb97d4f7caf01bdb6a7143fcce99d97a4ca1ca7f | 731 | cask "runjs" do
version "2.1.3"
sha256 "2b3760cc978c3e4dc0cc0128b9d2381270dbb1c86dd197ee357a726567e52d7a"
url "https://github.com/lukehaas/RunJS/releases/download/v#{version}/RunJS-#{version}-universal.dmg",
verified: "github.com/lukehaas/RunJS/"
name "RunJS"
desc "JavaScript playground that auto-evalu... | 26.107143 | 103 | 0.71409 |
ed40f2f1bddd6957112f781ed7c7063d0deb30bd | 1,562 | NovoFund::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 "scratch space" for the test ... | 42.216216 | 85 | 0.774648 |
5d984aaa01ca995d5ff67f55d35b03ebe88bc72f | 2,248 | # SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
#
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.
#
# Licensed to Elasticsearch B.V. under ... | 32.114286 | 112 | 0.662811 |
1c3d1891dd429e3b59629f111f87a9f94e28d807 | 1,687 | # frozen_string_literal: true
$LOAD_PATH.push File.expand_path('lib', __dir__)
require 'devise-security/version'
Gem::Specification.new do |s|
s.name = 'devise-security'
s.version = DeviseSecurity::VERSION.dup
s.platform = Gem::Platform::RUBY
s.licenses = ['MIT']
s.summary = 'Security e... | 37.488889 | 129 | 0.708358 |
6268ae48758d0a2e0cfbc2a2040c578cb0522e8c | 32,543 | require 'active_record/migration/join_table'
module ActiveRecord
module ConnectionAdapters # :nodoc:
module SchemaStatements
include ActiveRecord::Migration::JoinTable
# Returns a hash of mappings from the abstract data types to the native
# database types. See TableDefinition#column for detai... | 38.603796 | 170 | 0.612052 |
61b7845587216acaa8a9f0d47df9e1ac068bca46 | 6,409 | # feature tests for Images
# revision: $Revision$
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
require 'unittests/setup'
require 'ftools'
require 'webrick'
require 'watir/cookiemanager'
class TC_Images < Test::Unit::TestCase
tags :must_be_visible, :creates_windows
include Watir
... | 40.563291 | 116 | 0.678421 |
3358a0a6e7dfa24ba7a3df5531ab717400c6466c | 2,397 | =begin
#Calling Extensions API
#Provides a way for apps to add custom calling options to a contact record. This works in conjunction with the [Calling SDK](#), which is used to build your phone/calling UI. The endpoints here allow your service to appear as an option to HubSpot users when they access the *Call* action ... | 33.291667 | 450 | 0.736754 |
5d56e340a9f4d6bf438e42c02d37703c30574701 | 2,309 | require "active_support"
require "active_support/core_ext/module/delegation"
require "active_model"
require "orm_adapter"
# See {file:README.yard}.
module Heimdallr
class << self
# Allow implicit insecure association access. Consider this code:
#
# class User < ActiveRecord::Base
# include ... | 34.984848 | 82 | 0.731485 |
e8aaeb375a790106b3e756af6bb7379053b737cf | 1,552 | class Fortio < Formula
desc "HTTP and gRPC load testing and visualization tool and server"
homepage "https://fortio.org/"
url "https://github.com/fortio/fortio.git",
tag: "v1.17.1",
revision: "033287c10d16be7a9c695efa3fd9dd83f89056b5"
license "Apache-2.0"
livecheck do
url :stable
reg... | 35.272727 | 122 | 0.715851 |
f76ac48dbff9e3c39f8bff26218dc259fd3829af | 2,337 | # encoding: UTF-8
class Reviewer < ActiveRecord::Base
attr_trimmed :user_username
attr_autocomplete_username_as :user
belongs_to :user
belongs_to :conference
has_many :preferences, dependent: :destroy
has_many :accepted_preferences, -> { where('preferences.accepted = ?', true) }, class_name: 'Preferenc... | 25.966667 | 106 | 0.706889 |
bb1ed1143807f4fb800c42cccc027ff59a34a13e | 4,226 | # MdTranslator - minitest of
# reader / mdJson / module_keyword
# History:
# Stan Smith 2018-06-20 refactored to use mdJson construction helpers
# Stan Smith 2017-01-16 added parent class to run successfully within rake
# Stan Smith 2016-11-14 original script
require_relative 'mdjson_test_parent'
require 'adiwg/md... | 31.303704 | 75 | 0.710364 |
bb35c9e0dae3ac7a2c19e0c1b7e2a92fd13da3df | 2,057 | # -*- encoding: utf-8 -*-
# stub: virtus 1.0.5 ruby lib
Gem::Specification.new do |s|
s.name = "virtus".freeze
s.version = "1.0.5"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.authors = ["Piotr Solnica".free... | 43.765957 | 112 | 0.640739 |
f71630f281f0d01fa5243d83975ed607bb7bdbf6 | 1,360 | class Libvpx < Formula
desc "VP8/VP9 video codec"
homepage "https://www.webmproject.org/code/"
url "https://github.com/webmproject/libvpx/archive/v1.9.0.tar.gz"
sha256 "d279c10e4b9316bf11a570ba16c3d55791e1ad6faa4404c67422eb631782c80a"
license "BSD-3-Clause"
head "https://chromium.googlesource.com/webm/libvp... | 31.627907 | 94 | 0.726471 |
383b8bc3ef576b9282fa4dc94422f60f314d9875 | 2,556 | =begin
usage: yara [OPTION]... [RULEFILE]... FILE | PID
options:
-t <tag> print rules tagged as <tag> and ignore the rest. Can be used more than once.
-i <identifier> print rules named <identifier> and ignore the rest. Can be used more than once.
-n print only n... | 33.194805 | 107 | 0.668623 |
037a8f9be075bec8a2179b6450b4a5952fd1a621 | 5,840 | require 'testing_env'
require 'test/testball'
class FormulaTests < Test::Unit::TestCase
include VersionAssertions
def test_prefix
f = TestBall.new
assert_equal File.expand_path(f.prefix), (HOMEBREW_CELLAR+f.name+'0.1').to_s
assert_kind_of Pathname, f.prefix
end
def test_installed?
f = TestBal... | 25.064378 | 102 | 0.65411 |
4acaa1e2d5b8f464644d883a8616b855617ff28d | 516 | cask 'framer-x' do
version '32894,1560951087'
sha256 '12116b04b5b82bbd24bf382f2068e8dee423059b58e789a2e89ac72416aac21c'
# dl.devmate.com/com.framer.x was verified as official when first introduced to the cask
url "https://dl.devmate.com/com.framer.x/#{version.before_comma}/#{version.after_comma}/FramerX-#{vers... | 34.4 | 126 | 0.753876 |
6a649bd55529300ff425badeab275d5a1e769347 | 829 | require 'arkecosystem/crypto/enums/fees'
require 'arkecosystem/crypto/enums/types'
require 'arkecosystem/crypto/identities/public_key'
require 'arkecosystem/crypto/transactions/builder/base'
module ArkEcosystem
module Crypto
module Transactions
module Builder
# The builder for second signature regi... | 28.586207 | 106 | 0.657419 |
b9959d1a4ead97a4d6e37ad8f84fe847151df462 | 2,721 | #encoding: utf-8
require 'digest/md5'
require "open-uri"
require 'net/http'
require 'json'
$since_id = ""
$index = 0
$theTextDir = '../data/'
$itemContents = Array.new
$frontExistNames = Array.new
def frontExist
Dir.foreach($theTextDir) do |file|
if file !="." and file !=".." and file !=".DS_Store"
$fron... | 28.34375 | 141 | 0.608967 |
3949c70e7181790f2341aeb1f091594f2dc0cf8e | 6,326 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Editing file blob', :js do
include TreeHelper
let(:project) { create(:project, :public, :repository) }
let(:merge_request) { create(:merge_request, source_project: project, source_branch: 'feature', target_branch: 'master') }
let(:branch) { ... | 29.981043 | 124 | 0.656971 |
f753053e70403b4ff73b48b68265a31de34ac4a0 | 7,534 | ##
# This code was generated by
# \ / _ _ _| _ _
# | (_)\/(_)(_|\/| |(/_ v1.0.0
# / /
#
# frozen_string_literal: true
module Twilio
module REST
class Preview < Domain
class TrustedComms < Version
##
# PLEASE NOTE that this class contains preview products that are subjec... | 33.484444 | 201 | 0.560526 |
086ff4f717f4702b86e741246e59df014a2a8231 | 701 | require 'test_helper'
class StaticPagesControllerTest < ActionDispatch::IntegrationTest
def setup
@base_title = "Ruby on Rails Tutorial Sample App"
end
test "should get home" do
get root_path
assert_response :success
assert_select "title", "#{@base_title}"
end
test "should get help" do
... | 21.242424 | 65 | 0.694722 |
1d29259f2e3582ffcf9ec340f60a774712e5d69b | 1,729 | module SlotMachine
class SlottedObject < Slotted
attr_reader :known_object
def initialize( object , slots)
super(slots)
@known_object = object
raise "Not known #{slots}" unless object
end
def known_name
known_object.class.short_name
end
# load the slots into a regis... | 33.25 | 93 | 0.672643 |
33f3d2b28ef713f936b51c9be7c3fecebe291b3d | 437 | # == Schema Information
#
# Table name: partner_categories
#
# id :bigint(8) not null, primary key
# partnering_organization_id :bigint(8)
# category_id :bigint(8)
# created_at :datetime not null
# updated_at :datetime no... | 27.3125 | 69 | 0.599542 |
d510439d67143c6571d48ac9b41dcb3e7579f1f3 | 1,923 | # Encoding: utf-8
# Cloud Foundry Java Buildpack
# Copyright 2013 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | 36.283019 | 113 | 0.782111 |
6a81e0067430cc9c7cc374ce422ef55af310e6b7 | 3,102 | require "rubygems" if RUBY_VERSION < '1.9.0'
require "em-http-request"
require "eventmachine"
require "json"
module Sensu::Extension
class InfluxDB < Handler
def name
definition[:name]
end
def definition
{
type: "extension",
name: "influxdb"
}
end
def descripti... | 28.990654 | 271 | 0.51354 |
5d1f16b41a3f09f78d00a965bb2f427243622cd8 | 54 | class Group < ApplicationRecord
has_many :users
end
| 13.5 | 31 | 0.796296 |
91e3666d8431a1a815283b0eb5110de4be04a3f2 | 220 | require_dependency 'support/application_record'
module Support
module Candidate
class Convocation < ApplicationRecord
self.table_name = 'sihabx.candidate_convocations'
audited
end
end
end
| 18.333333 | 55 | 0.736364 |
799928a6da7191c4869a0925b2282923267e8ba5 | 686 | cask "qflipper" do
version "0.3.0"
sha256 "5228537be7fb6e567cc4e78c27b3709f88d145c00f51a7d6ec1bbc1e89dbf459"
url "https://update.flipperzero.one/builds/qFlipper/#{version}/qFlipper-#{version}.dmg"
name "qFlipper"
desc "Companion app for Flipper Zero devices"
homepage "https://update.flipperzero.one/"
li... | 29.826087 | 89 | 0.705539 |
f8e6ab61027a007553a57b5a7b6422cf67bdafaa | 1,341 | #---
# Excerpted from "Ruby on Rails, 2nd Ed."
# We make no guarantees that this code is fit for any purpose.
# Visit http://www.editions-eyrolles.com/Livre/9782212120790/ for more book information.
#---
$: << File.dirname(__FILE__)
require "connect"
require "rubygems"
require_gem "activerecord"
require "pp"
class ... | 17.644737 | 88 | 0.605518 |
01322a552de44cf4b2ff52c9c8df76ef8b2a3138 | 561 | module Populator
module Adapters
module Postgresql
def populate(table, columns, rows, name = nil)
queries = []
rows.each do |row|
row.gsub!(/^\(\d{1,}/, "(DEFAULT")
queries << "INSERT INTO #{table} #{columns} VALUES #{row}"
end
execute(queries.join("; "), ... | 24.391304 | 79 | 0.623886 |
01d8464123f73dcabaad90a1b1fc40bff5a7ba96 | 523 | module UsersHelper
def shorten_username(str)
# Remove http:// from users who haven't set their name
str.gsub!(/^http:\/\/(.*)\/?/, '\1')
# If str is some name-like thing ("John James Doe"), abbreviate to "John James D."
str.gsub!(/(.+)(\W+)(\w)\w+$/, '\1\2\3.') if str.match(/(\w+)(\W+)(\w).*/)
str... | 40.230769 | 128 | 0.604207 |
d52c4fe2ac783509cdb1dd31513a1d2a1ef39615 | 415 | # == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# name :string
# sub :string
# email :string
# token :string
# color :string
# created_at :datetime not null
# updated_at :datetime not null
#
require 'test_helper'
... | 18.863636 | 53 | 0.580723 |
ac51b25cb3c73ec4753a439c6a1ebe362ec84a98 | 4,303 | require 'rails_helper'
module Network::Chain
RSpec.describe Source do
context 'with demand of 2.0' do
context 'and no capacity set' do
let(:source) { Source.new(profile: [2.0])}
it 'has a load of 2.0' do
expect(source.call(0)).to eql(2.0)
end
end
context 'and... | 27.583333 | 68 | 0.511504 |
21b1c58c9f57640120c27277f172e48655e3b0e1 | 147 | FactoryBot.define do
factory :funding_plan do
association :activity_line_item
association :funding_source
amount { 100 }
end
end
| 14.7 | 35 | 0.734694 |
382748bb659d25405e792b494760d491aff0c88e | 932 | ## This has a fairly harmless hack that wraps the img tag in a div to prevent it from being
## wrapped in a paragraph tag instead, which would totally fuck things up layout-wise
## Usage {%- fullwidth 'path/to/image' 'caption goes here in quotes' -%}
#
module Jekyll
class RenderFullWidthTag < Liquid::Tag
req... | 32.137931 | 91 | 0.635193 |
62954971d5369f373e560a6c54c05113e2d85982 | 166 | class Configuration
attr_accessor :business_key, :agent_key
def initialize
@business_key = 'your_business_key'
@agent_key = 'your_agent_key'
end
end | 20.75 | 41 | 0.740964 |
5d37a225b221adbe99d32eba03cba14d35a8089d | 9,908 | module Frontapp
class Client
module Messages
# Parameters
# Name Type Description
# -------------------------------
# message_id string Id of the requested message
# -------------------------------
def get_message(message_id)
get("/messages/#{message_id}")
... | 62.314465 | 230 | 0.496165 |
796952fda5b987e6a3fb096720fc761a6192d1dc | 401 | project 'JRuby Ext' do
version = File.read( File.join( basedir, '..', 'VERSION' ) ).strip
model_version '4.0.0'
id 'org.jruby:jruby-ext'
inherit 'org.jruby:jruby-parent', version
packaging 'pom'
properties( 'tesla.dump.pom' => 'pom.xml',
'tesla.dump.readonly' => true )
modules [ 'readlin... | 21.105263 | 68 | 0.57606 |
035366b0a1ef38d6615aad3cd8c4a52bfb291231 | 1,781 | module Myreplicator
class VerticaUtils
class << self
# Example: get_grant({:db => "bidw", :schema => "king", :table => "customer"})
def get_grants *args
options = args.extract_options!
db = options[:db]
schema = options[:schema]
table = options[:table]
sql = "SE... | 29.196721 | 100 | 0.528916 |
189f48f4688ad48efa573af8fd94699e8f317c0a | 219 | class CreateContacts < ActiveRecord::Migration[5.1]
def change
create_table :contacts do |t|
t.string :name
t.text :title
t.text :email
t.text :message
t.timestamps
end
end
end
| 18.25 | 51 | 0.625571 |
4a774ad376d6c529325bd9b48a906a4af6ba6754 | 700 | # class Measure
# attr_accessor :beats
# attr_reader :chords
# def initialize(num_of_beats)
# self.beats = num_of_beats
# @chords = []
# end
# def add_chords(array)
# array.each do |chord|
# self.chords << chord
# end
# end
# def valid_num_of_be... | 25 | 69 | 0.515714 |
acc7242d59aafe4d06965e84771e212eea6c847d | 1,279 | module Fog
module OpenStack
class Volume
module Real
def list_snapshots(options = true, options_deprecated = {})
if options.kind_of?(Hash)
path = 'snapshots'
query = options
else
# Backwards compatibility layer, when 'detailed' boolean was sen... | 30.452381 | 140 | 0.546521 |
e83a8e3df13fa192ae7c5dc8f021f137bdd54457 | 399 | # frozen_string_literal: true
require "bundler/setup"
require "yabeda/rails"
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_... | 23.470588 | 66 | 0.756892 |
0845576ac6aaa8c6d649e5e95ed38da50ba2b382 | 945 | require "rails_helper"
describe "fields/polymorphic/_index", type: :view do
context "without an associated records" do
it "displays nothing" do
polymorphic = double(data: nil)
render(
partial: "fields/polymorphic/index",
locals: { field: polymorphic },
)
expect(rendered.... | 25.540541 | 66 | 0.627513 |
3800655c13c09369e715b30fad951c936ce5d7be | 4,911 | # frozen_string_literal: true
# require 'rails_helper'
#
# # This spec was generated by rspec-rails when you ran the scaffold generator.
# # It demonstrates how one might use RSpec to specify the controller code that
# # was generated by Rails when you ran the scaffold generator.
# #
# # It assumes that the implementat... | 37.48855 | 85 | 0.66687 |
bfc1ca12e6926d718060204b5678b70a941241a0 | 1,835 | require 'cases/helper'
require 'models/person'
class ActiveModelI18nTests < ActiveModel::TestCase
def setup
I18n.backend = I18n::Backend::Simple.new
end
def test_translated_model_attributes
I18n.backend.store_translations 'en', :activemodel => {:attributes => {:person => {:name => 'person name attrib... | 39.891304 | 124 | 0.733515 |
4a43fd850070abe356d3455cdfddf56b8c5d066e | 1,305 | module Fixtures
def self.response
{
merchantId: "508029",
transactionState: "4",
risk: "",
polResponseCode: "1",
referenceCode: "2205229",
reference_pol: "845122533",
signature: "cc3c8101113b056bc4b5b3d289dbb106",
polPaymentMethod: "10",
polPaymentMethodType: ... | 27.765957 | 60 | 0.593103 |
1c4f3213a2941f5d0fc758f4d5745df10ddf36ec | 1,618 | require_relative "./docker_image_creator"
require 'fileutils'
class DockerRailsAppCreator < DockerImageCreator
ARCHIVE_TMP_FILE = "/tmp/rails_application.tar.gz"
def docker_dir
dir = definition['build']['docker_dir'] || "#{FileUtils.pwd}/docker"
end
def before_build(definition)
build_from_current... | 26.966667 | 81 | 0.699629 |
62c986333479b1e5be4801c4afd83e5974d4c953 | 198 | class Todo < ActiveRecord::Base #533 methods
belongs_to :user #7 methods: user, user=, build_user
validates :title, presence: true, uniqueness: true
validates :user, presence: true
end
| 33 | 56 | 0.722222 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.