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 |
|---|---|---|---|---|---|
e94cc8a08b0a70655f312e741029372406ffc66e | 476 | cask "chirp" do
version "20210110"
sha256 "5297bafca608acc56c69146bb2a7e3d4f636c17b7f0c7bc97f3f751769bec6ac"
url "https://trac.chirp.danplanet.com/chirp_daily/LATEST/chirp-unified-daily-#{version}.app.zip"
appcast "https://trac.chirp.danplanet.com/chirp_daily/LATEST/SHA1SUM"
name "CHIRP"
desc "Tool for pro... | 31.733333 | 98 | 0.77521 |
f8346d2a74fa4072e7e739ea9ef995f8807a45cc | 624 | # vulkan-ruby 0.1.0
#
# => https://github.com/sinisterchipmunk/vulkan-ruby
#
# [NOTICE] This is an automatically generated file.
module Vulkan
VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION = 1 unless defined?(VK_KHR_EXTERNAL_SEMAPHORE_SPEC_VERSION)
VK_KHR_EXTERNAL_SEMAPHORE_EXTENSION_NAME = "VK_KHR_external_semaphore" ... | 48 | 133 | 0.858974 |
f8bac37ffc5e65aac88b7d88a9b33b5eb5d3e277 | 395 | puts 'A = '
A = 1 #переменные
B = 1 #переменные
C = -6 #переменные
D = B*B - 4*A*C
if (D == 0)
puts 'x = '+(-B/2/A).to_s
else
if (D > 0)
puts 'x1 = '+((-B-Math.sqrt(D))/2/A).to_s
puts 'x2 = '+((-B+Math.sqrt(D))/2/A).to_s
else
puts 'x1 = ('+(-B/2/A).to_s+','+(Math.sqrt(-D)/2/A).to_s+')'
... | 20.789474 | 67 | 0.458228 |
62e5c21f078a7ded07488b63dcf4f450ed867020 | 3,492 | module Fog
module Compute
class Cloudstack
class Project < Fog::Model
identity :id, :aliases => 'id'
attribute :name, :aliases => 'name'
attribute :display_text, :aliases => 'displaytext'
attribute :domain_id, :aliases => 'dom... | 59.186441 | 102 | 0.573883 |
e8724771266410fffc66f0d15dae02f4fa1fd644 | 1,076 | class Lego < Formula
desc "Let's Encrypt client"
homepage "https://go-acme.github.io/lego/"
url "https://github.com/go-acme/lego/archive/v2.6.0.tar.gz"
sha256 "1abba13871f58fe483a3d4ac3900d44cddeacfc3dfe9fae2d96e45a9a39e7ce7"
bottle do
cellar :any_skip_relocation
sha256 "f27e199f6740cfd1539d7065730c7... | 34.709677 | 94 | 0.739777 |
01231d91142c16c002cd7d65db41d5f48f0a0d48 | 5,449 | # (C) John Mair (banisterfiend) 2015
# MIT License
#
require 'pp'
require 'pry/input_lock'
require 'pry/exceptions'
require 'pry/helpers/base_helpers'
require 'pry/hooks'
require 'forwardable'
class Pry
# The default hooks - display messages when beginning and ending Pry sessions.
DEFAULT_HOOKS = Pry::Hooks.new.a... | 33.429448 | 151 | 0.658286 |
e296ab90da8595a86d7cef063a0cdfed4651ef7a | 1,021 | require 'net/http'
require 'net/https'
require 'json'
module Benchmark
module IPS
class Share
DEFAULT_URL = "https://benchmark.fyi"
def initialize(report, job)
@report = report
@job = job
end
def share
base = (ENV['SHARE_URL'] || DEFAULT_URL)
url = URI(Fil... | 20.836735 | 58 | 0.504407 |
08ca89fe4ad04da20640a545c1b28073d511f084 | 42 | module ActiveType
VERSION = '1.5.0'
end
| 10.5 | 19 | 0.690476 |
398a81de0d1f133cfdc4108a444511606ce2d2d7 | 45 | module GistGenerator
VERSION = "0.1.1"
end
| 11.25 | 20 | 0.711111 |
1d7c1e8ac904585e11bdc0008366226a659178b7 | 115 | # -*- coding:binary -*-
module MeterpreterBinaries
VERSION = '0.0.23'
def self.version
VERSION
end
end
| 11.5 | 26 | 0.652174 |
7a12956968b589620cb8c68a417508c86ad52a30 | 9,720 | require 'puppet/provider/f5'
Puppet::Type.type(:f5_virtualserver).provide(:f5_virtualserver, :parent => Puppet::Provider::F5) do
@doc = "Manages f5 device"
confine :feature => :posix
defaultfor :feature => :posix
@priority = []
def self.wsdl
'LocalLB.VirtualServer'
end
def wsdl
self.class.wsd... | 31.054313 | 147 | 0.637963 |
263a001a6fe3f07ae41b7924b2cc3d18e782e1bc | 4,747 | ##
# 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://metasploit.com/framework/
##
##
# This module is based on, inspired by, or is a port of a pl... | 37.674603 | 179 | 0.651359 |
ffc6d13af7d44b49eb57197fa10fbb1bca39c9ea | 130 | require 'spec_helper'
describe Labelito do
it 'has a version number' do
expect(Labelito::VERSION).not_to be nil
end
end
| 14.444444 | 43 | 0.730769 |
61c96db000fd2f94fb1267632cdafad5f766a1f1 | 410 | # frozen_string_literal: true
desc 'creates performance metrics records at set interval'
task record_metrics: :environment do
Bot.log('Due to throttling, recording metrics too frequently _may_ impact performance', nil, :warn)
Bot.log('Recording Metrics ...')
begin
PerformanceMetric.record
rescue StandardEr... | 29.285714 | 101 | 0.739024 |
ed8bd9a2f405a096ff1e655d9021fed183035875 | 740 | cask 'owasp-zap' do
version '2.7.0'
sha256 '6d163801edf2367506d47f9560d7610aba55a8149f09e2ab34000b597c09e2d0'
# github.com/zaproxy/zaproxy was verified as official when first introduced to the cask
url "https://github.com/zaproxy/zaproxy/releases/download/#{version}/ZAP_#{version}.dmg"
appcast 'https://githu... | 37 | 90 | 0.724324 |
ac1ff174a36621988a830b19b32752a73bbaa382 | 879 | require 'httpclient'
module Geminabox
class HttpClientAdapter < HttpAdapter
def get(*args)
http_client.get(*args)
end
def get_content(*args)
http_client.get_content(*args)
end
def post(*args)
http_client.post(*args)
end
def set_auth(url, username = nil, password = n... | 24.416667 | 111 | 0.684869 |
4a19dc70b13e6250b7b084e588cf4dbcce4007eb | 4,491 | # encoding: UTF-8
# frozen_string_literal: true
require 'base64'
require 'openssl'
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV['RAILS_ENV'] ||= 'test'
ENV['EVENT_API_JWT_PRIVATE_KEY'] ||= Base64.urlsafe_encode64(OpenSSL::PKey::RSA.generate(2048).to_pem)
ENV['PEATIO_JWT_PRIVATE_KEY']... | 36.217742 | 113 | 0.7446 |
bba9e232d8f614e03f88b18f062aabebe3918729 | 1,070 | module Shoppe
class CountriesController < Shoppe::ApplicationController
before_filter { @active_nav = :countries }
before_filter { params[:id] && @country = Shoppe::Country.find(params[:id]) }
def index
@countries = Shoppe::Country.ordered
end
def new
@country = Shoppe::Country.new
... | 23.26087 | 93 | 0.629907 |
28b26df465e16ee1f67cb4cad8a0f6e633cf5119 | 605 | class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
before_filter :authenticate if ENV["LOCK_CITYVOICE"] == "true"
before_filter :load_app_content
def authenticate
... | 31.842105 | 94 | 0.766942 |
18c0ae56b757f766581208dae72425f2b09ca8bc | 3,331 | #
# Cookbook Name:: aem
# Provider:: farm
#
# Copyright 2012, Tacit Knowledge, 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
#
# Unle... | 35.43617 | 87 | 0.649054 |
4a2a99350ce0c10b611b4ebfa5ba3423ce6605ea | 5,112 | #
# Be sure to run `pod spec lint BLAPIManagers.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
# To see working Podspecs in the CocoaPods repo see https://gith... | 36.255319 | 94 | 0.59018 |
e9717a72318f79b4acc6ffa797d2f6b39268b909 | 812 | Gem::Specification.new do |spec|
spec.name = "rubocop-govuk"
spec.version = "4.1.0"
spec.authors = ["Government Digital Service"]
spec.email = ["govuk-dev@digital.cabinet-office.gov.uk"]
spec.summary = "RuboCop GOV.UK"
spec.description = "Shared RuboCop rules for Ruby p... | 33.833333 | 73 | 0.640394 |
bbd2d13945fcf07e11b4fad3091fa07d287310f6 | 388 | cask 'piskel' do
version '0.5.5.1'
sha256 '88a8f90bdbd852c4b9d957b02f9af67fd8c076ababdf4009ad8b4985a90f38e3'
# dropboxusercontent.com is the official download host per the vendor homepage
url "https://dl.dropboxusercontent.com/u/17803671/piskel/standalone/mac/piskel-#{version}.dmg"
name 'Piskel'
homepage '... | 29.846154 | 96 | 0.770619 |
ed3a7d0c345aa00dd40041ce3cee9672e49e13f0 | 132 | module Hummus
class << self
def setup(hash)
Hummus::Hook.dup.tap { |h| h.stash = Chickpea.new(hash) }
end
end
end
| 16.5 | 63 | 0.606061 |
abdac054cf1c6be6fff7d3b249e9103942cdee20 | 1,857 | #!/usr/bin/ruby
# pianobar event script to make rbot send currently playing song to an IRC
# channel
# Copyright (c) 2010
# Matthew M. Boedicker <matthewm@boedicker.org>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software... | 36.411765 | 80 | 0.736134 |
21d7aa816dc20cb4ebb3bc860109dcf629f30098 | 3,878 | require_relative "test_helper"
class UserMailer < ActionMailer::Base
default from: "from@example.com"
after_action :prevent_delivery_to_guests, only: [:welcome2]
def welcome
mail to: "test@example.org", subject: "Hello", body: "World"
end
def welcome2
mail to: "test@example.org", subject: "Hello", ... | 25.513158 | 74 | 0.713254 |
1c2c56d471c1cd7b19adcbeb564f512982c8224e | 43 | module Limerickify
VERSION = "0.1.2"
end
| 10.75 | 19 | 0.697674 |
ffefff57d2e6c7ee988001a6f20a1ecd90b24685 | 2,128 | class Mediaconch < Formula
desc "Conformance checker and technical metadata reporter"
homepage "https://mediaarea.net/MediaConch"
url "https://mediaarea.net/download/binary/mediaconch/18.03.2/MediaConch_CLI_18.03.2_GNU_FromSource.tar.bz2"
version "18.03.2"
sha256 "8f8f31f1c3eb55449799ebb2031ef373934a0a9826ce6... | 34.322581 | 110 | 0.642857 |
ac85902c7c214e20c61ae7692639e5a306008cec | 542 | require 'rubygems'
require 'pp'
filename = "cia_world_factbook_2010.txt"
extractedir = "world_factbook"
FileUtils::mkdir(extractedir) if !File::exist? "world_factbook"
title = nil; text = ""
File.open(filename,"r").each_line do |l|
if (l =~ /^@/) then
l.strip!
if (title) then
# write old file
f... | 18.689655 | 70 | 0.575646 |
b970e7662ce1d6753f2d8cff2ed27c6c0d1083e8 | 140 | require 'test_helper'
class HeadingsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
| 17.5 | 62 | 0.742857 |
21e587288f54a05ecba414dd2255d29767dba237 | 7,534 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Gcp Cluster', :js do
include GoogleApi::CloudPlatformHelpers
let(:project) { create(:project) }
let(:user) { create(:user) }
before do
project.add_maintainer(user)
gitlab_sign_in(user)
allow(Projects::ClustersController).to rece... | 32.899563 | 118 | 0.66618 |
6adb8c71a1f928bd2c0a926af266b36d12f6a776 | 68 | require 'spree_core'
require 'spree_variants_promotion_rule/engine'
| 22.666667 | 46 | 0.867647 |
62959455f8ef4b3fae3718c060966022631f3aea | 6,210 | require 'test_helper'
module SerializationScopeTesting
class User < ActiveModelSerializers::Model
attr_accessor :id, :name, :admin
def admin?
admin
end
end
class Comment < ActiveModelSerializers::Model
attr_accessor :id, :body
end
class Post < ActiveModelSerializers::Model
attr_acce... | 27 | 121 | 0.650403 |
26dc25ca2e6a27e90713646cbb8aad0699ee4dc9 | 2,472 | # frozen_string_literal: true
# Copyright (c) Aptos
# SPDX-License-Identifier: Apache-2.0
require 'httparty'
class PersonaURL
# @param [URI] parsed_url
def initialize(parsed_url)
@parsed = parsed_url
query = parsed_url.query
@query = if query.present?
CGI.parse(query)
else... | 26.021053 | 143 | 0.642799 |
bf05e92f336e1f4a15a933c0e5fc6e7013895b13 | 971 | module Pod
class Lockfile
def freered?
frozen_pods = @internal_data['FROZENPODS']
if !frozen_pods || frozen_pods.count == 0
return false
end
return true
end
def frozen_pod_names
@internal_data['FROZENPODS'] || []
end
class << self
public
def generrate_by_freezer(podfile... | 27.742857 | 97 | 0.604531 |
6148da79b056be13fb635236ccbf01449951a601 | 868 | #!/usr/bin/env ruby
# -*- encoding: us-ascii -*-
desc "catalog ARCHIVE [TO]", "Set file modification dates for archived files, based on catalog"
option "catalog", :aliases=>'-c', :type=>'string', :desc=>"Location of the catalog listing"
option 'dryrun', :aliases=>'-d', :type=>'boolean', :desc=>"Perform a dry run. ... | 54.25 | 115 | 0.682028 |
1c06e418ee871c191f436d63ce5fba1f50a389cc | 1,173 | # encoding: utf-8
module Mongoid #:nodoc:
module Fields #:nodoc:
module Serializable #:nodoc:
# Defines the behaviour for range fields.
class Range
include Serializable
# Deserialize this field from the type stored in MongoDB to the type
# defined on the model.
#
... | 27.27907 | 78 | 0.544757 |
0335ec4c0ed303edc433b52b065a94e2ce373565 | 95 | class MessagePolicy < ApplicationPolicy
def create?
admin? || committee_admin?
end
end
| 15.833333 | 39 | 0.736842 |
1a67b69e15886b95d7f867a48966ce99ae118151 | 1,183 | # coding: utf-8
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'fastlane/plugin/hours/version'
Gem::Specification.new do |spec|
spec.name = 'fastlane-plugin-hours'
spec.version = Fastlane::Hours::VERSION
spec.author = %q{Rishabh T... | 34.794118 | 78 | 0.700761 |
b9ca19f55dd903713f09da643eaac7e2beb17801 | 1,112 | require 'adp/connection'
module Adp
module Product
module Userinfo
class Helper
attr_accessor :connection
attr_accessor :url_map
# @param [Object] conn
# @param [Object] urlmap
def initialize(conn, urlmap = [])
raise ::Adp::Connection::ConnectionException... | 27.121951 | 136 | 0.632194 |
ffc4cdcd83d30c8f34b40ce4344c8ff611988bae | 4,613 | class Gspell < Formula
desc "Flexible API to implement spellchecking in GTK+ applications"
homepage "https://wiki.gnome.org/Projects/gspell"
url "https://download.gnome.org/sources/gspell/1.2/gspell-1.2.0.tar.xz"
sha256 "6aa550b91e13c0073ec0dfef21b6eef730186912392e11128216b90519a3443f"
bottle do
sha256 "... | 29.570513 | 92 | 0.659007 |
392d99c695b0a1a8bd9fb7a5b71770f22c207449 | 7,578 | ##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = AverageRanking
include Msf::Exploit::Remote::HttpServer::HTML
def initialize(info={})
sup... | 30.930612 | 115 | 0.584191 |
6295583372bc1a775d320b3fee8f6f8b552097c1 | 847 | class SmtpSettings < NotcherSettings::Base
@keys = [
:host, :port, :domain, :user, :password, :authentication,
:enable_starttls_auto, :email_body, :email_subject
]
validates :port, numericality: {only_integer: true, greater_than: 0}, allow_blank: true
validates :domain, format: {with: /\A((?:[-a-z0-9]+... | 30.25 | 131 | 0.596222 |
1cdc3af3c300979bde4fe1eb87e6dba219a5881b | 1,423 | require "simplecov"
SimpleCov.start "rails"
ENV["RAILS_ENV"] ||= "test"
require File.expand_path("../config/environment", __dir__)
# Prevent database truncation if the environment is production
abort("The Rails environment is running in production mode!") if Rails.env.production?
require "rails_helper"
require "rsp... | 33.880952 | 91 | 0.763879 |
f86e295986a25a22b7ca62d88273e00fb128cad6 | 6,165 | # frozen_string_literal: true
module Pragma
module Client
# Represents a resource in your API, exposing an interface to retrieve and manipulate the
# instances of that resource.
#
# @abstract Subclass and set {#root_url} and {#base_path} to create a new resource. To avoid
# having to set {#root... | 32.619048 | 98 | 0.607461 |
61347685c184d61e68e7e978715ba99f899f4564 | 9,405 | require 'spec_helper'
describe 'apt::key', type: :define do
let(:facts) do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
lsbdistid: 'Debian',
osfamily: 'Debian',
puppetversion: Puppet.version,
}
end
GPG_KEY_ID = '6F6B15509CF8E59E6E469F327F438280... | 26.567797 | 105 | 0.472727 |
26771d3ab1b99b1e173a49b4f383e66f60d97f1f | 2,063 | require 'rubygems'
spec = Gem::Specification.new do |s|
s.name = 'trapeze'
s.version = '0.1.17'
s.author = 'Nils Jonsson'
s.email = 'nils@alumni.rice.edu'
s.homepage = 'http://trapeze.rubyforge.org/'
s.summary = 'Generates a suite of unit tests or specifications for ' +
... | 51.575 | 80 | 0.49491 |
03f917536503c2cd3069df3eff515b7adbb2e4f6 | 602 | xml.tag!("oub:quota.balance.event") do |quota_balance_event|
xml_data_item_v2(quota_balance_event, "quota.definition.sid", self.quota_definition_sid)
xml_data_item_v2(quota_balance_event, "occurrence.timestamp", timestamp_value(self.occurrence_timestamp))
xml_data_item_v2(quota_balance_event, "old.balance", self.... | 66.888889 | 110 | 0.835548 |
7a691e50fff594028f8197dd4279c4b9804fc0bf | 1,071 | class EntriesController < ApplicationController
before_action :authenticate_user!
def index
@entries = Entry.all.order("created_at DESC")
respond_to do |f|
f.html { render :index }
f.json { render json: @entries }
end
end
def new
@entry = Entry.new
end
def create
@entry = En... | 15.521739 | 58 | 0.623716 |
1c4c3da32353d026ac55c4f0e9948609a8bec2ad | 90,063 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::ContainerRegistry::Mgmt::V2017_10_01
#
# Registries
#
class Registries
include MsRestAzure
#
# Creates and initializes a new instance of th... | 48.841106 | 186 | 0.711979 |
28217d759c982c031ad2f6f534dfdb3d55634e99 | 225 | require_dependency 'pundit'
require 'minikas_payable/config'
module MinikasPayable
class ApplicationController < Config.parent_controller.constantize
include Pundit
protect_from_forgery with: :exception
end
end
| 20.454545 | 68 | 0.817778 |
d5507aae710b4123ba6ae0053ac8fd89e5efa06f | 3,688 | 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... | 39.655914 | 102 | 0.752711 |
2172b343c75af0da97ce6b0460373e84bf8eb91e | 1,563 | # frozen_string_literal: true
require 'cuba'
require 'cuba/render'
require 'bigdecimal'
module I18nYamlEditor
# The frontend rendering engine
class Web < Cuba
plugin Cuba::Render
settings[:render][:template_engine] = 'erb'
settings[:render][:views] = File.expand_path(
File.join(File.dirname(__F... | 26.491525 | 80 | 0.595649 |
bfdf4f2b1eb47a7a29e8d581b73630517187da9a | 1,836 | Lobsters::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 ... | 34.641509 | 85 | 0.735294 |
4a3653b1c77a1c7c130db878f8f2f1639856900a | 736 | require 'logger'
class BufferedLogger < ::Logger
require "buffered_logger/errors"
require "buffered_logger/log_device_proxy"
require "buffered_logger/middleware"
require "buffered_logger/version"
def initialize(*)
super
@logdev = LogDeviceProxy.new(@logdev)
end
def end
raise NotStartedError... | 15.659574 | 60 | 0.663043 |
1d0fb96d33e9949eb1bc25ec7e1db89e1c633b2c | 2,045 | # This controller is where clients can exchange
# codes and refresh_tokens for access_tokens
class Opro::Oauth::TokenController < OproController
before_action :opro_authenticate_user!, :except => [:create]
skip_before_action :verify_authenticity_token, :only => [:create]
def create
# Find the cl... | 38.584906 | 114 | 0.7022 |
f89bea78c880ff68459ee4ab973888b27c06d3af | 6,392 | require_relative '../spec_helper'
module Cardgame
describe Gameplay do
def setup
@deck = Deck.new
@player = Player.new
@ai = Ai.new
@gameplay = Gameplay.new(:deck => @deck, :player => @player, :ai => @ai)
end
it "can create a new game" do
@gameplay.must_be_instance_of Gamep... | 34.365591 | 109 | 0.608573 |
33330dd30ca9ed3dfb000861a918a3636d676cdd | 831 | require "rails_helper"
RSpec::Matchers.define :facilities do |facilities|
match { |actual| actual.map(&:id) == facilities.map(&:id) }
end
RSpec.describe MyFacilities::FacilityPerformanceController, type: :controller do
let(:facility_group) { create(:facility_group) }
let!(:facilities) { create_list(:facility, 3... | 25.181818 | 87 | 0.722022 |
9189e31435d666957128ca2bc79f0c8a9554c588 | 165 | module Fog
module Support
class StormOnDemand
class Alert < Fog::Model
attribute :message
attribute :subject
end
end
end
end
| 15 | 30 | 0.618182 |
bf2ceff55a51c01546366bdbdc8c6fb52b6289da | 7,336 | module Puppet::Test
# This class is intended to provide an API to be used by external projects
# when they are running tests that depend on puppet core. This should
# allow us to vary the implementation details of managing puppet's state
# for testing, from one version of puppet to the next--without forcing... | 41.92 | 100 | 0.67012 |
014b5033dd9f846380348180349747c686995621 | 683 | # Fact: hostname
#
# Purpose: Return the system's short hostname.
#
# Resolution:
# On all system bar Darwin, parses the output of the "hostname" system command
# to everything before the first period.
# On Darwin, uses the system configuration util to get the LocalHostName
# variable.
#
# Caveats:
#
Facter.ad... | 21.34375 | 80 | 0.654466 |
ac3404feff22487c0761031fce2a886f5dd33599 | 4,675 | require 'easy_app_helper'
require 'highline'
module Dovico
class App
include EasyAppHelper
NAME = 'Dovico Simple Client'
DESCRIPTION = <<EOL
Simple client for Dovico TimeSheet web application.
Please refer to the README.md page to setup your client.
WARNING: --auto and --simulate options are not effec... | 32.020548 | 132 | 0.64107 |
610c5326241432e2b453f6eaf50a9592e6835df5 | 2,355 | require 'web_logs'
require 'spec_helper'
describe WebLogs do
subject(:logs) { described_class.new(printer) }
let(:printer) { double :printer }
context 'Empty file uploaded.' do
before do
subject.create_sites_hash('./spec/empty_log.log')
end
describe '#order_sites' do
it 'Warns user if t... | 33.642857 | 205 | 0.625478 |
33435cd7ff4f5260d03f0f226c7004cda359fea5 | 248 | class Story < ActiveRecord::Base
has_many :story_attachment, dependent: :destroy
accepts_nested_attributes_for :story_attachment
validates :content, presence: true
has_many :story_outcomes
has_many :outcomes, through: :story_outcomes
end
| 31 | 49 | 0.810484 |
5d773568b6d7cf0cb35164cbdb3c0e4a1bcf727d | 496 | require 'pry'
require 'rubygems'
require 'active_support/inflector'
require "location_app/version"
# API Operations
require 'api_operations/list'
require 'api_operations/request'
# Resources
require 'location_app/api_resource'
require 'location_app/city'
require 'location_app/region'
require 'location_app/country'
m... | 20.666667 | 61 | 0.772177 |
4aa1dbb828437ac4ccb5ec82ed1e72cec4d768e2 | 1,397 | module Straight
module ExchangeRate
class AverageRateAdapter < BtcAdapter
# Takes exchange rate adapters instances or classes as arguments
def self.instance(*adapters)
instance = super()
instance.instance_variable_set(:@adapters, adapters.map { |adapter| adapter.respond_to?(:instance... | 25.4 | 138 | 0.584825 |
b9d36a0d9c0e1ebd49a5683664fd5d53273cbe5d | 3,398 | # ==========================================
# CMock Project - Automatic Mock Generation for C
# Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
# [Released under MIT License. Please refer to license.txt for details]
# ==========================================
class CMockGeneratorPlugin... | 39.511628 | 140 | 0.625074 |
b9ad609cc4a7304a2c14652571ebf6546555cebe | 444 | require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
class SymbolTest < Test::Unit::TestCase
context 'Symbol' do
should 'be able to create a FileMan name for itself' do
assert_equal 'DATE OF BIRTH', :date_of_birth.to_file_man_name
assert_equal 'FOO', :foo.to_file_man_name
end
... | 29.6 | 71 | 0.695946 |
e8dc92c02e4867d6fce5198662c4b8348fdf0488 | 1,619 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CDN::Mgmt::V2020_04_15
module Models
#
# Defines the url rewrite action for the delivery rule.
#
class UrlRewriteAction < De... | 24.907692 | 75 | 0.52378 |
62ef658cc4c3294fe5dab54939cfd552eeb6eb58 | 1,923 | #
# RefWorks XML format parser
#
# Parses a valid RefWorks XML file into a Ruby Hash.
#
#
#
class RefworksXmlParser < BaseXmlParser
def logger
CitationParser.logger
end
# Perform our initial parse of Citation Data,
def parse_data(data)
xml = Nokogiri::XML::Document.parse(data)
#Check if this is ... | 30.52381 | 85 | 0.615705 |
38743690a8421f35ddf8c21ad96432c8dde08df5 | 4,798 | # This file was generated by the `rails generate rspec:install` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# The generated `.rspec` file contains `--require spec_helper` which will cause
# this file to always be loaded, without a need to explicitly require ... | 47.98 | 92 | 0.744268 |
e9efa3f1dfa1a880a51886c8ebe9f5a7e082a75b | 3,207 | class FaasCli < Formula
desc "CLI for templating and/or deploying FaaS functions"
homepage "http://docs.get-faas.com/"
url "https://github.com/openfaas/faas-cli.git",
:tag => "0.6.2",
:revision => "a81705b7f50e89bad580f9930436dbf34996cbec"
bottle do
cellar :any_skip_relocation
sha256 "08418... | 32.07 | 94 | 0.647646 |
d58f5d350eb495e81c2dc3d8eb05edec50c8a9e0 | 2,136 | module OpenActive
module Models
module Schema
class Accommodation < ::OpenActive::Models::Schema::Place
# @!attribute type
# @return [String]
def type
"schema:Accommodation"
end
# @return [String]
define_property :accommodation_category, as: "accomm... | 29.666667 | 93 | 0.57912 |
e2f5880de1c5dfb66929bdb2c43c5152a466f824 | 7,179 | require 'cgi'
require 'nokogiri'
require 'fileutils'
require_relative '../default_logger'
require_relative 'export_urls'
#
# This class is used to post-process an httrack export of a site. It performs primarily 2 tasks:
#
# 1: Post process the HTML to improve site structure
# 2: Add in static resources e.g. robots.txt... | 41.258621 | 223 | 0.724474 |
1ccea6f26c516f02d6e8cc5eaf9a4cc74a4e7d64 | 3,514 | # frozen_string_literal: true
require "rails_helper"
require "stripe_mock"
RSpec.describe SubscriptionPaymentJob, type: :job do
let(:stripe_helper) { StripeMock.create_test_helper }
before { StripeMock.start }
after { StripeMock.stop }
context "queue" do
let(:subscription) { FactoryBot.create(:subscripti... | 32.841121 | 111 | 0.706318 |
38e2b42b5db2685d08aabc10d260d632d09af14c | 1,364 | require 'blueprinter'
module Beekeeper
class ExceptionBlueprinter < Blueprinter::Base
view :basic do
field :status do |exception, options|
exception.try(:status) || get_status(exception, options)
end
field :message
field :error do |exception, options|
exception.try(:error)... | 26.230769 | 87 | 0.66349 |
1d62b9592b5be3ac3bea4a84152144ed486ae96f | 3,396 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# This file is the source Rails uses to define your schema when running `rails
#... | 39.488372 | 114 | 0.725559 |
ed0079903c0e4f5c95a967bf37d679b43aaad12b | 1,564 | class Libcbor < Formula
desc "CBOR protocol implementation for C and others"
homepage "http://libcbor.org/"
url "https://github.com/PJK/libcbor/archive/v0.8.0.tar.gz"
sha256 "618097166ea4a54499646998ccaa949a5816e6a665cf1d6df383690895217c8b"
license "MIT"
bottle do
cellar :any
sha256 "3bbc50d56f1418... | 34.755556 | 94 | 0.703325 |
f716e5cd7988d1cb66546c2d60fe61dee1aaaf19 | 1,053 | Pod::Spec.new do |spec|
spec.name = "TOMLDecoder"
spec.version = "0.1.5"
spec.summary = "Swift Decodable support for TOML."
spec.homepage = "https://github.com/dduan/TOMLDecoder"
spec.license = { :type => "MIT", :file ... | 50.142857 | 116 | 0.534663 |
87e01463df802745c68baa09af97be8287aa0b18 | 4,548 | require 'basalt/version'
require 'basalt/config'
require 'basalt/basaltfile'
require 'basalt/packages/context'
require 'colorize'
require 'docopt'
require 'fileutils'
require 'ostruct'
require 'yaml'
module Basalt
class Packages
DOC = %Q(Usage:
%<binname>s package new [options] NAME
%<binname>s package insta... | 28.425 | 106 | 0.630827 |
39f803181334e9d25e621c929cd0eb381f5e34e9 | 1,154 | require_relative 'boot'
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 "action_cable/engine"
# require "sprockets/railti... | 33.941176 | 82 | 0.772964 |
26f7faca674422193ec558d8bebed6759a5d502d | 954 | class RebarAT3 < Formula
desc "Erlang build tool"
homepage "https://github.com/erlang/rebar3"
url "https://github.com/erlang/rebar3/archive/3.4.2.tar.gz"
sha256 "f4d38d01671af6a7eb4777654d1543b42c873dad32046e444434c64d929fc789"
head "https://github.com/rebar/rebar3.git"
bottle do
cellar :any_skip_reloc... | 31.8 | 92 | 0.774633 |
3872ad0bc081b9b1ea14f0f6144b3a3b73cd85e0 | 1,457 | class Account::PagesController < Account::BaseController
layout "account"
def index
@pager = pager_for resources.order(created_at: :desc), page: params[:page]
@pages = @pager.scoped
end
def show
@page = resources.find(params[:id])
end
def new
@page = resources.build
end
def edit
... | 20.236111 | 78 | 0.663006 |
28472e087da59a5981f29bb6039a004290c15c7d | 534 | Rails.application.routes.draw do
get 'friendships/new'
get 'friendships/create'
get 'friendships/update'
get 'friendships/destroy'
root 'posts#index'
devise_for :users
resources :users, only: [:index, :show]
resources :friendships, only:[:create, :update, :destroy]
resources :posts, only: [:index, ... | 26.7 | 101 | 0.709738 |
b92862a329d5965f8dfe67d11de07c92217bcd8f | 2,821 | module Idcf
module Dns
module ClientExtensions
# SDK APIs for zone resource
module Zone
# Create a new zone.
#
# @param attributes [Hash] request attributes
# @option attributes [String] :name unique name of zone (required)
# @option attributes [String] :email e... | 34.82716 | 74 | 0.585253 |
08f837dcd67456ca2e4a91a7ee38867d0fb226e4 | 445 | require 'spec_helper'
describe '/v1/websocket_uri' do
let(:request_headers) do
{
'HTTP_AUTHORIZATION' => "Bearer #{ENV['SECURITY_TOKEN']}"
}
end
describe 'GET' do
it 'returns websocket uri' do
get '/v1/websocket_uri', nil, request_headers
expect(last_response.status).to eq(200)
... | 23.421053 | 65 | 0.658427 |
017eeb949a446127651675bab36ea343fbed3e61 | 5,429 | module AASM
module Persistence
# This module adds transactional support for any database that supports it.
# This includes rollback capability and rollback/commit callbacks.
module ORM
# Writes <tt>state</tt> to the state column and persists it to the database
#
# foo = Foo.find(1)
... | 35.253247 | 123 | 0.669 |
7a40d8d2537b55bf5d01d3a849dc3006063cf279 | 81 | class TokyoMetro::Required::All::Modules::Fundamental < TokyoMetro::Required
end
| 27 | 76 | 0.802469 |
08e698800f84429b42d50734a1cb71b44809b710 | 97 | require 'nuggets/object/silence_mixin'
class Object
include Nuggets::Object::SilenceMixin
end
| 16.166667 | 39 | 0.814433 |
618df2b7d12ad404b858197155ceb14906831f11 | 4,771 | require 'sidekiq/web'
Rails.application.routes.draw do
match "/404", :to => "errors#not_found", :via => :all
match "/422", :to => "errors#unprocessable", :via => :all
match "/500", :to => "errors#internal_server_error", :via => :all
match "/503", :to => "errors#service_unavailable", :via => :all
scope "(:loc... | 43.770642 | 164 | 0.610983 |
f757115f52df8e7f38bb23806aeb4fa4338946c5 | 192 | class AddCaseNumberToMaintenances < ActiveRecord::Migration
def up
add_column :maintenances, :case_number, :string
end
def down
remove_column :maintenances, :case_number
end
end
| 21.333333 | 59 | 0.776042 |
e9bd4cf21d1a71a46f4cfba8bac72ff1c3541f74 | 1,753 | # encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Relay::Mgmt::V2017_04_01
module Models
#
# Parameters supplied to the regenerate authorization rule operation,
# specifies which... | 28.274194 | 79 | 0.553337 |
ff981242092377ed6c2d9d55f3b9c063ab7e9fec | 56,694 | # frozen_string_literal: true
# Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 56.694 | 444 | 0.569196 |
acfe5af7ee59a396992872eb4ec92b2f8157f121 | 235 | require './spec/rails_helper.rb'
require './spec/spec_helper.rb'
require './app/models/application_record.rb'
RSpec.describe 'self_abstract' do
it 'has to be a self ' do
expect(self.abstract_class?).to eq(true)
end
end | 26.111111 | 48 | 0.710638 |
bf893a8bdd6dd13111760aa4a04e9b7385a07c8b | 323 | module Zanox
class ZanoxJson < ZanoxXml
def initialize(version = false)
@version = version
@rest_action = 'GET'
@url = 'http://api.zanox.com/json'
@content_type = 'application/json'
@raw_data_disabled = true
end
# def serialize#TODO
#
# end
end
... | 17 | 40 | 0.569659 |
87bc2d6fc53ee3ae5326ca7214a4e9e639cea555 | 2,856 | # encoding: utf-8
require_relative '../../spec_helper'
module Epuber
module DSL
describe Object do
context 'simple attributes' do
class TestClass < Object
attribute :optional_string
attribute :optional_number,
types: [Fixnum]
end
before do... | 24.62069 | 78 | 0.522759 |
913e28289f9f957492adcba29542b17945b11871 | 659 | #!/usr/bin/env ruby
# encoding: utf-8
require "rubygems"
require "bunni"
require "benchmark"
conn = Bunni.new
conn.start
puts
puts "-" * 80
puts "Benchmarking on #{RUBY_DESCRIPTION}"
n = 50_000
ch = conn.create_channel
x = ch.default_exchange
s = "z" * (1024 * 128)
# warm up the JIT, etc
puts "Doing a warmup ru... | 18.305556 | 80 | 0.664643 |
abcfc85f70ee3647e441298bd9e68a478caf9a74 | 12,733 | module GitalyServer
class OperationsService < Gitaly::OperationService::Service
include Utils
def user_create_tag(request, call)
bridge_exceptions do
begin
repo = Gitlab::Git::Repository.from_gitaly(request.repository, call)
gitaly_user = request.user
raise GRPC::... | 38.702128 | 122 | 0.649101 |
334c67f4ef13a64e8f58c0d6646bfab64aa7b71a | 4,100 | module Opendata::Addon::ExportPublicEntityFormat
extend SS::Addon
extend ActiveSupport::Concern
module ClassMethods
def public_entity_csv(node)
csv = []
public_entity_enum_csv(node).each do |data|
csv << data
end
csv.join
end
def public_entity_enum_csv(node)
cri... | 34.166667 | 115 | 0.606098 |
5d54b5f8c3dd6f6340aa9e18da6269aa7a4d8d2e | 8,915 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::Dns::Mgmt::V2016_04_01
module Models
#
# Describes a DNS record set (a collection of DNS records with the same
# name and type).
#
class R... | 32.300725 | 79 | 0.426921 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.