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 |
|---|---|---|---|---|---|
613120a317384e382ffc39515153c23ee1ad765b | 1,620 | # Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
s.name = "tivoli"
s.version = "1.0.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_... | 27 | 105 | 0.604321 |
188ace51e4d85f861b3da3b4f85eb8ef7b017366 | 730 | require 'redmine'
Redmine::Plugin.register :redmine_project_select2 do
name 'Project Select2 Plugin'
author 'RETTA TI'
description 'Apply Select2 in the Redmine project selection.'
version '1.0.0'
url 'https://github.com/retta-ti/redmine_project_select2'
author_url 'https://github.com/retta-ti'
end
class ... | 36.5 | 101 | 0.771233 |
ffc7101e12decb8f538b7aa9cd51e88b38cf3507 | 481 | class BusinessPolicy < ApplicationPolicy
def update?
user == record.user
end
def permitted_attributes
if user.active_business_subscription?
default_attributes + notification_attributes
else
default_attributes
end
end
private
def default_attributes
[
:contact_name,
... | 15.516129 | 50 | 0.66736 |
ab452ae819b0fd307b276d719911135a183c8a0e | 1,772 | require 'erb'
require 'compiler/template_processor'
module Compiler
class PlayProcessor < TemplateProcessor
def render_erb
f=File.read(@file)
f.gsub!(/@-ms-viewport/, "@@-ms-viewport") unless @is_stylesheet
ERB.new(f).result(binding)
end
def handle_yield(section = :layout)
case ... | 28.126984 | 173 | 0.611738 |
87cc8a8faf4460071bdb4c713c3b3242c28422a9 | 520 | module Helpers
def stub_metadata(additional_metadata)
stub_metadata = metadata_with(additional_metadata)
RSpec::Core::ExampleGroup.stub(:metadata) { stub_metadata }
end
def metadata_with(additional_metadata)
m = RSpec::Core::Metadata.new
m.process("example group")
group_metadata = additional... | 24.761905 | 63 | 0.732692 |
3801fadc383421861cf36c769d3dcca38aa971ed | 2,523 | require 'spec_helper'
RSpec.describe 'Cryptopia integration specs' do
let(:client) { Cryptoexchange::Client.new }
let(:btc_usdt_pair) { Cryptoexchange::Models::MarketPair.new(base: 'BTC', target: 'USDT', market: 'cryptopia') }
it 'fetch pairs' do
pairs = client.pairs('cryptopia')
expect(pairs).not_to be... | 34.094595 | 166 | 0.715022 |
180b94117a1d5e30d4666c7c85e9c788d5e1181c | 702 | require 'more_core_extensions/core_ext/module/namespace'
module MoreCoreExtensions
module ObjectNamespace
#
# Returns whether or not the object is in the given namespace.
#
# Aaa::Bbb::Ccc::Ddd.in_namespace?(Aaa::Bbb) #=> true
# Aaa::Bbb::Ccc::Ddd.new.in_namespace?(Aaa::Bbb) ... | 35.1 | 87 | 0.632479 |
f834dcbcb031be7b9c3a7b7625a79ba491923134 | 1,759 | # frozen_string_literal: true
# config valid for current version and patch releases of Capistrano
lock '~> 3.14.1'
set :application, 'sigdiv'
set :repo_url, 'https://github.com/smfazendaniteroi/sigdiv.git'
set :user, 'sigdiv'
set :use_sudo, false
set :passenger_restart_with_touch, true
# Default branch is :master
#... | 29.316667 | 106 | 0.712337 |
617a401c64d550cea4d94e6ccbedb1d082cbeca6 | 1,695 | # This file provides a minimal Rails integration test environment with an empty database, without users.
require 'simplecov_helper'
require 'rspec_configuration'
require 'helpers/spec_helper_helpers'
require 'support/redis'
require 'helpers/named_maps_helper'
ENV['RAILS_ENV'] ||= 'test'
# INFO: this is the only slow s... | 27.33871 | 107 | 0.753392 |
33c94b28f651ecbe7fe15c9499aa40b3da97a901 | 996 | #-- encoding: UTF-8
# This file written by xcc
# 05/07/2019
module Targets
class RowCell < ::RowCell
include ::IconsHelper
include ReorderLinksHelper
def target
model
end
def name
link_to h(target.name), edit_project_target_path(id: target.id)
# target.name
end
def st... | 15.090909 | 69 | 0.589357 |
bf0fc3d9e844805c80032d267a89a84c6c9a539c | 86 | class Message < ApplicationRecord
belongs_to :conversation
belongs_to :user
end
| 12.285714 | 33 | 0.790698 |
4a79ea7a11dd78b614c56e98083db4e725b2aa42 | 1,770 | # frozen_string_literal: true
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "Lice... | 36.122449 | 124 | 0.678531 |
7a96e21cd8c0faad4d6ce83141d5570a758ad635 | 37 | class Errnie
VERSION = "0.1.0"
end
| 9.25 | 19 | 0.648649 |
f811924069270b3a2ae48840588ee13f4fa47040 | 177 | class AddTypeToIncident < ActiveRecord::Migration[5.1]
def change
add_column :incidents, :incident_type, :string
add_column :incidents, :complexity, :string
end
end
| 25.285714 | 54 | 0.751412 |
916d6df94c4b08771730e502de045d979945a981 | 141 | module Paginable
def paginate(params)
values = Pagination.new(params).call
limit(values[:limit]).offset(values[:offset])
end
end
| 20.142857 | 49 | 0.716312 |
7aa3673114b0e83456319b67168ee7393ce4cacc | 512 | cask 'prince' do
version '11'
sha256 'dac005d49c594b90b0933ffac0601997cee8c64c3e6190073dc1d024eb439553'
url "https://www.princexml.com/download/prince-#{version}-macosx.tar.gz"
name 'Prince'
homepage 'https://www.princexml.com/'
installer script: "prince-#{version}-macosx/install.sh",
sudo: ... | 24.380952 | 75 | 0.621094 |
1db2d9f614457c20c2ce3c00883b66fcbdeae497 | 821 | require "rails_helper"
RSpec.describe "routes for Lists", :type => :routing do
# API
it "routes /api/v1/lists to the Lists controller" do
expect(get("/api/v1/lists")).
to route_to(:controller => "lists", :action => "index")
end
it "routes /api/v1/lists/:sha to the Lists controller" do
list = cre... | 29.321429 | 87 | 0.619976 |
110eeaf25de09a2775ad0765e056b1a2d47cbc72 | 1,350 | class Timer
DIV = 0xFF04.freeze
TIMA = 0xFF05.freeze
TMA = 0xFF06.freeze
FREQ_4_KHZ = 4_096.freeze
FREQ_16_KHZ = 16_384.freeze
FREQ_64_KHZ = 65_536.freeze
FREQ_256_KHZ = 262_144.freeze
def initialize(device)
@device = device
@enabled = false
@div_counter = 0
@frequency = 0
reset_ti... | 21.09375 | 62 | 0.68 |
62f85de1105e06dcbe6b96a4f89b1fdf41f9574e | 220 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Dashboard issues' do
let(:user) { create(:user) }
let(:page_path) { issues_dashboard_path }
it_behaves_like 'dashboard gold trial callout'
end
| 20 | 48 | 0.754545 |
2166d435e796fa5aebf508c8746caa00c1476a87 | 312 | class CreateRoutes < ActiveRecord::Migration[5.0]
def change
create_table :routes do |t|
t.integer :pieces, null: false
t.references :city1, foreign_key: {to_table: :city}, null: false
t.references :city2, foreign_key: {to_table: :city}, null: false
t.timestamps
end
end
end
| 26 | 70 | 0.669872 |
e260c9e4066bb6031f98bb201c738e6b608d6804 | 34,277 | # Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 44.573472 | 190 | 0.732824 |
62562d79cf322ed215863f589e8b5fdb0f44670d | 3,188 |
require File.dirname(__FILE__) + '/../spec_helper'
describe UsersController, "when a new user registers" do
before(:each) do
# create john
@john_info = {:login => 'john',
:full_name => 'John John',
:email => 'john@space.com'}
@john = User.new(@john_info)
@john_activation_key = "1234... | 31.564356 | 88 | 0.651506 |
216a23c5b788845e0209625800e8304e5570b947 | 294 | module RedClothParslet::Parser
end
require 'redcloth-parslet/parser/common'
require 'redcloth-parslet/parser/exclusions'
require 'redcloth-parslet/parser/attributes'
require 'redcloth-parslet/parser/html_tag'
require 'redcloth-parslet/parser/inline'
require 'redcloth-parslet/parser/block'
| 26.727273 | 44 | 0.826531 |
03215a4624ab0be3ddfb2407323584543cede672 | 15,023 | require 'spec_helper'
describe MergeRequests::RefreshService, services: true do
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
let(:service) { MergeRequests::RefreshService }
describe '#execute' do
before do
@user = create(:user)
group = create(:group)
group... | 38.032911 | 125 | 0.608866 |
d5ac8b8676970cb2a004b2bc47142449af3219f9 | 2,241 | require File.expand_path('../boot', __FILE__)
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "sprockets/railtie"
# requi... | 35.571429 | 99 | 0.721107 |
01dd74c88fe49166780196a1ba53dfdc99a14b60 | 129 | class AddTheGeomToReferential < ActiveRecord::Migration
change_table :referentials do |t|
t.string :bounds
end
end
| 16.125 | 55 | 0.736434 |
2630a0509e22466c5a5bdbaa02df6f2940ef9d46 | 1,532 | <% if false # the license inside this if block assertains to this file -%>
# Copyright 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... | 38.3 | 80 | 0.734334 |
ff86d0adade7850169c01f9b5d14bd2753e14805 | 285 | #!/usr/bin/env ruby
# encoding: utf-8
require "bunny"
conn = Bunny.new
conn.start
ch = conn.create_channel
q = ch.queue("task_queue", durable: true)
msg = ARGV.empty? ? "Hello World!" : ARGV.join(" ")
q.publish(msg, :persistent => true)
puts " [x] Published #{msg}"
conn.close
| 14.25 | 51 | 0.659649 |
08558366b6b077b205543ffbf851917ec93cd60a | 2,008 | #--------------------------------------------------------------------
#
# Author: Martin Corino
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the R2CORBA LICENSE which is
# included with this program.
#
# Copyright (c) Remedy IT Expertise BV
#--------------------------... | 22.818182 | 121 | 0.6001 |
e99a9858e8a099c79c7ffa2948ed2e681108a698 | 615 | require File.dirname(__FILE__) + '/../spec_helper'
describe ListedDirectory do
before(:each) do
@files_count = 7
@path = File.expand_path(File.dirname(__FILE__))
@dir = ListedDirectory.new(:full_path => @path)
end
it "should be a listed file" do
@dir.should be_instance_of(ListedDirectory)
end
... | 22.777778 | 52 | 0.682927 |
1167d881c10276d82e51c53b7a3b284adfcc4038 | 1,788 | class Admin::UsersController < AdminController
before_action :ensure_only_admin_user
before_action :set_user, only: :destroy
before_action :acknowledge_admin
# GET /users
# GET /users.json
def index
@users = User.order(params[:order] || 'created_at ASC')
@formattedUsers = @users.map do |user|
... | 31.928571 | 138 | 0.64094 |
bf525a7d403db60d6872fb9b37554ba09a887885 | 84 | require 'spec_helper'
describe "Users" do
describe "GET /users" do
end
end
| 10.5 | 26 | 0.678571 |
61b93ab9f01b5b189d1eb594d5cff50000c7c9cb | 310 | json.id @word_hunt.id
json.name @word_hunt.name
json.teacher_id @word_hunt.teacher_id
json.teacher_name @word_hunt.teacher.name
json.team_id @word_hunt.team_id
json.team_name @word_hunt.team.name
json.words @word_hunt.words do |word|
json.id word.id
json.word word.word
end
json.puzzle @word_hunt.puzzle
| 22.142857 | 41 | 0.803226 |
bf4a77963527a6ac97298645b035ccf6241de90b | 812 | $:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "doccer/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "doccer"
s.version = Doccer::VERSION
s.authors = ["JoshAshby"]
s.email = ["joshuaashby@joshashby.co... | 32.48 | 140 | 0.663793 |
5dc47475867e07263c362dc1df447c8d0830f931 | 119 | require 'catechism'
describe 'life' do
it 'is a bummer' do
expect('stuff').not.to_equal('great')
end
end | 17 | 42 | 0.638655 |
1c90f6032f8da2d939bb8b6bc4a1f2ee3e518085 | 9,026 | # typed: false
# frozen_string_literal: true
require "delegate"
require "cli/args"
module Homebrew
module CLI
# Helper class for loading formulae/casks from named arguments.
#
# @api private
class NamedArgs < Array
extend T::Sig
def initialize(*args, parent: Args.new, override_spec: ni... | 33.306273 | 115 | 0.594394 |
5dcfdcf3c2ae00d135611dafafab848feb869167 | 8,674 | module ApplicationHelper
include Category::CategoryHelper
include SS::AutoLink
include SS::ButtonToHelper
include SS::ColorPickerHelper
include SS::ErrorMessagesFor
def tryb(&block)
begin
yield
rescue
nil
end
end
def br(*args)
options = args.extract_options!
option_html... | 29.40339 | 126 | 0.634655 |
79d7f046bc96c15d16b0883e0770ea5768fd66bd | 106 | # frozen_string_literal: true
json.array! @themes, partial: 'api/organizations/themes/theme', as: :theme
| 26.5 | 74 | 0.764151 |
08ee6738ec357ed608b773396b3fbbe9f99d5a5d | 2,843 | require 'sys-filesystem'
# USB Device Model Class
class USBDevice
attr_reader :device, :mount, :fstype, :size, :name
def initialize(fsm)
@device = fsm.name
@mount = fsm.mount_point
@fstype = fsm.mount_type
stat = Sys::Filesystem.stat(@mount)
@size = {
total: stat.block_size * stat.blocks,... | 27.07619 | 72 | 0.596201 |
5d94f69f1011aa9ea58a0fbc11ad2992a881044e | 721 | # frozen_string_literal: true
RSpec.describe Mihari::Feed::Parser do
subject { described_class.new data }
let(:data) {
[{
a: ["a", "b", "c"],
b: [{ foo: "bar", bar: "foo" }, { foo: "foo", bar: "bar" }],
c: [["1", "2", "3"], ["4", "5", "6"], ["7", "8", "9"]]
}]
}
describe "#parse" do... | 22.53125 | 66 | 0.485437 |
e206f813331ed8d66bca3b0fe9422d59b5c68175 | 608 | # 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 bin/rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
# ... | 46.769231 | 147 | 0.766447 |
ab09884772aa5b854bcb8de587877f15fd447c00 | 388 | # frozen_string_literal: true
RSpec.describe CloudFlare::DynamicDNS::IfConfig do
subject(:ifconfig) { described_class.new }
describe '#execute' do
before do
allow(Faraday).to receive(:get).and_call_original
end
it 'uses faraday to get public ip' do
ifconfig.execute
expect(Faraday).... | 21.555556 | 71 | 0.698454 |
e233d6f2443b924122c2d1380d759da27fb6946d | 3,149 | # == Schema Information
#
# Table name: users
#
# id :integer not null, primary key
# email :string default(""), not null
# encrypted_password :string default(""), not null
# reset_password_token :string
# reset_password_sent_at :datetime
# r... | 29.707547 | 118 | 0.59765 |
e882e797589617989ed8f95571b4df19b27472e8 | 584 | # frozen_string_literal: true
# mutation_destroy_scenario
# module Mutations
# class DestroyCartItem < BaseMutation
# argument :id, Integer, required: true
#
# field :cart_item, Types::CartItemType, null: false
# field :errors, [String], null: false
#
# def resolve(id:)
# cart_item = CartItem.f... | 21.62963 | 56 | 0.556507 |
ff22616c104bbfcf920bf9589874b21bbe0e72db | 685 | describe Enum do
describe 'using values' do
# Sample for use below
module ValueTest
enum :alpha, 5
enum :beta, 10, 'a label'
enum :gamma, 2
end
it 'should return a value as that value' do
ValueTest.value(5).should == 5
end
it 'should convert keys to values' do
... | 21.40625 | 55 | 0.6 |
877d6a0bc8a1cb2bbda2e84658b74e8e45113f54 | 1,329 | require 'turbolinks/version'
require 'turbolinks/xhr_headers'
require 'turbolinks/xhr_url_for'
require 'turbolinks/cookies'
require 'turbolinks/x_domain_blocker'
require 'turbolinks/redirection'
module Turbolinks
class Engine < ::Rails::Engine
initializer :turbolinks do |config|
ActiveSupport.on_load(:acti... | 30.906977 | 88 | 0.663657 |
6164bc5a474d3d8b6240022153cb630f0a65f790 | 523 | module GrapeTokenAuth
class UnauthorizedMiddleware
def self.call(env)
warden_opts = env.fetch('warden.options', {})
errors = warden_opts['errors'] || warden_opts[:errors]
[401,
{ 'Content-Type' => 'application/json'
},
prepare_errors(errors)
]
end
def self.pre... | 24.904762 | 71 | 0.609943 |
285418f525cf1eeaff8475a1c5e97fc1c4d3da2f | 6,950 | =begin
=end
require 'date'
module AuthressSdk
# A collect of permissions that the user has to a resource.
class InlineResponse2002
attr_accessor :account
attr_accessor :user_id
# A list of the permissions
attr_accessor :permissions
# Attribute mapping from ruby-style variable name to JSON ... | 29.956897 | 209 | 0.615396 |
e9eb3949700b73831299789d1c8910855d52661b | 6,131 | # Challenges:
# I have to manually create my time graphs
class TimeController < ApplicationController
include ApplicationHelper
respond_to :html, :xml, :json, :csv
# POST
def refresh_from_csv
authorize! :manage_account, current_account
if params[:tap_file]
@result = Record.refresh_from_tap_log(cu... | 41.993151 | 204 | 0.662535 |
184af25ec8c5699fdbcdf7b20b6b0798f0d5a10f | 232 | require File.dirname(__FILE__) + '/../../spec_helper'
require File.dirname(__FILE__) + '/fixtures/classes'
describe "StringIO#flush" do
it "returns itself" do
@io = StringIO.new("flush")
@io.flush.should == @io
end
end
| 23.2 | 53 | 0.676724 |
ed759da8733601e3ffa59f700330c504d63506c5 | 70 | module AnsibleTowerClient
class ProjectUpdate < BaseModel
end
end
| 14 | 33 | 0.814286 |
ff3f6f76fbc78615afac928f7961461e6a2a8320 | 620 | require 'test_helper'
describe Resque::Coder do
before do
@coder = Resque::Coder.new
end
describe '#encode' do
it 'raises an exception' do
assert_raises(Resque::EncodeException) {@coder.encode(nil)}
end
it 'aliased #dump should raise an exception' do
assert_raises(Resque::EncodeExce... | 22.142857 | 65 | 0.679032 |
ab2e4707477957ab10aacd07a0a0f506dede76ec | 836 | require_relative 'base_handler'
module LanguageHandler
class Python < BaseHandler
LANG_CNAME = 'py'.freeze
def self.run_before_test(directory)
dirs = ['./venv/*', './guides/*', './testable_snippets/*']
exclude = dirs.map{|dir| "--exclude='#{dir}'"}
Dir.chdir(directory) do
output = ... | 24.588235 | 64 | 0.61244 |
8784ca2936276db01035b2b862e3d9200254dbf2 | 37 | module Kirus
VERSION = "0.1.2"
end
| 9.25 | 19 | 0.648649 |
1ab77dccf32f7264954d74f9e90140f6f4746510 | 1,917 | class ApplicationHelper::Toolbar::StorageCenter < ApplicationHelper::Toolbar::Basic
button_group('storage_vmdb', [
select(
:storage_vmdb_choice,
'fa fa-cog fa-lg',
t = N_('Configuration'),
t,
:items => [
button(
:storage_scan,
'fa fa-search fa-lg',
... | 32.491525 | 248 | 0.553469 |
ab346156b49732a5917a9126930107c783a22fa9 | 2,903 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
def initialize(info = {})
super(update_info(info,
'N... | 28.184466 | 102 | 0.53393 |
ffc06d770f846b7d399aeccddef5ca80e8b47f6b | 3,198 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe ResourceAccessTokens::RevokeService do
subject { described_class.new(user, resource, access_token).execute }
let_it_be(:user) { create(:user) }
let(:access_token) { create(:personal_access_token, user: resource_bot) }
describe '#execute' do
... | 28.553571 | 133 | 0.6404 |
1d9983632d817ea02301f2aa5487e9f1f0156747 | 3,320 | #
# Author:: Adam Jacob (<adam@chef.io>)
# Copyright:: Copyright 2009-2016, 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
#
# ... | 33.535354 | 111 | 0.633133 |
1af4b5d3a5b89a48beb41405c0945b25f32f71f0 | 4,927 | Pod::Spec.new do |s|
s.name = 'GoogleUtilities'
s.version = '7.1.1'
s.summary = 'Google Utilities for iOS (plus community support for macOS and tvOS)'
s.description = <<-DESC
Internal Google Utilities including Network, Reachability Environment, Logger and Swizzling for
other... | 35.963504 | 97 | 0.68216 |
08c58a9f2a50e878bf320c555bc67f6b274bfdec | 121 | $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "discard/rails/observers"
require "minitest/autorun"
| 24.2 | 58 | 0.760331 |
91401ff73047a1f26735d056e28a85fa8cfbb132 | 179 | class CreateUsersTable < ActiveRecord::Migration[6.1]
def change
create_table :users do |t|
t.string :name
t.string :email
t.timestamps
end
end
end
| 16.272727 | 53 | 0.648045 |
61bca1b3d7177fc95f108ae67032a084da3d62bb | 379 | module Text
class Sorter
def self.sort(text_components)
components = text_components.clone
components = components.shuffle
nil_priorities, components = components.partition {|c| c.priority.nil? }
components = components.sort_by(&:priority_index)
components = components.reverse
... | 29.153846 | 78 | 0.71504 |
b9d2c07e21421cd147b66ddd9fc17db1ef24fdcd | 98 | # frozen_string_literal: true
require "devise_materialize/version"
module DeviseMaterialize
end
| 14 | 36 | 0.846939 |
1c0d14d3247ccb45fef095a2b4cf6374055ded88 | 65 | require_relative 'setup'
class TestMessage < Minitest::Test
end
| 13 | 34 | 0.8 |
bbb9ed086758c11470cea83a9ed2433b8aa6b53c | 669 | class Libcap < Formula
desc "User-space interfaces to POSIX 1003.1e capabilities"
homepage "https://sites.google.com/site/fullycapable/"
url "https://mirrors.edge.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.27.tar.xz"
sha256 "dac1792d0118bee6aae6ba7fb93ff1602c6a9bda812fd63916eee1435b9c486a"
... | 31.857143 | 102 | 0.748879 |
28d1512c406f446eca1943b0faf74142eeccbb68 | 1,385 | require "rails_helper"
describe "AllCasaAdmin auth", type: :system do
let(:all_casa_admin) { create(:all_casa_admin) }
let(:volunteer) { create(:volunteer) }
context "when authenticated user" do
before { sign_in all_casa_admin }
it "renders AllCasaAdmin dashboard page" do
visit "/"
expect(p... | 25.648148 | 65 | 0.652708 |
d5f21892de306e398d9e8f5cf17416b9d0351f70 | 2,212 | # 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... | 32.529412 | 83 | 0.65642 |
4a9ebc7db6993d6c1bd159437d8ef48c69caf6da | 204 | class CreateConversations < ActiveRecord::Migration[6.0]
def change
create_table :conversations do |t|
t.integer :sender_id
t.integer :recipient_id
t.timestamps
end
end
end
| 18.545455 | 56 | 0.691176 |
3868ad4c5de2af3cc69fdf7006ddd1d525560b7a | 2,042 | module Mrbmacs
class RustMode < Mode
include Scintilla
def initialize
super.initialize
@name = 'rust'
@lexer = 'rust'
@indent = 4
@keyword_list = "as fn let const static if else match for in loop \
while break continue return crate extern use mod self super struct \
e... | 36.464286 | 74 | 0.667483 |
5db6022b1baf3bb13b2a656ca168fdfc16d9ae73 | 660 | class ManageIQ::Providers::BaseManager::RefreshWorker::Runner < ::MiqQueueWorkerBase::Runner
def after_initialize
@emss = ExtManagementSystem.find([@cfg[:ems_id]])
@emss.each do |ems|
do_exit("Unable to find instance for EMS id [#{@cfg[:ems_id]}].", 1) if ems.nil?
do_exit("EMS id [#{ems.id}] faile... | 36.666667 | 105 | 0.683333 |
bff5f72727776e12c7b4bea5daa221dd1f99b457 | 2,789 | # Copyright 2020-2021 Couchbase, 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 ... | 25.824074 | 114 | 0.66332 |
91c0f9ba1040791e4e2d7cdf9721e48cd7358f7d | 1,739 | # frozen_string_literal: true
class SearchService
include Gitlab::Allowable
def initialize(current_user, params = {})
@current_user = current_user
@params = params.dup
end
# rubocop: disable CodeReuse/ActiveRecord
def project
return @project if defined?(@project)
@project =
if params... | 23.5 | 74 | 0.683151 |
87fd01e5b12c8e3bda0590386c9993c1e144467e | 1,004 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Elastic::ProcessInitialBookkeepingService do
let(:project) { create(:project) }
let(:issue) { create(:issue) }
describe '.backfill_projects!' do
it 'calls initial project indexing' do
expect(described_class).to receive(:maintain_index... | 37.185185 | 159 | 0.761952 |
62fbe414f4286b5cd064a3790677c535841988cc | 3,867 | class AssetTagImport
include Vmdb::Logging
attr_accessor :errors
attr_accessor :stats
# The required fields list is not limited anymore, so pass nil.
REQUIRED_COLS = {VmOrTemplate => nil, Host => nil}
MATCH_KEYS = {
VmOrTemplate => ["name", "hardware.networks.hostname", "guid"],
Host => ["... | 32.771186 | 137 | 0.556504 |
3943af1ae0c788f4259a6e92550a92034f7dd1ca | 1,118 | class CreateDiffRecordService < ApplicationService
attr_reader :user, :obj, :column_name, :after, :before
def initialize(user, obj, column_name, before, after)
@user = user
@obj = obj
@before = before
@after = after
@column_name = column_name
end
def call
ActiveRecord::Base.trans... | 23.291667 | 92 | 0.579606 |
abd2c7b49842ee7bfb614227b5a4615463e489ce | 750 | # Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Add Yarn node_modules ... | 32.608696 | 76 | 0.76 |
1c27980d3ebe413159cd1738b0a88ed1d246d578 | 172 | class AddBatchInvitationCodeIntoInvitationCodes < ActiveRecord::Migration[5.1]
def change
add_column :invitation_codes, :batch_invitation_code_id, :integer
end
end
| 28.666667 | 78 | 0.819767 |
1107374796ff2672a134921558a2be5fef2c4935 | 73 | # frozen_string_literal: true
module RailsEvent
VERSION = '0.1.1'
end
| 12.166667 | 29 | 0.739726 |
39afcd3ec75daa61b93760b49583340ad7a4759a | 1,472 | # frozen_string_literal: true
module Stupidedi
module Versions
module ThirtyForty
module SegmentDefs
s = Schema
e = ElementDefs
r = ElementReqs
LH2 = s::SegmentDef.build(:LH2, "Hazardous Classification Information",
"To specify the hazadous notation and endorsement... | 44.606061 | 79 | 0.616848 |
3347bd87835ef4afc43ba6763306240f5fc1b4f1 | 92 | class HomeController < ApplicationController
get "/" do
erb :"index.html"
end
end
| 11.5 | 44 | 0.684783 |
e8ffc5b6370aecf5c267849acd9cb189318f3a20 | 1,138 | require "formula"
class Abduco < Formula
homepage "http://www.brain-dump.org/projects/abduco"
url "http://www.brain-dump.org/projects/abduco/abduco-0.1.tar.gz"
sha1 "063b66d8a9a83ecd5b9501afc86812a06ad79076"
head "git://repo.or.cz/abduco.git"
bottle do
cellar :any
sha1 "dc3f05e32b87e67d3b9da26e199fb... | 33.470588 | 166 | 0.690685 |
61fa55a13c0159a2c73bad805f262ce85d6d96a5 | 41 | exclude :test_scan, "needs investigation" | 41 | 41 | 0.829268 |
d57a31dc5d1fc1a4fcd0ccca75452bf70419bc61 | 20,052 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Security::Mgmt::V2017_08_01_preview
#
# API spec for Microsoft.Security (Azure Security Center) resource provider
#
class InformationProtectionPolicies
... | 44.85906 | 141 | 0.704269 |
e263269373ab111209781eadf304c4f84c557f66 | 2,987 | require 'spec_helper'
describe 'gws_portal_user_portal', type: :feature, dbscope: :example do
let(:site) { gws_site }
let(:user) { create :gws_user }
let(:index_path) { gws_portal_user_path(site: site, user: user) }
let(:portal) { user.find_portal_setting(cur_user: user, cur_site: site).tap(&:save) }
let(:de... | 36.426829 | 91 | 0.68229 |
f8b0293b5b6cb86a573f9ef74e9b760192e6d4c0 | 4,780 | require 'spec_helper_acceptance'
require 'tempfile'
describe 'pdk remove config' do
include_context 'with a fake TTY'
shared_examples 'a saved configuration file' do |new_content|
it 'saves the setting' do
# Force the command to run if not already
subject.exit_status # rubocop:disable RSpec/NamedS... | 41.565217 | 164 | 0.677197 |
3971ff0789d397efdc9c12639ba07a4faf101bf7 | 11,172 |
require 'nationbuilder'
client = NationBuilder::Client.new('aycc', ENV['NATIONBUILDER_APIKEY'], retries: 8)
puts "finding wants to vols"
filter_wants_to_vol = {
tag: "wants%20to:%20volunteer%202019"
}
wants_to_vol = client.call(:people_tags, :people, filter_wants_to_vol)
wants_to_vol_2 = Nation... | 25.682759 | 168 | 0.724848 |
e2b33bec256fe5238bd3651faddd3931423fb530 | 4,676 | require "teaspoon/environment"
require "teaspoon/suite"
require "teaspoon/instrumentation"
module Teaspoon
class Engine < ::Rails::Engine
isolate_namespace Teaspoon
routes do
root to: "suite#index"
match "/fixtures/*filename", to: "suite#fixtures", via: :get, as: "fixture"
match "/:suite",... | 35.157895 | 118 | 0.684773 |
87ba3a3bfaf9731b0ab496d1db858de4a891621e | 1,927 | # == Schema Information
#
# Table name: emails
#
# id :integer not null, primary key
# person_id :string(255)
# address :string(255)
# confirmed_at :datetime
# confirmation_sent_at :datetime
# confirmation_token :string(255)
# created_at :dat... | 26.040541 | 81 | 0.688635 |
6a6a2a0ea493171ad0b287efaca604f6250d0ac1 | 1,447 | #!/usr/bin/env ruby
# Encoding: utf-8
#
# Copyright:: Copyright 2016, Google Inc. All Rights Reserved.
#
# License:: 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
#
# ... | 37.102564 | 80 | 0.680028 |
180076545d549b5f132a04ac639413e3b936a7b2 | 1,789 | set :stage, :production
# Simple Role Syntax
# ==================
#role :app, %w{deploy@example.com}
#role :web, %w{deploy@example.com}
#role :db, %w{deploy@example.com}
# Extended Server Syntax
# ======================
#server '127.0.0.1', user: 'juju', roles: %w{web app db}
server "46.101.185.144", user: 'deploy',... | 28.396825 | 131 | 0.70654 |
d55ee82ae7cce800d4809296cea5064f4013fbc6 | 801 | class Dshb < Formula
desc "macOS system monitor in Swift"
homepage "https://github.com/beltex/dshb"
url "https://github.com/beltex/dshb/releases/download/v0.2.0/dshb-0.2.0-source.zip"
sha256 "b2d512e743d2973ae4cddfead2c5b251c45e5f5d64baff0955bee88e94035c33"
bottle do
cellar :any_skip_relocation
sha25... | 30.807692 | 93 | 0.754057 |
8748bfdcf97a81be5dbb20ff088b48c7320c8222 | 412 | # these are the tests that run reliably and invisibly
TOPDIR = File.expand_path(File.join(File.dirname(__FILE__), '..'))
$LOAD_PATH.unshift TOPDIR
puts $LOAD_PATH
require 'unittests/setup.rb'
Dir.chdir TOPDIR
#tests = ["unittests/test.rb",
# "unittests/test_xpath.rb"
# ]
#tests.each { |x... | 20.6 | 67 | 0.65534 |
e9314230e7eb3e863b3e1e5016acbca00ec095e2 | 242 | require 'test_helper'
class Ffprober::Ffmpeg::FinderTest < Minitest::Test
def test_finder
finder = Ffprober::Ffmpeg::Finder.new
end
def test_executable_name
assert "ffprobe", Ffprober::Ffmpeg::Finder.executable_name
end
end
| 20.166667 | 62 | 0.752066 |
1817387b6c65353a2dae563fb5d539fae93784b3 | 794 | #
# Cookbook:: apache2
# Recipe:: mod_log_config
#
# Copyright:: 2008-2013, Chef Software, 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-... | 31.76 | 74 | 0.741814 |
26e17d546a4fb21affb37ecfdde9781480f6b5cc | 670 | require 'faraday_middleware'
require 'json'
require 'active_support/core_ext/hash/indifferent_access'
require "kalixa_api/version"
require 'kalixa_api/v3/http_service'
require 'kalixa_api/v4/http_service'
require 'kalixa_api/v4/merchant'
module KalixaApi
class << self
attr_accessor :api_user, :api_password, :... | 25.769231 | 89 | 0.770149 |
ff2517ec4a12eec4eb771cba8c63b3d5c2883216 | 3,580 | namespace :db do
namespace :import do
namespace :geography do
desc "Download Chicago Community Areas from the TribApps Boundary Service"
task :community_areas_download => :environment do
require 'open-uri'
require 'json'
community_areas_all = []
community_area... | 36.907216 | 138 | 0.594413 |
ac21b6ba56dc0d97119e25373a851b783ff2dd96 | 279 | # Paths
cookbook_path [
File.join(File.expand_path('../', __FILE__), "./cookbooks"),
File.join(File.expand_path('../', __FILE__), "./public-cookbooks"),
]
# Logging
log_level :info # Log additional info
log_location STDOUT # Write logs to the terminal | 31 | 72 | 0.648746 |
e26dd7d119328e76ea6c23bb234c43029e48534c | 478 | workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 5)
threads threads_count, threads_count
preload_app!
rackup DefaultRackup
port ENV['PORT'] || 3000
environment ENV['RACK_ENV'] || 'development'
on_worker_boot do
# Worker specific setup for Rails 4.1+
# Se... | 29.875 | 70 | 0.75523 |
015e89a2cdd18b2b4a80c6b94fb16cf4420e7c85 | 133 | FactoryGirl.define do
factory :product_gateway_web_service_ba, class: BrNfe::Product::Gateway::WebServiceBA do
env :test
end
end | 26.6 | 90 | 0.804511 |
7ae3be2c074d546226d6a8ab6885a2b6cc351287 | 261 | # frozen_string_literal: true
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, ENV['TWITTER_KEY'], ENV['TWITTER_SECRET']
end
OmniAuth.config.on_failure = proc { |env|
OmniAuth::FailureEndpoint.new(env).redirect_to_failure
}
| 26.1 | 62 | 0.785441 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.