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 |
|---|---|---|---|---|---|
b9c31d49be85b2b6b785923c5de710b6330937a6 | 966 | require 'ipaddr'
module Turnout
class Request
def initialize(env)
@rack_request = Rack::Request.new(env)
end
def allowed?(settings)
path_allowed?(settings.allowed_paths) || ip_allowed?(settings.allowed_ips)
end
private
attr_reader :rack_request
def path_allowed?(allowed_pa... | 24.769231 | 94 | 0.664596 |
333b9fe648abab7c059abd95bbe1b0b4a9f4d30d | 1,383 | # Licensed to Elasticsearch B.V under one or more agreements.
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information
require 'spec_helper'
describe Elasticsearch::DSL::Search::Queries::Wildcard do
describe '#to_hash' do
let(:... | 20.043478 | 75 | 0.606652 |
e9a647a47a21684e9e1c53a351e11a7bfa331261 | 595 | my_name = 'Zed A. Shaw'
my_age = 35 # not a lie
my_height = 74 # inches
my_weight = 180 # lbs
my_eyes = 'Blue'
my_teeth = 'White'
my_hair = 'Brown'
puts "Let's talk about %s." % my_name
puts "He's %d inches tall." % my_height
puts "He's %d pounds heavy." % my_weight
puts "Actually that's not too heavy."
puts "He's got... | 31.315789 | 67 | 0.67395 |
f8975bb7a895f0125ceb7f4e10b254462298aaf1 | 19,002 | # coding: ASCII-8BIT
#
# Copyright (c) 2011-2017 NAITOH Jun
# Released under the MIT license
# http://www.opensource.org/licenses/MIT
require 'test_helper'
class RbpdfTest < Test::Unit::TestCase
class MYPDF < RBPDF
def UTF8StringToArray(str)
super
end
def utf8Bidi(ta, str='', forcertl=false)
... | 42.797297 | 207 | 0.711346 |
01f8ea89806ee552867e633fd72808d9d381fc5d | 1,149 | #--
# Copyright (c) 2004-2006 David Heinemeier Hansson
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, m... | 45.96 | 72 | 0.775457 |
f74208ddb668868e6cd6f118ff3fbb2bfecbce15 | 232 | class SongsWorker
require 'csv'
include Sidekiq::Worker
def perform(songs_file)
CSV.foreach(songs_file, headers: true) do |song|
Song.create(title: song[0], artist_name: song[1])
end
end
end | 23.2 | 57 | 0.637931 |
ab0338a8bbfa4a36734bf494d5277029bb8494af | 11,215 | require 'active_model'
module Sequel::Validations
def self.const_missing(name)
begin
const = ActiveModel::Validations.const_get(name)
rescue NameError
const = super
end
const_set(name, const)
const
end
class UniquenessValidator < ActiveModel::EachValidator
def initialize(opti... | 36.650327 | 117 | 0.637985 |
26626f35726404aeb2a67008b4cd5696ad806803 | 4,666 | Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web serve... | 44.438095 | 114 | 0.766181 |
ed6ae82364912b6d92b55aa9766dbe501b1b9beb | 18,483 | #
# DO NOT MODIFY!!!!
# This file is automatically generated by Racc 1.4.14
# from Racc grammer file "".
#
require 'racc/parser.rb'
require 'nokogiri/css/parser_extras'
module Nokogiri
module CSS
class Parser < Racc::Parser
def unescape_css_identifier(identifier)
identifier.gsub(/\\(?:([^0-9a-fA-F])|([0-9... | 24.611185 | 95 | 0.501758 |
f745ced3e50652b510e0263f3e5e88fb5633083c | 508 | feature 'User edits the data on his profile' do
before(:example) do
@user = create(:user)
end
scenario 'user gets an updated message' do
login_as(@user)
visit(users_edit_path)
fill_in 'E-Mail', with: @user.email
fill_in 'Passwort', with: "teporingos2020"
fill_in 'Passwortbestätigung', ... | 28.222222 | 64 | 0.706693 |
e83756fcd1bb0c8559fd63003785832f44e1c3ee | 3,069 | module BlueStateDigital
class DatasetMap < ApiDataModel
extend ActiveModel::Naming
include ActiveModel::Validations
UPLOAD_ENDPOINT = '/cons/upload_dataset_map'
DELETE_ENDPOINT = '/cons/delete_dataset_map'
FIELDS = [
:map_id,
:type
]
attr_accessor *FIELDS
attr_reader :... | 22.23913 | 83 | 0.55523 |
386c3bcb8618310282b06b0a6638fdb7ab97087a | 1,139 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# Source: helloworld.proto for package 'helloworld'
# Original file comments:
# Copyright 2017 Google, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a ... | 29.205128 | 74 | 0.740123 |
21b1a67b828510834362e01540151cd6a9ef97d0 | 3,525 | # encoding: UTF-8
require_dependency 'carto/oauth/github/api'
require_dependency 'carto/oauth/github/config'
require_dependency 'carto/oauth/google/api'
require_dependency 'carto/oauth/google/config'
require_dependency 'account_creator'
module Carto
class OauthLoginController < ApplicationController
include Acc... | 32.638889 | 101 | 0.651064 |
33d08917dd9ca2a0b56fbc07f9370fb47491aafd | 1,460 | require 'ostruct'
module Lab42::Literate::Extractor extend self
require_relative 'extractor/block'
START_EXTRACTION = %r[\A \s* ``` ruby \s+ literate \s* (?<explicit_title> .*) ]x
STOP_EXTRACTION = %r[\A \s* ``` \s* \z]x
ALTERNATE_EQ_FORM = %r[\A (\s*) (.*) \s+ \#=> \s+ (.*) \z]x
def extract from_lines
... | 24.333333 | 108 | 0.617808 |
21598249cf6df864f15381461470f18b106aff8c | 1,001 | require 'spec_helper'
describe "IP Roles" do
context "when an item is restricted to an IP" do
let(:role) {FactoryGirl.create(:role)}
let(:ip_range) {IpRange.create(:role => role, :ip_start => ip, :ip_end => ip)}
let(:ip) {"128.0.0.0"}
let(:asset) do
a = FactoryGirl.create(:generic_asset)
... | 25.666667 | 82 | 0.591409 |
18b219db6449cc2e5b8fa23bb99f295af7ecb72a | 841 | class Api::V1::CarsController < ApplicationController
def index
render json: { data: Car.all }, status: :created
end
def create
@car = Car.new(cars_params)
if @car.save
render json: { message: 'Car created successfully', data: @car }, status: :created
else
render json: { message: 'Th... | 20.512195 | 88 | 0.605232 |
1a11f6b92c28f92741df4f5ae8f6ff8444f2c261 | 311 | module Cryptoexchange::Exchanges
module Zaif
class Market < Cryptoexchange::Models::Market
NAME = 'zaif'
API_URL = 'https://api.zaif.jp/api/1'
def self.trade_page_url(args={})
"https://zaif.jp/trade_#{args[:base].downcase}_#{args[:target].downcase}"
end
end
end
end
| 23.923077 | 81 | 0.636656 |
aca95746b4f73620be1af5d4a14d345b8c0bedf6 | 1,832 | #
# Cookbook Name:: aws-parallelcluster
# Recipe:: _master_slurm_config
#
# Copyright 2013-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the
# License. A copy of the License is located... | 23.487179 | 121 | 0.718886 |
21ec2db9b74aa17b8a67bdeee947a3d2d7a1836b | 476 | # Helper for checking if is null or empty, based on Rails implementation
# https://stackoverflow.com/questions/247948/is-there-a-better-way-of-checking-nil-or-length-0-of-a-string-in-ruby
module SimpleTasksRuby
module Object
# Module is included in libraries.rb file, based on:
# Monkey-patching, based on http... | 39.666667 | 114 | 0.733193 |
26dfed8226e30c7ebc02659d0e40fec3ba20e06b | 147 | # Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Whs::Application.initialize!
| 24.5 | 52 | 0.795918 |
b9eec9f6cf405aaf3703db028c3cd8704d652c2d | 33 | class NflGames::Schedule
end | 11 | 24 | 0.727273 |
013cf93dbc0992717005733e6b6eebf8212937b0 | 8,414 | module ActionDispatch
module Routing
# Polymorphic URL helpers are methods for smart resolution to a named route call when
# given an Active Record model instance. They are to be used in combination with
# ActionController::Resources.
#
# These methods are useful when you want to generate correct ... | 41.245098 | 141 | 0.574281 |
913ec5f2f447778383caa8012335e4e09fee7ca8 | 1,557 | require 'gitolite/dirty_proxy'
require 'spec_helper'
describe Gitolite::DirtyProxy do
it "should create a new instance given valid attributes" do
Gitolite::DirtyProxy.new([]).should_not be_nil
end
let(:target) { ['foo', 'bar'] }
let(:proxy) { Gitolite::DirtyProxy.new(target) }
describe 'delegating to ... | 24.328125 | 61 | 0.657033 |
f78691492787734c362e9482aff7132238e50ff1 | 1,014 | class Workflow < ArvadosModel
include HasUuid
include KindAndEtag
include CommonApiTemplate
validate :validate_definition
before_save :set_name_and_description
api_accessible :user, extend: :common do |t|
t.add :name
t.add :description
t.add :definition
end
def validate_definition
beg... | 23.581395 | 75 | 0.654832 |
f8082062b35589969a5abebf76f7989fa8a2773a | 3,086 | require 'spec_helper'
require 'sisimai/mail'
require 'sisimai/data'
require 'sisimai/message'
require 'sisimai/rhost/franceptt'
describe Sisimai::Rhost::FrancePTT do
rs = {
'01' => { 'status' => %r/\A5[.]1[.]1\z/, 'reason' => %r/userunknown/ },
'02' => { 'status' => %r/\A5[.]5[.]0\z/, 'reason' => %r/userunkn... | 48.21875 | 116 | 0.544718 |
33934754778a258531d23b7ccb751b61e7033e94 | 899 | require 'japr'
module JAPR
DEFAULTS = {
'output_path' => 'assets',
'display_path' => nil,
'staging_path' => '../.asset_pipeline',
'bundle' => true,
'compress' => true,
'gzip' => false
}
class SassConverter < JAPR::Converter
require 'sass'
def self.filety... | 17.98 | 87 | 0.599555 |
914509accf022a8f40e79db67fd46b30856bf15b | 8,031 | require 'spec_helper'
describe SS::Extensions::Decimal128 do
let(:zero) { described_class.new("0.0") }
let(:one) { described_class.new("1.0") }
let(:minus_one) { described_class.new("-1.0") }
describe "#add" do
it { expect(one.add(zero, 0)).to eq one }
it { expect(one.add(Integer(0), 0)).to eq one }
... | 34.029661 | 98 | 0.602914 |
11578cfb57ecace8d7d308af4730316b173a96e8 | 529 | class ChangeColumnsOfCsvImports < ActiveRecord::Migration
def self.up
rename_column :csv_product_imports, :products_count, :inserted_products_count
change_table :csv_product_imports do |t|
t.integer :updated_products_count
t.integer :loaded_images_count
end
end
def self.down
rename_c... | 26.45 | 81 | 0.763705 |
1dc161dbd5be149e28795be31a05403333e60be5 | 1,051 | # encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative sou... | 42.04 | 86 | 0.76118 |
ab4941e49d3f71876f2ae985181d847e361c703a | 879 | # frozen_string_literal: true
module MasterfilesApp
LocationSchema = Dry::Schema.Params do
optional(:id).filled(:integer)
required(:primary_storage_type_id).filled(:integer)
required(:location_type_id).filled(:integer)
required(:primary_assignment_id).filled(:integer)
required(:location_storage_d... | 39.954545 | 65 | 0.765643 |
879503d0f11521a2777a6b8df0f567e996651001 | 1,517 | #
# xmp.rb - irb version of gotoken xmp
# $Release Version: 0.9$
# $Revision: 11708 $
# $Date: 2007-02-13 08:01:19 +0900 (Tue, 13 Feb 2007) $
# by Keiju ISHITSUKA(Nippon Rational Inc.)
#
# --
#
#
#
require "irb"
require "irb/frame"
class XMP
@RCS_ID='-$Id: xmp.rb 11708 2007-02-12 23:01:19Z shyouhei... | 17.436782 | 63 | 0.602505 |
1d6dfc708265c0c95bfa3509e129ffb790d24639 | 3,702 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
def initialize(info={})
super(update_info(in... | 30.85 | 124 | 0.559968 |
e883c07cffa9db86bc1964e7c4a8cb18d03fd008 | 321 | # frozen_string_literal: true
module StoreModel
# StoreModel configuration.
class Configuration
# Controls usage of MergeErrorStrategy
# @return [Boolean]
attr_accessor :merge_errors
# Controls usage of MergeArrayErrorStrategy
# @return [Boolean]
attr_accessor :merge_array_errors
end
end... | 21.4 | 47 | 0.750779 |
871832610cedc61475f9a889fe2395f94e5dbdd8 | 201 |
CorProject.import_cpp = true
CorProject.import_cpp_entry = "simple_cpp_import_initialize"
CorProject.crypt = true
CorProject.add_include "#{CorProject.engine_path}/packages/cocos2dx/common_resources"
| 33.5 | 85 | 0.850746 |
9152cbcc2c0dd891a34838ff1d28611cea877e4f | 603 | #
# I18S
#
# Created on 2010-5-17.
# Copyleft nofxx (c) 2011.
#
#
# Inspired by translation rake task on spree (http://spreecommerce.com/)
#
require 'yaml'
# Changed to use YAML instead of text regex,
# but yaml has issues so we need to:
# In order to work with utf8 encoded .yml files.
# TODO: Fixed in ruby 1.9.x ??... | 18.84375 | 72 | 0.679934 |
21909bdc720cfe73630970cd6d1f046a42d23716 | 1,157 | # 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 ... | 38.566667 | 78 | 0.746759 |
ed66e5039df5a1f981e3619bbd09e71fe4964547 | 2,233 | # -*- coding: utf-8 -*-
require 'helper'
class TestRegressionChartsheet08 < Test::Unit::TestCase
def setup
setup_dir_var
end
def teardown
File.delete(@xlsx) if File.exist?(@xlsx)
end
def test_chartsheet08
@xlsx = 'chartsheet08.xlsx'
workbook = WriteXLSX.new(@xlsx)
worksheet = workb... | 36.016129 | 121 | 0.461711 |
214d5900beb142d909ca6e1202cf8cb67f259fa7 | 507 | class UsersController < ApplicationController
before_action :authorized, only: [:show]
def new
@user = User.new
end
def create
@user = User.new(user_params)
if @user.valid? && @user.save
redirect_to new_session_path, notice: 'Sign up successful, login using your credentials'
else
re... | 19.5 | 94 | 0.686391 |
87a1c47c33d49de16858888d3f58b953bf1d2012 | 178 | require_relative '../../../spec_helper'
require 'set'
require_relative 'shared/difference'
describe "ImmutableSet::Pure#-" do
it_behaves_like :sorted_set_2_difference, :-
end
| 22.25 | 46 | 0.764045 |
1d0ad7e126bf38d047d27ffd09b66bd1835d068f | 434 | require 'spec_helper'
describe User do
describe "#admin?" do
let(:user) { FactoryGirl.create(:user, role: 'user') }
context "when role is admin" do
it "should return true" do
user.role = 'admin'
user.admin?.should be_true
end
end
context "when role is user" do
it "s... | 21.7 | 59 | 0.596774 |
79e7df3fc45d048cc8950c77e59f11f257c6317f | 140,382 | survey 'TK',
:full_title => 'Tokelau',
:default_mandatory => 'false',
:status => 'alpha',
:description => '<p><strong>This has been generated based on a default and needs to be localised for Tokelau. Please help us! Contact <a href="mailto:certificate@theodi.org">certificate@theodi.org</a></strong></p><p>This s... | 54.45384 | 727 | 0.690886 |
d5c1056e606eaf4911eb6dafbc41a1af9ebc6a83 | 2,065 | cask "google-chrome-canary" do
version "93.0.4549.0"
sha256 :no_check
url "https://dl.google.com/chrome/mac/universal/canary/googlechromecanary.dmg"
name "Google Chrome Canary"
desc "Web browser"
homepage "https://www.google.com/chrome/canary/"
livecheck do
url "https://chromiumdash.appspot.com/fetc... | 38.240741 | 144 | 0.696368 |
f784a5797f6462d3dacca1baa6b1305277fba4ea | 89 | class RetentionPolicy < ApplicationRecord
validates :resource_id, uniqueness: true
end
| 22.25 | 42 | 0.831461 |
e9ebe2e57662cd9da517e3d59289b8de63996783 | 2,092 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Security::ScannedResourcesService, '#execute' do
before do
stub_licensed_features(sast: true, dependency_scanning: true, container_scanning: true, dast: true)
end
let_it_be(:project) { create(:project, :repository) }
let_it_be(:pipeline) ... | 28.657534 | 103 | 0.640535 |
f71a6429583f44f356b31d11badb81eda6270a44 | 1,660 | class SimpleTiles < Formula
desc "Image generation library for spatial data"
homepage "https://github.com/propublica/simple-tiles"
url "https://github.com/propublica/simple-tiles/archive/v0.6.1.tar.gz"
sha256 "2391b2f727855de28adfea9fc95d8c7cbaca63c5b86c7286990d8cbbcd640d6f"
license "MIT"
revision 9
head ... | 33.877551 | 93 | 0.675301 |
3839c42247d7658a083958e683badc1893b4b710 | 773 | class ThirteenFFiler < ApplicationRecord
def readonly?
true
end
paginates_per 200
has_many :thirteen_fs, primary_key: :cik, foreign_key: :cik
scope :autocomplete, -> (query) {
where("name ILIKE ? OR cik = ?", "%#{query}%", query).
order([Arel.sql("similarity(?, name) DESC, lower(name)"), quer... | 20.342105 | 71 | 0.658473 |
91adc477736aba419ac95eb0bbc42296436580a3 | 45 | module Righty
VERSION = '0.1.0'.freeze
end
| 11.25 | 26 | 0.688889 |
91987d8cd0bafc86dff750434e932f0ca6c5c558 | 1,531 | class GeneralCourse < ApplicationRecord
has_many :courses
has_many :professors, -> { distinct }, through: :courses
has_many :reviews, -> { distinct }, through: :courses
has_many :course_ratings, -> { distinct }, through: :courses
has_many :enrollments
has_many :users, through: :enrollments
... | 35.604651 | 162 | 0.650555 |
18893c81ee1cd4fe34909a63dc80fbb1a3b5f5d8 | 134 | # frozen_string_literal: true
module AcaEntities
module ShopMarket
require_relative 'questionnaires/questionnaire'
end
end
| 13.4 | 51 | 0.798507 |
e9edaefb72c6d826e0bb8f234967883745c0414f | 1,777 | require 'spec_helper'
require 'hiera/util'
describe "Hiera" do
describe "#logger=" do
it "should attempt to load the supplied logger" do
Hiera.stubs(:warn)
Hiera.expects(:require).with("hiera/foo_logger").raises("fail")
Hiera.logger = "foo"
end
it "should fall back to the Console logge... | 28.206349 | 101 | 0.654474 |
bf374ea9fc8845ca46358ff0282b5bae223cce09 | 6,015 | # frozen_string_literal: true
require_relative 'errors'
require_relative 'node'
module MiniPGM
#
# A directed graph representing a bayesian network
#
class BayesianNetwork
#
# Edges between individual nodes, sorted by label of the outgoing edge, e.g:
#
# Pollution -> Cancer
# Smoker ->... | 29.057971 | 114 | 0.621613 |
391c15405871ee1d0eae00ae31317654e1482ac4 | 43,788 | # 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... | 53.926108 | 138 | 0.576277 |
ffa191808ad32915d3addcd8073c09636109a88c | 953 | # SQLite に import する table
class TokyoMetro::Rake::Rails::Deploy::Heroku::Csv::Command::ImportToSqlite < TokyoMetro::Rake::Rails::Deploy::Heroku::Csv::Command::MetaClass
private
def optional_setting_of_initializer
@letter_code = "utf8"
# @dirname = ".import ./../rails_tokyo_metro_db/csv/#{ @time }/#{ @let... | 32.862069 | 142 | 0.673662 |
28993d2912b09a067018b973326a2eeb8e704bde | 6,710 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = AverageRanking
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::FileDropper
d... | 38.786127 | 128 | 0.577943 |
6243398a528c75a04ee989fd4201e435429e1b99 | 4,226 | require "set"
module ActiveRecord
module AttributeMethods
module PrimaryKey
extend ActiveSupport::Concern
# Returns this record's primary key value wrapped in an array if one is
# available.
def to_key
sync_with_transaction_state
key = self.id
[key] if key
e... | 29.760563 | 90 | 0.581874 |
4ad44f9e7d3bb6fadad326e74b94918f9f29ecfe | 645 | procs = [1,2,4,8]
iter = []
procs.each do |proc|
puts "============Start Processors: #{proc}==================="
accuracy_criteria = 0.1
while accuracy_criteria >= 0.000001
start_time = Time.now
op = `mpirun -np #{proc} ./monte_carlo_pi #{accuracy_criteria}`
end_time = Time.now
iter << [accuracy_c... | 28.043478 | 67 | 0.570543 |
1d28b65b8cdb3bb9d55b0769a787881ed8cc7182 | 2,481 | # frozen_string_literal: true
module Geo
module BlobReplicatorStrategy
extend ActiveSupport::Concern
include Delay
include Gitlab::Geo::LogHelpers
included do
event :created
end
def handle_after_create_commit
publish(:created, **created_params)
return unless Feature.enab... | 26.115789 | 88 | 0.714228 |
7a677f4687f0fee93b6ea13eed3fe3f40e35c333 | 652 | require 'spec_helper'
describe Sinatra::Extension do
module ExampleExtension
extend Sinatra::Extension
set :foo, :bar
settings.set :bar, :blah
configure :test, :production do
set :reload_stuff, false
end
configure :development do
set :reload_stuff, true
end
get '/' do
... | 19.757576 | 70 | 0.661043 |
abd48fb196a4c5ffe002e074d2aa47bf6c68c898 | 9,252 | require File.expand_path("../../Abstract/abstract-php-extension", __FILE__)
class Php53Opcache < AbstractPhp53Extension
init
homepage "https://github.com/zend-dev/ZendOptimizerPlus"
url "https://github.com/zendtech/ZendOptimizerPlus/archive/v7.0.5.tar.gz"
sha256 "2654d9611e386cc59887d4e8cfba2c010ed4480c7c9c509... | 43.641509 | 98 | 0.689256 |
6a6fc92729c65ada75155f28728b6d164c467729 | 10,300 | =begin
#Datadog API V1 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://openapi-generator.tech
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product... | 29.096045 | 221 | 0.603398 |
d597df3c096a1373f479795498401851abbb40b4 | 749 | name 'sudo'
default_version '1.8.17p1'
license 'ISC'
license_file 'doc/LICENSE'
dependency 'zlib'
version '1.8.17p1' do
source md5: '50a840a688ceb6fa3ab24fc0adf4fa23'
end
source url: "https://www.sudo.ws/dist/sudo-#{version}.tar.gz"
relative_path "sudo-#{version}"
build do
env = with_standard_compiler_flags(w... | 25.827586 | 92 | 0.683578 |
336dfc37ae7cad97a258c0e86cffb232e76064cd | 899 | covers 'facets/hash/recurse'
test_case Hash do
method :recurse do
test do
h = {:a=>1, :b=>{:b1=>1, :b2=>2}}
g = h.recurse{|h| h.inject({}){|h,(k,v)| h[k.to_s] = v; h} }
g.assert == {"a"=>1, "b"=>{"b1"=>1, "b2"=>2}}
end
test "with Arrays" do
require 'facets/array/recurse'
... | 22.475 | 66 | 0.433815 |
edbf0470ecc5f955b5283efb7a821f3edd5ed628 | 670 |
Pod::Spec.new do |s|
s.name = "Module1_a"
s.version = "0.0.5"
s.summary = "Module1 is a .a file"
s.description = <<-DESC
This project is very import.
DESC
s.homepage = "https://github.com/BaoBaoJianqiang/Module1_a"
s.platform = ... | 35.263158 | 107 | 0.523881 |
616beb8dd4fcb358c4e174f84e58938fc1c1ff15 | 313 | module Qsagi
class Message
attr_reader :payload
def initialize(delivery_details, payload)
@delivery_details = delivery_details
@payload = payload
end
def delivery_tag
@delivery_details.delivery_tag
end
def exchange
@delivery_details.exchange
end
end
end
| 16.473684 | 45 | 0.690096 |
088beed65ca2b5d1fb9c6bf0a6899294ea0b26bf | 5,246 | # 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... | 34.741722 | 245 | 0.670606 |
1a097fae47a05c17ff32bf54a9be58006b5a4812 | 2,468 | require 'test_helper'
class SaveTest < BaseTest
Song = Struct.new(:title, :album, :composer)
Album = Struct.new(:name, :songs, :artist)
Artist = Struct.new(:name)
class AlbumForm < TestForm
property :name
validation do
required(:name).filled
end
collection :songs do
property :tit... | 23.504762 | 98 | 0.608185 |
790f7f25d3b1a9de3857ac02acb2e6e03db4ed51 | 98 | module Kuronuri
# Your code goes here...
end
require 'kuronuri/mask'
require "kuronuri/version" | 16.333333 | 26 | 0.755102 |
61b0fef131269b2e4a914fb79fa66992f8f5c4c8 | 503 | class AccountActivationsController < ApplicationController
# GET /account_activations/:id/edit
def edit
user = User.find_by(email: params[:email])
if user && !user.activated? && user.authenticated?(:activation, params[:id])
user.activate
log_in user
flash[:suc... | 31.4375 | 84 | 0.602386 |
185252d534f7f2e58ba2fa5e1579bcd13ceceeb1 | 998 |
require('rspec')
require('./lib/word_finder')
describe '#count' do
it 'counts the number times a word occurs in a phrase' do
word_finder = WordFinder.new('cat', 'the cat jumps over the moon')
expect(word_finder.count).to eq 1
end
it 'counts the number times a word occurs in a phrase' do
... | 31.1875 | 73 | 0.668337 |
18556e751e42bd279429f2670383363da913962b | 1,295 | module Fog
module Compute
class Brightbox
class Real
# Requests an update to the currently scoped account
#
# @param [Hash] options
# @option options [String] :name Account name
# @option options [String] :address_1 First line of address
# @option options [Str... | 41.774194 | 123 | 0.639382 |
61d1966119c466b052b1d3bce07b7e7ea7505c64 | 11,535 | # frozen_string_literal: true
require 'rubygems/test_case'
require 'rubygems/platform'
require 'rbconfig'
class TestGemPlatform < Gem::TestCase
def test_self_local
util_set_arch 'i686-darwin8.10.1'
assert_equal Gem::Platform.new(%w[x86 darwin 8]), Gem::Platform.local
end
def test_self_match
assert... | 37.330097 | 80 | 0.595059 |
33f804749597789098fcb773f5d8c9006ba0e448 | 1,373 | namespace :data do
task :prepare => [:environment] do
require 'lib/data_marshal'
require 'open-uri'
end
desc "Dumps state to FILE, defaults to DBNAME.TIMESTAMP.data"
task :dump => :prepare do
filename = DataMarshal.dump(ENV["FILE"])
puts "* Dumped data to #{filename}"
end
desc "Restores st... | 28.604167 | 180 | 0.655499 |
1872189adbf0604951358720e72ead1131f888b6 | 772 | class AddSoftwareAndWarrantyFieldsToEquipment < ActiveRecord::Migration
def self.up
add_column :equipment, :included_accessories, :text
add_column :equipment, :included_software, :text
add_column :equipment, :replacement_fee, :float
add_column :equipment, :inventory_number, :string
add_column :equ... | 38.6 | 71 | 0.784974 |
bfb10c37ee92b5e8b1c656e633e8ae4df2466762 | 128 | json.extract! grade, :id, :person_id, :assignment_id, :value, :created_at, :updated_at
json.url grade_url(grade, format: :json)
| 42.666667 | 86 | 0.75 |
e9ed2cf6d4530793c52c708ad9d0eb44e334b630 | 568 | # frozen_string_literal: true
require_relative 'test_helper'
class TestFakerKpop < Test::Unit::TestCase
def setup
@tester = Faker::Kpop
end
def test_i_groups
assert @tester.i_groups.match(/\w+/)
end
def test_ii_groups
assert @tester.ii_groups.match(/\w+/)
end
def test_iii_groups
asser... | 16.705882 | 43 | 0.68838 |
e2a223f3e254ddbea5c893d555b63be9d534658b | 1,116 | Pod::Spec.new do |s|
s.name = 'BuddySDK'
s.version = '2.0.0'
s.license = { :type => 'Apache 2.0' }
s.summary = 'iOS SDK for the Buddy Platform.'
s.homepage = 'http://www.buddy.com'
s.authors = { 'Erik Kerber' => 'erik@buddy.com' }
s... | 62 | 226 | 0.620968 |
bb91f9071ca74097ac952ad6ee305ae442cf7270 | 2,468 | Chef::Log.info("** BOOTSTRAP START **")
delete_folder("c:\\temp-msi")
create_folder("c:\\temp-msi")
remote_file 'c:/temp-msi/AWSCLI64.msi' do
source 'https://s3.amazonaws.com/aws-cli/AWSCLI64.msi'
action :create
end
# powershell_script 'AWS Command Line Interface' do
# cwd "c:/temp-msi... | 31.641026 | 110 | 0.766613 |
4a7c61c2196848b45113c07db897dcc7ed7cc56b | 3,877 | require_relative '../spec_helper'
test_run = TestConfig.new
if test_run.deployment == Deployment::CORE
describe 'CollectionSpace' do
include Logging
include WebDriverManager
before(:all) do
test_run.set_driver launch_browser
@admin = test_run.get_admin_user
@login_page = test_run.ge... | 44.563218 | 157 | 0.730462 |
11597fc04c7f7bf2f3ec4ac17d3c05ccc94269d5 | 9,802 | require 'fileutils'
require_relative 'task'
require_relative 'worker'
module Ripe
##
# This class controls worker preparation from a given workflow, list of
# samples and parameters. It applies the workflow to each of the specified
# samples.
#
# @attr workers [Array<Worker>] workers prepared in current... | 33.227119 | 108 | 0.61059 |
ed29ddcc290da786e1db29ac1aa4da143b058217 | 206 | require "test_helper"
class ItDependsTest < Minitest::Test
def test_that_it_has_a_version_number
refute_nil ::ItDepends::VERSION
end
def test_it_does_something_useful
assert false
end
end
| 17.166667 | 39 | 0.786408 |
7a16931bf711aa334ce8fb5295b323704773adc2 | 696 | module Fog
class Connection
def initialize(url, persistent=false, params={})
@excon = Excon.new(url, params)
@persistent = persistent
end
def request(params, &block)
unless @persistent
reset
end
unless block_given?
if (parser = params.delete(:parser))
... | 19.333333 | 86 | 0.58477 |
b9b8b4eda08dc3e5a83c4f344837257173683024 | 446 | # frozen_string_literal: true
require 'yaml'
require 'json'
require 'i18n_data'
require 'countries/kwarg_struct'
require 'countries/configuration'
require 'countries/data'
require 'countries/structure'
require 'countries/translations'
require 'countries/country/class_methods'
require 'countries/country/finder_methods... | 24.777778 | 42 | 0.827354 |
2888b18c16ff1a829a8344f0f99bdb02aea28ed8 | 891 |
Pod::Spec.new do |s|
s.name = "LiveEB_IOS"
s.summary = "A short description of LiveEB_IOS."
s.homepage = "https://github.com/tencentyun/leb-ios-sdk.git"
s.license = "MIT"
s.author = { "tstan" => "tstan@tencent.com" }
s.version = "2.3.4"
s.platform = :ios
s.plat... | 27 | 111 | 0.626263 |
bfb238b928e2a87a5e099cf46515592dca430c96 | 699 | class HomeController < ApplicationController
get '/' do
"user start"
end
post '/' do
username = params[:username]
password = params[:password]
user = User.find_by(username: username)
if user && user.authenticate(password)
session[:logged_in] = true
session[:username] = user
session[:user_i... | 13.98 | 50 | 0.648069 |
21260ca2e290ae4772c1770802ff6770658897fa | 914 | class CreateStations < ActiveRecord::Migration[6.1]
def change
create_table :stations do |t|
t.string :name
t.string :address
t.string :zip
t.string :status
t.string :access
t.boolean :updates, default: false
t.boolean :flagged, default: false
#Outlet_Types
t.... | 29.483871 | 51 | 0.634573 |
87f8f98445d74aa6763a8f1851df25313bdeaa57 | 418 | require "spec_helper"
describe Duckweed::App do
let(:app) { described_class }
describe 'GET /health' do
it 'succeeds' do
get '/health'
last_response.should be_successful
end
it 'returns a 200 status code' do
get '/health'
last_response.status.should == 200
end
it 'res... | 18.173913 | 40 | 0.624402 |
4aca3e26bd0516992cb4f52b91afa31eda7368c7 | 1,648 | # -------------------------------------------------------------------------- #
# Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# no... | 53.16129 | 78 | 0.464806 |
08811fba5ea99e40947b482c2d512692a031392a | 379 | class CreateCategories < ActiveRecord::Migration[5.2]
def change
create_table :categories do |t|
t.integer :toilet_paper
t.integer :dental_hygiene
t.integer :first_aid
t.integer :general_hygiene
t.integer :diaper
t.integer :underwear_socks
t.integer :blankets
t.inte... | 22.294118 | 53 | 0.675462 |
2825478926a788bec90aab8e9d9dae19b4850959 | 3,476 | class WebHookService
class InternalErrorResponse
attr_reader :body, :headers, :code
def initialize
@headers = HTTParty::Response::Headers.new({})
@body = ''
@code = 'internal error'
end
end
include HTTParty
# HTTParty timeout
default_timeout Gitlab.config.gitlab.webhook_timeou... | 25.940299 | 146 | 0.664269 |
ab0c66064fdc9b02011c20ea0a4bda62b4949d23 | 605 | class AddTypeFlagsToEvents < ActiveRecord::Migration
def change
add_column :events, :comment, :boolean, default: false
add_column :events, :flagged, :boolean, default: false
add_column :events, :post_con, :boolean, default: false
add_column :events, :quote, :boolean, default: false
add_column :eve... | 43.214286 | 60 | 0.722314 |
b9cfb7d9d9ec0bd13efe9c9c52a0d98cff1cdf9d | 162 | require 'spec_helper'
describe Wukong do
it_behaves_like Hanuman::Shortcuts
it{ should respond_to(:processor) }
it{ should respond_to(:dataflow) }
end
| 14.727273 | 37 | 0.746914 |
d5f57023888e8c57e95832d2ed337950c594d164 | 1,675 | class ApplicationHelper::Toolbar::PersistentVolumesCenter < ApplicationHelper::Toolbar::Basic
button_group('persistent_volume_vmdb', [
select(
:persistent_volume_vmdb_choice,
nil,
t = N_('Configuration'),
t,
:image => "vmdb",
:items => [
button(
:persistent_vo... | 27.459016 | 117 | 0.489552 |
08484e5455c6ec86022ca013bd40ccc052f8490c | 1,585 | require "utils/bottles"
describe Utils::Bottles::Collector do
describe "#fetch_checksum_for" do
it "returns passed tags" do
subject[:lion] = "foo"
subject[:mountain_lion] = "bar"
expect(subject.fetch_checksum_for(:mountain_lion)).to eq(["bar", :mountain_lion])
end
it "returns nil if em... | 34.456522 | 87 | 0.677603 |
e9863e85ff7920cbbff95cdf8332dba14a752897 | 2,110 | require 'aws-sdk'
require 'json'
require 'curl'
Aws.config[:region] = 'us-east-1'
def s3_ls_a(prefix)
all = []
token = nil
1.step do
response = Aws::S3::Client.new().list_objects_v2(bucket: 'bostonlocaltv.org', prefix: prefix, max_keys: 1000, continuation_token: token)
chunk = response.contents.map{ |o|... | 36.37931 | 274 | 0.652133 |
21321e4851e2b221a5af2eaea6ebe8f61f718632 | 1,771 | require 'spec_helper'
require 'realm/event_store'
require 'realm/messaging'
module Realm
module EventStore
describe InMemoryEventStore do
let(:event_bus) { double(Messaging::Bus::MessageBus, publish: nil) }
subject(:event_store) { InMemoryEventStore.new(event_bus) }
it "is an EventStore" do
... | 30.534483 | 82 | 0.615471 |
26044ad87ebe7871fe04eb6cd83de3539021c57d | 2,441 | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... | 41.372881 | 132 | 0.659975 |
2867d9378e726efb3ea7228e4ae462a43c204ec3 | 1,251 | # frozen_string_literal: true
# Copyright, 2020, by Samuel G. D. Williams. <http://www.codeotaku.com>
#
# 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 withou... | 44.678571 | 79 | 0.767386 |
ed9cd01b84e1e312afbb35fb7cf375f5c6365f9c | 1,419 | require 'guard/guardfile/evaluator'
require 'guard/guardfile/generator'
require 'guard/ui'
module Guard
# @deprecated Use instance methods of {Guardfile::Evaluator} and
# {Guardfile::Generator} instead.
#
# @see Guardfile::Evaluator
# @see Guardfile::Generator
#
module Guardfile
# @deprecated Use ... | 31.533333 | 98 | 0.721635 |
18c314d38faf5de5f5e3e3ade34d239167ff9bab | 3,189 | class IgnitionGui6 < Formula
desc "Common libraries for robotics applications. GUI Library"
homepage "https://github.com/ignitionrobotics/ign-gui"
url "https://osrf-distributions.s3.amazonaws.com/ign-gui/releases/ignition-gui6-6.4.0.tar.bz2"
sha256 "ae6422ae78faa321df55e18fa436cfd2a85d19106460ea68eeb454d2e48f5b... | 30.663462 | 96 | 0.642521 |
d512b16e9de89eeb15e84171cb4db0634f895d1f | 2,529 | module StructuredApi
module StructuredApiable
# TODO: Needs clear_attr(name) methods
# TODO: Raise an exception on the singleton methods if self.class == StructuredApi::Endpoint (it will pollute everything)
# Defines an instance method and a class method,
# where the class method sets the template fo... | 33.276316 | 125 | 0.62238 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.