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 |
|---|---|---|---|---|---|
91868485aa3a6a604128bbfa3849ecf492476477 | 89 | $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
require 'rpmspec'
require 'rspec'
| 22.25 | 54 | 0.752809 |
b98ff4828e064409d968799d181061fece7359f4 | 1,694 | require File.expand_path("../../Abstract/abstract-php-extension", __FILE__)
class Php55Memcached < AbstractPhp55Extension
init
homepage 'http://pecl.php.net/package/memcached'
url 'http://pecl.php.net/get/memcached-2.1.0.tgz'
sha1 '16fac6bfae8ec7e2367fda588b74df88c6f11a8e'
head 'https://github.com/php-memcac... | 33.88 | 140 | 0.717828 |
ff6b426cdcc7da0c79a84c39630c29d56f116f1c | 7,965 | # 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::V2018_07_01
module Models
#
# The parameters to list service SAS credentials of a specific resource.
#
class ... | 32.116935 | 79 | 0.490898 |
7a77ce46fae486ad49bb1e9d03ecde1da7b7bdc2 | 2,195 | class Harbor
class Configuration < Harbor::Container
def self.instance
@instance ||= begin
instance = self::new(ENV["ENVIRONMENT"] || DEVELOPMENT)
instance.set("hostname", `hostname`.strip)
instance
end
end
def initialize(environment = nil)
super()
@debug ... | 22.171717 | 94 | 0.57631 |
5d888599f78afdfbf6438ff97a26ec7f3bd42702 | 177 | # frozen_string_literal: true
# EE-only
FactoryBot.define do
factory :plan_limits do
plan
trait :default_plan do
plan factory: :default_plan
end
end
end
| 13.615385 | 33 | 0.700565 |
26cd0222355c8c817e4aec19fe6b716560dbd06d | 476 | class Middleclick < Cask
if MacOS.version == :snow_leopard or MacOS.version == :lion
url 'http://clement.beffa.org/labs/downloads/MiddleClick.zip'
elsif MacOS.version == :mountain_lion
url 'http://clement.beffa.org/labs/downloads/MiddleClick_ml.zip'
else
url 'http://clement.beffa.org/labs/downloads/Mi... | 34 | 74 | 0.743697 |
21a0963c923ef826709c320da9fa03dff5161883 | 166 | class CreateEnvironments < ActiveRecord::Migration[6.0]
def change
create_table :environments do |t|
t.string :name
t.timestamps
end
end
end
| 16.6 | 55 | 0.680723 |
9198f53ff0718eb6cfbe2fd6e94ea7b132116c3b | 38 | module Cleric
VERSION = '0.3.0'
end
| 9.5 | 19 | 0.657895 |
61c653483e52d5808e3815599947462b437556b5 | 43 | class Splaytreemap
VERSION = "1.0.0"
end
| 10.75 | 19 | 0.697674 |
2189a3e73e4aa373e929fabedb217c6fd90b8451 | 755 | class Small3x2Image < ActiveRecord::Migration[5.2]
say "This migration will reprocess the medium sized listing image to 3/2 aspect ratio of #{Community.count} communities"
def up
Listing.all.each do |listing|
listing.listing_images.each do |listing_image|
listing_image.image.reprocess! :small_3x2
... | 35.952381 | 120 | 0.69404 |
edf6c26b405eeccea3c49606fbe45aa32e67602c | 2,371 | require "formula"
class Influxdb < Formula
homepage "http://influxdb.org"
url "http://get.influxdb.org/influxdb-0.5.7.src.tar.gz"
sha1 "8e5ed1ad3c516e62f461749e620d37901d56460a"
bottle do
sha1 "9cccfe0873dc7edf21e8b1f6c8f7919359f4734b" => :mavericks
sha1 "47bbecbd020077d4b8973ea75b398ab2e7dbfef8" => :... | 29.271605 | 106 | 0.615352 |
031bdfc6d3019fafe2069ff4aeeb7a23104e4a13 | 3,983 | if ENV['COVERAGE']
# Run Coverage report
require 'simplecov'
SimpleCov.start 'rails' do
add_group 'Libraries', 'lib/spree'
add_filter '/bin/'
add_filter '/db/'
add_filter '/script/'
add_filter '/spec/'
add_filter '/lib/generators/'
coverage_dir "#{ENV['COVERAGE_DIR']}/backend" if ENV... | 29.503704 | 114 | 0.728094 |
269b94fb5fea7094a8bb6971288497b17b3c0020 | 18,365 | # frozen_string_literal: true
module ApipieDSL
module Base
def apipie_eval_dsl(*args, &block)
raise ArgumentError, 'Block expected' unless block_given?
instance_exec(*args, &block)
dsl_data
ensure
dsl_data_clear
end
def dsl_data
@dsl_data ||= dsl_data_init
end
... | 30.305281 | 126 | 0.646284 |
01d756d7284e8cfe53cca429b79ce5d9e8c5cdcd | 772 | module Gitlab::Prometheus::Queries
class EnvironmentQuery < BaseQuery
def query(environment_id)
environment = Environment.find_by(id: environment_id)
environment_slug = environment.slug
timeframe_start = 8.hours.ago.to_f
timeframe_end = Time.now.to_f
memory_query = raw_memory_usage_... | 36.761905 | 101 | 0.738342 |
ab62960b17c2e54dd49939e387c42db8e398bfb2 | 3,231 | require 'puppet/provider/iispowershell'
require 'json'
Puppet::Type.type(:iis_application).provide(:powershell, :parent => Puppet::Provider::Iispowershell) do
mk_resource_methods
def initialize(value={})
super(value)
@property_flush = {
'appattrs' => {},
}
end
def self.instances
app_i... | 29.642202 | 150 | 0.629526 |
1cda20f914a88c4af7c0c106067b75d3b16ba4e9 | 200,013 | # Copyright 2015 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 48.759873 | 130 | 0.648393 |
21c73146cf42264aa9b758dbbe37659df68b37f6 | 1,046 | module Locatable
extend ActiveSupport::Concern
included do
has_many :checkins,
as: :locatable,
after_add: :checkin_added,
dependent: :destroy
def interpolated_checkin_coordinates(starting_at, ending_at = DateTime.now)
ending_at ||= DateTime.now
query = <... | 27.526316 | 130 | 0.635755 |
b9c03f4a8f6a1cfac3696644ab8414447f51eda6 | 204 | class UserHouseholdSerializer < ActiveModel::Serializer
attributes :id, :user_id, :household_id
belongs_to :user, serializer:UserSerializer
belongs_to :household, serializer:HouseholdSerializer
end
| 34 | 55 | 0.828431 |
bb4511b52b95bd472aaa66134e590facfee2657e | 2,597 | require 'fastlane'
require 'yaml'
require_relative '../helper/flutter_versioncode_bump_helper'
module Fastlane
module Actions
class FlutterVersioncodeBumpAction < Action
def self.run(params)
# Retrieve given params
pubspec_location = params[:pubspec_location]
version_code_increment ... | 35.094595 | 115 | 0.598383 |
ff03ff0aeb18907893757a8d5b58ec84c61bee4c | 709 | 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 ECommerceApp
class Application < Rails::Application
# Initialize configuration defaults for originally generated Ra... | 30.826087 | 79 | 0.739069 |
e9378488c7f58f99acbeb2f8221e909c361a5f29 | 128 | class ChangeTypeColumnForStream < ActiveRecord::Migration
def change
rename_column :streams, :type, :stream_type
end
end
| 21.333333 | 57 | 0.789063 |
bf5b3e20d8a3ee1461d59b1d28e2a667d32fb8b3 | 183 | require File.dirname(__FILE__) + '/../../../spec_helper'
require 'vmactor'
describe "VMActor::Container#initialize" do
it "needs to be reviewed for spec completeness" do
end
end
| 22.875 | 56 | 0.726776 |
bbda5396146a6efa91a3a2f8ba0e96c1b2b6b766 | 59 | class Club < ApplicationRecord
belongs_to :region
end
| 11.8 | 30 | 0.762712 |
62c74aeb74f50d8e1efa239b4652caba7861aa12 | 860 | cask "logseq" do
arch = Hardware::CPU.intel? ? "x64" : "arm64"
version "0.4.6"
if Hardware::CPU.intel?
sha256 "08d37337fe52bbdfa3d34a4fbd9034bb45712cfcbfb9c7d93310a05db68aadf2"
else
sha256 "fd0b5ded124f417e9d5813478ce39408212291747d4279b6b7867c6c8c64560f"
end
url "https://github.com/logseq/logseq... | 26.060606 | 106 | 0.727907 |
6a05dbe54c230bed065c252674000514298c2648 | 1,400 | require 'spec_helper'
describe 'role::ecs' do
it_behaves_like 'profile::base'
it_behaves_like 'profile::docker_host'
it_behaves_like 'role::defined', 'ecs'
it_behaves_like 'monitoring::cadvisor'
describe service('docker-amazon-ecs-agent') do
it { should be_enabled }
it { should be_running }
end
... | 33.333333 | 98 | 0.678571 |
f8a31d85c42eceb9f41ab1e0a013f4ece879729e | 374 | class ClimatePeriod < Weatherzone::Resource
include Weatherzone::Helpers::Units
attributes :name
has_elements :mean_temp_min_c, :mean_temp_max_c, :rain_days, :mean_rainfall_mm
has_attribute :units, :on_elements => [:mean_temp_min_c, :mean_temp_max_c, :mean_rainfall_mm]
temperature :mean_temp_min_c, :mean_temp... | 46.75 | 95 | 0.818182 |
87dc642ebc4ef52d51bef4a96c8670ff397ca2c8 | 3,243 | class User < ApplicationRecord
has_many :microposts, dependent: :destroy
has_many :active_relationships, class_name: "Relationship",
foreign_key: "follower_id",
dependent: :destroy
has_many :passive_relationships, class_name: "Relationship",
... | 29.481818 | 78 | 0.679618 |
6140bd8224baa4cbdfd86118f90d8cbbe02c75ba | 834 | # Require core library
require "middleman-core"
# Extension namespace
class MyExtension < ::Middleman::Extension
option :my_option, "default", "An example option"
def initialize(app, options_hash={}, &block)
# Call super to build options from the options_hash
super
# Require libraries only when activ... | 20.85 | 58 | 0.720624 |
ff18baae0e254ff91793198efaf8c706f510f656 | 802 | # frozen_string_literal: true
require 'nokogiri'
require_relative '../base/constants'
module StgToolkit
module Utils
module ConfigXml
include StgToolkit::Base::Constants
FILEPATH = "#{FULL_CODE_PATH}/config.xml"
def update_config_xml(name:, description:, widget_id:)
load_config_xml
... | 22.914286 | 70 | 0.653367 |
4a980524aee5d6f6215cab0816d17b858e261b33 | 4,472 | configatron.configure_from_hash(
:app_host => "example.com", #override this in your application.yml
:community_name => "Community",
:community_tagline => "CommunityEngine Rocks!",
:community_description => "The Best Place for People Who Love Communities",
:support_email => "support@community.com",
:met... | 25.701149 | 108 | 0.579606 |
fff6502358e730816fc05e73d26240cbf48e84c8 | 415 | require 'rubygems'
gem 'activeresource'
require 'active_resource'
require 'miter/active_resource_fix'
module Miter
class Base < ActiveResource::Base
def self.auth(user, token)
user, token = CGI.escape(user), CGI.escape(token)
self.site = "http://#{user}:#{token}@appmite.de/api/"
end
... | 17.291667 | 60 | 0.66988 |
b987ec3baeca67f795e38df624e7c965c03a079a | 73 | module VagrantPlugins
module Parallels
VERSION = '2.0.0'
end
end
| 12.166667 | 21 | 0.69863 |
1d9385f4979f5dd15780b18b467d2451271cb7ad | 2,063 | # frozen_string_literal: true
ActiveAdmin.register User do # rubocop:disable Metrics/BlockLength
config.sort_order = 'last_name_asc'
scope 'Active users', :active, default: true
scope 'Deactivated users', :deactivated
scope :all
filter :first_name
filter :last_name
filter :email
filter :role, as: :s... | 25.158537 | 87 | 0.666505 |
08a337bba40722f9bd1f157469a30b2e79dca4c8 | 584 | class Transfer
include ActiveModel::Model
attr_accessor :source_account_id, :destination_account_id, :amount
attr_reader :source_account
validates :source_account_id, :destination_account_id, :amount, presence: true
validate :balance
def balance
return if amount.blank?
return true unless (source... | 20.857143 | 80 | 0.746575 |
0837861e541292c2780892d58a6001eba862b196 | 1,661 | =begin
#OEML - REST API
#This section will provide necessary information about the `CoinAPI OEML REST API` protocol. <br/> This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a> <br/><br/> Implemented Standards: * [HTTP1.... | 34.604167 | 465 | 0.733895 |
8798e93481066bf4831ba71aef1beb4dc71e1416 | 1,499 | require_relative "categories/constants"
module Unicode
module Categories
def self.categories(string, **options)
res = []
string.each_char{ |char|
category_name = category(char, **options)
res << category_name unless res.include?(category_name)
}
res.sort
end
cl... | 32.586957 | 89 | 0.649099 |
0161ce8ffeef0d46d2164e7fb6d9c70fb9f3ee8e | 33,980 | # frozen_string_literal: false
require 'test/unit'
class ComplexSub < Complex; end
class Complex_Test < Test::Unit::TestCase
def test_rationalize
assert_equal(1.quo(3), Complex(1/3.0, 0).rationalize, '[ruby-core:38885]')
assert_equal(1.quo(5), Complex(0.2, 0).rationalize, '[ruby-core:38885]')
assert_eq... | 30.124113 | 90 | 0.626251 |
ac32470eda0b8222867d9feac59eac5ae24b4ff8 | 440 | module ProsperWorks
class BaseEntity < Base
# used for the 6 main entity types
attr_accessor :assignee_id,
:custom_fields,
:date_modified,
:details,
:name,
:tags
extend ApiOperations::Create
extend ApiOperati... | 20 | 38 | 0.584091 |
01f4c25d81177d92ad9705d1c40d7aad1573b538 | 964 | class AwsVault < Formula
desc "Securely store and access AWS credentials in development environments"
homepage "https://github.com/99designs/aws-vault"
url "https://github.com/99designs/aws-vault/archive/v4.7.1.tar.gz"
sha256 "a63163f2d1d344da19621c0b1d15dd2ed952abd2a7aa5e8f88f000ad71e6630a"
# tag "linux"
... | 30.125 | 138 | 0.71888 |
01a8b73b5304b6a17d3000f1630a64575eff6d05 | 1,254 | require 'test_helper'
class Attend::AbsenceStatsControllerTest < ActionDispatch::IntegrationTest
setup do
@absence_stat = create :absence_stat
end
test "should get index" do
get admin_absence_stats_url
assert_response :success
end
test "should get new" do
get new_admin_absence_stat_url
... | 25.591837 | 85 | 0.761563 |
6a4fc69264366bcc8bc86d29f7ad9cac1eaed6f8 | 2,071 | # 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 core properties of ARM resources.
#
class Resource
include MsRestAzure
# ... | 25.8875 | 72 | 0.489619 |
bf116eea244a2cdc7baf76df845146dd1f4217d1 | 638 | module TagsHelper
def tag_partial(model_instance)
locals = {model: model_instance.class, tags: model_instance.tags, show_add_tag: true}
{partial: 'shared/tag_list', locals: locals}
end
def index_tag_partial(model, tags)
locals = {model: model, tags: tags, show_add_tag: false}
{partial: 'shared/ta... | 22.785714 | 89 | 0.683386 |
61f51272b738a6cfcf0ad592d5e2b99c697dbfd4 | 80 | class Unit < ApplicationRecord
belongs_to :condo
has_many :packages
end
| 16 | 30 | 0.75 |
2823fe54a07c353aedd28222bb9b61fee8b91935 | 1,399 | class Ghz < Formula
desc "Simple gRPC benchmarking and load testing tool"
homepage "https://ghz.sh"
url "https://github.com/bojand/ghz/archive/v0.90.0.tar.gz"
sha256 "fbfd832bd81d4ae5b9bcd90b6a441dcfcd63e6519eda16dcab6282ddb06cbc8f"
license "Apache-2.0"
bottle do
sha256 cellar: :any_skip_relocation, ar... | 35.871795 | 122 | 0.714796 |
019dd35ce533c860d9b812754cf4e7d8dce7bc48 | 37 | require "simplecov"
SimpleCov.start
| 9.25 | 19 | 0.810811 |
796f0ff5a7f61a5e3771e98f20d75d6ea264aac1 | 34,026 | # frozen_string_literal: true
require "action_view/helpers/javascript_helper"
require "active_support/core_ext/array/access"
require "active_support/core_ext/hash/keys"
require "active_support/core_ext/string/output_safety"
module ActionView
# = Action View URL Helpers
module Helpers #:nodoc:
# Provides a set... | 44.07513 | 139 | 0.585787 |
ab973255fdf54000cb014e06e5ba0a90914a14fa | 482 | require File.dirname(__FILE__) + '/../test_helper'
require 'credit_controller'
# Re-raise errors caught by the controller.
class CreditController; def rescue_action(e) raise e end; end
class CreditControllerTest < Test::Unit::TestCase
def setup
@controller = CreditController.new
@request = ActionControll... | 25.368421 | 61 | 0.744813 |
1d201aca8443de27961a67970aa0429d44b2cd94 | 528 | # encoding: UTF-8
# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).
module TZInfo
module Data
module Definitions
module Africa
module Abidjan
include TimezoneDefinition
timezone 'Africa/Abidjan' do |tz|
... | 22 | 71 | 0.566288 |
f7241ff02b3439791030fe970dab83c4f2f00abd | 1,918 | class Chat::HistoriesController < ApplicationController
include Cms::BaseFilter
include SS::CrudFilter
model Chat::History
navi_view "cms/node/main/navi"
private
def set_crumbs
@crumbs << [@model.model_name.human, action: :index]
end
def cond
{ site_id: @cur_site.id, node_id: @cur_node.id }... | 24.278481 | 118 | 0.624609 |
8760384cfbab0d8317050ca6aefb76e4c4678c00 | 11,847 | # frozen_string_literal: true
require "liquid"
require "asciidoctor"
require "asciidoctor/reader"
require "lutaml"
require "lutaml/uml"
require "metanorma/plugin/lutaml/utils"
module Metanorma
module Plugin
module Lutaml
# Macro for quick rendering of datamodel attributes/values table
# @example [... | 45.045627 | 288 | 0.61543 |
39864813e05fc8774266d8c4a44bb9bcc2405937 | 1,326 | require_relative 'base_shared2'
module Whois
class Parsers
# Parser for the whois.nic.tienda server.
#
# @see Whois::Parsers::Example
# The Example parser for the list of all available methods.
#
class WhoisNicTienda < BaseShared2
property_supported :status do
if available?... | 23.678571 | 135 | 0.57089 |
b9937111183e994310cf68621efa5869692e165f | 286 | # frozen_string_literal: true
module Jekyll
module LocalTheme
class Theme < Jekyll::Theme
def initialize(name, root)
@root = root
super(name)
end
private
def gemspec
@gemspec ||= MockGemspec.new(self)
end
end
end
end
| 15.052632 | 42 | 0.590909 |
ab41ac8c924156035794f8b997c017cb26938e86 | 530 | require 'rdf-config/endpoint'
class RDFConfig
class SPARQL
class DatasetGenerator < SPARQL
def initialize(config, opts = {})
if opts.key?(:endpoint_name)
endpoint = Endpoint.new(config, name: opts[:endpoint_name])
else
endpoint = Endpoint.new(config)
end
... | 23.043478 | 69 | 0.598113 |
28313a98468f91bdc0613d3d4406ae8130d4904a | 1,751 | # -*- encoding: utf-8 -*-
# stub: jekyll-theme-primer 0.6.0 ruby lib
Gem::Specification.new do |s|
s.name = "jekyll-theme-primer".freeze
s.version = "0.6.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.autho... | 42.707317 | 112 | 0.675614 |
ac67d32a7d6409f0e5cddc7e9d81d60431e65203 | 1,423 | # -*- encoding: utf-8 -*-
# stub: rb-fsevent 0.11.1 ruby lib
Gem::Specification.new do |s|
s.name = "rb-fsevent".freeze
s.version = "0.11.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.metadata = { "source_code_uri" => "https://github.com/th... | 39.527778 | 112 | 0.68728 |
6a3112927fa89799257c13868c1c82bfb07e7912 | 245 | require 'i18n'
require 'i18n/backend/fallbacks'
module I18n
def self.load_translations_path(path)
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
I18n.load_path += Dir[path]
I18n.backend.load_translations
end
end | 22.272727 | 66 | 0.746939 |
f77a636064938a4d6ec99366fec5231a1bbeed80 | 4,066 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'rex'
class MetasploitModule < Msf::Post
def initialize(info={})
super( update_info( info,
'Name' => 'Windows Escalate SMB Icon LN... | 42.8 | 118 | 0.573045 |
e9792f3e346776e2f078d91a3377aeb0005de893 | 1,037 | class Organization < ActiveRecord::Base
validates :name, presence: true, uniqueness: true
validates :ebu_id, presence: true, uniqueness: true
has_many :users, foreign_key: 'organization_id', primary_key: 'ebu_id'
def self.refresh
if organizations = self.get_orga_list
self.destroy_all(["ebu_id ... | 24.690476 | 84 | 0.606557 |
1a0abcaf9354b4cf667a86a7baede4a77491fe6d | 1,446 | class Libart < Formula
desc "Library for high-performance 2D graphics"
homepage "https://people.gnome.org/~mathieu/libart/libart.html"
url "https://download.gnome.org/sources/libart_lgpl/2.3/libart_lgpl-2.3.21.tar.bz2"
sha256 "fdc11e74c10fc9ffe4188537e2b370c0abacca7d89021d4d303afdf7fd7476fa"
# We use a commo... | 45.1875 | 93 | 0.769018 |
f86253dda6e0be345d223c8a190d2edc002e61c7 | 1,293 | # frozen_string_literal: true
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Dynamoid::IdentityMap do
before :each do
Dynamoid::Config.identity_map = true
end
after :each do
Dynamoid::Config.identity_map = false
end
context 'object identity' do
it 'maintains a si... | 26.9375 | 105 | 0.652746 |
625ca41e9ed6927ac38fc25ac8768dca30fdb75d | 705 | require 'aws/templates/utils'
module Aws
module Templates
module Help
module Rdoc
module Contextualized
##
# Context filtering documentation aspect provider
#
# Describes context filtering in a separate text block.
class Provider < Rdoc::Inheritable... | 23.5 | 100 | 0.598582 |
ac1410d8736254913d5e9071faea342001a580e1 | 783 | require 'bootstrap_pager/models/active_record_model_extension'
module BootstrapPager
module ActiveRecordExtension
extend ActiveSupport::Concern
included do
# Future subclasses will pick up the model extension
class << self
def inherited_with_bootstrap_pager(kls) #:nodoc:
inherit... | 34.043478 | 112 | 0.727969 |
bb29dbc3dd6d018ef15a2a4e0d4a74ddafb93d4e | 1,259 | require 'test_helper'
class UsersEditTest < ActionDispatch::IntegrationTest
def setup
@user = users(:jared)
end
test "unsuccessful edit" do
log_in_as(@user)
get edit_user_path(@user)
assert_template 'users/edit'
patch user_path(@user), params: { user: { name: "",
... | 33.131579 | 76 | 0.540905 |
6a6ecb04d95fb6f5f11ea182272bcdc530da9989 | 1,361 | class Csvq < Formula
desc "SQL-like query language for csv"
homepage "https://mithrandie.github.io/csvq"
url "https://github.com/mithrandie/csvq/archive/v1.15.0.tar.gz"
sha256 "0055bbf1fd6ae9beb93e768fbca8d8ab13d7f3f74e5ec841a92afa0293969a08"
license "MIT"
livecheck do
url :stable
regex(/^v?(\d+(?:... | 32.404762 | 122 | 0.725937 |
618bd3b2d61cb66411d97080022183f70ec9b647 | 1,625 | class GnuChess < Formula
desc "GNU Chess"
homepage "https://www.gnu.org/software/chess/"
url "https://ftp.gnu.org/gnu/chess/gnuchess-6.2.5.tar.gz"
mirror "https://ftpmirror.gnu.org/chess/gnuchess-6.2.5.tar.gz"
sha256 "9a99e963355706cab32099d140b698eda9de164ebce40a5420b1b9772dd04802"
revision 1
bottle do
... | 29.017857 | 93 | 0.705231 |
0134b384493aaff8db317f0d67a1046a41a328b1 | 81 | json.array! @raid_rewards, partial: "raid_rewards/raid_reward", as: :raid_reward
| 40.5 | 80 | 0.790123 |
ed82374466bc95387cd4d3dc13d4f1d358ad6c39 | 2,245 | require_relative './slim_transformer'
class SlimKeyfy::Transformer::VueTransformer < SlimKeyfy::Transformer::SlimTransformer
def self.slim?
true
end
BEFORE = /(?<before>.*[\( ^])/
HTML_ARGUMENTS = {
placeholder: /(?<html_tag>[a-z\-]*placeholder=\s*)/,
title: /(?<html_tag>... | 26.72619 | 112 | 0.588864 |
610baf5c04d3eafb1fde3647452e191de8615325 | 2,811 | feature 'Search contexts' do
let(:exhibit) { FactoryBot.create(:exhibit) }
let(:exhibit_curator) { FactoryBot.create(:exhibit_curator, exhibit: exhibit) }
let(:feature_page) do
FactoryBot.create(
:feature_page,
title: 'FeaturePage1',
exhibit: exhibit
)
end
before { login_as exhibit_c... | 31.943182 | 127 | 0.645322 |
1885cb7705ccceeff133bd5e316a357c22bec30b | 5,485 | require 'application_system_test_case'
class EditUserTest < ApplicationSystemTestCase
def setup
super
@user = users(:participant)
sign_in(@user)
end
def teardown
super
clear_email_deliveries
end
def test_edit_form_contains_existing_values
visit edit_user_path(@user.uuid)
coun... | 32.844311 | 99 | 0.73309 |
91a363b4c2bc567da2aaa052f0f409a397aeb78c | 11,211 | # encoding: utf-8
require "spec_helper"
describe Mongoid::Config do
after(:all) do
if defined?(RailsTemp)
Rails = RailsTemp
end
end
let(:standard_config) do
File.join(File.dirname(__FILE__), "..", "config", "mongoid.yml")
end
let(:utc_config) do
File.join(File.dirname(__FILE__), ".."... | 21.726744 | 89 | 0.649005 |
ff1c9c140f28128f69a4040c0ed142a3db1bfd63 | 588 | Gem::Specification.new do |s|
s.name = "eeml-simple"
s.version = "0.2.0"
s.date = "2010-01-10"
s.summary = "A Ruby wrapper around the Extended Environments Markup Language"
s.email = "james@floppy.org.uk"
s.homepage = "http://github.com/Floppy/eeml-ruby"
s.has_rdoc = true
s.authors = ["James Smith"]
s... | 39.2 | 145 | 0.656463 |
613309ed581949b2b62446e772ffbbda8bf87eb4 | 256 | module Saxerator
class FullDocument
include DSL
def initialize(source, config)
@source = source
@config = config
@latches = []
end
def all
DocumentFragment.new(@source, @config, @latches).first
end
end
end
| 16 | 60 | 0.621094 |
abdcdde536672bdbfb73ec95bef68b4cec8ae8a5 | 680 | shared_context "enable signin api" do
let(:enable_signin_api) { true }
before do
allow(Schools::DFESignInAPI::Client).to \
receive(:enabled?) { enable_signin_api }
end
end
shared_context "stub role check api" do
include_context "enable signin api"
let(:role_check_class) { Schools::DFESignInAPI::Ro... | 27.2 | 74 | 0.738235 |
28d510198c2afdb29dae8acd4c95af0497e8b0ad | 38 | class AwsData
VERSION = "0.1.1"
end
| 9.5 | 19 | 0.657895 |
7a46a1bf7bc2af4174d7ea3c5d9b1a9054c3224a | 3,352 | require 'spec_helper'
require 'shared_contexts'
describe 'freeradius::sql' do
# by default the hiera integration uses hiera data from the shared_contexts.rb file
# but basically to mock hiera you first need to add a key/value pair
# to the specific context in the spec/shared_contexts.rb file
# Note: you can on... | 38.090909 | 208 | 0.605907 |
1adeec4453e1a8457afd8da6346e21ec577d15f7 | 14,153 | # @api private
module Puppet::Environments
class EnvironmentNotFound < Puppet::Error
def initialize(environment_name, original = nil)
environmentpath = Puppet[:environmentpath]
super("Could not find a directory environment named '#{environment_name}' anywhere in the path: #{environmentpath}. Does the... | 27.642578 | 159 | 0.655197 |
873b88c6d4779c1d00594f6d43291f80362a6bba | 1,484 | # encoding: UTF-8
$:.push File.expand_path('../lib', __FILE__)
require 'solidus_mailchimp_sync/version'
Gem::Specification.new do |s|
s.name = 'solidus_mailchimp_sync'
s.version = SolidusMailchimpSync::VERSION
s.summary = 'Solidus -> Mailchimp Ecommerce synchronization'
s.license = 'BSD-3-Cl... | 41.222222 | 79 | 0.694744 |
912e01395c56c9e5ce073ca184dd8e947bb582b0 | 3,088 | require 'cgi'
require 'time'
xml.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
xml.rss "xmlns:itunes" => "http://www.itunes.com/dtds/podcast-1.0.dtd", "xmlns:atom" => "http://www.w3.org/2005/Atom", "xmlns:content" => "http://purl.org/rss/1.0/modules/content/", "xmlns:media" => "http://search.yahoo.com/mrss/", :v... | 44.114286 | 252 | 0.642811 |
f71edfbf63afe7ea806e254ce4a17aa8727d016c | 177 | class CreateApplicationRecords < ActiveRecord::Migration
def change
create_table :application_records do |t|
t.text :responses
t.timestamps
end
end
end
| 17.7 | 56 | 0.717514 |
e277a0374118e9311a78006269fc98297d399222 | 372 | # coding: utf-8
require 'bundler/setup'
require_relative '../lxc-manager'
require 'optparse'
class LxcManager
class Cli
end
end
if __FILE__ == $0
params = ARGV.getopts(
'',
'create-container:',
'destroy-container:',
'create-network:',
'destroy-network:',
'take-snapshot:',
'destroy-snapshot:',
'r... | 13.285714 | 33 | 0.66129 |
4a5ab4a23df3ed1a2b59dd1924f2bd7b03aefe85 | 2,526 | # -*- encoding: utf-8; frozen_string_literal: true -*-
#
#--
# This file is part of HexaPDF.
#
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
# Copyright (C) 2014-2019 Thomas Leitner
#
# HexaPDF is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero Genera... | 36.608696 | 98 | 0.71734 |
bf39e6408a7f09a6b461981423621a911eb0fad6 | 2,427 | lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'lifx_dash/version'
Gem::Specification.new do |spec|
spec.name = "lifx_dash"
spec.version = LifxDash::VERSION
spec.authors = ["Matthew Hutchinson"]
spec.email = ["matt@hiddenl... | 37.921875 | 99 | 0.693037 |
ace6b577914349fd0fe0aab102a65d4c8cebde93 | 6,974 | # Copyright:: (c) Autotelik Media Ltd 2010
# Author :: Tom Statter
# Date :: Aug 2010
# License:: MIT ?
#
# Details:: Specific over-rides/additions to support Spree Products
#
require 'loader_base'
require 'csv_loader'
require 'excel_loader'
require 'image_loading'
require 'mechanize'
module DataShift
c... | 38.530387 | 141 | 0.64382 |
ac99a84eb0b3682d6ec04f618c8e8dc4b1697726 | 13,055 | #
# The MIT License
# Copyright (c) 2015 Estonian Information System Authority (RIA), Population Register Centre (VRK)
#
# 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, i... | 27.254697 | 98 | 0.692761 |
1a74eb32b420fea13123e0f91b2f0bf133577d2d | 376 | DEFAULT_API_VERSION = '2.0'.freeze
DEFAULT_AUTHORIZATION_TYPE = 'Bearer'.freeze
TEST_SAMPLE_URL = 'https://eloqua-api-wrapper.com/API/REST/{version}/'.freeze
TEST_SAMPLE_TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9'.freeze
HTTP_OK_CODE = 200
HTTP_BAD_REQUEST_CODE = 400
HTTP_UNAUTHORIZED_CODE = 401
HTTP_FORBIDDEN_CODE ... | 34.181818 | 77 | 0.827128 |
ab749975bdcc29cf142c5f6b6204a5c837608599 | 2,795 | require 'dav4rack/logger'
module DAV4Rack
class Handler
include DAV4Rack::HTTPStatus
def initialize(options={})
@options = options.dup
unless(@options[:resource_class])
require File.expand_path('../resources/file_resource', __FILE__)
@options[:resource_class] = FileResource... | 39.928571 | 178 | 0.630769 |
03e533c00183f8cfa6e80a66da37f3b1531113f7 | 1,615 | module PindsUtils
class Enumeration
include Comparable
def self.names() end
def self.labels() end
def initialize(index)
unless @index = self.class.names.index(index)
raise "Illegal value '#{index}'" unless (index.is_a?(String) ? index =~ /^[0-9]+$/ : index.respond_to?(:to_i))
... | 18.563218 | 118 | 0.540557 |
ff3707d8c458d54732bbaa4a298b70ccd52f38c4 | 719 | =begin
Given two strings s and t , write a function to determine if t is an anagram of s.
Example 1:
Input: s = "anagram", t = "nagaram"
Output: true
Example 2:
Input: s = "rat", t = "car"
Output: false
Note:
You may assume the string contains only lowercase alphabets.
Follow up:
What if the inputs contain unicode ... | 21.147059 | 94 | 0.662031 |
b90dcbd6d5ef950afc0cf3686e6877aedbeea69d | 619 | require_relative '../../test_helper'
module Sip
class AnexoTest < ActiveSupport::TestCase
PRUEBA_ANEXO= {
descripcion: 'x',
fecha: "2014-11-11",
created_at: "2014-11-11"
}
test "simple" do
anexo = Anexo.new PRUEBA_ANEXO
anexo.adjunto = File.new(Rails.root + 'db/seeds.rb')
... | 19.967742 | 58 | 0.617124 |
b965f30491ac19efc50766e68ac5ed81cd38f781 | 1,444 | class CompactingFormResponseChangesPresenter
attr_reader :changes
def initialize(changes)
@changes = changes
end
def compacted_changes
group_changes(changes).map do |grouped_changes|
next if grouped_changes.first.previous_value == grouped_changes.last.new_value
build_omnibus_change(grouped... | 30.083333 | 84 | 0.751385 |
e2c367a0cdb768ac94209037815dc99ec4b04b23 | 419 | # typed: false
module ObjectHelpers
RSpec::Matchers.define :be_a_frozen_copy_of do |expected|
match do |actual|
expect(actual).to eq expected
expect(actual).to_not be expected
expect(actual.frozen?).to be true
end
end
RSpec::Matchers.define :be_a_copy_of do |expected|
match do |act... | 22.052632 | 59 | 0.689737 |
18a10e5692f821ca92c3a3156e30dd83dc6921f5 | 130 | class AddUseridToAlbums < ActiveRecord::Migration[5.1]
def change
add_reference :albums, :user, foreign_key: true
end
end
| 21.666667 | 54 | 0.753846 |
b9a0a2664c6e70fc782cd76d907dd083f88600b2 | 299 | class Item
attr_reader :name, :price
def initialize(name, price)
@name = name
@price = price
end
end
class BasketItem < Item
attr_reader :qty
def initialize(name, price, qty)
super(name, price)
@qty = qty
end
def update_quantity(new_qty)
@qty = new_qty
end
end
| 14.95 | 34 | 0.658863 |
1a7c01c926bb074f21c9f2735d52741c37403d1a | 387 | module MarianaApi::AdminApi::Resources
class TenantBrands
def initialize(http_client)
@http_client = http_client
end
def list(params = {})
@http_client.get('/api/tenant_brands', params: params, auth_type: :none).force
end
def read(id, params = {})
@http_client.get("/api/tenant_... | 24.1875 | 84 | 0.661499 |
d5791de5ac721fad156eed170306faf34ee58a62 | 75 | # frozen_string_literal: true
# config.ru
require './app'
run ChillbudApp
| 12.5 | 29 | 0.76 |
ab8eae467455f26a6387c7a7d2028b7e0c3e496b | 709 | # frozen_string_literal: true
class NullifyUsersRole < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
INDEX_NAME = 'partial_index_users_updated_at_for_cleaning_mistaken_values'
DOWNTIME = false
def up
# expected updated users count is around 10K
# ... | 26.259259 | 89 | 0.74048 |
1cf7dcc0b4a33f62705521b0f033d32d33652feb | 1,167 | module Catmq
class Container::Queue
attr_accessor :array, :max_size, :size, :tail
def initialize(max_size = 10000)
# 用来存放数据的数组
self.array = []
# 队列最大长度
self.max_size = max_size
# 队列已存放元素个数(队列长度)
self.size = 0
# 队尾位置
self.tail = 0
end
alias :length :siz... | 21.611111 | 65 | 0.586975 |
e8c685b354aeaf2129e4082fbd26363a63d4cda4 | 3,616 | # typed: true
# frozen_string_literal: true
module Tapioca
module Helpers
module Test
# Copied from ActiveSupport::Testing::Isolation since we cannot require
# constants from ActiveSupport without polluting the global namespace.
module Isolation
extend T::Sig
require "thread"
... | 28.698413 | 104 | 0.488385 |
bf59c87a9e0ed0fe8db53b0eea0f39f9ac5c9bec | 1,355 | #
# Author:: Adam Jacob (<adam@chef.io>)
# Copyright:: Copyright (c) Chef Software 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
#
# http://... | 35.657895 | 415 | 0.735793 |
28e914fbfbbb4119c279afb0408ec1767efbd6b3 | 441 | $:.unshift File.dirname(__FILE__)
require "rubygems"
require "hpricot"
class Symbol
def to_proc
Proc.new { |obj, *args| obj.send(self, *args) }
end
end
require 'things/version'
require 'things/document'
require 'things/focus'
require 'things/task'
module Things
class FocusNotFound < StandardError; end
c... | 18.375 | 51 | 0.723356 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.