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 |
|---|---|---|---|---|---|
1ddcea9207bedbb835931adbe697c4f0c2167c54 | 47 | module Linearly
VERSION = '0.1.4'.freeze
end
| 11.75 | 26 | 0.702128 |
aca0e9a0e38a645f0e0223b4e87d28cd4910d99e | 1,767 | class Idba < Formula
# cite Peng_2012: "https://doi.org/10.1093/bioinformatics/bts174"
desc "Iterative De Bruijn Graph De Novo Assembler for sequence assembly"
homepage "https://i.cs.hku.hk/~alse/hkubrg/projects/idba/"
url "https://github.com/loneknightpy/idba/archive/1.1.3.tar.gz"
sha256 "6b1746a29884f4fa17b... | 36.061224 | 117 | 0.712507 |
2615262e7a27d0fcadce875e3e963b9f23a37882 | 10,051 | require 'spec_helper'
require 'base64'
kube_apiserver_secure_port = 6443
describe 'Waiting for all pods to be ready' do
describe command("for i in {1..1200}; do if [ $(kubectl get pods --all-namespaces -o json | jq -r '.items[] | select(.status.phase != \"Running\" or ([ .status.conditions[] | select(.type == \"Re... | 39.727273 | 318 | 0.685006 |
bf2ac15a1ae587bddd25e946eeb04cadefe4ec4a | 1,141 | class SS::DownloadJobFile
include ActiveModel::Model
cattr_accessor(:root, instance_accessor: false) { "#{Rails.root}/private/download" }
attr_reader :user, :filename, :path
attr_accessor :in_file, :in_path
def initialize(user, filename)
@user = user
@filename = filename
id_path = format("%02d"... | 22.82 | 87 | 0.650307 |
333fb7d4c6a74aec445dfbb2f80664c97c5fe40a | 8,787 | require 'cases/helper'
require 'support/ddl_helper'
require 'support/schema_dumping_helper'
if ActiveRecord::Base.connection.supports_foreign_keys?
module ActiveRecord
class Migration
class ForeignKeyTest < ActiveRecord::TestCase
include DdlHelper
include SchemaDumpingHelper
class Rocket < Act... | 33.410646 | 143 | 0.680096 |
e95a8de7f959f4f672f80b5d0b723a775036ae3a | 1,119 | class Mdr < Formula
desc "Make diffs readable"
homepage "https://github.com/halffullheart/mdr"
url "https://github.com/halffullheart/mdr/archive/v1.0.1.tar.gz"
sha256 "103d52c47133a43cc7a6cb8a21bfabe2d6e35e222d5b675bc0c868699a127c67"
license "GPL-3.0"
bottle do
cellar :any_skip_relocation
sha256 "9... | 38.586207 | 93 | 0.795353 |
6217a7a5b982a58498c54ea59504c7735d244da8 | 980 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'shellwords/version'
Gem::Specification.new do |spec|
spec.name = "shellwords"
spec.version = Shellwords::VERSION
spec.authors = ["Lars Kanis"]
spec.email = ["... | 40.833333 | 144 | 0.672449 |
39a74d34e23fa094fec352d5d69cd263a2d0c678 | 1,811 | # 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 u... | 33.537037 | 77 | 0.669796 |
bf2e4aa71f7eccd0012cfd177c326000ca6bf311 | 1,483 | # (C) Copyright 2017 Hewlett Packard Enterprise Development LP
#
# 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... | 40.081081 | 95 | 0.697235 |
015415b0258dd00e0d60e1c565b2122cdc2500e9 | 3,400 | #
# Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA
#
# 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 applic... | 31.775701 | 102 | 0.569706 |
62b3d5161093a15da547bdb65e72059fa95f6942 | 1,650 | require 'spec_helper'
describe Cnab240::V87::Pagamentos::Header do
it "deve conter campos header" do
header = Cnab240::V87::Pagamentos::Header.new
header.should respond_to(:controle_banco)
header.should respond_to(:controle_lote)
header.should respond_to(:controle_registro)
header.should respo... | 33 | 57 | 0.773939 |
bfa2a809dd7d7fd472990b00d6f38c8948fd36ce | 4,482 | require File.expand_path('../boot', __FILE__)
require 'rails/all'
require 'devise'
I18n.config.enforce_available_locales = false
Bundler.require(:default, Rails.env)
module Gitlab
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Applicat... | 42.283019 | 117 | 0.677822 |
e20bca437b8c9583c675e4362a2863b1ddcf5c32 | 3,355 | require File.dirname(__FILE__) + '/test_helper.rb'
class TestImg < Test::Unit::TestCase
def setup
return unless $dirname.nil?
$dirname = File.dirname(__FILE__)
$bytes888 = []
$bytes8888 = []
$bytes8888rev = []
$bytes565 = []
$bytes4444 = []
$bytes5551 = []
512.times do |y|
... | 28.922414 | 84 | 0.559463 |
d5cf9e0d53aca4d2180363f4492b518bc6218854 | 798 | # frozen_string_literal: true
# rubocop:disable Style/Documentation
# rubocop:disable Metrics/LineLength
module Gitlab
module BackgroundMigration
class AddMergeRequestDiffCommitsCount
class MergeRequestDiff < ActiveRecord::Base
self.table_name = 'merge_request_diffs'
end
def perform(st... | 29.555556 | 100 | 0.695489 |
1dfc58763a7c0d7ca3ccb45eeae7e32d144d01c9 | 4,528 | =begin
#Fatture in Cloud API v2 - API Reference
#Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol.
The vers... | 37.421488 | 261 | 0.746246 |
1c1fd46aed5abdda0abb58aad87ee2c29d92d7a1 | 735 | # A module to produce resources for a Garry's Mod server
class GarrysMod
attr_reader :name, :app_id, :friendly_name
def initialize
@name = "gmod"
@app_id = "4020"
@friendly_name = "Garry's Mod" #TODO: Add friendly name to all server objects
end
def launch(install_path, map = "gm_construct", players... | 28.269231 | 92 | 0.67483 |
e850ace3e79a1187ef895db1b3d1bc74451b87d5 | 3,384 | require 'spec_helper'
describe Restforce::Concerns::Authentication do
describe '.authenticate!' do
subject(:authenticate!) { client.authenticate! }
context 'when there is no authentication middleware' do
before do
client.stub authentication_middleware: nil
end
it "raises an error"... | 25.066667 | 86 | 0.624704 |
b96eaab0927f4487729a1f7010ba4f11de698523 | 447 | cask 'localizationeditor' do
version '2.3'
sha256 'a3b6914ec001effd1d74a8de28550dd475d3168f9487ef8d479503cedd60779c'
url "https://github.com/igorkulman/iOSLocalizationEditor/releases/download/v#{version}/LocalizationEditor.app.zip"
appcast 'https://github.com/igorkulman/iOSLocalizationEditor/releases.atom'
n... | 37.25 | 116 | 0.816555 |
e807ffa4470f78f4ef3c1d28d7164d113c90a9d1 | 211 | $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
require 'foo'
require 'test/unit/assertions'
require 'test/unit/assertions'
World do |world|
world.extend(Test::Unit::Assertions)
world
end
| 15.071429 | 57 | 0.696682 |
26c855204b05e48ef77a0dc15fcbd2ceb6537790 | 1,233 | =begin
#Accounting API
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 2.1.3
Contact: api@xero.com
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.3.0
=end
require 'spec_helper'
require 'json'
... | 25.6875 | 107 | 0.736415 |
38f19120d00b669f9970ea31e39b6bc003723808 | 4,080 | # frozen_string_literal: true
RSpec.describe 'extractor/type' do
include_context 'clean-up builder'
include_context 'duh common'
before(:all) do
RgGen.enable(:bit_field, :type)
end
it '\'access\'/\'modifiedWriteValue\'/\'readAction\'/\'reserved\'を取り出してbit_field階層の\'type\'とする' do
duh = <<~'DUH'
... | 36.428571 | 100 | 0.472794 |
28ce1eb5e00467e2e3c86e377319761b7d4c45ad | 162 | Copy the last part of a file.
{[Spec]}[http://pubs.opengroup.org/onlinepubs/9699919799/utilities/tail.html]
(file, options={})
--
execute 'tail', file, options | 27 | 77 | 0.716049 |
bf166bd4834abd570e5614065c8bb0830d95f83a | 1,675 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web serv... | 37.222222 | 85 | 0.773731 |
219adf55ebe8da0c27f19a726f549b55760afe70 | 3,630 | require "rails_helper"
RSpec.describe "Notifications page", :with_stubbed_antivirus, :with_stubbed_notify, type: :request do
context "when signed in as a poison centre user but accessing from submit domain", with_errors_rendered: true do
let(:responsible_person) { create(:responsible_person) }
before do
... | 35.242718 | 217 | 0.693664 |
33ba0ddcddf9b015d37869902b7fd08ffec650bc | 31,584 | require 'digest/md5'
require 'cgi'
require 'etc'
require 'uri'
require 'fileutils'
require 'enumerator'
require 'pathname'
require 'puppet/parameter/boolean'
require 'puppet/util/diff'
require 'puppet/util/checksums'
require 'puppet/util/backups'
require 'puppet/util/symbolic_file_mode'
Puppet::Type.newtype(:file) do
... | 33.815846 | 155 | 0.670656 |
4a1a712d6edbf02b97252cd056d08b3dca442407 | 1,259 | # frozen_string_literal: true
require "spec_helper"
require "generators/graphql/object_generator"
class GraphQLGeneratorsObjectGeneratorTest < BaseGeneratorTest
tests Graphql::Generators::ObjectGenerator
test "it generates fields with types" do
commands = [
# GraphQL-style:
["Bird", "wingspan:Int!... | 25.693878 | 70 | 0.693407 |
794291e39d57945071dac67c11b301087e96c2c4 | 298 | require 'test_helper'
class AssignmentTest < ActiveSupport::TestCase
def setup
@assignment = assignments(:one)
end
test "should be valid" do
assert @assignment.valid?
end
test "date should be present" do
@assignment.due_at = nil
assert_not @assignment.valid?
end
end
| 17.529412 | 46 | 0.708054 |
e9b43cd0589d37850e21ae858d5445b12c14913a | 791 | require "test_helper"
module Whitespace
describe Counter do
before do
@counter = Counter.new
end
it "is initially 0" do
expect(@counter.to_int).must_equal 0
end
describe "#increment" do
it "increases its value by 1" do
@counter.increment
expect(@counter.to_int... | 20.815789 | 67 | 0.616941 |
8734ed087cb001d887810b2287ab3f7183d87531 | 1,514 | # frozen_string_literal: true
require "spec_helper"
require "tempfile"
RSpec.describe ReciteCSV::Reader::Core do
let(:dummy_class) do
Class.new do
include ReciteCSV::Reader::Core
const_set(:Row, Class.new(ReciteCSV::Row::Base))
const_set(:DEFAULT_CSV_OPTIONS, headers: :first_row)
end
end... | 21.323944 | 58 | 0.585865 |
21f5b2f50400f3b72fd328c2faf66ca7e2a7790c | 4,558 | # frozen_string_literal: true
# inspired https://github.com/opentracing-contrib/ruby-rack-tracer/blob/master/lib/rack/tracer.rb
module JCW
module Rack
class Tracer
REQUEST_URI = "REQUEST_URI"
REQUEST_PATH = "REQUEST_PATH"
REQUEST_METHOD = "REQUEST_METHOD"
# Create a new Rack Tracer middl... | 32.557143 | 99 | 0.604212 |
260639ca2be97f0f3bebe8673368773de3745545 | 121 | class OffsitePaymentsLatipay
require 'offsite_payments'
require_relative 'offsite_payments/integrations/latipay'
end
| 24.2 | 58 | 0.859504 |
790c864e919d68284603ca38708f1da88cba09e7 | 205 | if ENV['CI'] == 'true'
require 'simplecov'
require 'codecov'
SimpleCov.formatter = SimpleCov::Formatter::Codecov
SimpleCov.start do
add_filter '/spec/'
end
end
require 'rspec'
require 'hss'
| 17.083333 | 53 | 0.692683 |
ab0b2c260440ed71bddc15251f1348d4fda2e0a2 | 1,719 | include Chef::Mixin::ShellOut
def whyrun_supported?
true
end
action :run do
converge_by("Sync #{@new_resource.name}") do
source = @new_resource.source.entries[0]
source = alias_provider(*source)
source = download_source_package(*source)
dest = @new_resource.dest.entries[0]
dest = alias_p... | 20.710843 | 107 | 0.648633 |
ffd18e54824a91c7b9f2a71a549ef748f15910ff | 1,425 | require 'rails_helper'
RSpec.describe Api::V1::SessionsController, type: :controller do
fixtures :all
describe "POST /" do
describe "when invalid credentials" do
it "should answer status :unauthorized" do
post :create, params: { email: 'invalid@email', password: '123' }
expect(response).... | 25.909091 | 73 | 0.612632 |
6a8da7d9c915c73942d253ad0de577e6da79bbde | 2,223 | class Gws::Survey::ReadablesController < ApplicationController
include Gws::BaseFilter
include Gws::CrudFilter
before_action :set_categories
before_action :set_category
before_action :set_search_params
before_action :set_items
before_action :set_item, only: [:show]
model Gws::Survey::Form
navi_view... | 26.464286 | 110 | 0.671165 |
edd0b5db8e2cfa9e276dd53b503cf5b8af9cf017 | 4,230 | require 'spec_helper'
describe User do
before(:each) do
@attr = {
:email => 'railskitchensink@recursive-design.com',
:password => '123456',
:password_confirmation => '123456'
}
end
it 'should create a new instance given valid attributes' do
User.create!(@attr)
end
describe 'e... | 26.772152 | 91 | 0.64208 |
39a5f439aad7262f4d365395c5cd450aa3e73e5e | 516 | unified_mode true
property :mime_magic_file, String,
default: lazy { default_mime_magic_file },
description: 'The location of the mime magic file
Defaults to platform specific locations, see libraries/helpers.rb'
action :create do
template ::File.join(apache_dir, 'mods-available', 'mime_magic.conf... | 27.157895 | 74 | 0.753876 |
b9764c8a27b67ea1b74f284af709b1add37c91eb | 2,613 | require 'docker'
require_relative '../docker_operations'
require_relative '../build/qa'
require_relative '../build/check'
require_relative '../build/info'
require_relative '../build/gitlab_image'
require_relative '../build/qa_image'
require_relative '../build/qa_trigger'
require_relative '../build/ha_validate'
require_... | 30.383721 | 108 | 0.703023 |
1af50427bd21db020379d62a44a71581654514e0 | 5,559 | ##########################GO-LICENSE-START################################
# Copyright 2014 ThoughtWorks, 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/li... | 38.075342 | 180 | 0.717395 |
21541ef51bf224d689998736e8eb712fe1f0bb3e | 1,530 | require 'sprockets/autoload'
module Sprockets
# Public: YUI compressor.
#
# To accept the default options
#
# environment.register_bundle_processor 'application/javascript',
# Sprockets::YUICompressor
#
# Or to pass options to the YUI::JavaScriptCompressor class.
#
# environment.regis... | 23.181818 | 74 | 0.621569 |
7afbf25cd49470ccab84facd2243fc708aca2e98 | 6,186 | FactoryGirl.define do
factory :plan do
sequence(:hbx_id) { |n| n + 12345 }
sequence(:name) { |n| "BlueChoice Silver#{n} 2,000" }
abbrev "BC Silver $2k"
sequence(:hios_id, (10..99).cycle) { |n| "41842DC04000#{n}-01" }
active_year { TimeKeeper.date_of_record.year }
... | 31.242424 | 115 | 0.634012 |
4a6e31e1a4fb82e068efd46bff05a5ddbffb09ba | 743 | Pod::Spec.new do |s|
s.name = "ExytePopupView"
s.version = "1.0.1"
s.summary = "SwiftUI library for toasts and popups"
s.homepage = 'https://github.com/exyte/PopupView.git'
s.license = 'MIT'
s.author = { 'Exyte' => 'info@exyte.com' }
s.source ... | 27.518519 | 99 | 0.567968 |
ac85efb61b38e698eaa972d2b86382bc86c2c7f6 | 110 | require 'terminal-table'
require 'percheron/formatters/stack'
module Percheron
module Formatters
end
end
| 13.75 | 36 | 0.8 |
1dfbd8e3419fbee2abd0da968b7c796f71288bd4 | 66,640 | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 61.76089 | 160 | 0.677506 |
f7f10808705de7a83aed9574f62f5ae8586af361 | 337 | class CreateComments < ActiveRecord::Migration[6.0]
def change
create_table :comments do |t|
t.text :body
t.references :commented_ticket, references: :tickets, foreign_key: { to_table: :tickets }
t.references :commenter, references: :users, foreign_key: { to_table: :users }
t.timestamps
... | 28.083333 | 95 | 0.688427 |
8772b398b6d972acdafff9b1793c022845b5510c | 1,382 | # frozen_string_literal: true
class DeviseCreateAdmins < ActiveRecord::Migration[6.1]
def change
create_table :admins do |t|
## Database authenticatable
t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""
## Recoverable
t.st... | 31.409091 | 102 | 0.664255 |
ffd31f8d7b73e1bd842706cd32351f2ee19117fb | 2,349 | # frozen_string_literal: true
module QA
module Page
module Component
module Wiki
extend QA::Page::PageConcern
def self.included(base)
super
base.view 'app/views/shared/wikis/show.html.haml' do
element :wiki_page_title
element :edit_page_button
... | 26.1 | 78 | 0.598978 |
870cc443815abc7871eb9ecc76615167694ee850 | 550 | module OpenBD
class Contributor
attr_reader :source
ROLE_MAP = {
"A01" => "著者",
"B06" => "翻訳者"
}.freeze
def initialize(source)
@source = source
end
def description
source.dig("BiographicalNote")
end
def kana_name
source.dig("PersonName", "collationkey"... | 14.864865 | 49 | 0.569091 |
1a93e41bca01e2e35c5ce7a897ec0b2a605ee55a | 7,939 | =begin
#The Plaid API
#The Plaid REST API. Please see https://plaid.com/docs/api for more details.
The version of the OpenAPI document: 2020-09-14_1.64.13
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 5.1.0
=end
require 'date'
require 'time'
module Plaid
# An optional object to filter ... | 34.072961 | 716 | 0.649956 |
91a0cf51d78704d5c72580dd4f6739da91fe493a | 41,043 | require 'adwords4r/v201003/BidLandscapeService'
require 'soap/mapping'
module AdWords; module V201003; module BidLandscapeService
module DefaultMappingRegistry
EncodedRegistry = ::SOAP::Mapping::EncodedRegistry.new
LiteralRegistry = ::SOAP::Mapping::LiteralRegistry.new
NsV201003 = "https://adwords.google.com/ap... | 42.797706 | 122 | 0.652121 |
3937588ea6b02c980cd0b1ebd817682d67cdc21c | 605 | 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 Phuonghoang713chat
class Application < Rails::Application
# Initialize configuration defaults for originally genera... | 31.842105 | 82 | 0.770248 |
bb3f0e942a553076590665e818166322296ebfef | 703 | # frozen_string_literal: true
require 'maxmind/geoip2/record/location'
module Minfraud
module Model
# Model of the GeoIP2 location information, including the local time.
class GeoIP2Location < MaxMind::GeoIP2::Record::Location
# The date and time of the transaction in the time zone associated with
... | 27.038462 | 77 | 0.674253 |
38fb405e3547bc57730fe57d03293f698f9952fc | 8,521 | # Utility methods used for versioning projects for various kinds of packaging
module Pkg::Util::Version
class << self
GIT = Pkg::Util::Tool::GIT
def git_co(ref)
Pkg::Util.in_project_root do
%x{#{GIT} reset --hard ; #{GIT} checkout #{ref}}
$?.success? or fail "Could not checkout #{ref}... | 30.873188 | 136 | 0.608966 |
d59bd80408294d3febcffcda958d37e9dc3c9bf2 | 125 | FactoryGirl.define do
factory :book_author do
book_id Faker::Number.digit
author_id Faker::Number.digit
end
end
| 15.625 | 33 | 0.744 |
61f52033f8afc247557b08d2b70085e3c93f9c0d | 770 | #
# Cookbook:: django
# Recipe:: startproject
#
# Copyright:: 2017, The Authors, All Rights Reserved.
project_name = node.default['django']['project_name']
env = node.default['django']['env']
# Create the environment directory
directory "#{env}/#{project_name}/#{project_name}" do
recursive true
end
# Add manage.p... | 26.551724 | 72 | 0.685714 |
6aa7bc43a8bd160d2a2b4b40fb54f81c961f7308 | 1,297 | class WikiPageVersion < ApplicationRecord
array_attribute :other_names
belongs_to :wiki_page
belongs_to_updater
user_status_counter :wiki_edit_count, foreign_key: :updater_id
belongs_to :artist, optional: true
delegate :visible?, :to => :wiki_page
extend Memoist
module SearchMethods
def for_user(u... | 23.581818 | 97 | 0.666924 |
7af54d9791c70c6b03848bd17312f32d32da74a3 | 6,585 | # Copyright 2016 Google Inc. 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 36.381215 | 127 | 0.686409 |
e2b1b332a0e674fce1e63b094d6bb9ca7d128341 | 4,550 | # encoding: UTF-8
#
# Copyright (c) 2015 by Chris Schlaeger <chris@taskjuggler.org>
#
# MIT License
#
# 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 ... | 29.166667 | 76 | 0.663736 |
6279f0946063f23ece78234147eefe124ff0c15e | 1,178 | class FontBitstreamVera < Formula
version "1.10"
sha256 "1b0ba0f7af2e1d05f64e259d351965a2cb2673104a057ce715a06969c478f6cc"
url "https://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/#{version}/ttf-bitstream-vera-#{version}.zip"
desc "Bitstream Vera"
homepage "https://www.gnome.org/fonts/"
def install
... | 51.217391 | 111 | 0.698642 |
4ac68bea7a7807d2c249a2591d821d13e153ae8c | 10,725 | # frozen_string_literal: true
# Represents an assessment in Coursemology, as well as the enclosing module for associated models.
#
# An assessment is a collection of questions that can be asked.
class Course::Assessment < ApplicationRecord
acts_as_lesson_plan_item has_todo: true
acts_as_conditional
has_one_folder... | 37.897527 | 108 | 0.728671 |
381bbe3db3787769120ee17d155e703e171db434 | 156 | require File.expand_path('../../../../spec_helper', __FILE__)
describe "CGI::Util#escape_element" do
it "needs to be reviewed for spec completeness"
end
| 26 | 61 | 0.724359 |
ed0fb3631b761bb2d5d3eadc99ff04c9877e185c | 2,603 | require 'api/lib/restresource'
require 'api/lib/restresource_tags'
require 'api/resources/polls/polls.objects'
require 'api/resources/polls/votes.rest'
module MojuraAPI
class PollsResource < RestResource
def name
'Polls'
end
def description
'Resource of polls'
end
def all(params)
params[:pagesi... | 26.292929 | 123 | 0.699577 |
615f53268e11ef1865876e8049041e3976b2f457 | 379 | cask 'lacona' do
version '0.3'
sha256 'e45fb6f855ffca635b96f79bdc262d46d1e384157163694f8686c29095c5e450'
url "http://lacona-download.firebaseapp.com/packages/#{version}/LaconaBeta.zip"
name 'Lacona'
homepage 'http://www.lacona.io'
license :unknown # TODO: change license and remove this comment; ':unknown' ... | 31.583333 | 112 | 0.765172 |
1c80155860ff66b8f85f3a99f76e87e92102cf33 | 2,213 | # encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# This class represents a set of metrics that were recorded during a single
# transaction. Since the name of the transaction is not known until its... | 33.029851 | 93 | 0.646182 |
5d89377303229cacd4fbf6bd6860cd4e15ccf36a | 5,815 | namespace :radiant do
namespace :extensions do
namespace :ratings do
desc "Single task to install and update the ratings extension"
task :install => [:environment, :migrate, 'update:all']
desc "Single task to uninstall the ratings extension"
task :uninstall => :environment do
if c... | 42.137681 | 191 | 0.601032 |
ff0c1ca01716a29855a8c74afd58e0d99a296046 | 172 | require 'checkout_system/product'
require 'checkout_system/promotion_rule'
require 'checkout_system/checkout'
module CheckoutSystem
class Error < StandardError; end
end
| 21.5 | 40 | 0.837209 |
62ce8b492d6a4483d6230241fbac069fe72bbff7 | 68 | module OpsWorks
module CLI
VERSION = '0.7.1'.freeze
end
end
| 11.333333 | 28 | 0.661765 |
330ff1852de8d1b90efef4f0db63f25d9ee4e1ec | 238 | class CreateLessons < ActiveRecord::Migration[5.0]
def change
create_table :lessons do |t|
t.string :title
t.string :video_url
t.string :description
t.boolean :published
t.timestamps
end
end
end
| 18.307692 | 50 | 0.651261 |
619cd3ae363da91b75bc3b26290d9b86be2fe5c6 | 1,144 | require 'test_helper'
class ChirpyTest < Test::Unit::TestCase
@@root = "http://twitter.com/"
context "Class methods" do
should "request the public timeline URL" do
assert_equal @@root + "statuses/public_timeline.xml", Chirpy.public_timeline.url
end
should "request the test URL" do
a... | 30.918919 | 120 | 0.674825 |
33e985ac1cd26e5319e73a815f22f35f6212ae06 | 89 | # desc "Explaining what the task does"
# task :healthcheck do
# # Task goes here
# end
| 17.8 | 38 | 0.685393 |
21d4afff9c279307447b83e0f4a4a9bda5262d44 | 712 | require 'json'
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
Pod::Spec.new do |s|
s.name = 'react-native-camera'
s.version = package['version']
s.summary = package['description']
s.description = package['description']
s.license = package['license']
s... | 30.956522 | 115 | 0.601124 |
91d21cfd8472fd5245775d607600c55e728f0688 | 1,160 | #
# Be sure to run `pod lib lint DLCommonTool.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'DLComm... | 35.151515 | 109 | 0.627586 |
11127fb382a2c080228c4ba17bed92f2049bd106 | 3,263 | #!/usr/bin/ruby -w
# -*- ruby -*-
require 'riel/text'
#
# = string.rb
#
# RIEL extensions to the Ruby String class.
#
# Author:: Jeff Pace <jpace@incava.org>
# Documentation:: Author
#
class String
#
# Returns whether the string ends with the given substring.
#
def ends_with(substr)
return rindex(substr... | 25.896825 | 107 | 0.539994 |
281fab0b869396661f322a91492c82c0a1af1a06 | 4,780 | # Cloud Foundry Java Buildpack
# Copyright 2013-2017 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
#
# Un... | 38.548387 | 120 | 0.755858 |
790e03718650c03fcb8d2ea4f3e4674effb64964 | 21,929 | # assert_select plugins for Rails
#
# Copyright (c) 2006 Assaf Arkin, under Creative Commons Attribution and/or MIT License
# Developed for http://co.mments.com
# Code and documention: http://labnotes.org
unless defined?(RAILS_ROOT)
RAILS_ROOT = ENV["RAILS_ROOT"]
end
require File.join(RAILS_ROOT, "test", "test_helpe... | 32.296024 | 117 | 0.626476 |
e29bcb225e3166a33ed1abffa79715cecedede4e | 586 | require 'cancancan'
require 'kaminari'
require 'jquery-rails'
require 'carrierwave'
require 'mini_magick'
require 'closure_tree'
require 'optimadmin/presenter_methods'
module Optimadmin
class Engine < ::Rails::Engine
config.generators do |g|
g.test_framework :rspec, fixture: false
g.fixture_replaceme... | 24.416667 | 67 | 0.728669 |
abe598077bd782fc70dd6e71bdeabaaa192ea3ab | 2,605 | # Copyright © 2011 MUSC Foundation for Research Development
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list of c... | 38.880597 | 145 | 0.758157 |
1de8cdb2887f3c79f08e6b6bc59a7525e842f292 | 1,122 | # frozen_string_literal: true
class BlueprintsBoy::BlueprintBuilder
def initialize(blueprint, environment, strategy, options)
@environment = environment
@name = blueprint.name
@factory = blueprint.factory_class
@options = options
@attributes = normalize_attributes(blueprint).merge(options)
... | 31.166667 | 132 | 0.704991 |
3876a656ee7c0dd38d306340e0fa46bd10556b23 | 5,023 | require 'open3'
require 'fileutils'
require 'socket'
require 'capybara'
require 'selenium-webdriver'
require 'capybara/webmock/version'
require 'capybara/webmock/proxy'
require 'capybara/webmock/proxied_request'
module Capybara
module Webmock
class << self
attr_accessor :port_number, :pid_file, :kill_timeo... | 26.718085 | 107 | 0.609795 |
91eaff9fecf57b0b30fbe759015104fa3e0f3141 | 912 | class N < Formula
desc "Node version management"
homepage "https://github.com/tj/n"
url "https://github.com/tj/n/archive/v7.0.1.tar.gz"
sha256 "33d210287c7a3752135560f743cdc2d944048986f757c3ac1db6e738e01b7ebf"
license "MIT"
head "https://github.com/tj/n.git"
bottle do
sha256 cellar: :any_skip_relocat... | 36.48 | 122 | 0.769737 |
21a73da086dbdc2a1a7ea477cee56a140a7278b6 | 4,925 | require 'date'
require File.expand_path('../../../spec_helper', __FILE__)
describe "Date#strptime" do
it "returns January 1, 4713 BCE when given no arguments" do
Date.strptime.should == Date.civil(-4712, 1, 1)
end
it "uses the default format when not given a date format" do
Date.strptime("2000-04-06").... | 32.833333 | 112 | 0.614822 |
abe6bf8727f63b7d3f38c89a3c55f8fe97f28684 | 366 | cask 'mountain-duck' do
version '3.3.4.15443'
sha256 '6bfc4235ae7a1e7c8c7901eb0499d78dce0df07cacbd5b952743c9016b6e2703'
url "https://dist.mountainduck.io/Mountain%20Duck-#{version}.zip"
appcast "https://version.mountainduck.io/#{version.major}/macos/changelog.rss"
name 'Mountain Duck'
homepage 'https://mou... | 30.5 | 80 | 0.762295 |
1a5285dba7efd774086b0bfa8168e53fc01c57d3 | 877 | require 'spec_helper'
feature 'Add an attached file' do
let(:user) { create(:user) }
let!(:work) { create(:work, user: user) }
before do
sign_in user
# stub out characterization. Travis doesn't have fits installed, and it's not relevant to the test.
allow(CharacterizeJob).to receive(:perform_later)
... | 29.233333 | 105 | 0.692132 |
4aacb8f3c86d607dacaca26dab785cf850add17f | 5,283 | require 'test/unit'
require 'marc'
require 'xmlsimple'
def xml_cmp a, b
eq_all_but_zero = Object.new.instance_eval do
def ==(other)
Integer(other) == 0 ? false : true
end
self
end
a = XmlSimple.xml_in(a.to_s, 'normalisespace' => eq_all_but_zero)
b = XmlSimple.xml_... | 33.865385 | 326 | 0.631081 |
035e1faea1db342908f1e77c18ad232652b17a07 | 1,040 | require 'spec_helper.rb'
describe 'rkhunter' do
context 'supported operating systems' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
# config is a private class called by init.
#
context 'with default parameters' do
it { i... | 32.5 | 102 | 0.560577 |
f7615ef86664feb5b6a1460eb4549f818c4a731d | 453 | cask "haroopad" do
version "0.13.2"
sha256 "97ef0a7df52daeace17ea01a1ca82dc974955c147593f251fb7c04ca0ff09064"
# bitbucket.org/rhiokim/haroopad-download/ was verified as official when first introduced to the cask
url "https://bitbucket.org/rhiokim/haroopad-download/downloads/Haroopad-v#{version}-x64.dmg"
name... | 32.357143 | 103 | 0.774834 |
bb2876f067be59ea6d20e83ac702f29a28ce389e | 131 | class Player
attr_accessor :pieces, :name, :color
def initialize(args)
@name = args[:name]
@color = args[:color]
end
end
| 14.555556 | 37 | 0.671756 |
d562bf2480a0c46bc3491fade7c84377031db941 | 4,247 | require 'fog/compute/models/server'
module Fog
module Compute
class Fogdocker
# fog server is a docker container
class Server < Fog::Compute::Server
identity :id
attr_accessor :info
attribute :name
attribute :created
attribute :path
attribute :args
... | 31 | 129 | 0.506004 |
038e4623f3c9a43d77d41858554b894e060be24c | 333 | require 'mxx_ru/cpp'
require 'restinio/asio_helper.rb'
MxxRu::Cpp::exe_target {
target 'sample.hello_world_sendfile'
RestinioAsioHelper.attach_propper_asio( self )
required_prj 'nodejs/http_parser_mxxru/prj.rb'
required_prj 'fmt_mxxru/prj.rb'
required_prj 'restinio/platform_specific_libs.rb'
cpp_source ... | 22.2 | 51 | 0.786787 |
2164eb1fa396fd497c7ccff54a8f4c72253a276d | 255 | class AddMemberSelfRelationship < ActiveRecord::Migration[5.0]
def change
return if table_exists? :members_members
create_table "members_members", id: false, force: :cascade do |t|
t.integer "member_id", null: false
end
end
end
| 25.5 | 69 | 0.709804 |
39fb779ae8982a9ad58603f9b821c8780ccef019 | 88 | # desc "Explaining what the task does"
# task :kms_models do
# # Task goes here
# end
| 17.6 | 38 | 0.681818 |
08d0b1e40ffcdef5dea706d221e5a42524773172 | 1,643 | class Ragel < Formula
desc "State machine compiler"
homepage "https://www.colm.net/open-source/ragel/"
url "https://www.colm.net/files/ragel/ragel-6.10.tar.gz"
sha256 "5f156edb65d20b856d638dd9ee2dfb43285914d9aa2b6ec779dac0270cd56c3f"
bottle do
cellar :any_skip_relocation
sha256 "a402204e97c35c6a9487d... | 35.717391 | 94 | 0.712112 |
d5cc235a21270edf1ec9c274b5f9ba4432ad6f70 | 200 | require 'spec_helper'
describe Upgrademe do
it 'has a version number' do
expect(Upgrademe::VERSION).not_to be nil
end
it 'does something useful' do
expect(false).to eq(true)
end
end
| 16.666667 | 44 | 0.71 |
e847f4885978c34cd8f0cf5487b85bef9bca3d4c | 109 | require "rspec"
require File.expand_path(File.join(File.dirname(__FILE__), "..", "lib/chromedriver/helper"))
| 36.333333 | 92 | 0.752294 |
e9151ae7a873ba1a08b77c4e822f9b37778970ba | 104 | class ContactController < ApplicationController
def index
@user = current_user
end
end
| 17.333333 | 47 | 0.701923 |
26c68a0ea5ce92c4bafb3a20e9754d7e4823def6 | 725 | require 'easy_management/builders/class_builder'
module EasyManagement
module Builders
class ManagerBuilder < ClassBuilder
protected
def class_full_name
"#{model_helper.namespace}::#{model_helper.manager_class}"
end
def superclass
EasyManagement::Managers::BaseManager
... | 22.65625 | 71 | 0.689655 |
e81c7ef323b1f181759fa7e175a4f12cc5ad86f2 | 1,347 |
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require "gem_sample_pruby/version"
Gem::Specification.new do |spec|
spec.name = "gem_sample_pruby"
spec.version = GemSamplePruby::VERSION
spec.authors = ["Taiki Hisamura"]
spec.email ... | 36.405405 | 96 | 0.672606 |
ac17f81c29b8a5cb31a4d5be392d68e53edb1881 | 1,964 | require 'shopify_cli'
module ShopifyCli
module Tasks
class JsDeps < ShopifyCli::Task
include SmartProperties
INSTALL_COMMANDS = {
yarn: %w(yarn install --silent),
npm: %w(npm install --no-audit --no-optional --silent),
}.freeze
def call(ctx)
@ctx = ctx
@d... | 28.882353 | 111 | 0.564664 |
d5f16d72f71db594f2548b1d4ba83b6a0f5b6300 | 158 | class AddIsPublicToProjects < ActiveRecord::Migration[5.0]
def change
add_column :projects, :is_public, :boolean, null: false, default: false
end
end
| 26.333333 | 75 | 0.753165 |
0816e211be835f547e452d0085f14d6339e7857e | 449 | if defined? ::BENCHMARK_JOB
return
end
::BENCHMARK_JOB = 1
RSpec.shared_examples 'Benchmark Job' do
before { Rails.cache.clear }
let!(:count) { 500 }
it 'runs for 501 times' do
perform_enqueued_jobs do
(count + 1).times { |i| described_class.perform_later i }
end
p "#{described_class}-0, #... | 22.45 | 74 | 0.665924 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.