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 |
|---|---|---|---|---|---|
792df7ffa8783735377c96b957cb5489753a4490 | 403 | require "coveralls"
Coveralls.wear!
require "bundler/setup"
require "nutrientes"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_mon... | 22.388889 | 66 | 0.756824 |
e26086c36d4c24962978b7a8db0028f16eebb63a | 92 | ActionController::Dispatcher.to_prepare do
BaseController.renders_in_context :section
end
| 23 | 44 | 0.869565 |
38a3f3f504357b159f387f3a27bc16c721b8436e | 371 | # This migration shouldn't change these column types, but we need it to stick around
# so just comment out column changes
class IntsToBigint < ActiveRecord::Migration[5.1]
def up
remove_foreign_key :users, :roles
# change_column :users, :role_id, :bigint
end
def down
# change_column :users, :role_id,... | 26.5 | 84 | 0.725067 |
bf17f91a5cf86cd953ac74a0584c65c4e9ad3668 | 7,114 | # Copyright (c) 2015 Vault12, Inc.
# MIT License https://opensource.org/licenses/MIT
class SessionController < ApplicationController
include TransactionHelper
before_action :preamble
# POST /start_session - start handshake
def start_session_token
reportCommonErrors("start_session_token error ") do
... | 32.190045 | 98 | 0.691453 |
1cb824003ef13a80431755971c736e9dfa6617aa | 929 | class Libmonome < Formula
desc "Interact with monome devices via C, Python, or FFI"
homepage "http://illest.net/libmonome/"
url "https://github.com/monome/libmonome/releases/download/v1.4.0/libmonome-1.4.0.tar.bz2"
sha256 "0a04ae4b882ea290f3578bcba8e181c7a3b333b35b3c2410407126d5418d149a"
head "https://github... | 37.16 | 92 | 0.76211 |
d588720155da4bc3407d0cb9c8cd5fc999468a9d | 1,613 | # frozen_string_literal: true
# encoding: utf-8
module Seorel
module Model
module InstanceMethods
def seorel?
try(:seorel).present?
end
def seorel_changed_mode?
::Seorel.config.store_seorel_if.eql?(:changed)
end
def should_update_seo_title?
seorel_changed_m... | 28.803571 | 106 | 0.688779 |
e2f371a453a271d6961792c4d975873acad60486 | 598 | Pod::Spec.new do |s|
s.name = 'XMCommon'
s.version = '0.1.1'
s.license = 'MIT'
s.summary = 'extension class.'
s.description = %{XMCommon is a extension Class.}
s.homepage = 'https://github.com/rgshio/XMCommon'
s.author = { 'rgshio' => 'rgshio@qq.com' }
s.source =... | 31.473684 | 96 | 0.600334 |
38234dff872e139be706ce430ee36572422a26e2 | 978 | Pod::Spec.new do |s|
s.name = 'ksyhttpcache'
s.version = '1.2.4'
s.license = {
:type => 'Proprietary',
:text => <<-LICENSE
Copyright 2015 kingsoft Ltd. All rights reserved.
LICENSE
}
s.homepage = 'https://github.com/ksvc/ksyhttpcache_ios'
s.authors = { 'ksyun' => 'zeng... | 33.724138 | 146 | 0.654397 |
7acf056d6d0f5434a3d93602357ce40d1199eac2 | 5,080 | Shindo.tests('Fog::AWS[:dynamodb] | item requests', ['aws']) do
@table_name = "fog_table_#{Time.now.to_f.to_s.gsub('.','')}"
unless Fog.mocking?
Fog::AWS[:dynamodb].create_table(
@table_name,
{'HashKeyElement' => {'AttributeName' => 'key', 'AttributeType' => 'S'}},
{'ReadCapacityUnits' => 5,... | 36.811594 | 170 | 0.529134 |
d50564d8923790bf4da5d45a637e2ffa3a9e0259 | 186 | class ApplicationController < ActionController::Base
before_action :force_sso_user
after_action :verify_authorized, except: [:index, :who_impersonate, :impersonate, :shibboleth]
end
| 37.2 | 96 | 0.817204 |
0170df719d7d64475f055f5df8d6747a9fdb0724 | 781 | cask 'font-monoid-halftight-xtrasmall-dollar-nocalt' do
version :latest
sha256 :no_check
# github.com/larsenwork/monoid was verified as official when first introduced to the cask
url 'https://github.com/larsenwork/monoid/blob/release/Monoid-HalfTight-XtraSmall-Dollar-NoCalt.zip?raw=true'
name 'Monoid-HalfTig... | 39.05 | 111 | 0.775928 |
5d4644202ac860220f2d1cd209e8a415a5e70db3 | 2,708 | #--
# Copyright (c) 2006-2009, John Mettraux, jmettraux@gmail.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 without limitation the rights
# to use, copy... | 24.844037 | 79 | 0.656942 |
bfa2aaaa833b01402754303e3d475f9b4a1e44b1 | 313 | # Class of an Hervester or WSDL files
Class WSDLHervester
# method used for initialization of an class
def initialize
end
# method used for download of an wsdl file
def downloader(file_location)
end
# method used to parse wsdl file
def parser
end
# method used to display
def method_name
end
end | 12.52 | 44 | 0.757188 |
e9ee98a128041f4ba6c8ef0e07cff789fce9a559 | 4,727 | require 'active_support/core_ext/object/duplicable'
require 'active_support/core_ext/string/inflections'
module ActiveSupport
module Cache
module Strategy
# Caches that implement LocalCache will be backed by an in-memory cache for the
# duration of a block. Repeated calls to the cache for the same ke... | 29.360248 | 115 | 0.566744 |
87544b9c9426cd06cac9f4a9e4ac2d0a9d96a09e | 2,010 | 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... | 35.892857 | 87 | 0.756219 |
e8b0020d7539ff77fbc7bfee73d3a24d4f8f730f | 1,434 | FactoryGirl.define do
factory :user do
password Devise.friendly_token[0, 20]
email 'user@test.com'
name 'erikdstock'
after(:create) do |user, _evaluator|
create(:authentication, user: user)
end
# after(:build) { |u| u.class.skip_callback(:create, :after, :queue_initial_refresh) }
#... | 36.769231 | 98 | 0.681311 |
388da4a1007888aa17f42c804ee3dd3af0e380ae | 1,555 | module Vodka
class Configuration
attr_accessor :request_secret, # Secret token to use in signing requests, stronger is better
:response_secret, # Secret token to use in signing responses, stronger is better
:digest, # Digest algorithm to use in... | 37.02381 | 114 | 0.630868 |
ed603cdb3ac8a74f4faba5aa171d16b9b06cb20c | 5,009 | =begin
PureCloud Platform API
With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more.
OpenAPI spec version: v2
Contact: DeveloperEvangelists@genesys.com
Generated by: https://github.com/swagger-ap... | 24.553922 | 177 | 0.593332 |
7a770da92eb1feb7dcf704c740c41612ab9a7de7 | 2,686 | require 'active_support/concern'
module KonoUtils::Concerns
module BaseModals
extend ActiveSupport::Concern
def create
authorize @obj if defined? Pundit
save_response
end
def destroy
authorize @obj if defined? Pundit
@obj.destroy
respond_to do |f|
f.json { rende... | 27.690722 | 134 | 0.540208 |
e92f4a65989e35d36d03aff4ffd1ca9c91c8b2eb | 268 | class CreateStartupApplications < ActiveRecord::Migration[5.1]
def change
create_table :startup_applications do |t|
t.string :name
t.string :email
t.string :phone
t.text :idea
t.string :website
t.timestamps
end
end
end
| 19.142857 | 62 | 0.652985 |
0822de92dbe680919c922104181990457d2eb5e5 | 2,537 | require File.expand_path("../Abstract/abstract-osquery-formula", __FILE__)
class Thrift < AbstractOsqueryFormula
desc "Framework for scalable cross-language services development"
homepage "https://thrift.apache.org/"
license "Apache-2.0"
url "http://www-us.apache.org/dist/thrift/0.10.0/thrift-0.10.0.tar.gz"
... | 32.948052 | 108 | 0.644462 |
1cdb986ba0269d5d7248db65d260ef6c1f1eb644 | 3,975 | #-- encoding: UTF-8
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2021 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProje... | 35.810811 | 123 | 0.653585 |
1cc5d3fe7645f37b045c1ab19eb3b061bad9d09c | 124 | require "immutablejs/rails/version"
module Immutablejs
module Rails
class Engine < ::Rails::Engine
end
end
end
| 13.777778 | 35 | 0.717742 |
e87bd78a3689d4c2130dfd34eec4a72322472e38 | 723 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'formtastic_i18n/version'
Gem::Specification.new do |spec|
spec.name = "formtastic_i18n"
spec.version = FormtasticI18n::VERSION
spec.authors = ["Timo Schilling"]
spec.... | 34.428571 | 73 | 0.662517 |
115e3b498c3170faed0e22874b4a5a43c7528032 | 337 | Rails.application.routes.draw do
mount Hyperstack::Engine => '/hyperstack' # this route should be first in the routes file so it always matches
get '/(*others)', to: 'hyperstack#App'
# get '/(*others)', to: 'hyperstack#app'
# For details on the DSL available within this file, see http://guides.rubyonrails.org/... | 48.142857 | 113 | 0.721068 |
b9b37c8885f7278b1566949ed21d4f2e2a33f9ff | 4,187 | module Oz
class CoreElement;
end
OzLoader.require_all('./elements')
class CoreElement
def self.type
:core_element
end
@@locator_options = [:id, :class, :xpath, :text, :href, :for, :name, :css, :index]
def self.locator_options
@@locator_options
end
attr_reader :name, :acti... | 25.845679 | 140 | 0.624313 |
91e436f445cc737c307d1455f13ecc5fd8a3e486 | 3,141 | require 'fog/core/collection'
require 'fog/rackspace/models/compute_v2/server'
module Fog
module Compute
class RackspaceV2
class Servers < Fog::Collection
model Fog::Compute::RackspaceV2::Server
# Returns list of servers
# @return [Fog::Compute::RackspaceV2::Servers] Retrieves a... | 46.880597 | 129 | 0.622732 |
e2e44b86748acef1f43cd5a0238bbf19a0530943 | 5,065 | #!/opt/puppetlabs/puppet/bin/ruby
require 'json'
require 'puppet'
def budgets_create_or_update_by_resource_group_name(*args)
header_params = {}
argstring = args[0].delete('\\')
arg_hash = JSON.parse(argstring)
# Remove task name from arguments - should contain all necessary parameters for URI
arg_hash.dele... | 32.467949 | 186 | 0.669497 |
1df7c4b4d1d1f5fdadea9f8be293b0d1cda0cecd | 1,493 | module DataMapper
# Tracks objects to help ensure that each object gets loaded only once.
# See: http://www.martinfowler.com/eaaCatalog/identityMap.html
class IdentityMap
# Get a resource from the IdentityMap
def get(key)
raise ArgumentError, "+key+ is not an Array, but was #{key.class}" unless Arr... | 28.169811 | 128 | 0.64568 |
187db146525c84ee269737c8db62842b7ef68b9a | 1,297 | module HealthSeven::V2_6
class Fhs < ::HealthSeven::Segment
# File Field Separator
attribute :file_field_separator, St, position: "FHS.1", require: true
# File Encoding Characters
attribute :file_encoding_characters, St, position: "FHS.2", require: true
# File Sending Application
attribute :file_sending_app... | 40.53125 | 75 | 0.754048 |
abf79a7c9fbb108d97cdf26f997d6b7c3b8ae707 | 566 | require 'spec_helper'
def run_Candles
load(File.expand_path('../../Candles.rb', __FILE__))
end
describe "Candles" do
it "Sample case" do
allow(STDIN).to receive(:gets).and_return("4\n")
expect { run_Candles }.to output("45\n").to_stdout
end
it "Test case #1" do
allow(STDIN).to receive(:gets).and_r... | 24.608696 | 54 | 0.659011 |
bb57bcc3089839bc89bbe597aadcd3123e17ee0f | 686 | require_relative "test_helper"
class BindingTest < StdlibTest
target Binding
using hook.refinement
def test_eval
binding.eval('1', '(eval)', 1)
end
def test_local_variable_defined?
binding.local_variable_defined?(:yes)
yes = true
binding.local_variable_defined?('yes')
end
def test_loca... | 18.540541 | 42 | 0.728863 |
62afa441d6275d733ba3f96632d1ab070ae64f38 | 56 | require 'zgomot/ui/output'
require 'zgomot/ui/windows'
| 14 | 27 | 0.767857 |
28460bc64d94c64e49e387f41328acea458d9359 | 977 | # encoding: utf-8
module Backup
module Configuration
module Database
class MySQL < Base
class << self
##
# Name of the database that needs to get dumped.
# To dump all databases, set this to `:all` or leave blank.
attr_accessor :name
##
... | 22.72093 | 73 | 0.561924 |
620cb121d29d6436e8306fa5a8c049d192dafaae | 20,223 | =begin
#OpenAPI Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
OpenAPI spec version: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 4.0.0-SNAPSHOT
=end
require 'uri... | 39.421053 | 164 | 0.667903 |
bb0b18fe65c8f703221079eff1b9ad4dcdc1c2bf | 274 | class CreateSubscriptions < ActiveRecord::Migration
def change
create_table :subscriptions do |t|
t.references :leader, index: true, foreign_key: true
t.references :follower, index: true, foreign_key: true
t.timestamps null: false
end
end
end
| 24.909091 | 60 | 0.711679 |
7ab5b45573d3cff5e4580516bd1d4cd582a1ea5a | 1,062 | require 'active_record/migration'
require 'rails/generators/active_record'
module Roomer
module Generators
class MigrationGenerator < Rails::Generators::NamedBase
include Rails::Generators::Migration
extend ActiveRecord::Generators::Migration
include Roomer::Helpers::GeneratorHelper
sour... | 29.5 | 95 | 0.623352 |
4a60010d56d81a153a3b74fe0b9a2dc60e87aab8 | 1,320 | # frozen_string_literal: true
# WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
require 'aws-sdk-core'
require 'aws-sigv4'
require_relative 'aws-sdk-sms/types'
... | 24.90566 | 96 | 0.733333 |
21262c5c99244ae3e3a7dda2886a3425f3c60c42 | 322 | class Recipe < ApplicationRecord
belongs_to :user
belongs_to :original, class_name: "Recipe", optional: true
has_many :spinoffs, class_name: "Recipe", foreign_key: "original_id"
has_many :collector_favorites, foreign_key: "favorite_id"
has_many :collectors, class_name: "User", through: :collector_favorites
en... | 40.25 | 73 | 0.782609 |
e985ad8953f44e5a26fb506e3ca3af3daf933af8 | 1,764 | module SmartAnswer
class StatePensionAgeFlow < Flow
def define
content_id "5491c439-1c83-4044-80d3-32cc3613b739"
name "state-pension-age"
status :published
# Q1
radio :which_calculation? do
option :age
option :bus_pass
on_response do |response|
sel... | 23.210526 | 85 | 0.598073 |
1166f1eaeb6777b3320f33e5e56ef031c373a160 | 410 | class Issue
include MongoMapper::Document
key :account_id, ObjectId, :required => true
key :name, String, :required => true
key :description, String
key :projected, Date
key :notes, Array
timestamps!
attr_accessible :account_id, :description, :name, :new_note
attr_accessor :new_note
attr_read... | 20.5 | 61 | 0.712195 |
f8df11da6377f78b5d69b37cd5132d32ac6cb54b | 75 | # frozen_string_literal: true
json.partial! 'genres/genre', genre: @genre
| 18.75 | 43 | 0.76 |
03eee09f737bb86530efc01d944ef8f7ae16c7da | 1,947 | # frozen_string_literal: true
require 'spec_helper'
describe 'ActionMailer hooks' do
describe 'smime signature interceptor' do
before do
class_spy(ActionMailer::Base).as_stubbed_const
# rspec-rails calls ActionMailer::Base.deliveries.clear after every test
# https://github.com/rspec/rspec-rai... | 34.767857 | 112 | 0.671803 |
62753abfa110107b6a2634bcac75d804b4b5d8b4 | 585 | require 'spec_helper'
describe 'session creation' do
it 'should begin without a session' do
get(SESSION_PATH)
json.should_not have_key('sessionId')
end
it 'should generate a session ID' do
post(SESSION_PATH)
json.should have_key('sessionId')
end
it 'should not create a session when request... | 21.666667 | 95 | 0.729915 |
62d1d08a25441b6925cc9460b0da9d9cef0685b5 | 2,433 | # -*- coding: utf-8 -*-
# gems
require 'rubygems'
require 'bundler'
Bundler.require
if ENV['RACK_ENV'] == 'production'
# production config / requires
else
# development or testing only
require 'pry'
require 'awesome_print'
use Rack::ShowExceptions
end
# require the dependencies
$LOAD_PATH.unshift(File.dirn... | 21.723214 | 88 | 0.69626 |
5d7b6b24cf9c797c573c1dbb07201adb908bbeac | 561 | module Docker
class ServiceStarter
attr_reader :host_node
##
# @param [HostNode] host_node
def initialize(host_node)
@host_node = host_node
end
##
# @param [String] service_name
def start_service_instance(service_name)
self.request_start_service(service_name)
end
... | 18.096774 | 49 | 0.648841 |
ed810e64bd7a63bbee27d9e7318de598d29cabb5 | 56 | BetterErrors.editor = :macvim if Rails.env.development?
| 28 | 55 | 0.803571 |
1decca2a816fcaea3fd29be485fb73b70fb9ad27 | 1,021 | class InvitationCode < ApplicationRecord
hobo_model # Don't put anything above this
fields do
name :string, :unique, :null => false
total :integer, :null => false
used :integer, :null => false
trial_days :integer, :null => false
start_at :date, :null => false
end_at... | 22.688889 | 94 | 0.661117 |
d535e31cacf673cd7bf2e04afd5e8114a5ec067e | 387 | class CreateEntitiesLists < ActiveRecord::Migration[5.1]
def change
create_table :entities_lists, id: :uuid do |t|
t.string :listname
t.integer :position, default: 0
t.string :color
t.text :description
t.integer :visibility, default: 0
t.references :agent, foreign_key: { on_del... | 25.8 | 76 | 0.658915 |
abd0e268020554af479ab8abef0af5a614bf5412 | 2,479 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Auxiliary
include Msf::Exploit::Remote::Capture
def initialize(info = {})
super(
'Name' => 'Forge Cis... | 28.170455 | 98 | 0.570795 |
d5b268ba2971e77e720bd532d5f947c5e115eb48 | 511 | module Dashboard
class RemotePhoneCallEventsController < Dashboard::BaseController
private
def association_chain
if parent_resource
parent_resource.remote_phone_call_events
else
current_account.remote_phone_call_events
end
end
def parent_resource
phone_call if... | 19.653846 | 69 | 0.714286 |
ab24b2778866710ab0bc68b6c1c669308166c6dc | 6,316 | =begin
#Selling Partner API for Fulfillment Inbound
#The Selling Partner API for Fulfillment Inbound lets you create applications that create and update inbound shipments of inventory to Amazon's fulfillment network.
OpenAPI spec version: v0
Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Co... | 31.267327 | 250 | 0.639329 |
ac10794882415ecb521db79eb3525781012b2c4c | 173 | module Kaseya::VSA
class Client::Logs < Api
def alarms_by_agent(agent_guid, params = {})
get_many "assetmgmt/logs/#{agent_guid}/alarms", params
end
end
end | 24.714286 | 60 | 0.687861 |
08bde33d7b3405433b86da875bae9a927cea3577 | 7,961 | #
# Author:: Steven Danna (steve@opscode.com)
# Copyright:: Copyright (c) 2012 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | 29.705224 | 143 | 0.642633 |
bf8f50bbb74d544ed71a126477a96358fa11df0c | 6,434 | # WARNING ABOUT GENERATED CODE
#
# This file is generated. See the contributing guide for more information:
# https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
module Aws::EC2
class KeyPair
extend Aws::Deprecations
# @overload def initialize(name, options = {}... | 30.065421 | 102 | 0.627448 |
e8f755fc5f9028e9a168342c7ccedebe49164d00 | 58 | # frozen_string_literal: true
RailsRoutingChecker.valid!
| 14.5 | 29 | 0.844828 |
ed4b9203c91502e05943eee40359190fde4dc132 | 2,246 | require 'one_gadget/gadget'
# https://gitlab.com/libcdb/libcdb/blob/master/libc/libc6_2.19-10ubuntu2_i386/lib/i386-linux-gnu/libc-2.19.so
#
# Intel 80386
#
# GNU C Library (Ubuntu GLIBC 2.19-10ubuntu2) stable release version 2.19, by Roland McGrath et al.
# Copyright (C) 2014 Free Software Foundation, Inc.
# This is ... | 53.47619 | 158 | 0.60463 |
f8b3853da5a6b0ef55a405bebf4c1671e99b1ac5 | 252 | module CsCertificates
class UdlModuleCertificate < Certificate
def initialize(args={})
super(args)
@user_module_assessment = args.fetch(:user_module_assessment, nil)
end
def build_pdf
@pdf.text "This is a test pdf."
end
end
end
| 18 | 70 | 0.72619 |
1d538b2d6301e31edb3db2ae7b4a725079c5bf09 | 3,951 | #!/opt/puppetlabs/puppet/bin/ruby
require 'json'
require 'puppet'
def model_update_composite_entity(*args)
header_params = {}
argstring = args[0].delete('\\')
arg_hash = JSON.parse(argstring)
# Remove task name from arguments - should contain all necessary parameters for URI
arg_hash.delete('_task')
oper... | 30.392308 | 119 | 0.675778 |
f7e95af89892d6988ca1c2500fc503b938bec880 | 150 | ##
# BasicObject
assert('BasicObject') do
BasicObject.class == Class
end
assert('BasicObject superclass') do
BasicObject.superclass == nil
end
| 12.5 | 35 | 0.733333 |
267958147e149810681cd6e9ccaf087d5651673d | 1,804 | # frozen_string_literal: true
require_relative "lib/gem_test_yuno/version"
Gem::Specification.new do |spec|
spec.name = "gem_test_yuno"
spec.version = GemTestYuno::VERSION
spec.authors = ["Yunosuke Minegishi"]
spec.email = ["y.minegishi0924@gmail.com"]
spec.summary = "Thi... | 40.088889 | 104 | 0.686807 |
abd1b04939813b24d46c3a532e62b598b720cc00 | 138 | require 'test_helper'
class Api::PhotosControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end
| 17.25 | 60 | 0.724638 |
7a0b0a5e1e51ae8865099143c2da2db14092af71 | 1,080 | #!/usr/bin/env ruby
require 'sigdump/setup'
require 'emony/configuration'
require 'emony/engine'
config = Emony::Configuration.new(
sources: [
{
type: :network,
}
],
filters: {
'*' => [
{
type: :numeric,
key: 'reqtime',
float: true,
result_in_float: false,
... | 22.978723 | 103 | 0.513889 |
082570c55b3f5b856ae94863865a8fcd68e4946a | 1,945 | require "cases/helper"
require 'models/binary'
class SanitizeTest < ActiveRecord::TestCase
def setup
end
def test_sanitize_sql_hash_handles_associations
quoted_bambi = ActiveRecord::Base.connection.quote("Bambi")
quoted_column_name = ActiveRecord::Base.connection.quote_column_name("name")
quoted_tab... | 55.571429 | 129 | 0.760925 |
620928acb51a0453798dd802f13f814149c9bde9 | 1,214 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Logic::Mgmt::V2018_07_01_preview
module Models
#
# The integration account session filter.
#
class IntegrationAccountSessionFilter
incl... | 26.391304 | 76 | 0.58402 |
e86c9b976bbede09a822af5e68faa107bbe63734 | 397 | # frozen_string_literal: true
module Contex
class RailtiePostload < Rails::Railtie
initializer 'rails_context.postload' do |app|
path_rejector = lambda { |s| s == Rails.root.join('app', 'contexts').to_s }
app.config.eager_load_paths = app.config.eager_load_paths.reject(&path_rejector)
ActiveSup... | 30.538462 | 86 | 0.732997 |
79c798bb1a069ba1ed9024769f85c5dfe28d987e | 2,712 | #### releasinator config ####
configatron.product_name = "PayPal Python SDK"
# List of items to confirm from the person releasing. Required, but empty list is ok.
configatron.prerelease_checklist_items = [
"Sanity check the master branch."
]
def validate_version_match()
if 'v'+package_version() != @current_rel... | 34.769231 | 136 | 0.753319 |
6158095e4d1f01e08a0f51d87ad3d67c65b04836 | 41 | module EpiDeploy
VERSION = "2.1.0"
end
| 10.25 | 19 | 0.682927 |
0159f45e380d5c7d2f2537b8d04a46d8513fb915 | 10,776 | # -------------------------------------------------------------------------- #
# Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# no... | 32.555891 | 80 | 0.516518 |
7af7e9d70bcb8b09cf720b8de0bdc4a9897b18cc | 124 | require "devcamp_view_tool_vaibhavsfirstgem/version"
module DevcampViewToolVaibhavsfirstgem
# Your code goes here...
end
| 20.666667 | 52 | 0.83871 |
f77633b3e544ed5392b8c6cfd5a0b2435ed66713 | 348 | module SpreeRemoveBs3
module_function
# Returns the version of the currently loaded SpreeRemoveBs3 as a
# <tt>Gem::Version</tt>.
def version
Gem::Version.new VERSION::STRING
end
module VERSION
MAJOR = 0
MINOR = 0
TINY = 1
PRE = 'alpha'.freeze
STRING = [MAJOR, MINOR, TINY, PRE].... | 18.315789 | 67 | 0.649425 |
873ffb68888567a24293cd462cb86b5066d4efa3 | 1,251 | # encoding: utf-8
module Mutant
class Mutator
class Node
# Mutator for case nodes
class Case < self
handle(:case)
children :condition
private
# Emit mutations
#
# @return [undefined]
#
# @api private
#
def dispatch
... | 19.857143 | 73 | 0.513189 |
4adf76b6f1e95f5f595373c9da7e93328c94a172 | 814 | require "spring/watcher"
module Spring
@commands = {}
class << self
attr_reader :commands
end
def self.register_command(name, klass)
commands[name] = klass
end
def self.command?(name)
commands.include? name
end
def self.command(name)
commands.fetch name
end
require "spring/comm... | 22 | 75 | 0.718673 |
e971af9b5c2776a2a670d1f60c109846bd99e36d | 1,127 | # 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 source for your
# dat... | 41.740741 | 86 | 0.755102 |
399a6884474d5dc0698df116ad55edb43fc6b535 | 830 | require 'pact/symbolize_keys'
module Pact
# Specifies that the actual object should be considered a match if
# it includes the same keys, and the values of the keys are of the same class.
class SomethingLike
include SymbolizeKeys
attr_reader :contents
def initialize contents
@contents = cont... | 16.6 | 80 | 0.624096 |
7a3d33be863ec341a3288d9bd999b6c8ea284313 | 1,291 | $:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "topological_inventory/core/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "topological_inventory-core"
s.version = TopologicalInventory::Core::VERSION
s.authors ... | 40.34375 | 83 | 0.714175 |
e90592a2914b64fcf44e02d872d18dbe9a2b17d0 | 1,492 | module Codekraft
module Api
module Service
class SubscriptionService < Base
def initialize
super(Codekraft::Api::Model::Subscription)
end
def fetchAll params
params[:user] = @current_user
subscriptions = super(params).to_a
if subscriptions.s... | 35.52381 | 183 | 0.644772 |
5d4047f779abda3270258a9ba4a1ff9b9fa327ec | 2,645 | #!/usr/bin/env ruby
# Copyright (C) 2012-2014 Open Source Robotics Foundation
# 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 require... | 30.755814 | 88 | 0.697921 |
5d248f54ea806ca07b67dc444f2bb7484d24c0d1 | 444 | # frozen_string_literal: true
require 'spec_helper'
require 'vk/api/notes/responses/get_comments_response'
RSpec.describe Vk::API::Notes::Responses::GetCommentsResponse do
subject(:model) { described_class }
it { is_expected.to be < Dry::Struct }
it { is_expected.to be < Vk::Schema::Response }
describe 'attri... | 27.75 | 64 | 0.738739 |
1a478205608303d1ba4438609e07d0dd574ef4bf | 59 | class CustomSessionsController < ApplicationController
end
| 19.666667 | 54 | 0.898305 |
283ed1e9a59c47356e32f6a0f5356d219c03e2c6 | 7,690 | class SphinxDoc < Formula
include Language::Python::Virtualenv
desc "Tool to create intelligent and beautiful documentation"
homepage "https://www.sphinx-doc.org/"
url "https://files.pythonhosted.org/packages/f6/3a/c51fc285c0c5c30bcd9426bf096187840683d9383df716a6b6a4ca0a8bde/Sphinx-2.2.1.tar.gz"
sha256 "3108... | 48.0625 | 159 | 0.825098 |
7ab0701f9248879ca72e88b1cc2b63ec8b62a504 | 4,357 | require 'rails_helper'
RSpec.describe PostsController, type: :controller do
before do
@bob = User.create(
email: 'bob@example.com',
first_name: 'bob',
last_name: 'sinclair',
password: 'secret',
password_confirmation: 'secret'
)
sign_in(@bob)
end
describe '#index' do
... | 20.84689 | 79 | 0.578839 |
6a5d483dcf8ab0e1efb0c21b6671feee992767f4 | 2,327 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `rails
#... | 41.553571 | 116 | 0.73743 |
39f1c4126b34a0e82aa1f75d5e07c3d6b5759db0 | 7,281 | # == Schema Information
#
# Table name: user_stories
#
# id :integer not null, primary key
# name :string
# description :string
# acceptance_condition :string
# priority :integer
# effort :integer
# status :integer ... | 40.45 | 113 | 0.699354 |
5dd10d80057d4081030d180d6896dcfdd8453e5b | 705 | #!/usr/bin/env ruby
$LOAD_PATH << File.join(__dir__, "../lib")
require "set"
IS_LATEST_RUBY = Gem::Version.new(RUBY_VERSION).yield_self do |ruby_version|
Gem::Version.new('3.0.0') <= ruby_version && ruby_version < Gem::Version.new('3.1.0')
end
unless IS_LATEST_RUBY
unless ENV["CI"]
STDERR.puts "⚠️⚠️⚠️⚠️ std... | 22.03125 | 98 | 0.64539 |
0138a0f39ffbf4c417878e00517cae339ffe61c3 | 7,849 | require "plugin"
########################################################
# Author: Almudena Bocinos Rioboo
#
# Defines the main methods that are necessary to execute PluginAdapters
# Inherit: Plugin
###########################################... | 34.275109 | 254 | 0.637024 |
873a391b7802e7bbd71f7e0741a2eed7dfd51ea3 | 5,255 | # encoding: utf-8
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
require 'azure_mgmt_resourcegraph'
module Azure::ResourceGraph::Profiles::Latest
module Mgmt
Operations = Azure::ResourceGraph::Mgmt::V2019... | 38.07971 | 129 | 0.69686 |
1dc9f9351c6d81076f6873191be81cfa3861886b | 2,066 | class Freeling < Formula
desc "Suite of language analyzers"
homepage "http://nlp.lsi.upc.edu/freeling/"
url "https://github.com/TALP-UPC/FreeLing/releases/download/4.2/FreeLing-src-4.2.tar.gz"
sha256 "f96afbdb000d7375426644fb2f25baff9a63136dddce6551ea0fd20059bfce3b"
license "AGPL-3.0-only"
revision 4
bot... | 38.981132 | 106 | 0.689255 |
f73270cd48d906006a5c8c059bc26f100bcafb34 | 160 | class AddTaxAmountToErpOrdersOrderDetails < ActiveRecord::Migration[5.1]
def change
add_column :erp_orders_order_details, :tax_amount, :decimal
end
end
| 26.666667 | 72 | 0.80625 |
268b16a5fe641302a9ae6f33e3429fe064a0d099 | 413 | module VertexClient
module Response
class LineItem
attr_reader :total_tax, :product, :quantity, :price
def initialize(params={})
@product = params[:product]
@quantity = params[:quantity] ? params[:quantity].to_i : 0
@price = BigDecimal(params[:price] || ... | 25.8125 | 72 | 0.578692 |
8771084f15b4cbccac8ade11956230e5ef3f16d2 | 748 | # myExperiment: app/models/permission_sweeper.rb
#
# Copyright (c) 2007 University of Manchester and the University of Southampton.
# See license.txt for details.
class PermissionSweeper < ActionController::Caching::Sweeper
include CachingHelper
observe Permission
def after_create(permission)
expire_listi... | 32.521739 | 118 | 0.80615 |
6167478ea05a820ca48b11ba6315e67270555a61 | 31,624 | # encoding: utf-8
require File.dirname(__FILE__) + '/spec_helper'
class TestAutolink
include Twitter::Autolink
end
describe Twitter::Autolink do
def original_text; end
def url; end
describe "auto_link_custom" do
before do
@autolinked_text = TestAutolink.new.auto_link(original_text) if original_text... | 37.424852 | 350 | 0.617854 |
f70bf2d66adcaa79f7d299a9f828ef671846851b | 2,768 | ##
# Float ISO Test
assert('Float', '15.2.9') do
assert_equal Class, Float.class
end
assert('Float superclass', '15.2.9.2') do
assert_equal Numeric, Float.superclass
end
assert('Float#+', '15.2.9.3.1') do
a = 3.123456788 + 0.000000001
b = 3.123456789 + 1
assert_float(3.123456789, a)
assert_float(4.12345... | 18.958904 | 43 | 0.607298 |
ed7045b644950e4e6172ded820e490c23e08aae9 | 4,864 | module Glueby
class FeeProvider
class Tasks
attr_reader :fee_provider
STATUS = {
# FeeProvider is ready to pay fees.
ready: 'Ready',
# FeeProvider is ready to pay fees, but it doesn't have enough amount to fill the UTXO pool by UTXOs which is for paying fees.
insuffici... | 34.496454 | 231 | 0.631373 |
7ac61e632fe8b3a6ab9fb4c6caa7112c6c6d440c | 2,029 | module Vimpack
module Utils
module Vimscripts
def self.included(base)
base.send(:include, Vimpack::Utils::Api)
base.send(:extend, ClassMethods)
end
module ClassMethods
def vimscripts_url
'http://vim-scripts.org/api/scripts_recent.json'
end
d... | 30.742424 | 206 | 0.566289 |
187f4a5056caab46a49c754ac6bba9d11f64e89f | 322 | module Elb2Logstalgia
module Types
class Success
attr_reader :parsed
def initialize(*args, &block)
begin
@parsed = String.new(*args[0].to_s)
rescue StandardError => e
raise e
end
end
def to_s
self.parsed.to_s
end
end
end
en... | 15.333333 | 45 | 0.546584 |
91858563d9d7b3e9ff926002d95fbb0c1d106640 | 54 | module FeatureSiteAddressBook
VERSION = "0.0.3"
end
| 13.5 | 29 | 0.759259 |
ed777487b870a8505cdc3c439f460b29424bdb65 | 3,175 | module EE
module LockHelper
def lock_file_link(project = @project, path = @path, html_options: {})
return unless project.feature_available?(:file_locks) && current_user
return if path.blank?
path_lock = project.find_path_lock(path, downstream: true)
if path_lock
locker = path_loc... | 37.352941 | 155 | 0.669291 |
5de7ec2497fd97ed0abe6af131f01991325d9a77 | 2,546 | class LibgpgError < Formula
desc "Common error values for all GnuPG components"
homepage "https://www.gnupg.org/related_software/libgpg-error/"
url "https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.42.tar.bz2"
sha256 "fc07e70f6c615f8c4f590a8e37a9b8dd2e2ca1e9408f8e60459c67452b925e23"
license "LGPL-2.1-... | 43.896552 | 154 | 0.739984 |
1c550c1335512ee2f6d8b54edf3fa3bf39a4b9d3 | 37 | puts "Hello, this is core image tool" | 37 | 37 | 0.756757 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.