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 |
|---|---|---|---|---|---|
0145342ac746edf7e14e238f572cf7811939ac6f | 2,169 | Rails.application.routes.draw do
resources :users, except:[:new, :show] do
resources :destinations
resources :flights, only: [:update, :destroy, :create]
resources :pilots, only: [:update, :destroy, :create]
resources :passengers, only: [:update, :destroy, :create]
end
... | 29.310811 | 88 | 0.619179 |
aba86829a77b9e0b416fa85fb3451b3432e47cc5 | 899 | class DelayedJobsController < ApplicationController
respond_to :html, :json, :js
before_filter :admin_only, except: [:index]
def index
@delayed_jobs = Delayed::Job.order("run_at asc").paginate(params[:page], :limit => params[:limit])
respond_with(@delayed_jobs)
end
def cancel
@job = Delayed::Job... | 21.404762 | 102 | 0.637375 |
bf2a95e213fdc57023953ee0f9c9941591c27d6e | 142 | require 'test/unit'
class MydryTest < Test::Unit::TestCase
# Replace this with your real tests.
def test_this_plugin
flunk
end
end
| 15.777778 | 38 | 0.725352 |
f7420b809ace362ab8f92e60acd2ea9e568a6c13 | 438 | require "dea/staging/staging_message"
require "dea/staging/env"
require "dea/starting/env"
module Dea
class Env
class StrategyChooser
def initialize(message, task)
@message = message
@task = task
end
def strategy
if @message.is_a? StagingMessage
Staging::Env.n... | 19.043478 | 44 | 0.605023 |
01271546a353581a4fb7b6f216cc0a48778af928 | 589 | # frozen_string_literal: true
module Git
module Cop
module Styles
class CommitSubjectLength < Abstract
def self.defaults
{
enabled: true,
severity: :error,
length: 72
}
end
def valid?
commit.subject.sub(/(fixup!|squa... | 17.323529 | 72 | 0.49236 |
bf74915d3fede1633f7d4999038e6c28facc3cd7 | 145 | class RemoveOldTables < ActiveRecord::Migration
def change
drop_table :question_associations
drop_table :option_associations
end
end
| 20.714286 | 47 | 0.8 |
62b6ad6553ce70e5c4895f2a2d07c4036eb07942 | 3,290 | require 'nokogiri'
require 'net/https'
class Webservice < ActiveRecord::Base
include WebserviceParser
validates_presence_of :base_url, :title
validates_uniqueness_of :title
validate :correct_yaml_in_rule_scheme
# Parameters store key-value pairs that will be sent to remote webservice.
# Data stores r... | 33.917526 | 105 | 0.651368 |
2148e052565a94b520a50022cfb98e0bcf195205 | 4,519 | module MCollective
# A set of classes that helps create data description language files
# for plugins. You can define meta data, actions, input and output
# describing the behavior of your agent or other plugins
#
# DDL files are used for input validation, constructing outputs,
# producing online help, inf... | 39.640351 | 93 | 0.626466 |
03e422aec548678bc56a90c1687440878a337ce2 | 863 | # frozen_string_literal: true
module Admin
module PropagateService
extend ActiveSupport::Concern
BATCH_SIZE = 10_000
class_methods do
def propagate(integration)
new(integration).propagate
end
end
def initialize(integration)
@integration = integration
end
priv... | 22.710526 | 103 | 0.705678 |
f855296ac668986466cdcc3e7ccd4d698d5eb050 | 9,253 | module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class WepayGateway < Gateway
self.test_url = 'https://stage.wepayapi.com/v2'
self.live_url = 'https://wepayapi.com/v2'
self.supported_countries = %w[US CA]
self.supported_cardtypes = %i[visa master american_express discover]
sel... | 39.374468 | 132 | 0.620555 |
ab4ecdc77593860b913fd7c891a1594920b45cf7 | 465 |
module Ebay # :nodoc:
module Types # :nodoc:
# == Attributes
# text_node :refund_option, 'RefundOption', :optional => true
# text_node :description, 'Description', :optional => true
class RefundDetails
include XML::Mapping
include Initializer
root_element_name 'RefundDetails'
... | 25.833333 | 66 | 0.668817 |
26a07af7f0afb4850bfe1209f1e662ae8c61b0e9 | 11,360 | # encoding: UTF-8
# (c) Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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.... | 32.364672 | 80 | 0.603433 |
33b1cb5aa1b3fc5dac70b3f3002c0e8cb9aafa06 | 2,640 | cask 'adobe-photoshop-cc' do
version '16'
sha256 'c5a30a102299215b7df7e0cc519d3d63c20a63b0fecf54bc41eb68061c96dec7'
url "http://trials3.adobe.com/AdobeProducts/PHSP/#{version}/osx10/Photoshop_#{version.major}_LS20.dmg",
user_agent: :fake,
cookies: { 'MM_TRIALS' => '1234' }
name 'Adobe Photoshop ... | 37.714286 | 232 | 0.55 |
f8353bbc6e3e09f5a320217f0ba0466abfaaf175 | 2,614 | # encoding: utf-8
require 'test_helper'
class GooglePlacesSearchTest < GeocoderTestCase
def setup
Geocoder.configure(lookup: :google_places_search)
set_api_key!(:google_places_search)
end
def test_google_places_search_result_contains_place_id
assert_equal "ChIJhRwB-yFawokR5Phil-QQ3zM", madison_squa... | 32.271605 | 89 | 0.786917 |
ff6a6b4d10a31f625bff014798dbbb0f60d4e221 | 29 | module SideEffectsHelper
end
| 9.666667 | 24 | 0.896552 |
08decc1172ddd4efd829cb967a5ee6a76e48d2c2 | 785 | require 'test_helper'
class EventsControllerTest < ActionDispatch::IntegrationTest
setup do
@event = events(:one)
end
test "should get index" do
get events_url, as: :json
assert_response :success
end
test "should create event" do
assert_difference('Event.count') do
post events_url, pa... | 20.128205 | 63 | 0.666242 |
ff1ba028d37c8fabb6c3911ff610c3dc3857ec90 | 260 | require 'test_helper'
class ExeptionsAppTest < ActionDispatch::IntegrationTest
test 'returns 404 for unknown format for pages that do not exist' do
get '/does_not_exist', headers: { 'Accept' => '*/*' }
assert_equal 404, response.status
end
end
| 23.636364 | 70 | 0.719231 |
01bb610dcf52589a467468b2f7c1b25a57116fdf | 6,781 | #
# Author:: Bryan McLellan (btm@loftninjas.org)
# Copyright:: Copyright (c) 2009 Bryan McLellan
# 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
#
# ... | 36.069149 | 162 | 0.534287 |
1cb756f382e07a0d7e35a9ac3b38eddf6c7f8e64 | 981 | class P4pRankings::Fighters
attr_accessor :name, :win, :loss, :draw
def initialize(name:, win:, loss:, draw:)
@name = name
@win = win
@loss = loss
@draw = draw
end
def record
"#{@win} - #{@loss} - #{@draw}"
end
def self.all
@@all ||= self.scrape_fighters.collect.with_index do |fi... | 23.926829 | 155 | 0.599388 |
01faeaf228e3f5277216b9ba876a63aeeb0c40a8 | 824 | cask "ledger-live" do
version "2.37.2"
sha256 "f3a690502bf76d0feae4dd3254561df83e2e08a8bcabf820de402fc32bc62582"
url "https://github.com/LedgerHQ/ledger-live-desktop/releases/download/v#{version}/ledger-live-desktop-#{version}-mac.dmg",
verified: "github.com/LedgerHQ/ledger-live-desktop/"
name "Ledger Li... | 26.580645 | 125 | 0.724515 |
39cfc32a6f8fffc593d65a3c3f9e072d70a8fbca | 1,869 | require 'net/http'
require 'json'
require 'cgi'
module Build
module Trigger
def invoke!(image: nil)
uri = URI("https://gitlab.com/api/v4/projects/#{CGI.escape(get_project_path)}/trigger/pipeline")
params = get_params(image: image)
res = Net::HTTP.post_form(uri, params)
id = JSON.parse(res... | 26.7 | 102 | 0.59069 |
9193c8980fdb4aa242e30cf9ce5556edac03ab2d | 600 | # 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/version-3/CONTRIBUTING.md
#
# WARNING ABOUT GENERATED CODE
$:.unshift(File.expand_path('../../lib', __FILE__))
$:.unshift(File.expand_pat... | 31.578947 | 74 | 0.721667 |
aba3d7a617dbd0fbf764ddb05a3f990ea9f89fbc | 57,700 | =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: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.0.0-SNAPSHOT
=en... | 43.383459 | 173 | 0.685719 |
79cb9d3922936f28ceceb1cb8da430e1156abe0f | 1,074 | require 'test_helper'
require 'gemgen/generator'
module Gemgen
class GemgenTest < MiniTest::Unit::TestCase
def setup
if File.exist? tmp_dir
rm_rf tmp_dir
end
mkdir tmp_dir
end
def test_that_minitest_unit_tests_runs
gem_name = 'minitest_unit'
Dir.chdir(tmp_dir) do |d... | 25.571429 | 85 | 0.608939 |
2645e1a54fc6704f0ccce1f4f9ceb4a188697f99 | 312 | class EmailEvent < FlowdockEvent
register_event "mail"
def render
email_text = team_inbox_event("Email", "#{@message['content']['from'][0]['address']}: #{@message['content']['subject']}")
render_notice(IrcServer::FLOWDOCK_USER, @target.irc_id, email_text)
end
def valid?
channel?
end
end
| 24 | 125 | 0.685897 |
26f5e15a049f15d5e90ed7bf95a25583024a24fa | 540 | # frozen_string_literal: true
# == Schema Information
#
# Table name: users
#
# id :bigint(8) not null, primary key
# nickname :string(64) not null
# icon_url :string
# introduction :text
# created_at :datetime not null
# updated_at :datetime not null
#
require... | 21.6 | 55 | 0.62963 |
d5114afcb9ec1596b022179b139c6d4670eb8778 | 1,775 | # Shape Transform
# by Ira Greenberg.
#
# Illustrates the geometric relationship
# between Cube, Pyramid, Cone and
# Cylinder 3D primitives.
#
# Instructions:
# Up Arrow - increases points
# Down Arrow - decreases points
# 'p' key toggles between cube/pyramid
class ShapeTransform < Processing::App
def setup
... | 18.882979 | 65 | 0.562817 |
086254551f277de9cd526538c74719f9b9b95f50 | 140 | class ChangeContentTextLength < ActiveRecord::Migration
def change
change_column :contents,:content,:text,limit: 4294967295
end
end
| 23.333333 | 60 | 0.792857 |
010bc1b77eaa266dd684098c8eff01ddf09ee0b0 | 1,705 | require 'spec_helper'
describe DeactivationsController, '#create' do
context 'when deactivation succeeds' do
it 'returns successful response' do
membership = create(:membership)
repo = membership.repo
activator = double(:repo_activator, deactivate: true)
RepoActivator.stub(new: activator)... | 28.898305 | 62 | 0.667449 |
6299e2fac0edc52a89468be8ed9eb630c10fc33c | 1,416 |
module EJP
module Schema
class ConceptScheme
attr_accessor :uri
attr_accessor :title
attr_accessor :creator
attr_accessor :concepts
attr_accessor :graph
attr_accessor :factory
def initialize(params = {})
SioHelper::General.se... | 25.285714 | 94 | 0.516243 |
1d46912f97e4e277cd6d60b3cf9235ee9484b049 | 297 | Aws.config[:codedeploy] = {
stub_responses: {
get_application: {
application: {
application_id: 'd3be67e5-e7l6-457b-946b-7a457EXAMPLE',
application_name: 'my-codedeploy',
create_time: Time.at(1_446_229_001),
linked_to_git_hub: false
}
}
}
}
| 22.846154 | 63 | 0.622896 |
6a0c253c5fa162dc26a0b9926309fa3adab6b8dd | 1,981 | module BootstrapFlashMessages
module FlashMessages
def redirect_to(options = {}, response_status_and_flash = {})
messages = response_status_and_flash[:flash]
if messages && (messages.is_a?(Symbol) || messages.is_a?(Array))
flashes = {}
locals = response_status_and_flash[:locals]
... | 30.015152 | 83 | 0.620394 |
ff4e1b93f5af46ba0fd4cd0e57a1377ff3397fee | 18,750 | require 'minitest'
require 'thread'
require 'fileutils'
require 'yaml'
require_relative "interactor"
require_relative "util"
# Holder to put and run test cases
class SassSpec::Test < Minitest::Test
def self.create_tests(test_cases, options = {})
options[:limit] ||= test_cases.length + 1
test_cases[0...option... | 28.409091 | 172 | 0.637973 |
281e9a2507f79f777c7a899b951acdd3db6f03cd | 1,036 | require 'formula'
class Pmdmini < Formula
homepage 'https://github.com/BouKiCHi/mdxplayer'
url 'https://github.com/BouKiCHi/mdxplayer/archive/aa55d9d3128f06aac4a15d5cefc083bd7b66d814.tar.gz'
version '20120115'
sha1 'b312f5b11b62a9d2be910252a97bed7decdef13f'
option "lib-only", "Do not build commandline playe... | 31.393939 | 128 | 0.682432 |
e2d6292edd24ab10b8b50189ba81c4723c30c5b9 | 1,109 | # frozen_string_literal: true
require_relative '../shared_examples'
RSpec.describe 'Invoice Resource', type: :integration do
include_context 'Shared initialization'
let(:invoice_period) { '2011-05-01' }
def create_res_instance(acc_id = nil)
@manager.create(
'account_id' => acc_id,
'period' ... | 22.632653 | 94 | 0.644725 |
62e110be1a79f2bf5b75051a66b5f4e84ca7e261 | 875 | require 'ares-hackathon'
c = AresHackathon.new
c.connect("127.0.0.1", "Salut")
while c.status == AresHackathon::ONGOING
puts "--- Waiting for my turn"
c.next_turn
break if c.status != AresHackathon::ONGOING
puts "--- Attacking"
m = c.my_cells
for i in 0..10
cell = m.sample
dx = cell.x + rand(3) -... | 25 | 76 | 0.637714 |
6191d960b678a2f71fcc80a63322fbbb747290d4 | 851 | module Octopub
module Entities
class Dataset < Grape::Entity
include GrapeRouteHelpers::NamedRouteMatcher
expose :id
expose :url do |dataset|
datasets_path(id: dataset.id)
end
expose :name
expose :description
expose :publisher do
expose :publisher_name, ... | 25.029412 | 106 | 0.609871 |
1ae9abba1789eecc440131c027427604665a4cd6 | 2,082 | class EventEditor
attr_reader :current_user, :params
def initialize(user, params)
@current_user = user
@params = params
end
def create
event = Event.new(event_params)
result = EventEditorResult.new(event: event)
unless event.save
result.render = :new
return result
end
... | 23.133333 | 125 | 0.678194 |
1cd20a6351d6408af3be46099d607bb1042278c4 | 1,987 | require "test_helper"
require "getto/roda/config"
module Getto::Roda::ConfigTest
describe Getto::Roda::Config do
describe "configure" do
it "create frozen OpenStruct when valid config" do
config =
Getto::Roda::Config.configure(
name: String,
key: {
a... | 24.8375 | 64 | 0.490689 |
7a1b860eb6448097e4ae402c272c84f356b2f56a | 23,070 | module Unix::Pkg
include Beaker::CommandFactory
# This method overrides {Beaker::Host#pkg_initialize} to provide
# unix-specific package management setup
def pkg_initialize
@apt_needs_update = true
end
def check_for_command(name)
result = exec(Beaker::Command.new("which #{name}"), :accept_all_exit... | 42.408088 | 164 | 0.650889 |
d5c77245a866cffdece353b2ebf3dd53ce525954 | 186 | module V1
class SchoolsController
# Serializer to return selected class attributes
class Serializer < ActiveModel::Serializer
attributes :name, :address
end
end
end | 23.25 | 52 | 0.736559 |
e927e9257b86d7e8d919d3baaa1d6fd25db343a6 | 133 | class AddDescriptionToPositions < ActiveRecord::Migration[5.1]
def change
add_column :positions, :description, :text
end
end
| 22.166667 | 62 | 0.766917 |
e232584f7e76a1b2335295e1313d50a1d882fadf | 2,130 | require 'spec_helper'
describe "sys_notice", type: :feature, dbscope: :example do
let(:name) { unique_id }
let(:name2) { unique_id }
let(:html) { "<p>#{unique_id}</p>" }
before { login_sys_user }
describe "basic crud" do
it do
#
# Create
#
visit sys_notice_index_path
click... | 28.4 | 116 | 0.621596 |
1d8078d0784b63f00cac86c6c56279bef0b204c8 | 1,808 | # 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 = %q{mail_diff}
s.version = "0.1.3"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_ruby... | 30.133333 | 105 | 0.674226 |
38f46aba081a21c6f40adb2a92cd15d48352a567 | 866 | # frozen_string_literal: true
require "date"
require "xsv/helpers"
require "xsv/sax_parser"
require "xsv/relationships_handler"
require "xsv/shared_strings_parser"
require "xsv/sheet"
require "xsv/sheet_bounds_handler"
require "xsv/sheet_rows_handler"
require "xsv/sheets_ids_handler"
require "xsv/styles_handler"
requ... | 30.928571 | 77 | 0.795612 |
217a4474ced18f0c320433cc02690b5baeaa89a9 | 2,630 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CDN::Mgmt::V2020_04_15
module Models
#
# Defines the parameters for the url rewrite action.
#
class UrlRewriteActionParameters
include ... | 30.581395 | 100 | 0.543726 |
38168668d014b9cf9d4616646feeec78c19aef1b | 2,135 | module Behavior
class Shielder < Rubyhave::Behavior
attr_reader :duration, :recharge, :defenses
def on_initialize
@duration = @options['duration'] || 5
@recharge = @options['recharge'] || 5
@defenses = [*@options['defenses']].compact
if @defenses.delete('all')
@defenses += G... | 26.358025 | 111 | 0.622482 |
f7a433e4a54e9c5c8204ee02cb3c9961f6fa2a3e | 7,304 | ##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'msf/core/auxiliary/report'
class Metasploit3 < Msf::Post
include Msf::Post::File
include Msf::Post::Unix
include Msf::Auxiliary::Report
def init... | 25.099656 | 129 | 0.537377 |
87720c1487b3f6792ffdcf8af6de9a7e445b1b76 | 1,832 | require 'test_helper'
class UsersEditTest < ActionDispatch::IntegrationTest
def setup
@user = users(:michael)
end
test "unsuccessful edit" do
log_in_as(@user)
get edit_user_path(@user)
assert_template 'users/edit'
patch user_path(@user), params: { user: { name: "",
... | 33.309091 | 78 | 0.510917 |
ffad5a76384eb0657b7c3caa5058d7258e16c81b | 1,028 | require "spec_helper"
describe Shamu::Features::Conditions::Env do
let( :context ) { double( Shamu::Features::Context ) }
let( :toggle ) { double( Shamu::Features::Toggle ) }
it "matches on presence of truthy variable" do
condition = scorpion.new Shamu::Features::Conditions::Env, "CANARY", toggle
exp... | 35.448276 | 98 | 0.694553 |
0333a845214beaada0b4a014b4dc76baacb40446 | 4,655 | require_relative 'remi_spec'
require 'remi/data_subjects/salesforce'
require_relative 'fixtures/sf_bulk_helper_stubs'
describe Remi::SfBulkHelper do
describe SfBulkHelper::SfBulkQuery do
before do
@sf_query = SfBulkHelper::SfBulkQuery.new({}, 'Contact', SfBulkHelperStubs.contact_query)
allow(@sf_que... | 35 | 143 | 0.682062 |
26ea547d512136573f40a93aaf6ce2635fa2f45f | 237 | migration 7, :add_current_rule_id_to_context do
up do
modify_table :contexts do
add_column :current_rule_id, Integer
end
end
down do
modify_table :contexts do
drop_column :current_rule_id
end
end
end
| 16.928571 | 47 | 0.71308 |
e8a156a50b4f225daa41f63e336d3e90e4d1019b | 165 | pkgs = %w{build-essential libreadline-dev libssl-dev zlib1g-dev libxml2-dev libxslt1-dev}
pkgs.each do |pkg|
package pkg do
action :install
end
end
| 20.625 | 89 | 0.70303 |
8771c7bc5013ea4e8dbe2e1a143264fff51d0903 | 592 | cask "responsively" do
version "0.15.0"
sha256 "db01fb5e333056fe6cf4945d677b57190e82f6e26d4524277ef06c3df333f135"
url "https://github.com/responsively-org/responsively-app/releases/download/v#{version}/ResponsivelyApp-#{version}.dmg",
verified: "github.com/responsively-org/responsively-app/"
name "Respon... | 32.888889 | 122 | 0.760135 |
4a571c67152ffa6edd21658e04843c7686991c03 | 1,665 | require_relative "../../spec_helper"
require_relative "../../../lib/scraper/type_scraper"
describe SchemaOrg::Scraper::TypeScraper do
context("Thing.html") do
let(:type) { html = File.read(File.expand_path("../Thing.html", __FILE__)); SchemaOrg::Scraper::TypeScraper.new(html, "http://schema.org/Thing").scrape }
... | 61.666667 | 476 | 0.712312 |
7ae7c2369e9984151998e9d408d113775d40414f | 1,027 | require 'spec_helper'
describe Zookeeper do
describe :initialize, 'with watcher block' do
before do
@events = []
@watch_block = lambda do |hash|
logger.debug "watch_block: #{hash.inspect}"
@events << hash
end
@zk = Zookeeper.new(Zookeeper.default_cnx_str, 10, @watch_bloc... | 24.452381 | 79 | 0.633885 |
799e539932afd37a83823497158a6953d485362b | 13,475 | =begin
#ESP Documentation
#The Evident Security Platform API (version 2.0) is designed to allow users granular control over their Amazon Web Service security experience by allowing them to review alerts, monitor signatures, and create custom signatures.
OpenAPI spec version: v2_sdk
Generated by: https://github.com/s... | 31.557377 | 347 | 0.62872 |
acca7d8bb3b2bd4e003d4f1d970b03839723df91 | 6,743 | class Ruby < Formula
desc "Powerful, clean, object-oriented scripting language"
homepage "https://www.ruby-lang.org/"
url "https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.2.tar.xz"
sha256 "91fcde77eea8e6206d775a48ac58450afe4883af1a42e5b358320beb33a445fa"
bottle do
sha256 "0370836f4107a976de5fa84a333fae... | 31.957346 | 97 | 0.639775 |
394a6b0a74269a194f6d02edad9421dfc5d3d230 | 263 | require 'lib/pod/animated_sprite_docs.rb'
require 'lib/pod/game_docs.rb'
module Pod
module PodDocs
def docs_module
<<-DOCS
* LIB: ~Pod~
Module of engine that contains all related classes.
DOCS
end
end
extend Docs
extend PodDocs
end
| 14.611111 | 51 | 0.69962 |
5d0694f891fdd698b202f14c1010f481951153a5 | 4,999 | #===============================================================================
# Script Name: Popup message windows
# Author: vFoggy
# Description:
# This script allows the user to show popup windows with messages. By adding
# a \pop in the beginning of a message (in the events) the message will be shown
# as a p... | 24.870647 | 97 | 0.655731 |
e9a334049e9063bac9a6ce511aa4e2f6ee77bf1f | 1,389 | class TreeBuilderAlertProfileObj < TreeBuilder
def initialize(name, sandbox, build = true, **params)
@assign_to = params[:assign_to]
@cat = params[:cat]
@selected = params[:selected_nodes]
@cat_tree = @assign_to.ends_with?("-tags")
super(name, sandbox, build, **params)
end
def override(node, ... | 30.195652 | 109 | 0.605472 |
284a611ae8e6db9c4d1b8ba5cf0edeedfab5b5ee | 19,217 | ##########################GO-LICENSE-START################################
# Copyright 2014 ThoughtWorks, 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/li... | 58.410334 | 192 | 0.719415 |
f7209fdb83fe96aaa4fd3271b3a9a1c9a8d96232 | 94 | # frozen_string_literal: true
module Manifold
module Tools
VERSION = '0.1.0'
end
end
| 11.75 | 29 | 0.702128 |
1df27f334ea4fee771a13d57915663a6ac756422 | 13,455 | require "rails_helper"
feature "Course confirmation", type: :feature do
let(:recruitment_cycle) { build(:recruitment_cycle, application_start_date: "2019-08-08") }
let(:course_confirmation_page) do
PageObjects::Page::Organisations::CourseConfirmation.new
end
let(:course_page) do
PageObjects::Page::Orga... | 35.975936 | 160 | 0.700037 |
2187bc324c811a13a11ceefd623f8a2fd7f351c4 | 2,232 | require_relative 'ionoscloud_base'
class Chef
class Knife
class IonoscloudVolumeDetach < Knife
include Knife::IonoscloudBase
banner 'knife ionoscloud volume detach VOLUME_ID [VOLUME_ID] (options)'
option :datacenter_id,
short: '-D DATACENTER_ID',
long: '--datacente... | 31 | 100 | 0.600806 |
d5613395faeaf535474c88dd9332019930323666 | 549 | Gem::Specification.new do |s|
s.name = 'ecc'
s.version = '0.0.0'
s.date = '2015-05-10'
s.summary = "ecc"
s.description = "ecc"
s.authors = ["Benjamin Kanouse"]
s.email = 'kanobt61@gmail.com'
s.files = ["lib/ecc.rb"]
s.homepage = 'https://github.com/BenKanouse/e... | 34.3125 | 69 | 0.570128 |
7a792fe829b5a17d0ea49ce93447eb6363bcfc97 | 11,910 | require 'formula'
def mysql_installed?
`which mysql_config`.length > 0
end
def postgres_installed?
`which pg_config`.length > 0
end
class Php54 < Formula
homepage 'http://php.net'
url 'http://www.php.net/get/php-5.4.3.tar.bz2/from/this/mirror'
md5 '51f9488bf8682399b802c48656315cac'
version '5.4.3'
hea... | 35.029412 | 288 | 0.634425 |
e2952c5d72f8ac37fe688abbf19994228d9ddfa4 | 636 | # typed: strict
# frozen_string_literal: true
if !ENV['METRICS'].nil? || !ENV['COVERAGE'].nil?
require 'simplecov'
SimpleCov.at_exit do
SimpleCov.result.format!
end
SimpleCov.start
end
require 'pry'
require 'bundler/setup'
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failu... | 23.555556 | 75 | 0.745283 |
e8884a790b755d42b6cca712291a471a930d4529 | 1,343 | class NewRelic::MetricParser::View < NewRelic::MetricParser
def is_view?; true; end
def is_render?
segments.last == "Rendering"
end
def is_compiler?
segments.last == "Compile"
end
def pie_chart_label
case segments.last
when "Rendering"
"#{file_name(segments[-2])} Template"
w... | 21.66129 | 88 | 0.615786 |
03d3fbd54cc5fba670ae6b8c416ef63296a8ca26 | 2,406 | require 'rspec'
require_relative '../lib/handler_link.rb'
require_relative '../lib/images_link.rb'
describe 'handler_links' do
# check the get_host_link method for returning the hostname of the URL
it 'get_host_link return host name' do
handler_link = HandlerLink
link = 'https://www.google.com.ua/webhp?so... | 50.125 | 185 | 0.742727 |
21f64ea785155ce093e7ea2ac44ee0d5f5362a5e | 496 | require 'spec_helper'
describe BlinkApi::Endpoints::Status do
let(:client) { BlinkApi::Client.create }
describe '#for_location' do
it 'gets the status of a location' do
VCR.use_cassette('endpoints/status') do
response = client.status.for_location(132742)
expect(response).to be_an_instan... | 23.619048 | 73 | 0.681452 |
ff78ed1657b4efd1f2e4d384d49fc6f74af19504 | 1,098 | require 'railroader/checks/base_check'
class Railroader::CheckBasicAuthTimingAttack < Railroader::BaseCheck
Railroader::Checks.add self
@description = "Check for timing attack in basic auth (CVE-2015-7576)"
def run_check
@upgrade = case
when version_between?("0.0.0", "3.2.22")
... | 32.294118 | 123 | 0.602914 |
6aca516760699e0e977e2dba66434e09895ada0e | 221 | require 'appgen/loader'
require 'appgen/generator'
module Appgen
class CLI
def self.execute(path=nil)
puts 'Appgen'
app = Appgen::Loader.load path
Appgen::Generator.generate app
end
end
end
| 17 | 36 | 0.678733 |
03eb65f43ec7a7c72b083f3d9026bce515250975 | 1,970 | #!/usr/bin/env ruby
# Encoding: utf-8
#
# Copyright:: Copyright 2017, 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
#
# ... | 30.307692 | 79 | 0.672081 |
38defb2055da5b2d27770aa3a8c6f8a75b1f88f6 | 1,515 | require 'spec_helper'
module TinyMCE::Rails
describe Engine do
describe ".default_base" do
it "generates a default path based on the asset prefix" do
TinyMCE::Rails::Engine.default_base.should eq "/assets/tinymce"
end
it "ignores the asset prefix if missing" do
Rails.applicatio... | 40.945946 | 116 | 0.69703 |
bffc0aaaefb8e27c5d807298f0b31bf1041917df | 56 | module Fog
module AWS
VERSION = "3.0.0"
end
end
| 9.333333 | 21 | 0.607143 |
b9365f5217982a645c34e9d6fa9b0abe9e5c0b31 | 1,165 | # 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,... | 32.361111 | 79 | 0.733906 |
261f932196ccf99db3d1f65acf858ec46679ffa1 | 3,916 | # frozen_string_literal: true
require_relative 'spec_helper'
describe Facter do
context 'when calling facter cli' do
context 'with no user query' do
it 'returns no stderr' do
_, err, = IntegrationHelper.exec_facter
expect(err).not_to match(/ERROR Facter/)
end
it 'returns 0 ex... | 25.594771 | 95 | 0.601124 |
7a8b9e8030272fad833151c5618a30307713e7e4 | 128 | class AddRepeatsToFormItem < ActiveRecord::Migration[4.2]
def change
add_column :form_items, :repeats, :boolean
end
end
| 21.333333 | 57 | 0.757813 |
1cfec44b65598c297fe3bbc7be964f6e3e07a3ab | 35 | class TarError < StandardError
end
| 11.666667 | 30 | 0.828571 |
ab9f49638835775169bf83617168406384c1af7d | 4,042 | class Kapacitor < Formula
desc "Open source time series data processor"
homepage "https://github.com/influxdata/kapacitor"
url "https://github.com/influxdata/kapacitor.git",
tag: "v1.6.0",
revision: "cee3f4e305c7f50c9d8d1d9b561ade565f46e5f6"
license "MIT"
head "https://github.com/influxdata/k... | 34.254237 | 122 | 0.638793 |
3919c4a8589aa1503481119c64cd10aa3ff47fad | 231 | # frozen_string_literal: true
module AdequateCryptoAddress
class Eos < Base
def valid_prefix?
/^[a-z1-5]*$/.match?(address)
end
def valid_length?
address.to_s.length == 12
end
end
EOS = Eos
end
| 14.4375 | 35 | 0.636364 |
ed2a5f71387b37a16ac1734b66e5aa0fc8e3b637 | 2,919 | # encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
require 'optparse'
# Run the command given by the first argument. Right
# now all we have is deployments. We hope to have other
# kinds of events here later.
$... | 31.728261 | 92 | 0.603289 |
1c772c17d50733a61d59807a438ff689eb04a48b | 2,380 | module TackleBox
class Attachment
# The path to the file to attach
attr_reader :path
# The desired name of the attachment
attr_reader :name
# The contents for the attachment
attr_reader :content
# The encoding of the attachment
attr_reader :encoding
# The password for the atta... | 24.536082 | 68 | 0.589076 |
bf5f3558634ccce837f1f0f909946825720083b7 | 724 | class Feature::Feature
@@name = nil
@@reporter = nil
def self.configure(reporter)
@@reporter = reporter
end
def self.do
if @@reporter
@@reporter.report("#{@@name} is enabled")
end
begin
yield
rescue => e
if @@reporter
@@reporter.report_error("Error dete... | 16.088889 | 68 | 0.566298 |
f7a4892f281f1a9249737b8c800352fddf29ed5f | 695 | class CreateSupportJuridicalComplements < ActiveRecord::Migration[5.2] # :nodoc:
def change
create_table 'extranet.juridical_complements' do |t|
t.integer :document_type_id
t.integer :lawsuit_id
t.integer :instancy_place_id
t.date :distribution_date
t.date :end_date
t.tex... | 27.8 | 80 | 0.677698 |
e8b2869fadd09ca5cb6f6750ff31fb80217e700a | 753 | # frozen_string_literal: true
module Stupidedi
module Versions
module ThirtyForty
module SegmentDefs
s = Schema
e = ElementDefs
r = ElementReqs
G62 = s::SegmentDef.build(:G62, "Date/Time",
"To specify pertinent dates and times",
e::E432 .simple_use(r::Rel... | 32.73913 | 72 | 0.608234 |
ab5aae9b13686f8dd323158aac1ed77762abc775 | 42,155 | require 'cgi'
require 'erb'
require 'action_view/helpers/form_helper'
require 'active_support/core_ext/string/output_safety'
require 'active_support/core_ext/array/extract_options'
require 'active_support/core_ext/array/wrap'
module ActionView
# = Action View Form Option Helpers
module Helpers
# Provides a num... | 50.606242 | 217 | 0.63072 |
6168a9e0f8d745910a01d8fc21113a65c18866e3 | 2,759 | class GamesController < ApplicationController
before_action :set_game, only: [:show, :edit, :update, :destroy]
# GET /games
# GET /games.json
def index
# WALTER - hard coding sports here
@games = Game.all
if params[:sport1].nil?
@games = @games.not_for_sport(1)
end
if params[:sport2].... | 25.311927 | 103 | 0.623777 |
1a1a3da4537ee8736b77d654bfac12f18e4bd75b | 2,288 | ##
# $Id: bea_weblogic_transfer_encoding.rb 9744 2010-07-08 23:34:50Z jduck $
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://met... | 26.298851 | 107 | 0.583479 |
01d0159951f757293f887429b2ec92429e921234 | 542 | #
# Cookbook Name:: bach_repository
# Recipe:: python_sources
#
# This recipe downloads pypi packages that are distributed to workers
# in source form.
#
include_recipe 'bach_repository::directory'
bins_dir = node['bach']['repository']['bins_directory']
directory "#{bins_dir}/python" do
mode 0555
end
remote_file "... | 27.1 | 82 | 0.773063 |
bffbfee8b9befc80b35936bed636700429cf0b3f | 133 | class AddTypeToCustomer < ActiveRecord::Migration[5.2]
def change
add_reference :customers, :type, foreign_key: true
end
end
| 22.166667 | 54 | 0.759398 |
e85a966cffd7a9a29f5745940a05a56b8bf14234 | 992 | module Shipcloud
class Base
include Shipcloud::Operations::Create
include Shipcloud::Operations::Find
# Initializes an object using the given attributes
#
# @param [Hash] attributes The attributes to use for initialization
def initialize(attributes = {})
set_attributes(attributes)
e... | 22.044444 | 71 | 0.607863 |
33bf18d5284aa4627918f31b49c34eaacd1c35ee | 4,857 | require File.expand_path(File.dirname(__FILE__) + '/test_helper.rb')
class TestFakerInternet < Test::Unit::TestCase
def setup
@tester = Faker::Internet
end
def test_email
assert @tester.email.match(/.+@.+\.\w+/)
end
def test_free_email
assert @tester.free_email.match(/.+@(gmail|hotmail|yahoo)\... | 25.429319 | 91 | 0.652666 |
622efcc2f322e57778a648c35f9a1b4c96b8fff0 | 3,699 | require 'rails_helper'
feature 'Email confirmation during sign up' do
scenario 'confirms valid email and sets valid password' do
allow(IdentityConfig.store).to receive(:participate_in_dap).and_return(true)
reset_email
email = 'test@example.com'
sign_up_with(email)
open_email(email)
visit_in_e... | 36.264706 | 94 | 0.729927 |
e987eee6e9159b27788d4760fe5d58cb52f2d5b3 | 49,747 | require "spec_helper"
describe API::MergeRequests do
include ProjectForksHelper
let(:base_time) { Time.now }
let(:user) { create(:user) }
let(:admin) { create(:user, :admin) }
let(:non_member) { create(:user) }
let!(:project) { create(:project, :public, :repository, creator: user, names... | 42.555175 | 272 | 0.693449 |
7a7201a645486d8cebd647af213dbeb1bd6b52aa | 11,721 | # frozen_string_literal: true
require 'spec_helper'
describe Admin::UsersController do
let(:user) { create(:user) }
let_it_be(:admin) { create(:admin) }
before do
sign_in(admin)
end
describe 'GET #index' do
it 'retrieves all users' do
get :index
expect(assigns(:users)).to match_array... | 28.04067 | 171 | 0.630322 |
1d90aa956a0572504af1b7b6c6b3cdaf05ccba93 | 484 | class RemoveVmDiscoverRowFromMiqEventDefinitions < ActiveRecord::Migration[4.2]
class Relationship < ActiveRecord::Base; end
class MiqEventDefinition < ActiveRecord::Base; end
def up
say_with_time("Remove event definition vm_discover") do
MiqEventDefinition.where(:name => 'vm_discover').each do |event... | 32.266667 | 106 | 0.737603 |
bf5e70497959c91b3648131e46d4344a253d43fe | 774 | #!/usr/bin/env ruby
# frozen_string_literal: true
require 'socket'
begin
require 'rugged'
rescue LoadError
t = Time.new
puts t.to_i
else
environmentpath = ARGV[0]
environment = ARGV[1]
# Get the hostname of the Puppet master compiling the catalog.
# Sometimes the hostname is the fqdn, so we'll take... | 26.689655 | 77 | 0.728682 |
b9249f9ad55151e16526fe1ac89fa6e34d24b27e | 194 | class AddStorageHeaterDashboardType < ActiveRecord::Migration[6.0]
def change
add_column :configurations, :storage_heater_dashboard_chart_type, :integer, default: 0, null: false
end
end
| 32.333333 | 103 | 0.798969 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.