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 |
|---|---|---|---|---|---|
abb1067227bf63993b148bbaad65673741a4144d | 2,391 | # frozen_string_literal: true
require "spec_helper"
RSpec.describe Asciidoctor::Standoc::Datamodel::DiagramPreprocessor do
describe "#process" do
context "when simple models without relations" do
let(:datamodel_file) do
examples_path("datamodel/common_models_diagram.adoc")
end
let(:res... | 32.753425 | 79 | 0.595567 |
33596f7c6155e39222650b99dabc750e04b9b88d | 1,523 | class Atk < Formula
desc "GNOME accessibility toolkit"
homepage "https://library.gnome.org/devel/atk/"
url "https://download.gnome.org/sources/atk/2.28/atk-2.28.1.tar.xz"
sha256 "cd3a1ea6ecc268a2497f0cd018e970860de24a6d42086919d6bf6c8e8d53f4fc"
bottle do
sha256 "b1abd123e7054ba1ec18f26bb18e4486b6daaccc25... | 28.735849 | 93 | 0.635588 |
bb22e8ec3baa0d43126edd7cf23d7d69c8d6b4f1 | 2,304 | =begin
#Kubernetes
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.2.3
=end
require "uri"
module Kubernetes
class AutoscalingApi
at... | 31.561644 | 157 | 0.681424 |
4ac631363497fff80f7611a5a1aaef3e31eaa5e6 | 941 | # frozen_string_literal: true
Gem::Specification.new do |spec|
spec.name = "typographical"
spec.version = "1.1.22"
spec.authors = ["Ram Iyer"]
spec.email = ["ramakrishnan.rkology@gmail.com"]
spec.summary = %{A typography-focused theme based on Tale by Chester How.}
spec.... | 39.208333 | 132 | 0.645058 |
5dd899cac173d4cd0885d0c779a04436f88d52b8 | 441 | cask :v1 => 'hashcat' do
version '0.48'
sha256 '39fee1757b33b3e7232ce3797f0be024fa784dbbd0939b475b5b1ea7462cec5e'
url "https://hashcat.net/files/hashcat-#{version}.7z"
homepage 'https://hashcat.net/hashcat/'
license :unknown # todo: change license and remove this comment; ':unknown' is a machine-generated... | 33.923077 | 115 | 0.734694 |
183c61eb6de7c71e125b0cae1554a815ef21140a | 284 | module Twitter
module Enumerable
include ::Enumerable
# @return [Enumerator]
def each(start = 0, &block)
return to_enum(:each) unless block_given?
Array(@collection[start..-1]).each do |element|
yield element
end
self
end
end
end
| 17.75 | 53 | 0.619718 |
012d6da00ca8988d1aee2c912dc164df6132c0d5 | 1,246 | class Sops < Formula
desc "Editor of encrypted files"
homepage "https://github.com/mozilla/sops"
url "https://github.com/mozilla/sops/archive/v3.7.1.tar.gz"
sha256 "536ee140d888b53b71c1e8edd669f4c11bc573428983fbea644fbbfcd7d7079a"
license "MPL-2.0"
head "https://github.com/mozilla/sops.git", branch: "develo... | 41.533333 | 122 | 0.757624 |
87af7cc7dacb6b88a57da65b822dac512e3abc0d | 12,124 | require 'json'
module VagrantPlugins
module Salt
class Provisioner < Vagrant.plugin("2", :provisioner)
def provision
upload_configs
upload_keys
run_bootstrap_script
call_overstate
call_highstate
end
# Return a list of accepted keys
def keys(group='... | 35.450292 | 173 | 0.587265 |
7920f28806e56d47295fdf440b45f87f026c3b51 | 1,043 | require 'test_helper'
class NavigationTest < ActionDispatch::IntegrationTest
setup { MongoMetrics::Metric.delete_all }
test "can visualize notifications" do
get main_app.home_foo_path
get main_app.home_bar_path
get main_app.home_baz_path
get mongo_metrics.root_path
assert_match "Path: /home/f... | 25.439024 | 67 | 0.738255 |
3961595b96920c2b6ed95368448b982f68e94797 | 370 | cask :v1 => 'tiled' do
version '0.11.0'
sha256 '82d9c33f02b1f048807e55728331e1c94c92a9cd3cb83d1bc6dc89cf7655e1be'
# github.com is the official download host per the vendor homepage
url "https://github.com/bjorn/tiled/releases/download/v#{version}/tiled-#{version}.dmg"
name 'Tiled'
homepage 'http://www.mape... | 28.461538 | 89 | 0.740541 |
ff32bac4c705d37a5d90252a0aeed4b5dadd8ced | 235 | # frozen_string_literal: true
class CreateProhibitionAndResponsibilities < ActiveRecord::Migration[5.2]
def change
create_table :prohibition_and_responsibilities do |t|
t.string :item
t.timestamps
end
end
end
| 19.583333 | 73 | 0.748936 |
1a5e1faa7ac48db41c943252b7d48c0c1729e77e | 165 | # frozen_string_literal: true
module PortalHelper
def active_status_class
'active_status'
end
def status_active?(status)
status = "Active"
end
end
| 13.75 | 29 | 0.733333 |
39b0ad344a53a6fa2fba7dd9b8067ac158e7d14a | 1,394 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
require 'aws-sdk-core'
require 'aws-sigv4'
require_relative 'aws-sdk-securityhu... | 25.814815 | 83 | 0.749641 |
62dfc045d9334e25f2a68b748b19023ca20d15a4 | 1,722 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::EventGrid::Mgmt::V2020_01_01_preview
module Models
#
# BoolEquals Advanced Filter.
#
class BoolEqualsAdvancedFilter < AdvancedFilter
in... | 24.956522 | 70 | 0.5 |
7ae9dcbcb819d623d02297149c6d67ff74a683cb | 986 | # Encoding: utf-8
#
# This is auto-generated code, changes will be overwritten.
#
# Copyright:: Copyright 2015, Google Inc. All Rights Reserved.
# License:: Licensed under the Apache License, Version 2.0.
#
# Code generated by AdsCommon library 0.9.9 on 2015-06-30 09:24:51.
require 'ads_common/savon_service'
require '... | 28.171429 | 69 | 0.744422 |
7a77616e01e5398304b7534d06ebc9f5db274050 | 4,765 | # frozen_string_literal: true
#
# Copyright:: 2020, Chef Software, Inc.
# Author:: Tim Smith (<tsmith@chef.io>)
#
# 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/licen... | 32.862069 | 288 | 0.642392 |
ab8a5c112bad6cbc7cbc372d73bae9d1801d4491 | 3,492 | module DeliveryBoy
# This class implements the actual logic of DeliveryBoy. The DeliveryBoy module
# has a module-level singleton instance.
class Instance
def initialize(config, logger)
@config = config
@logger = logger
@async_producer = nil
end
def deliver(value, topic:, **options... | 31.178571 | 89 | 0.70504 |
1864c0c48ac950c71227f8266c96490f0c7942cb | 696 | require 'rails_helper'
RSpec.describe "offers/index", :type => :view do
before(:each) do
assign(:offers, [
Offer.create!(
:title => "Title",
:desc => "MyText",
:code => "Code",
:link => "Link"
),
Offer.create!(
:title => "Title",
:desc => "MyText"... | 24 | 62 | 0.507184 |
62b91d0b192e7e6324c7afeadd85f653d572d152 | 1,189 | module SessionsHelper
def log_in(user)
session[:user_id] = user.id
end
def remember(user)
user.remember
cookies.permanent.signed[:user_id] = user.id
cookies.permanent[:remember_token] = user.remember_token
end
def current_user?(user)
user == current_user
end
def current_user
if ... | 21.232143 | 73 | 0.68545 |
399dbb31987b08f7fdb9dc80869da634ecb1fb3d | 7,268 | # frozen_string_literal: true
require 'rails_helper'
require "#{Rails.root}/lib/wiki_api"
describe WikiApi do
describe 'error handling' do
let(:subject) { described_class.new.get_page_content('Ragesoss') }
it 'handles mediawiki 503 errors gracefully' do
stub_wikipedia_503_error
expect(subject).... | 34.609524 | 93 | 0.635526 |
edc0250d6348094f5a7e10ed2f6acf278ac61dc8 | 2,103 | ENV['FOG_RC'] = ENV['FOG_RC'] || File.expand_path('../.fog', __FILE__)
ENV['FOG_CREDENTIAL'] = ENV['FOG_CREDENTIAL'] || 'default'
require 'fog'
require 'fog/bin' # for available_providers and registered_providers
Excon.defaults.merge!(:debug_request => true, :debug_response => true)
require File.expand_path(... | 37.553571 | 166 | 0.735616 |
acf775b3538addeb5b78958e344d7483d3a515ba | 11,555 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Database::MigrationHelpers::V2 do
include Database::TriggerHelpers
include Database::TableSchemaHelpers
let(:migration) do
ActiveRecord::Migration.new.extend(described_class)
end
before do
allow(migration).to receive(:puts)... | 35.444785 | 151 | 0.674859 |
e80655ff8ebd80af951758180dd8deda8173a698 | 100 | module Spree
module Admin
class BankAccountsController < ResourceController
end
end
end
| 14.285714 | 53 | 0.76 |
f8afaf23fd5acd16f18656e940392e9636152a1b | 705 | class Api::V1::OrdersController < ApplicationController
def index
@orders = Order.all
render json: @orders
end
def create
@order = Order.new(order_params)
if @order.save
render json: {
message: 'Order Successfully Placed!',
order: @order
}
else
render json: ... | 19.054054 | 59 | 0.629787 |
bb4687985dbcf42e8ef47e163f50ad39db55f856 | 398 | FactoryGirl.define do
factory :user do
user_name('Athena')
email('athena@athena.com')
password('mycoolpass')
password_confirmation('mycoolpass')
admin true
end
factory :service, class: Service do
name('Martini')
description('Cold and dirty and dry')
price('36')
end
factory :r... | 18.952381 | 41 | 0.663317 |
28c213ad4fc8b0c2ee90978b99c2a267ee456386 | 10,151 | # frozen_string_literal: true
# Methods added to this helper will be available to all templates in the hosting application
module Blacklight::BlacklightHelperBehavior
include Blacklight::UrlHelperBehavior
include Blacklight::HashAsHiddenFieldsHelperBehavior
include Blacklight::LayoutHelperBehavior
include Black... | 32.745161 | 165 | 0.72712 |
4a1d78f7fbbf515109c1845c28ac49f1c2b633ba | 1,912 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = AverageRanking
include Msf::Exploit::Remote::Tcp
include Msf::Exploit::Remote::Seh
def initialize(info = {})
super... | 25.493333 | 88 | 0.535042 |
d5a14791177a90df8ecf7ad2cc65a85b4a5e62b3 | 1,340 | class Torrentcheck < Formula
desc "Command-line torrent viewer and hash checker"
homepage "https://torrentcheck.sourceforge.io/"
url "https://downloads.sourceforge.net/project/torrentcheck/torrentcheck-1.00.zip"
sha256 "a839f9ac9669d942f83af33db96ce9902d84f85592c99b568ef0f5232ff318c5"
bottle do
cellar :a... | 49.62963 | 94 | 0.80597 |
1cff403b94c05c3b5a585a66d5f26fd7578bbebb | 893 | # frozen_string_literal: true
require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module FacebookClone
class Application < Rails::Application
# Initialize configuration defa... | 31.892857 | 82 | 0.701008 |
bfd7516d8f81d3fcaac0c8735f84b4ffbd5491b1 | 1,787 | # (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2021
require 'csv'
module Instana
module Backend
# Utility class to discover the agent that a given instance of the collector
# needs to communicate with.
# @since 1.197.0
class HostAgentLookup
def initialize(host = ::Instana.config[:... | 30.810345 | 131 | 0.595411 |
1d5c2f7314047bfec93adbca958f0702f497d9d0 | 2,580 | # The JsonCatalogEncoder is a wrapper around a catalog produced by the Pal::CatalogCompiler.with_json_encoding
# method.
# It allows encoding the entire catalog or an individual resource as Rich Data Json.
#
# @api public
#
module Puppet
module Pal
class JsonCatalogEncoder
# Is the resulting Json pretty printed or no... | 35.833333 | 119 | 0.737597 |
269e4ff554332d4b9dcb57960fa1ef2d032af8bb | 4,580 | class PunchesController < ApplicationController
###############################################
# Punchy
# Please submit bug reports/suggestions via the github repo http://github.com/mazondo/Punchy
#
# Copyright (c) 2010 Ryan Quinn
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# o... | 30.331126 | 100 | 0.627948 |
bb21f1cb9342d1521e984ed09b91188e1b84b065 | 1,252 | class Awsweeper < Formula
desc "CLI tool for cleaning your AWS account"
homepage "https://github.com/jckuester/awsweeper/"
url "https://github.com/jckuester/awsweeper/archive/v0.12.0.tar.gz"
sha256 "43468e1af20dab757da449b07330f7b16cbb9f77e130782f88f30a7744385c5e"
license "MPL-2.0"
head "https://github.com/... | 31.3 | 115 | 0.699681 |
1dc35790dfa5c80be24496c6e5857e731c0861b6 | 1,309 | require_relative '../../spec_helper'
require_relative 'shared/comparison_coerce'
describe "Integer#<" do
it_behaves_like :integer_comparison_coerce_not_rescue, :<
context "fixnum" do
it "returns true if self is less than the given argument" do
(2 < 13).should == true
(-600 < -500).should == true
... | 27.851064 | 68 | 0.612681 |
6142046ac5bd23a9a0db69feb73890f385d2ba6c | 225 | require 'spec_helper'
describe 'gce_gcsfuse::default' do
# Serverspec examples can be found at
# http://serverspec.org/resource_types.html
it 'does something' do
skip 'Replace this with meaningful tests'
end
end
| 22.5 | 45 | 0.746667 |
e966f4e45e493c3fc43963066d7f0e0a9b062ad6 | 768 | require 'rails_helper'
RSpec.describe User, type: :model do
describe 'validations' do
it { should validate_presence_of(:name) }
it { should validate_presence_of(:email) }
it { should validate_presence_of(:username) }
it { should validate_presence_of(:password) }
it { should validate_presence_of(:... | 34.909091 | 88 | 0.705729 |
3811e67f768b6e959ee730915ae3d0f449eecdaf | 1,740 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use... | 48.333333 | 130 | 0.757471 |
ab83be3637bf1684e9d61044b93e0b830cc009a8 | 121 | module Rails
module Html
module Owasp
class Sanitizer
VERSION = "1.0.0"
end
end
end
end
| 11 | 25 | 0.561983 |
e96f82f7a85847ae06c8e198a6de6e6a944d2799 | 587 | module Servicetools
class Systemd
def start(options)
generate_service
system "systemctl start #{@project}"
end
def stop(options)
generate_service
system "systemctl stop #{@project}"
end
def status(options)
generate_service
system "systemctl status #{@p... | 17.264706 | 44 | 0.630324 |
ac50d8c939c7a92c409f9176b3ddc1766e6d5805 | 1,275 | class Jump < Formula
desc "Helps you navigate your file system faster by learning your habits"
homepage "https://github.com/gsamokovarov/jump"
url "https://github.com/gsamokovarov/jump/archive/v0.19.0.tar.gz"
sha256 "1157a681d8f43d95febf2222004c26b0642f0493cf04832cb4ba08f256e708ff"
head "https://github.com/gs... | 36.428571 | 94 | 0.750588 |
bbefa92a6bc97e922448a9e48d0723dd8fc8877f | 131 | # frozen_string_literal: true
module CXML
class GrossAmount < DocumentNode
accessible_nodes %i[
money
]
end
end
| 13.1 | 34 | 0.694656 |
ed3195affba9128a5c9fed6fa9642cae217eb63b | 114 | require "quick_search/history/engine"
module QuickSearch
module History
# Your code goes here...
end
end
| 14.25 | 37 | 0.736842 |
ed401c4912e348ca6da446a01d1cb9dfa17d53ca | 1,058 | module Rasti
module Web
module ApiDoc
class Request
def initialize(env)
@env = env
end
def method
env['REQUEST_METHOD']
end
def path_info
env['PATH_INFO']
end
def route
env['PATH_INFO'].dup.tap do |path_info|... | 20.346154 | 101 | 0.464083 |
1cb033d813a2b8a4344dfac02e88d10248f45fab | 7,862 | # frozen_string_literal: true
module Mongoid
module Association
# This module contains the core macros for defining associations between
# documents. They can be either embedded or referenced.
module Macros
extend ActiveSupport::Concern
included do
class_attribute :embedded, instanc... | 34.482456 | 96 | 0.578606 |
1cf1056353ecd246e5c6ce755c0da766f6794cb2 | 1,121 | class Jetty < Formula
desc "Java servlet engine and webserver"
homepage "https://www.eclipse.org/jetty/"
url "http://download.eclipse.org/jetty/9.3.5.v20151012/dist/jetty-distribution-9.3.5.v20151012.tar.gz"
version "9.3.5.v20151012"
sha256 "24e80e350fcc9749aa4a29913c34917ad238a0fa3abdb7d7c9b42dc40bdf0f9b"
... | 26.690476 | 104 | 0.641392 |
792f10b656a88449bc9feb63a6bd0b645694d4d1 | 261 | require 'rails_helper'
RSpec.describe "StudioHomePages", type: :request do
describe "GET /studio_home_pages" do
it "works! (now write some real specs)" do
get studio_home_pages_path
expect(response).to have_http_status(200)
end
end
end
| 23.727273 | 51 | 0.724138 |
28db68de24fc45548939e8b9cf5984d3f1c5aa34 | 4,858 | # Patch to improve generated addXXX and setXXX method performance
#
# Submitted to rgen as PR: https://github.com/mthiede/rgen/pull/22. This
# patch should be removed once that PR has been included in an rgen
# release.
#
# The current implementation of the generated addXXX method will iterate
# over the contained arra... | 36.526316 | 118 | 0.548786 |
e24daaad7d7b87c69e054fa9875a840ad45baeee | 3,053 | module Providers
module ApplicationMeritsTask
class StatementOfCasesController < ProviderBaseController
def show
populate_form
end
def update
if upload_button_pressed?
perform_upload
elsif save_continue_or_draft(form)
convert_new_files_to_pdf
... | 30.227723 | 161 | 0.70226 |
1ceb992c9ea18d3bf4273c90ef02d1b4cb28c918 | 1,035 | require 'spec_helper'
describe Matchers::OutputApproval do
subject { Matchers::OutputApproval.new 'something' }
describe '::output_approval' do
it "works" do
expect{ print 'anything' }.to output_approval('anything')
end
end
describe '#matches?' do
context "when interactive mode is enabled" ... | 24.642857 | 72 | 0.685024 |
3922ac7d2a8308ef661fa46e12ff1eb802972779 | 1,390 | # frozen_string_literal: true
class DeviseCreateUsers < ActiveRecord::Migration[6.0]
def change
create_table :users do |t|
## Database authenticatable
t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""
## Recoverable
t.stri... | 30.888889 | 104 | 0.653237 |
5d2ba732315b7102621aa5afa99f9c82e6706979 | 685 | # frozen_string_literal: true
require 'base64'
module Uphold
module API
module AuthToken
def generate_access_token(username: '', password: '', otp: '')
request_data = Uphold::RequestData.new(
Endpoints::AUTH,
Entities::AuthToken,
auth_headers(username, password, otp),... | 24.464286 | 82 | 0.583942 |
acb84c57993e69e3e764a6cd7b6c2611582d2600 | 417 | class ApplicationController < ActionController::Base
helper_method :current_user, :logged_in?
def current_user
@current_user ||= User.find_by(id: session[:user_id])
end
def logged_in?
!!current_user
end
def authorized
redirect_to login_path unless logged_in?
end
def authorized_for_user(u... | 18.130435 | 57 | 0.724221 |
4a6cf67166206ed63ba1d03da18a0fced602d7ca | 4,906 | require 'spec_helper'
require 'json'
RSpec.describe Arduino::Library::Model do
context '#initialize' do
let(:schema) { Arduino::Library::Types.schema }
let(:file) { 'spec/fixtures/audio_zero.json' }
let(:json) { JSON.load(File.read(file)) }
let(:hash) { json }
let(:converted) { schema[hash] }
... | 34.307692 | 182 | 0.575214 |
bfe33c711799e52d727f683e6a6e27f83c0ecf6b | 365 | #
# SmartRails
# Ruby on Rails Project
# (C) Alessio Saltarin 2021
# MIT License
#
class HomeController < ApplicationController
def home
@items = Item.all
logger.info('Home Controller - page: home')
end
def services
logger.info('Home Controller - page: services')
end
def about
logger.info... | 14.6 | 51 | 0.682192 |
f8b9b518a2a54c2f1ef80dd1c3f15e4c0d13d233 | 362 | require "bundler/setup"
require "alltop"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect_with :rspe... | 24.133333 | 66 | 0.751381 |
bfb2c4660e09f7c41256cdefbe5f5edf4f11da5f | 1,377 | require 'everywhere/util'
module ActiveRecord
module ChainRelation
module NotBuilder
include Everywhere::Util
def build_where(opts, other = [])
super.map {|r| negate r}
end
end
module LikeBuilder
def build_where(opts, other = [])
super.map {|r| Arel::Nodes::Match... | 23.338983 | 69 | 0.628903 |
ab80acf91ab76a19c650189ad28b4e2952650472 | 148 | require 'rails_helper'
describe Section do
it { belongs_to :chapter }
it { have_many :lessons }
it { should validate_presence_of :name }
end
| 18.5 | 42 | 0.72973 |
d5ed60819b0c906d67c5b1dc3800edea4c221303 | 1,622 | class PasswordResetsController < ApplicationController
before_action :get_user, only: [:edit, :update]
before_action :valid_user, only: [:edit, :update]
before_action :check_expiration, only: [:edit, :update] # (1) への対応
def new
end
def create
@user = User.find_by(email: params[:password_reset][:em... | 26.16129 | 73 | 0.623921 |
e20d22be2be0e1dba47082850a70d707ee76300c | 367 | # frozen_string_literal: true
module ActiveStorage::SetBlob #:nodoc:
extend ActiveSupport::Concern
included do
before_action :set_blob
end
private
def set_blob
@blob = ActiveStorage::Blob.find_signed!(params[:signed_blob_id] || params[:signed_id])
rescue ActiveSupport::MessageVerifier::Inva... | 21.588235 | 93 | 0.735695 |
d5cc78e2302d571b37cc46eaf89eb251c138c6dc | 28,419 | # coding: utf-8
# MIT License
# tweetcart.rb has been released under MIT (*only this file*).
# Contributors outside of DragonRuby who also hold Copyright:
# - https://github.com/HIRO-R-B
# - https://github.com/oeloeloel
# - https://github.com/leviongit
module GTK
##
# Tweetcart: The main module
module Tweetcart... | 23.801508 | 217 | 0.46015 |
03c864cef382c065d72060e1af1c9240b7f5d710 | 5,709 | require "active_support/core_ext/integer/time"
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your applica... | 44.601563 | 114 | 0.763181 |
b998c2ef7b3f002826ece32bfaab7a82d44c826d | 5,104 | require 'formula'
class Git < Formula
homepage "http://git-scm.com"
url "https://www.kernel.org/pub/software/scm/git/git-2.0.1.tar.gz"
sha1 "b51a95588249aa71501a01273671f32ea99c392c"
head "https://github.com/git/git.git", :shallow => false
bottle do
sha1 "6796bef3d6692035a5e4daf1b76c3adc9f32c435" => :m... | 34.721088 | 107 | 0.650274 |
62581ff16c9468f71d8802e086997817db20ffc0 | 1,157 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v7/errors/user_data_error.proto
require 'google/api/annotations_pb'
require 'google/protobuf'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("google/ads/googleads/v7/errors/user_data_error.proto", :syntax =>... | 35.060606 | 178 | 0.750216 |
33b6ba88ec4342e6a13d47800de06b726ff121ea | 3,975 | class DockerCloud < Formula
desc "SaaS to build, deploy and manage Docker-based applications"
homepage "https://cloud.docker.com/"
url "https://files.pythonhosted.org/packages/78/75/511a967ccabff691b57f97bde04cff29af2f493c6ec91a5f57c42badc3b0/docker-cloud-1.0.9.tar.gz"
sha256 "dcddda43b2e9acbadcc3b658a61a35a413... | 45.689655 | 160 | 0.810566 |
012ea8367e405d44809cbe52569f94c5f6d0eacb | 197 | cask 'cheetah3d' do
version :latest
sha256 :no_check
url 'https://cheetah3d.com/download/Cheetah3D.dmg'
name 'Cheetah3D'
homepage 'https://www.cheetah3d.com/'
app 'Cheetah3D.app'
end
| 17.909091 | 52 | 0.715736 |
ff360af373d79e541229f4923f6f397eb47b2391 | 62 | module Travis
class Metrics
VERSION = '2.0.0'
end
end
| 10.333333 | 21 | 0.645161 |
18864e38ed3891f26c3553e9cf20a4cb2634470a | 295 | require_relative '../../lib/controller_base'
class StylesheetsController < ControllerBase
def stylesheet
filename = File.dirname(__FILE__) + '/../stylesheets/stylesheet.css'
res.body = File.read(filename)
res.content_type = 'text/css'
@already_built_response = true
end
end
| 26.818182 | 72 | 0.728814 |
286029f31b52baceda4446cebaadd91062276a86 | 537 | module Bot
module DiscordCommands
# Command for evaluating Ruby code in an active bot.
# Only the `event.user` with matching discord ID of `CONFIG.owner`
# can use this command.
module Eval
extend Discordrb::Commands::CommandContainer
command(:eval, help_available: false) do |event,... | 28.263158 | 71 | 0.588454 |
08ef0f646d567ee1cf3d81928100eb293fde4f2c | 521 | require "rails_helper"
RSpec.describe "routes for Welcome", :type => :routing do
it "routes /admin/welcome to the admin/welcome controller" do
expect(get("/admin/welcome")).
to route_to("admin/welcome#index")
end
it "routes /admin/login to the admin/welcome controller" do
expect(get("/admin/login"... | 27.421053 | 63 | 0.68906 |
871e566afcb77eb8e253621f4e45a322279c1d00 | 1,028 | # Copyright 2011 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/LICENSE-2.0
#
# Unless required by applicable law or a... | 34.266667 | 83 | 0.746109 |
18e9db35df16aa608c7b3ff2424d006d7e68bc13 | 257 | require_relative '../automated_init'
context "Read" do
context "Precision" do
number_text = "1.11e+01"
number = Read.(number_text)
test "All significant figures are preserved" do
assert(number == BigDecimal('11.1'))
end
end
end
| 18.357143 | 51 | 0.669261 |
acdc73c441d45748758de5122b55fe438d5ead8f | 8,210 | require 'active_support/concern'
require 'active_support/core_ext/array/extract_options'
require 'active_support/deprecation/reporting'
module MoneyRails
module ActiveRecord
module Monetizable
extend ActiveSupport::Concern
module ClassMethods
def monetize(field, *args)
options = ar... | 36.981982 | 119 | 0.578685 |
21a0c9a23e70ff225a96b39552534e7055662289 | 1,378 | class Scorecard
def initialize
@scorecard = {
ones: 0,
twos: 0,
threes: 0,
fours: 0,
fives: 0,
sixes: 0,
three_of_a_kind: 0,
four_of_a_kind: 0,
full_house: 0,
small_straight: 0,
large_straight: 0,
yahtzee: 0,
chance: 0
}
@bonus... | 19.685714 | 136 | 0.591437 |
5dce89db49a98b06eea0e42d6616794124ad0884 | 118 | require 'test_helper'
class IdeaTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 14.75 | 40 | 0.694915 |
91f35dbb7d3a67bcd15bf595608a58f2d05987ef | 267 | class RoomsController < ApplicationController
def new
end
def create
redirect_to room_path(42)
end
def show
@client = Client.new(id: SecureRandom.uuid)
cookies.encrypted[:client_id] = @client.id
@room = Room.new(id: params[:id])
end
end
| 17.8 | 47 | 0.689139 |
33df1131cb0b6556174ea2894bdd491d50090e20 | 1,238 | require 'abstract_unit'
require 'action_controller/integration'
require 'action_controller/routing'
unless defined? ApplicationController
class ApplicationController < ActionController::Base
end
end
class UploadTestController < ActionController::Base
session :off
def update
SessionUploadTest.last_request... | 28.136364 | 101 | 0.716478 |
613f1a41b6efc6ec839d1a04f5302bccf4f9f36d | 210 | require "application_system_test_case"
class IndustriesTest < ApplicationSystemTestCase
# test "visiting the index" do
# visit industries_url
#
# assert_selector "h1", text: "Industry"
# end
end
| 21 | 48 | 0.738095 |
21afcb42bb50e226badb1b2de1e31a24f26158aa | 144 | def fizzbuzz(int)
if (int % 5 == 0) && (int % 3 == 0)
"FizzBuzz"
elsif int % 5 == 0
"Buzz"
elsif int % 3 == 0
"Fizz"
else
end
end | 14.4 | 37 | 0.5 |
e8e5781c3f42aac4593802d608be1e5b833a046b | 9,079 | # coding: utf-8
require "spec_helper"
describe NginxUtils::CLI do
describe "#status" do
let(:result) {
{
active_connections: 1,
accepts: 4,
handled: 5,
requests: 51,
reading: 1,
writing: 3,
waiting: 2
}
}
before {NginxUtils::Status.sho... | 31.744755 | 110 | 0.607225 |
f8c32aaf87cc1cdceb8fb61193675c66713bfe88 | 117 | require 'test_helper'
class CveTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 14.625 | 39 | 0.692308 |
1c389606fbea157879d39e572a56204e264a633b | 152 | # frozen_string_literal: true
# typed: true
# compiled: true
def foo(a, b = 2, k:, g:6, **args)
puts a, b, k, g, args.inspect
end
foo(1, k: 3, y: 7)
| 16.888889 | 34 | 0.605263 |
265d6185110a296bef5f6f0f8728369f85598359 | 1,674 | # frozen_string_literal: true
module Types
module DesignManagement
class VersionType < ::Types::BaseObject
# Just `Version` might be a bit to general to expose globally so adding
# a `Design` prefix to specify the class exposed in GraphQL
graphql_name 'DesignVersion'
description 'A speci... | 39.857143 | 107 | 0.672043 |
ffa1ebce7f0bdccb63ab272224a4f9e3078b111d | 9,428 | # Copyright (c) 2016, 2021, 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... | 37.561753 | 245 | 0.675965 |
e27e61fceb5871e82eb125f0811cce674c93d917 | 159 | module MessageFormatHelper
include RegexHelper
def transform_user_mention_content(message_content)
message_content.gsub(MENTION_REGEX, '\1')
end
end
| 22.714286 | 53 | 0.81761 |
b99ac0cde98744e3ce21ff014644e13a852fb26c | 2,268 | require_relative '../spec_helper'
describe "Intrigue v1.0 Tasks" do
describe "DnsSrvBruteTask" do
include Intrigue::Test::Integration
###
### dns_brute_srv
###
it "runs a default dns_brute_srv and returns the correct result" do
entity = {:type => "DnsRecord", :attributes => {:name => "ra... | 35.4375 | 90 | 0.497354 |
08feb77ee9bceced47998278ddc5e5d21dba9a9c | 2,770 | require 'openssl'
require 'mauth/errors'
# methods to sign requests and responses. part of MAuth::Client
module MAuth
class Client
SIGNING_DIGEST = OpenSSL::Digest::SHA512.new
module Signer
UNABLE_TO_SIGN_ERR = UnableToSignError.new('mAuth client cannot sign without a private key!')
# takes an... | 39.571429 | 119 | 0.69278 |
26013f26845c820f7842b824eb552bfa411818c4 | 378 | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module America
module St_Thomas
include TimezoneDefinition
linked_timezone 'America/St_Thomas', 'Ame... | 19.894737 | 68 | 0.650794 |
1d572c442f8c8d3e40b707ec9457d75d487fc58c | 3,664 | # 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::DataFactory::Mgmt::V2017_09_01_preview
module Models
#
# Magento server dataset.
#
class MagentoObjectDataset < Dataset
... | 29.312 | 75 | 0.418395 |
91060106e0cfeee47e597080c759a253e31576fa | 8,532 | require 'lotus/view/rendering/template_name'
require 'lotus/view/rendering/layout_finder'
module Lotus
module View
# Class level DSL
#
# @since 0.1.0
module Dsl
# When a value is given, specify a templates root path for the view.
# Otherwise, it returns templates root path.
#
... | 26.091743 | 88 | 0.4891 |
61b69f1dd173946124c233ef69b714dc3383a6eb | 140 | require File.expand_path('../../../spec_helper', __FILE__)
describe "Set#reject!" do
it "needs to be reviewed for spec completeness"
end
| 23.333333 | 58 | 0.721429 |
1d18ac2a46aee04d048fc74384cfeb576900881d | 58 | require 'ubiquity/vimeo/api/client/requests/base_request'
| 29 | 57 | 0.844828 |
7a44c4d4351a6b1a436a0e642c0bf51d0eb5c6d7 | 1,168 | module Rack
# A multipart form data parser, adapted from IOWA.
#
# Usually, Rack::Request#POST takes care of calling this.
module Multipart
autoload :UploadedFile, 'rack/multipart/uploaded_file'
autoload :Parser, 'rack/multipart/parser'
autoload :Generator, 'rack/multipart/generator'
EOL = "\r\... | 33.371429 | 83 | 0.593322 |
79c69945bce16069c6792ff082d711c2cfa422e3 | 2,795 | #!/usr/bin/env ruby
# Encoding: utf-8
#
# Copyright:: Copyright 2019 Google LLC
#
# License:: 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.o... | 32.126437 | 79 | 0.686225 |
91a94eb376e34c10ae9d8d7197bc8ca40ff2b6da | 6,958 | #
# Fluentd
#
# 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, so... | 33.776699 | 148 | 0.612101 |
e9d24bf1ef87b679034838f0ee23e3475851c523 | 1,029 | require_relative 'errors/no_items_in_order_error'
# Public: In charge of receiving rental orders and applying discounts
# to provide the final pricing.
#
# Examples
#
# order = OrderProcessor.new(
# [HourlyRental.new(2)],
# [FamilyDiscount, ChristmasDiscount]
# )
#
# order.price
# order.discount
class ... | 21.4375 | 69 | 0.699708 |
2619f1aee2e616424f7f32a0b2562b648b863cd0 | 2,881 | # frozen_string_literal: true
require File.expand_path('../../test_helper', __FILE__)
class SchedulingPollTest < ActiveSupport::TestCase
include Redmine::PluginFixtureSetLoader
fixtures :projects, :issues, :roles, :users
plugin_fixtures :scheduling_polls, :scheduling_poll_items, :scheduling_votes
test "shall... | 36.0125 | 155 | 0.742451 |
f772cea3b5da752c33b445b26dd4cc2666a432fd | 77 | class Comment < ApplicationRecord
belongs_to :board
belongs_to :user
end
| 15.4 | 33 | 0.792208 |
e89d581a6d6ecc8a8c9ea390ebf2b8df0192f808 | 632 | # frozen_string_literal: true
module Quality
module Tools
# Adds 'reek' tool support to quality gem
class Reek < Tool
def quality_reek
args = "--single-line #{ruby_files.join(' ')}"
ratchet_quality_cmd('reek',
args: args,
emacs_for... | 23.407407 | 75 | 0.509494 |
acfb2e477416172eae8f731d62a35ed7710ecb5a | 1,415 | module Talkable
class Configuration
DEFAULT_SERVER = 'https://www.talkable.com'.freeze
DEFAULT_TIMEOUT = 5
attr_accessor :site_slug
attr_accessor :api_key
attr_accessor :server
attr_accessor :read_timeout
attr_accessor :open_timeout
attr_accessor :js_integration_library
class Un... | 23.583333 | 79 | 0.633922 |
b9369c3d113f00c18f289bad60b797be2ceab3c3 | 3,842 | class Ykman < Formula
include Language::Python::Virtualenv
desc "Tool for managing your YubiKey configuration"
homepage "https://developers.yubico.com/yubikey-manager/"
url "https://developers.yubico.com/yubikey-manager/Releases/yubikey-manager-3.1.1.tar.gz"
sha256 "68ef41ac3cd2e891019e755a492427ecdd63d88165... | 39.204082 | 140 | 0.789172 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.