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 |
|---|---|---|---|---|---|
3851435aade570f2195bbad15a29c1991b7467ee | 80 | c
s tc:255:255:255:255:89:1:0:0:1:1:211
t 0:182:0:0:182:0
t 182:0:182:182:0:182
| 16 | 37 | 0.65 |
fff39c85723946744f864df8549936e86e88ffe5 | 4,886 | require_relative '../../controller/PostController'
describe PostController do
before :each do
@stub_client = double
@controller = PostController.new
@posts = Posts.new({ "id": 0, "post_text": 'saya #aku', "attachment": 'a.png', "user_id": 1, "hashtag": ['aku'] })
@arr = [Posts.new({ "id": 0, "post_te... | 32.357616 | 118 | 0.554237 |
d54facd196cd4bc01a298bc3edf80fbadb94bcc9 | 207 | module Querkle
module ControllerExtensions
def authorize!(*args)
current_role.authorize!(*args)
end
def current_role
@current_role ||= Role.compile(current_user)
end
end
end
| 17.25 | 50 | 0.68599 |
6ab23621f83f8af1a31bc68acf0dbe33982ada73 | 919 | module ArticleJSON
module Export
module AMP
module Elements
class Base
include ArticleJSON::Export::Common::HTML::Elements::Base
# List of custom element tags used by this element
# @return [Array[Symbol]]
def custom_element_tags
[]
end
... | 24.837838 | 78 | 0.529924 |
e81baf644afd9b3f088c15850416bdf392d3bf8a | 455 | Rails.application.assets.logger = Logger.new(RUBY_PLATFORM =~ /(win|w)32$/ ? "NUL" : "/dev/null")
Rails::Rack::Logger.class_eval do
def call_with_quiet_assets(env)
previous_level = Rails.logger.level
Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0
call_without_quiet... | 35 | 99 | 0.681319 |
01075be9a5615c183439043b8bc4cfd99325fde4 | 5,009 | 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.327434 | 114 | 0.762228 |
18384c223045901e64fe88fa231653d4126c67b5 | 632 | require_dependency 'core/application_record'
module Core
module Regularization
class SolicitationAnswer < ApplicationRecord # :nodoc:
self.table_name = 'extranet.regularization_solicitation_answers'
belongs_to :solicitation, required: false, class_name: 'Core::Regularization::Solicitation'
belon... | 37.176471 | 125 | 0.75 |
ab9660e55cb3d1d5ff23d406c96d3c5fef8dd4bc | 74 | class GopayPayment < ApplicationRecord
include Gopay::Mixins::Model
end
| 18.5 | 38 | 0.810811 |
7a0234a17e270093dc572aad9980252a7a534511 | 2,008 | # frozen_string_literal: true
require 'io/console'
namespace :password do
namespace :master do
desc 'Reset password for a master user'
task(:reset, %i[email_or_username password] => [:environment]) do |_task, args|
def say(message, icon = :info)
puts "[#{emoji(icon)}] " + message.to_s
en... | 27.135135 | 100 | 0.574203 |
ab6ee345545494926421110f1219feb9672db364 | 5,163 | =begin
#Selling Partner API for Merchant Fulfillment
#The Selling Partner API for Merchant Fulfillment helps you build applications that let sellers purchase shipping for non-Prime and Prime orders using Amazon’s Buy Shipping Services.
OpenAPI spec version: v0
Generated by: https://github.com/swagger-api/swagger-cod... | 29.169492 | 182 | 0.629866 |
6144446aafa44654e83b19c52673e4d96c103d7b | 5,535 | describe PglogicalSubscription do
let(:subscriptions) do
[
{
"subscription_name" => "subscription_example_com",
"status" => "replicating",
"provider_node" => "region_0",
"provider_dsn" => "dbname = 'vmdb\\'s_test' host='example.com' user='root' port='' pas... | 33.75 | 139 | 0.609575 |
1a97850468dc2d7651290f3e1b4af2143589616a | 678 | cask "robo-3t" do
version "1.4.1,122dbd9"
sha256 "02cf60fd969e7c2f7037bb567f558e436618f9a707904f786d1f03f97193a263"
# download.studio3t.com was verified as official when first introduced to the cask
url "https://download.studio3t.com/robomongo/mac/robo3t-#{version.before_comma}-darwin-x86_64-#{version.after_co... | 32.285714 | 123 | 0.740413 |
e847aadb99656a3ec95154a31e00755a0357151a | 2,141 | # Include this file into your view layer. For example, in Rails:
#
# module ApplicationHelper
# include Microformats::Helpers
# end
#
module Microformats::Helpers
# Creates a vCard with the given options and a block.
#
# OPTIONS:
# * :tag - The HTML wrapper element (defaults to :div)
# * Any other pas... | 28.932432 | 78 | 0.601121 |
1d7d91d97a5e17d2e9d9b132f34cd51388dabe16 | 540 | require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
require File.expand_path('../shared/take', __FILE__)
describe "Enumerable#first" do
it "returns the first element" do
EnumerableSpecs::Numerous.new.first.should == 2
EnumerableSpecs::Empty.new... | 28.421053 | 58 | 0.727778 |
624fb9de2eb4ec1617895c511c015fb9379fa30c | 1,104 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'aruba/rspec/version'
Gem::Specification.new do |spec|
spec.name = "aruba-rspec"
spec.version = Aruba::RSpec::VERSION
spec.authors = ["Eric Saxby"]
spec.email ... | 40.888889 | 155 | 0.682971 |
6281368fadaad767da8dc20b856abd28da971cbc | 352 | require 'ruby2ruby'
module Reek
module Source
#
# Formats snippets of syntax tree back into Ruby source code.
#
class SexpFormatter
def self.format(sexp)
return sexp.to_s unless Array === sexp
sexp = Sexp.from_array(YAML::load(YAML::dump(sexp)))
Ruby2Ruby.new.process(se... | 19.555556 | 65 | 0.636364 |
5d8dae1f462060f196970ce5cfec34c9335f8e73 | 423 | cask 'gisto' do
version '1.10.26'
sha256 'e63854a615f3e1a0f6a5d32b7fa83119da1861230fe01301e677e3d98775021b'
# github.com/Gisto/Gisto was verified as official when first introduced to the cask
url "https://github.com/Gisto/Gisto/releases/download/v#{version}/Gisto-#{version}.dmg"
appcast 'https://github.com/G... | 32.538462 | 89 | 0.756501 |
081f3d63dfc366f9bca421fc24459830e76a4caa | 1,780 | # -*- coding: utf-8 -*-
module Kindai
class SpreadDownloader
attr_accessor :spread
attr_accessor :retry_count
attr_accessor :book_path
def self.new_from_spread(spread)
raise TypeError, "#{spread} is not Kindai::Spread" unless spread.is_a? Kindai::Spread
me = self.new
me.spread = spr... | 26.969697 | 185 | 0.646067 |
39642cdfe17cd24e7faf7c5e08813cc869c125c3 | 314 | class AddCommitAccessPermission < ActiveRecord::Migration
def self.up
Role.all.select { |r| not r.builtin? }.each do |r|
r.add_permission!(:commit_access)
end
end
def self.down
Role.all.select { |r| not r.builtin? }.each do |r|
r.remove_permission!(:commit_access)
end
end
end
| 22.428571 | 57 | 0.665605 |
6ab50b30dee68153a185e40cfc2c5cfc6e518b54 | 4,856 | require 'spec_helper'
describe 'ZabbixApi::Templates' do
let(:templates_mock) { ZabbixApi::Templates.new(client) }
let(:client) { double }
describe '.method_name' do
subject { templates_mock.method_name }
it { is_expected.to eq 'template' }
end
describe '.identify' do
subject { templates_mock.... | 26.391304 | 89 | 0.600906 |
ed0c47ec2b3fab2f1c9f4379faf99c9497a5bd2d | 235 | describe file('/boot/cmdline.txt') do
it { should be_file }
it { should be_mode 755 }
it { should be_owned_by 'root' }
its(:content) { should match /console=tty1/ }
its(:content) { should match /console=ttyAMA0,115200/ }
end
| 29.375 | 57 | 0.680851 |
ed8f34e52f223b43e0d4dcc7aefad768c378a3e1 | 44 | module Adyen
VERSION = '0.1.8'.freeze
end
| 11 | 26 | 0.681818 |
bfe08b02ad16c24d9bc69eb13e94bb64d8c9872e | 680 | # Copyright 2017, Google Inc. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 45.333333 | 83 | 0.780882 |
381649185a0ba39e2ecf9fece05d7f8e870d8830 | 3,156 | class Array2D
include Enumerable
attr_accessor :state
def initialize(rows, columns, value=nil)
@state = Array.new(rows) { Array.new(columns) { value } }
end
def each(&block)
@state.each do |row|
row.each do |e|
yield e
end
end
end
def each_with_index(&block)
@state.e... | 24.276923 | 86 | 0.534537 |
1cda566e8d998bdbb0d09a31886ba7386d46c1e9 | 95 | Rails.application.routes.draw do
mount ViewComponentKit::Engine => "/view_component_kit"
end
| 23.75 | 57 | 0.8 |
1ab0e1f387c7f691c5a2264a5bbec7c9a49003d4 | 3,136 | module Cheffish
module RSpec
module RepositorySupport
def when_the_repository(desc, *tags, &block)
context("when the chef repo #{desc}", *tags) do
include_context "with a chef repo"
extend WhenTheRepositoryClassMethods
module_eval(&block)
end
end
::... | 29.037037 | 91 | 0.544643 |
bbb9f52eb7931576ffa22473690d36e7f0448516 | 5,599 | # frozen_string_literal: true
RSpec.describe RuboCop::Cop::Rails::ContentTag, :config do
context 'Rails 5.0', :rails50 do
it 'does not register an offense' do
expect_no_offenses(<<~RUBY)
content_tag(:p, 'Hello world!')
RUBY
end
it 'does not register an offense with empty tag' do
... | 29.010363 | 109 | 0.567066 |
e211481baa947bbc543c50d3f8a6344c023865c1 | 1,908 | module Api
class CloudVolumesController < BaseController
include Subcollections::Tags
def create_resource(_type, _id = nil, data = {})
ext_management_system = ExtManagementSystem.find(data['ems_id'])
klass = CloudVolume.class_by_ems(ext_management_system)
raise BadRequestError, klass.unsup... | 36 | 131 | 0.705451 |
5d46778d96c148c46fcc72deda7bf3efed05bae0 | 1,418 | class Dolt < Formula
desc "Git for Data"
homepage "https://github.com/liquidata-inc/dolt"
url "https://github.com/dolthub/dolt/archive/v0.22.8.tar.gz"
sha256 "baf41ca21fd2f7ab239ca27245a5e22152206db6e141cbf2329624199556f4fd"
license "Apache-2.0"
livecheck do
url :stable
strategy :github_latest
en... | 34.585366 | 113 | 0.705219 |
089a8b784b2ce7bdff0d0bbc2244183ec76411e2 | 39 | class TagDecorator < DecoratorBase
end
| 13 | 34 | 0.846154 |
21ecb8a8598b6017c9d4868bb80c4acfbc92fff9 | 1,115 | #!/usr/bin/env ruby
require 'facets'
require 'andand'
require 'commander'
require 'colorize'
require 'terminal-table'
require 'chronic_duration'
require_relative './ext'
class App
include Commander::Methods
module Commands
end
INDENT = 2
class << self
def command(name, &block)
@commands ||= []
@comman... | 16.15942 | 77 | 0.632287 |
038406b578c963ad781e6e06ced05fba6d71c8ff | 497 | # frozen_string_literal: true
module Mj
module AlternativeFile
class Resolver
def initialize
@stack = []
end
def add(resolver)
@stack.push(resolver)
end
def resolve(file)
file = AlternativeFile::CurrentFile.new(file.to_s)
resolved = []
@sta... | 18.407407 | 65 | 0.603622 |
797879d077ec008988e91dcfac9e125bec486b24 | 202 | # frozen_string_literal: true
class Todo < ActiveRecord::Model
attributes title: '', completed: false
scope(:completed) { where(completed: true) }
scope(:active) { where(completed: false) }
end
| 22.444444 | 46 | 0.717822 |
4abdbcb939c0e985c302d5c8262909f990f52fbc | 1,691 | class KSTable
include DRbUndumped
attr_accessor :row, :context, :rollback_buffer, :rollback_hash
def pending_deletion?
@deletion
end
def read_only?
@read_only
end
alias :read_only :read_only?
def read_only=(cond)
@read_only = cond ? true : false
end
def serialized?
@serialized
end
def set_p... | 16.417476 | 100 | 0.690124 |
1aeae5174af05be7abf35dd90d0dc486e6fe16ee | 7,844 | # frozen_string_literal: true
RSpec.feature "ColocatedTask", :all_dbs do
let(:vlj_support_staff) { create(:user) }
before { Colocated.singleton.add_user(vlj_support_staff) }
describe "attorney assigns task to vlj support staff, vlj returns it to attorney after completion" do
let(:judge_user) { create(:user... | 40.854167 | 119 | 0.692504 |
396a15a4e291fad41f00a8ac4092999d1e48a466 | 714 | module Fog
module Compute
class Google
class Mock
def add_url_map_path_matchers(url_map, path_matchers)
Fog::Mock.not_implemented
end
end
class Real
def add_url_map_path_matchers(url_map, path_matchers)
api_method = @compute.url_maps.update
... | 23.8 | 62 | 0.572829 |
b9e00ff7d626c5a4800d57ecbdee8026fb53a025 | 7,687 | require 'activefacts/api'
module CinemaTickets
class AddressText < Text
value_type
end
class Address
identified_by :address_text
one_to_one :address_text, mandatory: true # Address has Address Text, see AddressText#address
end
class CinemaID < AutoCounter
value_type
end
cla... | 38.435 | 156 | 0.661767 |
1c9b7cb41c2adff92c8675d8a109bcec5edea216 | 72 | class Crypto::AlertSubscription < Common::AlertSubscriptionNotifier
end
| 24 | 67 | 0.861111 |
08592d0d4788f907a89d6a4673d1bb07b96c6355 | 41 | include_recipe 'role-balanced-commander'
| 20.5 | 40 | 0.853659 |
f79c29513d36adb28175399c7185f8f620b3742b | 435 | cask "4k-stogram" do
version "3.0.7.3300"
sha256 "4bfb52578517e40a2176a7666b05dd32d2baf35af8e41800380469b9b139415f"
url "https://dl.4kdownload.com/app/4kstogram_#{version.major_minor_patch}.dmg"
appcast "https://www.4kdownload.com/download"
name "4K Stogram"
homepage "https://www.4kdownload.com/products/pr... | 27.1875 | 80 | 0.749425 |
ab7e1d81fff2fdb2ee0de39378dd78f393ac5cf0 | 111 | $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "panos/phpipam"
require "minitest/autorun"
| 22.2 | 58 | 0.747748 |
e836e1a4cb351241bfd7e34069ece760c16427e3 | 160 | module Tak
class Game
def initialize(size)
@tak_board = Tak::Board.new(size)
@turn = :white
@first_move = true
end
end
end
| 16 | 40 | 0.56875 |
f773520248a65e0274cefc6b4ce487e3aa54988b | 1,626 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ApiManagement::Mgmt::V2019_01_01
module Models
#
# Sampling settings for Diagnostic.
#
class SamplingSettings
include MsRestAzure
... | 26.655738 | 78 | 0.52214 |
f7c2354ac11e2fe78690ce01ef8d5d4a1ae16fdd | 10,265 | module MoneyS3
module Parsers
class BanDoklType
include ParserCore::BaseParser
def vydej
at 'Vydej'
end
def vydej_attributes
attributes_at 'Vydej'
end
def doklad
at 'Doklad'
end
def doklad_attributes
attributes_at 'Doklad'
e... | 24.73494 | 102 | 0.604189 |
914726c25e2397a9e5a36361af5747e0b02ee000 | 1,075 | require 'test_helper'
class CassandraObject::CallbacksTest < CassandraObject::TestCase
class TestIssue < CassandraObject::BaseSchemaless
self.column_family = 'Issues'
string :description
%w(before_validation after_validation after_save after_create after_update after_destroy).each do |method|
send... | 22.87234 | 112 | 0.72 |
21c3669979c3581ab1155550af9eca0432c58331 | 581 | # frozen_string_literal: true
# rubocop:disable Graphql/AuthorizeTypes
module Types
class AccessLevelType < Types::BaseObject
graphql_name 'AccessLevel'
description 'Represents the access level of a relationship between a User and object that it is related to'
field :integer_value, GraphQL::INT_TYPE, nu... | 32.277778 | 111 | 0.719449 |
03e84beff27b0b7c9b86a08a9bc5a186c2d66cd9 | 1,251 | module Rediscover
module Frame
class Main < Wx::Frame
include Wx
WINDOW_WIDTH = 600
WINDOW_HEIGHT = 400
def initialize
super(nil, -1, 'Rediscover', DEFAULT_POSITION, Size.new(WINDOW_WIDTH, WINDOW_HEIGHT))
@redis = get_app.redis
@logger = get_app.logger
s... | 26.617021 | 93 | 0.644285 |
62b5b2c75606c0f922d960abb1c3df1b78f326eb | 2,614 | # Size of the CoreOS cluster created by Vagrant
$num_instances=1
# Used to fetch a new discovery token for a cluster of size $num_instances
$new_discovery_url="https://discovery.etcd.io/new?size=#{$num_instances}"
# To automatically replace the discovery token on 'vagrant up', uncomment
# the lines below:
#
if File.e... | 35.808219 | 121 | 0.722647 |
f7e316bd21638da56b1a86bd95ce8f4304b201f1 | 15,969 | require_relative 'spec_helper'
require 'sprockets_metadata'
require 'opal/rspec/rake_task'
describe SprocketsMetadata do
describe '::get_dependency_graph' do
include_context :temp_dir
RSpec::Matchers.define :have_graph do |expected|
match do |actual|
actual_keys = actual[:file_mapping].keys
... | 33.904459 | 107 | 0.416682 |
ab0fab93ade54a2deeed94a7284631bc601ee6fc | 1,768 | # This file specifies the Pod setup for GTMSessionFetcher. It enables developers
# to import GTMSessionFetcher via the CocoaPods dependency Manager.
Pod::Spec.new do |s|
s.name = 'GTMSessionFetcher'
s.version = '1.6.1'
s.authors = 'Google Inc.'
s.license = { :type => 'Apache', :file => 'LICEN... | 34 | 80 | 0.665724 |
21efbaeac3d447f7cbb3a9501bdf06996d7520e1 | 969 | RSpec.describe 'Inertia::Request', type: :request do
describe 'it tests whether a call is an inertia call' do
subject { response.status }
before { get inertia_request_test_path, headers: headers }
context 'it is an inertia call' do
let(:headers) { {'X-Inertia' => true} }
it { is_expected.to ... | 26.916667 | 90 | 0.633643 |
7926dd5220f462660ca86530b302951175167eca | 523 | module SugarCRM; class Connection
# Retrieves the list of modules available to the current user logged into the system.
def get_available_modules
login! unless logged_in?
json = <<-EOF
{
"session": "#{@sugar_session_id}"
}
EOF
json.gsub!(/^\s{6}/,'')
mods = send!(:get_... | 23.772727 | 89 | 0.625239 |
e8fa625d8c43718cce2dec9b2f2476a05a48fd8e | 1,568 | #
# Author:: Enrico Stahn <mail@enricostahn.com>
#
# Copyright 2014, Zanui, <engineering@zanui.com.au>
#
# 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/L... | 28 | 78 | 0.777423 |
26ed38cee7135be730e2b113456f5c1a2bb0aebb | 2,049 | 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... | 34.15 | 85 | 0.762811 |
b933f99d246a43989745650ca3789b278c2b3548 | 8,204 | # OAuth extension for User model
#
# * Find GitLab user based on omniauth uid and provider
# * Create new user from omniauth data
#
module Gitlab
module Auth
module OAuth
class User
prepend ::EE::Gitlab::Auth::OAuth::User
SignupDisabledError = Class.new(StandardError)
SigninDisabled... | 30.958491 | 123 | 0.615553 |
1a8f73613a126ee080e6cdb9036cf85d4e2bc242 | 562 | # frozen_string_literal: true
require 'rails_helper'
describe "collections/_form_metadata.html.erb" do
let(:collection) { build(:collection) }
let(:form) { Sufia::Forms::CollectionForm.new(collection) }
let(:page) do
view.simple_form_for form do |f|
render 'collections/form_metadata.html.erb', f... | 26.761905 | 72 | 0.711744 |
f7c7075ab71827940a8a17f1c04ddd9deb584b98 | 205 | def multiply(x,y)
x*y
end
print "Insert the first integer number: "
num1 = gets.chomp.to_i
print "Insert the second integer number: "
num2 = gets.chomp.to_i
puts "#{num1}*#{num2}=#{multiply(num1,num2)}" | 22.777778 | 45 | 0.707317 |
e809106f0a323acb1e65a53ca20e24d10fcc8142 | 156 | # This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
run Molamp::Application
| 31.2 | 67 | 0.769231 |
ed4bfbbee6f476646f498ca5a63266b1759cfb76 | 219 | require "rack/pooledthrottle/version"
require 'rack'
require 'connection_pool'
require 'rack/pooledthrottle/throttle'
require 'rack/pooledthrottle/memcached_throttle'
module Rack
module PooledThrottle
end
end
| 18.25 | 48 | 0.808219 |
21835d80267700dce5f21b8251de0e50394f0682 | 3,104 | # This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
# Ch... | 57.481481 | 157 | 0.750322 |
e20af2c7f1d7e05e13d098cd53c3d964969f8c8c | 503 | require 'rake'
module TaskExampleGroup
extend ActiveSupport::Concern
included do
let(:task_name) { self.class.top_level_description.sub(/\Arake /, '') }
let(:tasks) { Rake::Task }
subject(:task) { tasks[task_name] }
end
end
RSpec.configure do |config|
config.define_derived_metadata(file_path: %r... | 20.12 | 75 | 0.701789 |
399cc91c35cf26b16102801ff1cefb19c4f1d074 | 1,177 | module BittrexRb
module Endpoints
class Market < Base
# parameter - required - description
# market - required - a string literal for the market (ex: BTC-LTC)
# quantity - required - the amount to purchase
# rate - required - the rate at which to place the order.
def buylimit(... | 33.628571 | 80 | 0.621071 |
e99ccaafd4bcf01e0776604ce5aa9e7fab85c4ae | 187 | RSpec.describe Deckrefcard do
it "has a version number" do
expect(Deckrefcard::VERSION).not_to be nil
end
it "does something useful" do
expect(false).to eq(true)
end
end
| 18.7 | 46 | 0.71123 |
187f463977ef91a0f6c91b543c9fb271e50dcf34 | 2,303 | # frozen_string_literal: true
require 'yaml'
control 'postgresql-replication._mapdata' do
title '`map.jinja` should match the reference file'
### Method
# The steps below for each file appear convoluted but they are both required
# and similar in nature:
# 1. The earliest method was to simply compare the f... | 47.979167 | 83 | 0.746418 |
f8136989675cb2d561dbfbc5017134f1b6c5375b | 1,688 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'rails_select_on_includes/version'
Gem::Specification.new do |spec|
spec.name = "rails_select_on_includes"
spec.version = RailsSelectOnIncludes::VERSION
spec.authors = [... | 38.363636 | 129 | 0.697275 |
f774a23dfd8b64446a5fda2089b9757df2b09786 | 713 | require 'push_type_core'
require 'push_type_api'
require 'coffee-rails'
require 'sass-rails'
require 'haml-rails'
require 'foundation-rails'
require 'foundation-icons-sass-rails'
require 'jquery-rails'
require 'pickadate-rails'
require 'selectize-rails'
require 'codemirror-rails'
require 'wysiwyg-rails'
require 'font-... | 19.27027 | 50 | 0.776999 |
28875a74ced67b2d085ceac64e8a2b74374b6499 | 15,599 | # -*- coding:binary -*-
require 'spec_helper'
require 'msf/core'
require 'msf/core/exploit/powershell'
def decompress(code)
Rex::Exploitation::Powershell::Script.new(code).decompress_code
end
describe Msf::Exploit::Powershell do
subject do
mod = Msf::Exploit.allocate
mod.extend described_class
mod.se... | 31.769857 | 114 | 0.631258 |
038e3cadd1a08f430536c3e952554ef9a6f1e597 | 1,436 | # coding: utf-8
module KuaiJieQian
module Utils
#
# 把 hash 中的 key,都转化为 symbol 类型
# @param hash [Hash] 需要更改的 hash
#
# @return [Hash] 更改后的 hash
#
def self.symbolize_keys(hash)
new_hash = {}
hash.each do |key, value|
new_hash[(key.to_sym rescue key) || key] = value
... | 25.192982 | 91 | 0.594011 |
01e547414aba45f8ff44628ff086ae64af982633 | 455 | # frozen_string_literal: true
control 'event_edit_forward' do
describe event('uei.opennms.org/cheftest/thresholdExceeded2', 'events/chef.events.xml', [{ 'mename' => 'id', 'mevalue' => ['.1.3.6.1.4.1.11385.102.1'] }, { 'mename' => 'generic', 'mevalue' => ['6'] }, { 'mename' => 'specific', 'mevalue' => ['2'] }]) do
... | 56.875 | 254 | 0.593407 |
6a497e80601524711f359661501d036a6b24076f | 2,868 | require 'test_helper'
class PasswordResetsTest < ActionDispatch::IntegrationTest
def setup
ActionMailer::Base.deliveries.clear
@user = users(:chloe)
end
test "password resets" do
get new_password_reset_path
assert_template 'password_resets/new'
#invalid email
post password_resets_path, ... | 35.85 | 72 | 0.674686 |
7918bf465de9c77160d130b73bb12f514566cd9e | 2,307 | # 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,... | 35.492308 | 90 | 0.713914 |
e9f6079e1e246c20a2bf59426b2477fd7a534510 | 806 | Pod::Spec.new do |spec|
spec.cocoapods_version = '>= 1.0'
spec.name = "Instructions"
spec.version = "1.4.0"
spec.summary = "Create walkthroughs and guided tours (with coach marks) in a simple way, using Swift."
spec.homepage = "https://github.com/ephread/Instructions"
... | 40.3 | 113 | 0.593052 |
795ea2354cf9b717c5bc0306dfa1b7bd66509b40 | 2,714 | # Controller for Certificate views
class CertificatesController < ApplicationController
include ActionController::MimeResponds
before_action :set_default_request_format
before_action :require_auth, only: %i[show create update destroy]
before_action :check_current_cert, only: %i[create]
before_action :set_cert... | 27.414141 | 121 | 0.683861 |
6ad4ee5e1d30a0c4ec87666c26caaf2f76446794 | 1,570 | module RailsUtil
# `RailsUtil::Util` includes class helper methods for handling nested hashes
module Util
# Deep merges a nested hash given a path
# Does not mutate the original hash
# @param [String, Array] path the nested keys
# @param [String, Integer, Array] value the value of nested path key
... | 38.292683 | 78 | 0.668153 |
f876c6928bc879e99e412e33268eb38391d59d1c | 122 | etcd_installation_binary 'default' do
action :create
end
etcd_service_manager_systemd 'default' do
action :start
end
| 15.25 | 41 | 0.811475 |
87c97396a1510e6d6a488c7727f5f2bf1400437b | 4,055 | require 'spec_helper'
describe VCSToolkit::Diff do
describe 'instance' do
subject { described_class.from_sequences(%w(a b c d), %w(a b d e)) }
it { should be_a_kind_of Enumerable }
it { should respond_to :each }
it { should respond_to :has_changes? }
it { should respond_to :to_s ... | 28.159722 | 111 | 0.597041 |
bfbec5a18ecac781e2ef95c21639812077200115 | 291 | class CreatePledges < ActiveRecord::Migration
def change
create_table :pledges do |t|
t.string :name
t.string :email
t.text :comment
t.decimal :amount
t.references :project, index: true, foreign_key: true
t.timestamps null: false
end
end
end
| 20.785714 | 59 | 0.652921 |
113b0df7cfc0d2f7adb5fe2e9e29907c68af10d4 | 1,330 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/api/quota.proto
require 'google/protobuf'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("google/api/quota.proto", :syntax => :proto3) do
add_message "google.api.Quota" do
repeated :limits, :message, 3, "google.... | 35 | 107 | 0.697744 |
11029de6750e1b79a78e2b4d65c04a9882e1585c | 1,301 | ##
# 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::Tcp
include Msf::Auxiliary::Dos
def initialize(info = {})
super(update_info(info,
... | 25.509804 | 89 | 0.550346 |
012519463fb7ea06bec527f7ababdb7b280f73bb | 174 | module Events
class NoteOnWorkfile < Note
has_targets :workfile
has_activities :actor, :workfile, :workspace
include_shared_search_fields(:workspace)
end
end | 21.75 | 48 | 0.764368 |
fffb40dfbe70a9084397827b2917eca5be3b73ea | 1,554 | module Guard
module UI
class << self
def info(message, options = {})
unless ENV["GUARD_ENV"] == "test"
reset_line if options[:reset]
puts reset_color(message) if message != ''
end
end
def error(message, options = {})
unless ENV["GUARD_ENV"] == "test"... | 21.887324 | 80 | 0.503218 |
91df4dd558edec5db2787fb40c41ee8d1c169a4c | 37,828 | module OMS
class RetryRequestException < Exception
# Throw this exception to tell the fluentd engine to retry and
# inform the output plugin that it is indeed retryable
end
class Common
require 'json'
require 'net/http'
require 'net/https'
require 'time'
require 'zlib'
require 'd... | 42.455668 | 149 | 0.612271 |
032fd765bf9b06ff402cc93c9607c7f32ae11394 | 1,317 | # frozen_string_literal: true
require_relative 'lib/riot_games_api_client/version'
Gem::Specification.new do |spec|
spec.name = 'riot_games_api_client'
spec.version = RiotGamesApiClient::VERSION
spec.authors = ['Ryo Nakamura']
spec.email = ['r7kamura@gmail.com']
spec.summary ... | 38.735294 | 87 | 0.690205 |
f7faa2147f80a7391d4e9354a60f6c650fb7bcc5 | 147 | class RemoveEncyclopaediaEntryIdFromTaggings < ActiveRecord::Migration
def change
remove_column :taggings, :encyclopaedia_entry_id
end
end
| 24.5 | 70 | 0.829932 |
3371a8c02ea2cbd53577cbad169b3e392040eafe | 965 | #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 this ... | 50.789474 | 92 | 0.777202 |
21a227335cd232e2b445694cd58e2757320dc7c7 | 1,545 | require 'spec_helper'
describe Gitlab::ImportExport::AfterExportStrategies::WebUploadStrategy do
include StubRequests
let(:example_url) { 'http://www.example.com' }
let(:strategy) { subject.new(url: example_url, http_method: 'post') }
let!(:project) { create(:project, :with_export) }
let!(:user) { build(:us... | 30.294118 | 96 | 0.688026 |
bf53558c746f058e5e5f7abecf00e1472657fba8 | 760 | require File.expand_path("../../Abstract/abstract-php-extension", __FILE__)
class Php70Uv < AbstractPhp70Extension
init
desc "interface to libuv library"
homepage "https://github.com/bwoebi/php-uv"
url "https://github.com/bwoebi/php-uv/archive/v0.1.1.tar.gz"
sha256 "e576df44997a0b656deb4a1c2bfd1879fb3647419b... | 29.230769 | 75 | 0.677632 |
bba29de51b5421eae6c6ba67dc71cdece160df89 | 715 | require "rails_helper"
RSpec.feature "Payroll run download" do
scenario "User can download a payroll run file" do
sign_in_to_admin_with_role(DfeSignIn::User::PAYROLL_OPERATOR_DFE_SIGN_IN_ROLE_CODE)
payroll_run = create(:payroll_run, claims_counts: {StudentLoans: 2, MathsAndPhysics: 1})
visit new_admin_... | 31.086957 | 92 | 0.751049 |
4aa84d5de18e24cfae44476d51e4f768193e6d76 | 787 | # == Schema Information
#
# Table name: gears
#
# @!attribute id
# @return []
# @!attribute armor
# @return [Integer]
# @!attribute description
# @return [String]
# @!attribute harm
# @return [Integer]
# @!attribute name
# @return [String]
# @!attribute created_at
# @return [Time]
# @!attribute updated_at
#... | 17.108696 | 46 | 0.614994 |
18cfd4caa143eb32bf97342c214be4c99f82a1b8 | 281 | #!/usr/bin/env ruby
#
# Put description here
#
#
#
#
#
require 'swig_assert'
require 'template_rename'
i = Template_rename::IFoo.new
d = Template_rename::DFoo.new
a = i.blah_test(4)
b = i.spam_test(5)
c = i.groki_test(6)
x = d.blah_test(7)
y = d.spam(8)
z = d.grok_test(9)
| 11.708333 | 29 | 0.658363 |
ac5feb298ae224bb14cb2af4c8d005763c65f50b | 490 | # Tests windows_ad::default
# Tests windows_ad::domain - create forest
include_recipe 'windows_ad::default'
user = 'Administrator'
pass = 'Password1234###!'
domain = 'contoso.local'
execute "net user \"#{user}\" \"#{pass}\""
windows_ad_domain domain do
type 'forest'
safe_mode_pass pass
domain_pass pass
doma... | 19.6 | 42 | 0.673469 |
91b1f69687a77037baa0774538e59f238317f136 | 2,489 | # frozen_string_literal: true
#
# Copyright:: Copyright 2020, Chef Software Inc.
# Author:: Tim Smith (<tsmith@chef.io>)
#
# 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.... | 36.602941 | 241 | 0.616714 |
7a4351b7f46ba070f922bb128c0acb2cb50520f4 | 498 | task :compile_licenses do
puts 'Compiling open source licenses via Yarn.'
output = 'public/LICENSE.txt'
`npx yarn licenses generate-disclaimer --silent > #{ output }`
additional_licenses = <<-HERE
-----
beige-tiles.png by SubtlePatterns and irongrip.png by Tony Kindard downloaded from toptal.com and releas... | 29.294118 | 218 | 0.726908 |
f8cd96586f3e7ef1de675373e5dd0044d03cccaf | 7,045 | # frozen_string_literal: true
# Routines for building and saving a course timeline after submission of wizard data
class WizardTimelineManager
###############
# Entry point #
###############
def self.update_timeline_and_tags(course, wizard_id, wizard_params)
new(course, wizard_id, wizard_params).update_ti... | 37.275132 | 113 | 0.681192 |
8772f832d05c195a24bdde397732073b985033c2 | 4,558 | describe "{{helper context key=value}}" do
let(:global_helpers_providers) { [] }
describe "#compile" do
let(:post) { double("post") }
let(:presenter) { IntegrationTest::Presenter.new(double("view_context"), post: post) }
it "passes two arguments" do
template = Curlybars.compile(<<-HBS)
{... | 24.374332 | 90 | 0.596534 |
ed91f62c4fa4f5b77b1ae221c825aa5a93e3a4f6 | 6,152 | # -*- coding: binary -*-
module Msf
module Handler
###
#
# This module implements the Bind TCP handler. This means that
# it will attempt to connect to a remote host on a given port for a period of
# time (typically the duration of an exploit) to see if a the payload has
# started listening. This can tend to be rath... | 25.213115 | 103 | 0.612809 |
79081a7e78321097dfb172a24c5981b3e439ddc7 | 474 | # This code was automatically generated using xdrgen
# DO NOT EDIT or your changes may be overwritten
require 'xdr'
# === xdr source ============================================================
#
# union switch (int v) {
# case 0:
# void;
# }
#
# ===============================================... | 19.75 | 77 | 0.424051 |
014a1bae48984fa9295cd77d9e449da2e5e4c444 | 506 | require 'test_helper'
class EasyPayHelperTest < Test::Unit::TestCase
include ActiveMerchant::Billing::Integrations
def setup
@helper = EasyPay::Helper.new(123, 'test_account', :amount => 500, :secret => 'secret')
end
def test_basic_helper_fields
assert_field 'EP_MerNo', 'test_account'
assert_fiel... | 25.3 | 91 | 0.745059 |
ac3c54092cde2dff3826a48535bbb6ab61f0bcbc | 199 | # frozen_string_literal: true
require 'forwardable'
module Signalwire::Relay::Calling
class ConnectAction < Action
def result
ConnectResult.new(component: @component)
end
end
end
| 16.583333 | 46 | 0.738693 |
bf0307a64745d6af6c6f833d2b8f862d111c299d | 47 | task(:default).clear.enhance(%i[rubocop spec])
| 23.5 | 46 | 0.744681 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.