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 |
|---|---|---|---|---|---|
ed25416afefa6e1395bcca3758b7ffd62332e39d | 2,277 | #!/usr/bin/env ruby
require "spaceship"
require "fileutils"
require "yaml"
def format_review(review, add_language)
result = "### " + review["title"]
result += "\n\n"
rating = review["rating"]
for i in 1..5
if i <= rating
result += "★"
else
result += "☆"
... | 22.544554 | 72 | 0.59552 |
3964ef749419b1a776858785109952ba4f2842f8 | 433 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Network::Mgmt::V2020_07_01
module Models
#
# Defines values for CircuitConnectionStatus
#
module CircuitConnectionStatus
... | 24.055556 | 70 | 0.713626 |
6a4cd123340ec9028cc1b2df73001973082aea6b | 968 | ALL_SKILLS = [ 'Analytics', 'Biology', 'Biotech', 'Content', 'Data entry', 'Design', 'Funding', 'Localization', 'Manufacturing', 'Marketing', 'Medicine', 'Mechanics & Electronics', 'Operations', 'PM', 'QA', 'Social Media', 'Software', 'Volunteer vetting', 'Anything' ].freeze
ALL_AVAILABILITY = [ '1-2 hours a day', '2-4... | 31.225806 | 275 | 0.677686 |
03828ace322f6275900e08e70cbbaebc1518e74f | 318 | module SessionsHelper
def log_in(user)
session[:user_id] = user.id
end
def current_user
if session[:user_id]
@current_user ||= User.find_by(id: session[:user_id])
end
end
def admin_status
if current_user && current_user.is_admin == 1
return true
else
return false
end
end
end
| 15.9 | 59 | 0.679245 |
38ef9fef54f85f3c69ca8d4b9070cae5410c527b | 5,292 | require 'rails_helper'
RSpec.describe AuditsController, type: :controller do
let(:default_params) do
{ organization_id: @organization.to_param }
end
let(:valid_attributes) do
{
organization_id: @organization.id,
storage_location_id: create(:storage_location, organization: @organization).id,
... | 37.531915 | 122 | 0.656463 |
61c646172eac02a80e0f7b9fca6b0f37b23fb403 | 6,016 | #--
# Amazon Web Services EC2 Query API Ruby library
#
# Ruby Gem Name:: amazon-ec2
# Author:: Glenn Rempe (mailto:glenn@rempe.us)
# Copyright:: Copyright (c) 2007-2008 Glenn Rempe
# License:: Distributes under the same terms as Ruby
# Home:: http://github.com/grempe/amazon-ec2/tree/master
#++
require File... | 48.516129 | 117 | 0.744515 |
0186d6e1b6f1f5057162023d4dd8460904605817 | 119 | class PlanFeature < ActiveRecord::Base
belongs_to :plan
belongs_to :feature
include StripeSaas::PlanFeature
end
| 17 | 38 | 0.789916 |
ac033d447735efcbcb03a3cbcfa200ae5f0e553a | 948 | cask "vscodium" do
version "1.61.1"
sha256 "43b78afcefc90f8e63a03d6f9fd03565703211cf4096d812d1729ca0ed46392a"
url "https://github.com/VSCodium/vscodium/releases/download/#{version}/VSCodium.x64.#{version}.dmg"
name "VSCodium"
desc "Binary releases of VS Code without MS branding/telemetry/licensing"
homepag... | 37.92 | 146 | 0.754219 |
3921cd2bafb1e31878d206179b07fd3e481f42f9 | 4,871 | require 'active_record/migration/sql_helpers'
class CreateDatadicVariables < ActiveRecord::Migration[5.2]
include ActiveRecord::Migration::SqlHelpers
def change
create_table 'ref_data.datadic_variables' do |t|
t.string :study
t.string :source_name
t.string :source_type
t.string :domain
... | 38.054688 | 90 | 0.478957 |
b9e660d4850d73205e8d156ec7754dd5a747734b | 1,432 | require 'spec_helper'
require 'pdk/template/renderer/v1'
describe PDK::Template::Renderer::V1 do
let(:template_root) { '/some/path' }
let(:template_uri) { PDK::Util::TemplateURI.new(template_root) }
let(:pdk_context) { PDK::Context::None.new(nil) }
describe '.compatible?' do
subject(:compatible) { describ... | 34.926829 | 127 | 0.689246 |
d59b3782186813b80cdf20019f14ee7a3b5954bb | 1,324 | RSpec.describe PerseidsStatus::RequestMap do
describe '.from_hash' do
let(:config) { Factory.config }
subject(:request_map) { PerseidsStatus::RequestMap.from_hash(config) }
it 'converts the config hash to a flat list' do
results = []
request_map.each do |request|
results << [request... | 27.583333 | 77 | 0.603474 |
3323b64f741b2cca8828aa47b82daf006c28329b | 343 | # frozen_string_literal: true
FactoryBot.define do
factory :facebook_page, class: 'Channel::FacebookPage' do
sequence(:page_id) { |n| n }
sequence(:user_access_token) { |n| "random-token-#{n}" }
sequence(:name) { |n| "Facebook Page #{n}" }
sequence(:page_access_token) { |n| "page-access-token-#{n}" }... | 28.583333 | 65 | 0.655977 |
0354c71ce2e7cd0204a736f96e574559b2d0fa68 | 792 | cask "atext" do
version "2.40.5,122"
sha256 :no_check
url "https://www.trankynam.com/atext/downloads/aText.dmg"
name "aText"
desc "Tool to replace abbreviations while typing"
homepage "https://www.trankynam.com/atext/"
livecheck do
url "https://www.trankynam.com/atext/aText-Appcast.xml"
strategy... | 27.310345 | 71 | 0.712121 |
08360228592ae32009b7c53182b7367cf0e8cad3 | 45 | module Xray
VERSION = "0.3.2.1".freeze
end
| 11.25 | 28 | 0.666667 |
bb71d9b8f4152e3a3a0bb0bf4712ed35fb1981d0 | 1,542 | require 'method_decorators/decorators'
class User < ActiveRecord::Base
extend MethodDecorators
has_many :likes, dependent: :destroy
after_create :update_likes
validates :uid, presence: true
validates :nickname, presence: true, uniqueness: true
validates :provider, presence: true
validates :email, prese... | 24.09375 | 82 | 0.677043 |
08479b59a7a241cbf903936b12cedafdd1dda396 | 1,801 | class PromotionsController < ApplicationController
before_action :authenticate_user!, only: %i[index show new create update destroy
generate_coupons search]
before_action :set_promotion, only: %i[show generate_coupons
edit update... | 22.5125 | 82 | 0.671294 |
d51c7d376ec77e5e48f3886dd4a5b10727c1a6a9 | 1,015 | class Asset < ActiveRecord::Base
ASSETTYPE = ["Automobile",
"Bond",
"BridgeLoanNotDeposited",
"CashOnHand",
"CertificateOfDepositTimeDeposit",
"CheckingAccount",
"EarnestMoneyCashDeposi... | 39.038462 | 66 | 0.434483 |
6a098b7e1dea4f4ac877fdd3a6a631ab9878d43b | 1,060 | class BookController < ApplicationController
def list
@books = Book.all
end
def show
@book = Book.find(params[:id])
end
def new
@book = Book.new
@subjects = Subject.all
end
def create
@book = Book.new(book_params)
if @book.save
redirect_to :action => 'list'
else
... | 17.966102 | 76 | 0.624528 |
acbc032c1f0bfbe04f9f1d07c796e0a9067f2a25 | 872 | shared_examples 'Unidom::Geo::Concerns::AsRegion' do |model_attributes|
location_1_attribtues = {
longitude: 120.000000,
latitude: 31.000000,
postal_address: '#1 Some Street',
postal_code: '969696',
minimum_longitude: 119.000000,
minimum_latitude: 30.000... | 31.142857 | 131 | 0.644495 |
ac2b2010d133ef2849c7e57410871329db41218c | 90 | #\ -p 4567
require(File.expand_path("../lti_example", __FILE__))
run Sinatra::Application
| 22.5 | 53 | 0.744444 |
e262a6910c9d4b5fc0acd3736cb11e7cb73dacd6 | 6,115 | module Nexpose
# Object that represents a connection to a Nexpose Security Console.
#
# === Examples
# # Create a new Nexpose::Connection on the default port
# nsc = Connection.new('10.1.40.10', 'nxadmin', 'password')
#
# # Create a new Nexpose::Connection from a URI or "URI" String
# nsc = Conn... | 37.060606 | 115 | 0.647915 |
f715183db68909e728b41e88bb9c04621e1b931a | 390 | RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
DatabaseCleaner.strategy = :truncation
end
config.before(:each) do
DatabaseCleaner.start... | 17.727273 | 43 | 0.715385 |
7af809345bf4224606bdc1581109223bb8abbe9b | 1,047 | require 'test_helper'
class BulkUpdateRequestPrunerTest < ActiveSupport::TestCase
context '#warn_old' do
should "update the forum topic for a bulk update request" do
forum_topic = as(create(:user)) { create(:forum_topic) }
bur = create(:bulk_update_request, status: "pending", forum_topic: forum_topic... | 40.269231 | 145 | 0.730659 |
bf85ca1389912a8201703fa8667bbf3dfad2cad8 | 374 | # frozen_string_literal: true
module Thy
module Types
class Enum
def initialize(values)
@values = values
end
def check(value)
if @values.any? { |v| value == v }
Result::Success
else
Result::Failure.new("Expected #{value.inspect} to be one of: #{@valu... | 18.7 | 91 | 0.558824 |
62683c01052b2bdb12df891bba9145d9ecce6e0e | 710 | 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.515152 | 65 | 0.688732 |
1c9cafea210a119b12641bad8f12cce4affc432b | 1,951 | class OrdersController < ApplicationController
before_action :set_order, only: [:show, :edit, :update, :destroy]
# GET /orders
# GET /orders.json
def index
@orders = Order.all
end
# GET /orders/1
# GET /orders/1.json
def show
if params[:id].present?
@order = Order.find_by_id(params[:id... | 24.696203 | 102 | 0.655561 |
9182df4e4ecac1bb4851826856168e67e7a3fed6 | 874 | # frozen_string_literal: true
class User < ApplicationRecord
attr_accessor :login
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable, au... | 30.137931 | 81 | 0.721968 |
61f8934d03787c72eb9ab625eb0770de17977792 | 2,879 | class Jinja2Cli < Formula
include Language::Python::Virtualenv
desc "CLI for the Jinja2 templating language"
homepage "https://github.com/mattrobenolt/jinja2-cli"
url "https://files.pythonhosted.org/packages/23/67/6f05f5f8a9fc108c58e4eac9b9b7876b400985d33149fe2faa87a9ca502b/jinja2-cli-0.7.0.tar.gz"
sha256 "9... | 38.905405 | 140 | 0.715874 |
7958336e3512b9d506dad95f52f6ad2cf738e814 | 2,395 | require 'moromi/error/loggerable'
module Moromi
module Error
class DefaultLogger
include ::Moromi::Error::Loggerable
UNKNOWN = 'unknown'.freeze
def write(controller, status, title, exception, options, locals)
Moromi::Error.config.severity_mappings.each do |klass, severity|
i... | 33.263889 | 154 | 0.647182 |
e96446ddec5a8d555e5e2dce1db6772dd2225c5c | 4,616 | module Fog
module Compute
class ProfitBricks
class Real
# Update a group.
# Normally a PUT request would require that you pass all the attributes and values.
# In this implementation, you must supply the name, even if it isn't being changed.
# As a convenience, the other four... | 53.674419 | 106 | 0.541811 |
f7343a8704f76d861997d657363c4c6a2843aa54 | 248 | require File.dirname(__FILE__) + '/../../spec_helper'
describe "ByteArray#[]" do
it "returns the byte at index" do
s= "A92f"
b = s.data
a = []
0.upto(s.size-1) { |i| a << b[i].chr }
a.should == ["A", "9", "2", "f"]
end
end
| 20.666667 | 53 | 0.516129 |
182867be71067b0bc7ae72282306fa65624ad800 | 4,074 | # frozen_string_literal: true
require_relative '../../spec_helper'
require_relative '../../../lib/rley/lexical/token'
# Load the class under test
require_relative '../../../lib/rley/parser/error_reason'
module Rley # Open this namespace to avoid module qualifier prefixes
module Parser # Open this namespace to avoid... | 31.338462 | 75 | 0.618066 |
e9f02d78ddc3e82f02d0d8cc1f6cba0f7ce86579 | 12,892 | require 'test_helper'
class RemotePayuLatamTest < Test::Unit::TestCase
def setup
@gateway = PayuLatamGateway.new(fixtures(:payu_latam).update(payment_country: 'AR'))
@amount = 4000
@credit_card = credit_card('4097440000000004', verification_value: '444', first_name: 'APPROVED', last_name: '')
@decli... | 33.05641 | 154 | 0.684843 |
e2073c92a3d9bf4c6afd0f76e9b5cf606acedc31 | 13,719 | # frozen_string_literal: true
require 'active_support'
require 'active_support/core_ext/string/inflections'
require 'grape-swagger/endpoint/params_parser'
module Grape
class Endpoint
def content_types_for(target_class)
content_types = (target_class.content_types || {}).values
if content_types.empty... | 35.819843 | 119 | 0.660252 |
7ab2057927585d6719cc308a56ca33fb89cfad5c | 2,283 | # This is the main point of invocation for rendering a node within Adapt. It
# takes a design and a view template and merge them together for a complete page
# layout.
class NodeRenderer
# Initialize a new renderer.
def initialize(design, view_template, site, node)
@design = design
@view_template = view_t... | 27.506024 | 96 | 0.715287 |
629dc788fff7e9f0f824130ff2e7ac37bcc29398 | 1,366 | require "language/node"
class AwsCdk < Formula
desc "AWS Cloud Development Kit - framework for defining AWS infra as code"
homepage "https://github.com/aws/aws-cdk"
url "https://registry.npmjs.org/aws-cdk/-/aws-cdk-1.89.0.tgz"
sha256 "c40b09240f21cf9e70f92221661101efeaa4db4a411e421a1f177ad973084000"
license ... | 39.028571 | 122 | 0.751098 |
ac57bbda3f3abf199c370fdb51a20aaf0f01eaec | 744 | Pod::Spec.new do |s|
s.name = 'TestApp1'
s.version = '0.0.1'
s.summary = 'Application to test with sub apps'
s.description = <<-DESC
Application check for modules. It is app 1.
DESC
s.homepage = 'https://github.com/Marthitejasree/TestApp1.g... | 31 | 107 | 0.567204 |
610b6a19e49b929ed33ab641070c171e37a556b3 | 1,879 | require File.expand_path("../../Abstract/abstract-php-phar", __FILE__)
class Composer < AbstractPhpPhar
desc "Dependency Manager for PHP"
homepage "https://getcomposer.org"
url "https://getcomposer.org/download/1.6.2/composer.phar"
sha256 "6ec386528e64186dfe4e3a68a4be57992f931459209fd3d45dde64f5efb25276"
hea... | 38.346939 | 134 | 0.728047 |
030904c239604aa7b12d7783c2bae992e63599f9 | 2,337 | # MIT License
#
# Copyright (c) Sebastian Katzer 2017
#
# 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, me... | 35.409091 | 80 | 0.735131 |
ed7f60b0d55a84c0c75bb4b750ee69cc08f8b476 | 1,108 | require 'rails_helper'
require Rails.root.join('lib', 'tasks', 'hbx_import', 'broker', 'parsers', 'broker_parser')
describe Parser::BrokerParser do
before(:all) do
xml = Nokogiri::XML(File.open(Rails.root.join('spec', 'test_data', 'NewBrokerFile.xml')))
@brokers = Parser::BrokerParser.parse(xml.root.canonic... | 32.588235 | 93 | 0.686823 |
0363188fba500bca69fd7aa5e9dfaaf6c4fcd636 | 565 | 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)
Dotenv::Railtie.load
module CollabCont
class Application < Rails::Application
config.assets.precompile += %w( add_users_mo... | 31.388889 | 82 | 0.759292 |
e95b7d25467f12abcb7c97def8d7db794d8f67a0 | 409 | class CreatePagesAndFields< ActiveRecord::Migration<%= migration_version %>
def change
create_table :editable_pages do |t|
t.string :name
t.text :description
t.string :kind
t.timestamps
end
create_table :editable_fields do |t|
t.string :label
t.string :kind
t.text... | 22.722222 | 75 | 0.650367 |
e940ebfaf0a13333ab9ccfe566025eb3d12192a0 | 1,789 | # frozen_string_literal: true
module DiceBag
# This class abstracts access to configuration values, to be used within ERB
# templates. Currently, the values are read from the environment, as per the
# Twelve-Factor App principles.
class Configuration
def initialize
@prefixed = {}
end
# Retur... | 28.854839 | 100 | 0.665735 |
180045e6a8b464cd90aba523de0276f1997cd6dd | 5,439 |
require 'spec_helper'
describe 'VagrantPlugins::GuestAlpine::Cap::ChangeHostname' do
let(:described_class) do
VagrantPlugins::GuestAlpine::Plugin.components.guest_capabilities[:alpine].get(:change_host_name)
end
let(:machine) { double('machine') }
let(:communicator) { VagrantTests::DummyCommun... | 42.162791 | 105 | 0.576944 |
4acc10339289f4532942647d71aa6b1fe86f9aa9 | 136 | require 'sqlite3'
db = SQLite3::Database.new'Test_SQL.sqlite'
db.execute"INSERT INTO Cars (Name, Price) values('Opel', 4500)"
db.close
| 22.666667 | 63 | 0.742647 |
bfb6cfe024ffb9108ab10d83dc1907cb4ee45f4d | 324 | class CreateProxyDepositRights < ActiveRecord::Migration[4.2]
def change
create_table :proxy_deposit_rights do |t|
t.references :grantor
t.references :grantee
t.timestamps null: false
end
add_index :proxy_deposit_rights, :grantor_id
add_index :proxy_deposit_rights, :grantee_id
end
... | 27 | 61 | 0.737654 |
ede8ac2c686603700683105b7a7dfdcd4d22b456 | 2,842 | # frozen_string_literal: true
#
# Copyright:: 2021, Chef Software, 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 a... | 39.472222 | 202 | 0.701619 |
f8fdf9f7ac9b71a554376ad918588fa7b189b797 | 120 | class Disciplina < ActiveRecord::Base
has_many :oferecimentos
has_many :professores, :through => :oferecimentos
end
| 24 | 51 | 0.783333 |
79d713cd1e86156a48f23383b2613920e9088274 | 8,284 | class GetRecords < BaseCswModel
RESULT_TYPES = %w(results hits)
RESPONSE_ELEMENTS = %w(brief summary full)
attr_accessor :result_types
validate :validate_method
attr_accessor :result_type
validates :result_type, inclusion: {in: RESULT_TYPES, message: "Result type '%{value}' is not supported. Supported re... | 47.609195 | 214 | 0.678416 |
ed441411b825f3f747238d15657535c8c80bec35 | 1,200 | class PostsController < ApplicationController
# GET /posts/1
def show
post
@comment = Comment.new(post_id: params[:id])
@comments = @post.comments.reverse
end
# GET /posts/new
def new
@post = Post.new
end
# GET /posts/1/edit
def edit
post
end
# POST /posts
def create
@p... | 18.75 | 86 | 0.658333 |
ab413d0f7f7c3b7f2413627f85718f5546dba620 | 1,708 | #
# Author:: Daniel DeLeo (<dan@opscode.com>)
# Copyright:: Copyright (c) 2010 Opscode, 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
#
# h... | 28.466667 | 84 | 0.685597 |
26d73c2d8f487b51f489bbbf98a5d741c52bc68a | 446 | # frozen_string_literal: true
require 'spec_helper'
require 'vk/api/newsfeed/responses/get_banned_response'
RSpec.describe Vk::API::Newsfeed::Responses::GetBannedResponse do
subject(:model) { described_class }
it { is_expected.to be < Dry::Struct }
it { is_expected.to be < Vk::Schema::Response }
describe 'att... | 27.875 | 65 | 0.73991 |
91f93973d2bcbc019c2cce186b192aecdbf9d513 | 104 | # frozen_string_literal: true
require "omniauth-netlify/version"
require "omniauth/strategies/netlify"
| 20.8 | 37 | 0.826923 |
f8f3bbe7b05c2aa8b1b943508049fa08356c3673 | 6,135 | # frozen_string_literal: true
module Stupidedi
include Refinements
class Either
# @return [Boolean]
abstract :defined?
###########################################################################
# @group Filtering the Value
# @return [Either]
abstract :select, :args => %w(reason='select... | 21.010274 | 79 | 0.429666 |
d539b59cef1b406443e7de270ffb53361a893527 | 45 | Rails.application.config.token_expires = 3600 | 45 | 45 | 0.866667 |
0894b933f70a4570dd23486f6ca6c56d118a881e | 3,226 | require_relative './simplecov_helper'
require_relative './rspec_configuration'
require 'helpers/spec_helper_helpers'
require 'helpers/named_maps_helper'
require 'helpers/unique_names_helper'
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path(... | 28.052174 | 107 | 0.722877 |
266f68669efc8ac447eb59617bba668e2a45ae3a | 4,713 | # -*- coding: utf-8 -*-
#
# Cookbook Name:: sentry cookbook
# Definition:: sentry_conf
#
# Making sentry configuration file
#
# :copyright: (c) 2012 - 2013 by Alexandr Lispython (alex@obout.ru).
# :license: BSD, see LICENSE for more details.
# :github: http://github.com/Lispython/sentry-cookbook
#
class Chef::Recipe
... | 27.242775 | 111 | 0.662635 |
1cb1a6e9640c2e403cdeded47802a4851dfd8331 | 670 | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional ... | 47.857143 | 93 | 0.767164 |
1cb7c044cfbf4888b0db5113da419333abf2c681 | 16,985 | module Sequel
module Plugins
# The many_through_many plugin allow you to create an association using multiple join tables.
# For example, assume the following associations:
#
# Artist.many_to_many :albums
# Album.many_to_many :tags
#
# The many_through_many plugin would allow this:
... | 52.585139 | 354 | 0.637563 |
622b691723cabeedc9cf361dbd3773a2ab301b8d | 827 | class DeviseInvitableAddToUsers < ActiveRecord::Migration
def up
change_table :users do |t|
t.string :invitation_token
t.datetime :invitation_created_at
t.datetime :invitation_sent_at
t.datetime :invitation_accepted_at
t.integer :invitation_limit
t.referenc... | 33.08 | 98 | 0.683192 |
33f77f37c83e4ef6a3c449c59a1bb6804945c955 | 1,887 | module RequestSigning
module TestUtils
# Provides helpers for testing request signature verification integration
# Example:
# require 'rack/test'
# require 'request_signing'
# require 'request_signing/test_utils'
#
# class MyServerTest < Minitest::Test
# include Rack::Test:... | 33.696429 | 106 | 0.611023 |
38793953f37ca0d5eba086c971ab3fdc1eaaf75e | 1,965 | AlohaTest::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
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.acti... | 37.075472 | 104 | 0.76285 |
039ed3b27a7e950c8d7bb45293e382ca7564119c | 195 | require 'serverspec'
# Required by serverspec
set :backend, :exec
describe package('sysdig-dkms'), :if => os[:family] == 'debian' || os[:family] == 'ubuntu' do
it { should be_installed }
end
| 21.666667 | 93 | 0.671795 |
bf4bce81aa412c769db199946517f3a555c84c32 | 1,296 | # frozen_string_literal: true
$LOAD_PATH.push File.expand_path('lib', __dir__)
require 'doorkeeper/openid_connect/version'
Gem::Specification.new do |spec|
spec.name = 'doorkeeper-openid_connect'
spec.version = Doorkeeper::OpenidConnect::VERSION
spec.authors = ['Sam Dengler', 'Markus Koller... | 36 | 84 | 0.690586 |
91e757dc2ad4d6ef8cd018427f53667d50277edf | 1,667 | require_dependency 'spree/calculator'
module Spree
class Calculator::TieredPercent < Calculator
preference :base_percent, :decimal, default: 0
preference :tiers, :hash, default: {}
preference :currency, :string, default: -> { Spree::Config[:currency] }
before_validation do
# Convert tier value... | 27.783333 | 88 | 0.644871 |
e84b277907bf542ff02ab9641c50f0a0c1102834 | 4,047 | RAILS_ENV="test"
require 'test/unit'
require 'test/unit/ui/console/testrunner'
require "rubygems"
require "active_support"
ActiveSupport::Callbacks
require File.dirname(__FILE__) + "/../test_project/config/environment"
require File.dirname(__FILE__) + "/../lib/multidb_tester"
require 'spec'
require 'spec/rails'
requir... | 32.902439 | 115 | 0.76427 |
1cad2178c531cc69f11e9aaa2b67dcc1831dfa37 | 483 | # 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::Storage::Mgmt::V2019_06_01
module Models
#
# Defines values for PrivateEndpointConnectionProvisioningState
#
module PrivateE... | 25.421053 | 70 | 0.718427 |
08b00d07ac470188d25720d1eaaf167f3f766174 | 1,168 | # -*- encoding: utf-8 -*-
# stub: sawyer 0.7.0 ruby lib
Gem::Specification.new do |s|
s.name = "sawyer"
s.version = "0.7.0"
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib"]
s.authors = ["Rick Olson", "Wynn Netherland"]
s.... | 33.371429 | 109 | 0.620719 |
e9e953265522ccfaaa223a72af559997c40283a4 | 337 | json.array!(@tag_definitions) do |tag_definition|
json.extract! tag_definition, :id, :name, :description, :entity_type, :tag_type, :structure, :subjective, :unique, :tag_type_range_id, :tag_target, :virtual, :virtual_target, :dev_status, :dev_pertinence, :td_version_id
json.url tag_definition_url(tag_definition, fo... | 67.4 | 221 | 0.780415 |
f8b2fbb16b68a8a9dfe7114fd6a08bef74761ba2 | 7,296 | module Sequel
module Plugins
# The validation_helpers plugin contains instance method equivalents for most of the legacy
# class-level validations. The names and APIs are different, though. Example:
#
# class Album < Sequel::Model
# plugin :validation_helpers
# def validate
# ... | 46.177215 | 128 | 0.618284 |
7ac017501f1288958e49af4f1d4341fd8b2cb326 | 1,276 | # frozen_string_literal: true
class RegexpTest < Minitest::Test
def test_default
regexp = /abc/
assert_match regexp, 'abcde'
end
def test_braces
regexp = %r{abc}
assert_match regexp, 'abcde'
end
def test_braces_with_slashes
regexp = %r{a/b/c}
assert_match regexp, 'a/b/c/d/e'
en... | 16.571429 | 65 | 0.627743 |
f77f50ff198ca3abcdfdc0dc8ebee496ef694e12 | 355 | class FontAmaticSc < Formula
head "https://github.com/google/fonts/trunk/ofl/amaticsc", verified: "github.com/google/fonts/", using: :svn
desc "Amatic SC"
homepage "https://fonts.google.com/specimen/Amatic+SC"
def install
(share/"fonts").install "AmaticSC-Bold.ttf"
(share/"fonts").install "AmaticSC-Regu... | 29.583333 | 110 | 0.709859 |
33c4bf20c14ffd1f6b8419858ad5fdd2e7efc7b2 | 47 | module FidorApi
VERSION = '2.1.4'.freeze
end
| 11.75 | 26 | 0.702128 |
613aa255b9965181cfb121747e23c37eefa3f051 | 1,229 | # frozen_string_literal: true
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 28.581395 | 74 | 0.664768 |
ab67b95214bd0bc6182437fbbff470f10af2f83d | 121 | class AddUserIdToEvents < ActiveRecord::Migration[4.2]
def change
add_column :events, :user_id, :integer
end
end
| 20.166667 | 54 | 0.743802 |
1c4ddb01e79f3977085c8292cef8a02951dc0bf7 | 1,600 | #!/usr/bin/env ruby
require 'retrospectives'
require_relative '../utils/load_jira_auth.rb'
include Retrospectives
(0..2).each do |index|
if(ARGV[index].to_s.empty?)
puts("Usage: ruby #{__FILE__} sprint_index time_start time_end. Example :")
abort("\nruby #{__FILE__} 1 20170216 20170228")
end
end
# this ... | 30.769231 | 115 | 0.7525 |
5d1213161c22260dd39fb7983ab68a2a66b657a3 | 1,435 | # cookies_api
#
# This file was automatically generated by APIMATIC v2.0
# ( https://apimatic.io ).
module CookiesApi
# Asset linked to a managed brand.
class BrandAsset < BaseModel
SKIP = Object.new
private_constant :SKIP
# Rasterized asset.
# @return [RasterGraphic]
attr_accesso... | 23.52459 | 73 | 0.58676 |
ff8c085367305813e5596d74d9b9b30e57a64524 | 912 | require 'test_helper'
class MicropostsControllerTest < ActionDispatch::IntegrationTest
def setup
@micropost = microposts(:orange)
@user = users(:bryan)
end
test "should redirect create when not logged in" do
assert_no_difference 'Micropost.count' do
post microposts_path, params: { micropost: {... | 28.5 | 95 | 0.733553 |
792925ce4e60284c612b63555ccf906d3fd56809 | 88 | # :NODOC:
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end
| 17.6 | 44 | 0.772727 |
79862e607af4260aafc76dd79052e41b646a5a58 | 2,044 | # 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::MediaServices::Mgmt::V2018_07_01
module Models
#
# The class to specify one track property condition.
#
class FilterTrackPro... | 28.388889 | 75 | 0.537182 |
ab7223dd937c8f6b866a741e9450992b9421e5ab | 9,074 | class Payment < Ohm::Model
include ActiveModel::Conversion
include ActiveModel::Validations
extend ActiveModel::Naming
PAYMENT_TYPES = %w[
CASH
CHEQUE
POSTALORDER
]
PAYMENT_TYPES_FINANCE_BASIC = %w[
BANKTRANSFER
]
PAYMENT_TYPES_FINANCE_ADMIN = %w[
WORLDPAY_MISSED
]
PAYMENT_T... | 30.146179 | 246 | 0.705312 |
38cb80878a4f0d1dcb0a9d55a610354023075e36 | 2,363 | module Webcast
class Merged < UserSpecificModel
include Cache::CachedFeed
def initialize(uid, course_policy, term_yr, term_cd, ccn_list, options = {})
super(uid.nil? ? nil : uid.to_i, options)
@term_yr = term_yr.to_i unless term_yr.nil?
@term_cd = term_cd
@ccn_list = ccn_list
@o... | 28.817073 | 146 | 0.572154 |
e8dad9bb02136aacbb57103879765f8dfeb688b0 | 1,903 | class Telnet < Formula
desc "User interface to the TELNET protocol (built from macOS Sierra sources)"
homepage "https://opensource.apple.com/"
url "https://opensource.apple.com/tarballs/remote_cmds/remote_cmds-54.50.1.tar.gz"
sha256 "156ddec946c81af1cbbad5cc6e601135245f7300d134a239cda45ff5efd75930"
bottle do... | 34.6 | 93 | 0.739359 |
bfcedfd0becbf22566ee01d045c132a14b9cdc3b | 3,394 | # 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... | 38.568182 | 95 | 0.721273 |
7a77ee5f0f3db1f322382ce046c4443bbee70f3a | 17,045 | #-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
#
# 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 ... | 40.583333 | 136 | 0.67621 |
5dd8ae73a01dbf4239bc575f7d0b9e47b7384b18 | 5,248 | require 'uri'
class Munin
DUMMY_MUNIN_URL = 'http://munin.example.com/'
DUMMY_GRAPH_PATH = '/assets/dummy-graph-for-development.png'
class Error < StandardError; end
attr_accessor :service
def initialize (service = nil)
@service = service
end
def dummy?
Rails.env.development? && (service && ... | 20.743083 | 98 | 0.457317 |
f76d1de7ee7c5ded520ce09a92cf987b5988f65f | 641 | cask 'autopano-pro' do
version '4.2.3'
sha256 '07fb35d00fa7f8926e00ede0031ef1c56a6e0e89d1f3d7485b4fa00da765fb99'
url 'http://download.kolor.com/app/stable/macleopard'
name 'Autopano Pro'
homepage 'http://www.kolor.com/panorama-software-autopano-pro.html'
pkg "Autopano Pro #{version.major_minor}.pkg"
un... | 33.736842 | 75 | 0.599064 |
7aa7d861edfc603092078a127596cedf203ade65 | 88 | $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'app_market_scraper'
| 29.333333 | 58 | 0.761364 |
916a55a5bccd9c7a63bfd5baed3077f85948fa90 | 222 | project_path = File.dirname(__FILE__)
http_path = '/'
output_style = :compressed
sass_dir = 'content/style'
css_dir = 'output/style'
images_dir = 'content/static/images'
sass_options = {
:syntax => :scss
}
| 22.2 | 38 | 0.68018 |
1d5654a65cfa56de36b4e8533c1b7accbb6440bf | 3,976 | # encoding: utf-8
require 'set'
require 'forwardable'
require 'adamantium'
require 'equalizer'
require 'abstract_type'
require 'concord'
require 'lupo'
# Substation can be thought of as a domain level request router. It assumes
# that every usecase in your application has a name and is implemented in a
# dedicated c... | 35.81982 | 79 | 0.777666 |
f7b99ddbfd2c272d83be0bc5c6317daa6d219c28 | 8,950 | class Assay < ApplicationRecord
include Seek::Rdf::RdfGeneration
include Seek::Ontologies::AssayOntologyTypes
include Seek::Taggable
include Seek::ProjectHierarchies::ItemsProjectsExtension if Seek::Config.project_hierarchy_enabled
# needs to before acts_as_isa - otherwise auto_index=>false is overridden by ... | 33.773585 | 163 | 0.745698 |
262566f81de4bd5b346d8037c71fc4d4b5c12ea8 | 99 | # desc "Explaining what the task does"
# task :sgas_rails_middleware do
# # Task goes here
# end
| 19.8 | 38 | 0.717172 |
7ac604427d2cb24e265d3ac896125654d666a480 | 2,269 | module Elasticsearch
module Persistence
module Repository
# The default repository class, to be used either directly, or as a gateway in a custom repository class
#
# @example Standalone use
#
# repository = Elasticsearch::Persistence::Repository::Class.new
# # => #<El... | 31.513889 | 110 | 0.57955 |
6af0cfee54a291f8b4124d95b25771b4a80f7300 | 41 | module SimpleView
VERSION = "0.6.5"
end | 13.666667 | 19 | 0.707317 |
62c3742952ca8ac6cd2e8f542dbcb373e4935120 | 5,765 | require 'rails_helper'
RSpec.describe '/api/v1/widget/messages', type: :request do
let(:account) { create(:account) }
let(:web_widget) { create(:channel_widget, account: account) }
let(:contact) { create(:contact, account: account, email: nil) }
let(:contact_inbox) { create(:contact_inbox, contact: contact, in... | 44.689922 | 137 | 0.671292 |
d5131303ee76694d171c25047f150960d91a2892 | 1,241 | require 'spec_helper'
module Alf
describe AttrList, 'subset?' do
context 'when equal' do
let(:left){ AttrList[:id, :name] }
let(:right){ AttrList[:name, :id] }
it 'returns true if non proper' do
expect(left.subset?(right)).to be_truthy
end
it 'returns false if proper' do
... | 24.333333 | 54 | 0.592264 |
01bca6c5495f35f0d1688e9c8d0f9052d47efc80 | 617 | class TimelineEntry::WhitehallImportedEntry < ApplicationRecord
enum entry_type: {
archived: "archived",
document_updated: "document_updated",
fact_check_request: "fact_check_request",
fact_check_response: "fact_check_response",
first_created: "first_created",
imported_from_whitehall: "importe... | 26.826087 | 63 | 0.71637 |
b9dd1c7807d63f503917bcebde06967b2de82c80 | 1,937 | # frozen_string_literal: true
require 'spec_helper'
describe 'osquery::ubuntu' do
include_context 'converged recipe'
let(:node_attributes_extra) do
{}
end
let(:node_attributes) do
{
'osquery' => {
'version' => '2.3.0',
'packs' => %w[chefspec]
}
}.merge(node_attributes... | 22.788235 | 108 | 0.639133 |
39de9de8b970832b1bb99d4bc4873140c3b0750f | 23,565 | # frozen_string_literal: true
require 'cucumber/cli/profile_loader'
require 'cucumber/formatter/ansicolor'
require 'cucumber/glue/registry_and_more'
require 'cucumber/project_initializer'
require 'cucumber/core/test/result'
module Cucumber
module Cli
class Options
INDENT = ' ' * 53
# rubocop:disable... | 39.738617 | 193 | 0.59478 |
625194c37a8f4f360ab7bc29edf29e8f58f48b84 | 1,957 | class UsersController < ApplicationController
before_action :set_user, only: [:show, :edit, :update, :destroy]
before_action :authenticate_user!, except: [:show, :index]
load_and_authorize_resource
# GET /users
# GET /users.json
def index
@users = User.all
end
# GET /users/1
# GET /u... | 25.415584 | 89 | 0.621359 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.