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 |
|---|---|---|---|---|---|
e8955dd7276824466a5ae3a6a7453747fafb5ee7 | 883 | module TwimlGenerator
def self.generate_connect_conference(call_sid,
wait_url,
start_on_enter,
end_on_exit)
dial = Twilio::TwiML::Dial.new
dial.conference(call_sid, start_conference_on_enter: s... | 33.961538 | 92 | 0.593431 |
1d57679241f1310ce9ffaaabb06a55ffcd5f15ef | 976 | # frozen_string_literal: true
module QA
RSpec.describe 'Verify', :docker, :runner do
describe 'Runner registration' do
let(:executor) { "qa-runner-#{Time.now.to_i}" }
let!(:runner) do
Resource::Runner.fabricate! do |runner|
runner.name = executor
runner.tags = ['e2e-test']... | 27.111111 | 128 | 0.619877 |
4a05d80dac68afd186c74f9e974fe4c1844b93be | 138 | class MenuItem < ActiveRecord::Base
belongs_to :restaurant
has_many :reviews
validates_uniqueness_of :name, scope: :restaurant
end
| 19.714286 | 51 | 0.789855 |
e2066546e76d7c9fca811a4298e4a403e7bc0bfb | 8,534 | require_relative 'helpers/factory_girl'
FactoryGirl.define do
factory :user do
sequence(:email) { |n| "stove_user#{n}@example.com" }
password '12345678'
trait :admin do
is_admin true
end
end
factory :ingredient do
sequence(:name) { |n| "Ingredient#{n}" }
sequence(:body) { |n| "# In... | 37.594714 | 397 | 0.663464 |
03960e47debca5c0965f9effcdd33b7434af5e41 | 4,838 | # 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 u... | 35.573529 | 81 | 0.593014 |
fff2f26757dff032017f4683228ae7b6d1d1eeb5 | 1,586 | # The MIT License (MIT)
# Copyright (c) 2016 Davide Petilli
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation the
# rights to use, copy, modi... | 44.055556 | 79 | 0.70744 |
ac4e9e5a417a9d03de50363d727f8ca5b40e2e55 | 5,359 | # frozen_string_literal: true
# mixin to automate testing of Rest services per controller test
require 'json-schema'
require 'json-diff'
require 'rest_test_cases_shared'
module JsonRestTestCases
include RestTestCasesShared
JSONAPI_SCHEMA_FILE_PATH = File.join(Rails.root, 'public', '2010', 'json', 'rest', 'jsonap... | 33.080247 | 134 | 0.665609 |
b9a4fa974cfa169601ef9048716fb3b78e821a8b | 2,709 | class Krakend < Formula
desc "Ultra-High performance API Gateway built in Go"
homepage "https://www.krakend.io/"
url "https://github.com/devopsfaith/krakend-ce/archive/v2.0.0.tar.gz"
sha256 "07ce9669881f13d9c3d1ae2c14de353461a44e7ef2d95a4cf1eb66d915fb59ed"
license "Apache-2.0"
bottle do
sha256 cellar: ... | 32.25 | 123 | 0.616833 |
621493fc94f0fdbacc7d24b23a1c2a03506d4cf3 | 4,221 | 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... | 41.792079 | 102 | 0.759062 |
5dcb3b8951b1b85bdc1652f44369ed27d1cdbd4b | 30,744 | class Ansible < Formula
include Language::Python::Virtualenv
desc "Automate deployment, configuration, and upgrading"
homepage "https://www.ansible.com/"
url "https://files.pythonhosted.org/packages/d9/7d/dacd49b75da7d82c3f24ada25ee10693080113a3b61d4d4d38066f7802b2/ansible-3.0.0.tar.gz"
sha256 "843aa80781331... | 47.591331 | 151 | 0.811866 |
1aea6f56af3dca2c2f02db7dbe4a960dba8163e9 | 1,530 | require File.expand_path('../test_helper', __FILE__)
DataMapper.setup(:default, 'sqlite3::memory:')
class Client
include DataMapper::Resource
property :id, Serial
property :encrypted_email, String
property :encrypted_email_iv, String
property :encrypted_email_salt, String
property :encrypted_credentials... | 26.37931 | 72 | 0.757516 |
39b8f93777038971c6a58892232ec608900cd7ea | 1,682 | class WorksController < ApplicationController
def create
@work = Work.create!(work_params)
end
def index
@works = Work.all
render json: { works: @works }, status: :ok
end
def pairs
# @users = User.all.includes(:works)
# .map { |u| {
# id: u.id,
# works: u.works
# }}.flat... | 26.28125 | 269 | 0.516647 |
33c47c7eb08d361e4009110fb72d2f076873e285 | 476 | # Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'
# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::MonitorClient.new(account_sid, auth_token)
@params = {
actor_sid: 'US... | 29.75 | 66 | 0.792017 |
acc5522d8ba044f3e3a446f67a429b06947de28a | 569 | require 'minitest/autorun'
require 'base64'
require 'self_msgproto'
class TestMessage < Minitest::Test
include SelfMsg
def test_new_acl
d = Base64.decode64('EAAAAAwAFAAMABMACwAEAAwAAAAQAAAAAAAAARQAAAAAAAAEBwAAAHBheWxvYWQAJAAAADk5NDliMWEzLWRhN2QtNGQzYy05OTMxLTlkYzkzMTJhZWI4YQAAAAA')
h = SelfMsg::Acl.new(d... | 23.708333 | 150 | 0.797891 |
bf1398efd99ec900af73545002a32fedf844c10a | 13,235 | # encoding: utf-8
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
require File.expand_path(File.dirname(__FILE__) + "/client_api/spec_helper")
describe Braintree::Dispute do
let(:document_upload) do
file = File.new("#{File.dirname(__FILE__)}/../../fixtures/files/bt_logo.png", "r")
respon... | 43.110749 | 134 | 0.715905 |
bfa494ef14139c0e399dc7f82a1c0afe281239a6 | 10,028 | require 'daemons/pidfile'
require 'daemons/pidmem'
module Daemons
class Application
attr_accessor :app_argv
attr_accessor :controller_argv
# the Pid instance belonging to this application
attr_reader :pid
# the ApplicationGroup the application belongs to
attr_reader :group
... | 28.733524 | 221 | 0.57858 |
ed25e5cdd41598f71ff7a11e8b1404d698afc53a | 4,983 | module Auth0UserManagementHelper
AUTH0_CONNECTION_NAME = ENV["AUTH0_CONNECTION"] || "Username-Password-Authentication"
# Create a new user in the Auth0 user database.
# This method creates the user only in the main user database (Username-Password-Authentication)
def self.create_auth0_user(email:, name:, role:... | 47.009434 | 132 | 0.723259 |
e2ad89a9a95fd21d22ddee04c1eef87b098d7f83 | 4,771 | # ---------------------------------------------------------------------------- #
# Copyright 2002-2019, OpenNebula Project, OpenNebula Systems #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may ... | 35.080882 | 80 | 0.504087 |
1d6a062b5dc3219cdb17b17ab55c546785498bf9 | 194 | class SponsorContact < ApplicationRecord
validates :email,
:sponsor,
:first_name,
:fathers_last_name,
presence: true
belongs_to :sponsor
end
| 19.4 | 40 | 0.597938 |
1acb00fd3aaa15b28467f5f6c6b13a9a4a9f5e63 | 183 | # frozen_string_literal: false
module Bundler
VERSION = "2.4.0.dev".freeze
def self.bundler_major_version
@bundler_major_version ||= VERSION.split(".").first.to_i
end
end
| 18.3 | 60 | 0.73224 |
1d21f76bb068318548b99e7e1879dfe190b371b9 | 119 | require "slickgrid/version"
require "jquery-plugins-rails"
module SlickGrid
class Engine < ::Rails::Engine; end
end
| 17 | 37 | 0.764706 |
0802f15ad28a2856ea16a76dcf3d54e4437aaebe | 48 | module ActsAsTagPgarray
VERSION = "0.4.2"
end
| 12 | 23 | 0.729167 |
b9ae68134b0466fc05198ad8966ce63710ec9dc1 | 803 | # frozen_string_literal: true
module Gitlab
module Badge
##
# Abstract class for badge metadata
#
class Metadata
include Gitlab::Routing
include ActionView::Helpers::AssetTagHelper
include ActionView::Helpers::UrlHelper
def initialize(badge)
@badge = badge
end
... | 18.674419 | 69 | 0.596513 |
6a8a4a6df4e48c86b1677715ce45e1669bb2026e | 1,690 | class Api::V1::ContentElementController < ApplicationController
skip_before_filter :verify_authenticity_token,
:if => Proc.new { |c| c.request.format == 'application/json' }
# Just skip the authentication for now
# before_filter :authenticate_user!
def create
new_content_element = C... | 35.208333 | 180 | 0.553254 |
ac2094271050f14c464f0050019c20fedb3a2de9 | 330 | module ControllerSpecHelper
def enable_ssl
request.env['HTTPS'] = 'on'
end
def disable_ssl
request.env['HTTPS'] = 'off'
end
def with_ssl
old_https = @request.env['HTTPS']
begin
request.env['HTTPS'] = 'on'
yield
ensure
request.env['HTTPS'] = old_https
end
en... | 14.347826 | 38 | 0.590909 |
e2c067bc6f263c9fcfc0f6396ee4a27762494c5e | 124 | class AddAuthTokenToUsers < ActiveRecord::Migration[6.0]
def change
add_column :users, :auth_token, :string
end
end
| 20.666667 | 56 | 0.75 |
384843bfea5aab0918d5b9049f91faf68146fa95 | 3,964 | #
# Copyright (c) 2013-2017 SKYARCH NETWORKS INC.
#
# This software is released under the MIT License.
#
# http://opensource.org/licenses/mit-license.php
#
require_relative '../spec_helper'
describe InfrastructureLogsController, type: :controller do
login_user
describe '#index' do
before do
get :index,... | 23.595238 | 97 | 0.638749 |
bb632416f64d75298e3483f9225bcc687c28864d | 1,658 | # frozen_string_literal: true
module Types
# An enum used to distinguish what type of {EntityDescendant} to include.
#
# @see Resolvers::FiltersByEntityDescendantScope
class EntityDescendantScopeFilterType < Types::BaseEnum
description <<~TEXT
This enum is used to filter the type(s) of descendants to i... | 24.382353 | 97 | 0.658022 |
bf8bbac8ab0aa46fc3597821d23f74b2e3ff857f | 349 | module SessionHelpers
def sign_in
visit root_url
if page.has_content?('Sign out')
click_link 'Sign out'
end
click_link 'Sign in'
if page.all("input[value='Update Profile']").first
fill_in 'Bio', with: 'i work here'
click_button 'Update Profile'
end
end
end
World(SessionHel... | 21.8125 | 54 | 0.667622 |
f85447ead784ea6dfdaaa28875b67286cadb3f16 | 844 | Pod::Spec.new do |s|
s.name = 'devil'
s.platform = :ios
s.version = '0.0.122'
s.summary = 'Devil Core'
s.description = <<-DESC
This is Devil
DESC
s.homepage = 'https://github.com/muyoungko/devil_ios'
s.license = { :type... | 30.142857 | 103 | 0.543839 |
ff5c391143c0970554ff578a8808099adc5f970e | 132 | require 'test_helper'
class Statman::Test < ActiveSupport::TestCase
test "truth" do
assert_kind_of Module, Statman
end
end
| 16.5 | 45 | 0.75 |
91900a8621ab2f7b9f8a9ae5f2a688acf4e082d2 | 906 | require 'compass/import-once/activate'
# Require any additional compass plugins here.
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "js"
fonts_dir = "fonts"
relative_assets = true
# You can select your preferred output style here (can be overridden via the command line):
... | 30.2 | 96 | 0.753863 |
bbb6aa74cb816afda1835685437ee1dbb1ddc743 | 4,151 | # frozen_string_literal: true
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 memor... | 36.095652 | 80 | 0.746808 |
399b80fd10890e65e5c39d27f39f56d2e23dc405 | 3,342 | # fronzen_string_literal: true
require "aws-sdk-s3"
require "aws-sdk-ecr"
require "aws-sdk-lambda"
require_relative "../git"
require_relative "./s3_pusher"
require_relative "./ecr_pusher"
require_relative "./lambda_updater"
require_relative "./ruby_builder"
require_relative "./docker_builder"
require_relative "./pyth... | 29.06087 | 108 | 0.624776 |
e2f32f0f70c04831789af76e415867053227568a | 391 | IRB.conf[:AUTO_INDENT] = true
IRB.conf[:USE_READLINE] = true
IRB.conf[:SAVE_HISTORY] = 5000
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history"
IRB.conf[:PROMPT_MODE] = :SIMPLE
require 'irb/completion'
require 'irb/ext/save-history'
require 'pp'
#load rubygems and wirble
require 'rubygems' rescue all
require 'wir... | 19.55 | 55 | 0.749361 |
398aae23f52997b47befa882d02b1c112818174c | 679 | # frozen_string_literal: true
require 'spec_helper'
describe Connect do
subject { build(:connect) }
it { is_expected.to be_valid }
it { is_expected.to belong_to(:user) }
it { is_expected.to belong_to(:server) }
describe 'instance' do
subject { create(:connect) }
it 'returns server hostname' do
... | 19.970588 | 60 | 0.664212 |
ab8b53ff06db4c3c8e7af8eed6528c38f0bd81bb | 3,249 | #
# Author:: Julian C. Dunn (<jdunn@chef.io>)
# Cookbook:: powershell
# Recipe:: powershell5
#
# Copyright:: 2014-2017, 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
#
#... | 42.194805 | 127 | 0.711911 |
613738691375852f4ba6cdf1dc3b5ed4c670252f | 1,167 | Puppet::Type.newtype(:cs_commit) do
@doc = 'This type is an implementation detail. DO NOT use it directly'
newproperty(:cib) do
def sync
provider.sync(should)
end
def retrieve
:absent
end
def insync?(_is)
false
end
defaultto { @resource[:name] }
end
newparam(:na... | 18.822581 | 154 | 0.670951 |
e2842b83ec48c306396d673d7ee4b6792805e9c3 | 272 | require 'configcat/interfaces'
module ConfigCat
class InMemoryConfigCache < ConfigCache
def initialize()
@_value = {}
end
def get(key)
return @_value.fetch(key, nil)
end
def set(key, value)
@_value[key] = value
end
end
end
| 15.111111 | 41 | 0.625 |
2659b8ba9c333981f89588edf270374a59c615fa | 5,059 | # frozen_string_literal: true
require "hanami/configuration/logger"
require "logger"
RSpec.describe Hanami::Configuration::Logger do
subject { described_class.new(application_name: application_name, env: env) }
let(:application_name) { -> { :my_app } }
let(:env) { :development }
describe "#logger_class" do
... | 23.751174 | 88 | 0.629966 |
e89d4bab9fbd16d75a3ab49b1ef2ff696b719823 | 3,105 | # frozen_string_literal: true
require "pathname"
require_relative "helpers"
require_relative "path"
class RubygemsVersionManager
include Spec::Helpers
include Spec::Path
def initialize(source)
@source = source
end
def switch
return if use_system?
assert_system_features_not_loaded!
switch... | 23.70229 | 149 | 0.70306 |
f8fa62041c0c43488c08ab653216cfa0bef1e541 | 1,820 | require 'octokit'
require 'sinatra_auth_github'
require 'dotenv'
require 'open3'
require 'json'
require 'securerandom'
require 'fileutils'
require 'rack/coffee'
require 'rack-flash'
require 'sinatra/redirect_with_flash'
require_relative "github_uploader/helpers"
Dotenv.load
module GitHubUploader
class App < Sinatra... | 23.636364 | 80 | 0.62033 |
ffa91e709d269d47e23758b71b03b25cda51e1b5 | 368 | require "bundler/setup"
require "solution_03a"
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
config.expect_with... | 24.533333 | 66 | 0.755435 |
1d4dca8050cb00ad959c974284275066ab01d136 | 1,577 | # This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# dat... | 47.787879 | 86 | 0.693088 |
ab1f2d1c31bee392de40a5a6caa2197f7ac9188d | 2,691 | module Etsy
class OAuthTokenRevoked < StandardError; end
class MissingShopID < StandardError; end
class TemporaryIssue < StandardError; end
class ResourceUnavailable < TemporaryIssue; end
class ExceededRateLimit < TemporaryIssue; end
class InvalidUserID < StandardError; end
class EtsyJSONInvalid < Standa... | 20.860465 | 82 | 0.618729 |
5dcddba421cde39d8bbf86c535b12424526a7309 | 1,473 | require 'spec_helper'
require 'actions/v2/app_stop'
require 'actions/staging_cancel'
module VCAP::CloudController
RSpec.describe V2::AppStop do
let(:cancel_action) { instance_double(StagingCancel, cancel: nil) }
let(:app) { AppModel.make(desired_state: 'STARTED') }
let!(:process1) { ProcessModelFactory.... | 32.021739 | 90 | 0.663951 |
6a80cb636615acbee750edb88b77a8b256ac3a4a | 625 | # frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: requests/batches.proto
require 'google/protobuf'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_message 'learn_ipc.requests.UnhandledRequest' do
optional :user_uuid, :string, 1
optional :correla... | 27.173913 | 125 | 0.76 |
7a43d2101d4961f55d1fceec0911f502c22cdb60 | 7,716 | # frozen_string_literal: true
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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/... | 42.866667 | 101 | 0.637895 |
e24e3347dee1355d27ecaa387bd0c81bbaf0be2f | 25 |
task :environment do
end | 8.333333 | 20 | 0.8 |
ac6dce5dd0b77c81bc40d1a1c92e34303540116c | 50 | module InlineStylesMailer
VERSION = "1.0.3"
end
| 12.5 | 25 | 0.74 |
38221a7b1bd3bf38e174a1789608f7176f751b7b | 281 | class VmwareFusion < Cask
url 'https://download3.vmware.com/software/fusion/file/VMware-Fusion-6.0.2-1398658-light.dmg'
homepage 'http://www.vmware.com/products/fusion/'
version '6.0.2-1398658'
sha1 '13e159b7b3c934d2d7066c249277e1be8493841e'
link 'VMware Fusion.app'
end
| 35.125 | 95 | 0.768683 |
4a8511e1b231008ab8693d57bbd223713a161e16 | 701 | class ERB::Builder
TemplateRoot = Rails.root.join('lib', 'erb-builder', 'templates')
FragmentRoot = Rails.root.join('lib', 'erb-builder', 'fragments')
# @param [String] name
def initialize(name)
fname = TemplateRoot.join("#{name}.json.erb")
@value = File.read(fname)
end
# @return [String]
def bu... | 24.172414 | 67 | 0.661912 |
abd4bbf2a77f054c27f2b872d3798db64f94e539 | 1,279 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'after_notifier/version'
Gem::Specification.new do |spec|
spec.name = "after_notifier"
spec.version = AfterNotifier::VERSION
spec.authors = ["Yuji Takaesu"]
spec.email... | 41.258065 | 120 | 0.684128 |
f8615293ae31325cbadea10cb602995082a20108 | 1,192 | # frozen_string_literal: true
require_relative '../utils'
require_relative '../validation'
module DonationSystem
class CreatorDataValidator
def self.execute(data)
new(data).execute
end
def initialize(data)
@data = data
end
def execute
validation = Validation.new
validat... | 21.285714 | 80 | 0.671141 |
1111e8df66091d819b4b120acb13038a2b91935c | 370 | CarrierWave.configure do |config|
config.fog_provider = 'fog/google' # required
config.fog_credentials = {
provider: 'Google',
google_storage_access_key_id: 'GOOGJE77MZCFLA2G6CQK',
google_storage_secret_access_key: 'fdD4IfxPNo7kgD8/zvpEhEYJU2DN1uFHMVr2P... | 41.111111 | 80 | 0.67027 |
185dd80ecc6e20ef3833af2a94b5c638a48072b4 | 451 | class ApplicationController < ActionController::Base
before_action :authenticate_user!
before_action :configure_permitted_parameters, if: :devise_controller?
protected
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: %i[fname lname dob education image])
devise_para... | 32.214286 | 90 | 0.742794 |
e8ba3ade2986e44a8afdf058f4d0cfeb48984359 | 689 | class Email < ApplicationRecord
require 'csv'
validates :email_address, :presence => true,
:length => {:minimum => 3, :maximum => 254},
:uniqueness => true
# :email => true
validates :name, :presence => true
# validates :email_address, email: true
def self.imp... | 22.225806 | 60 | 0.628447 |
1a857a6a94a7485973fb7afd47adf81b6396f41f | 810 | # frozen_string_literal: true
module MasterfilesApp
StorageRuleTypeSchema = Dry::Schema.Params do
optional(:id).filled(:integer)
required(:storage_rule_type_code).filled(Types::StrippedString)
required(:rule_type_name).filled(Types::StrippedString)
required(:description).maybe(Types::StrippedString)
... | 40.5 | 67 | 0.766667 |
7a354c0971a0552037079612d1e65487c821b45a | 84 | module SensorReadings
Destroy = CreateDestroyer.run!(resource: SensorReading)
end
| 21 | 57 | 0.821429 |
bf20e6c93426dc6db3a71d176cbb21a145f67073 | 2,122 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe Admin::SubscriptionPaymentsController, type: :controller do
let(:admin) { create(:user, admin: true) }
let(:current_user) { admin }
before do
allow(controller).to receive(:current_user).and_return(current_user)
end
describe 'POST refu... | 32.151515 | 109 | 0.69557 |
87014600e214bc30caee886718e5d5c2effe51df | 5,265 | ##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##
require 'msf/core'
class Metasploit3 < Msf::Auxiliary
include Msf::Exploit::R... | 34.411765 | 134 | 0.573219 |
bb4d0ae58230134104fc40fd5ab565b7a3239cb8 | 12,025 | class Gdal < Formula
desc "Geospatial Data Abstraction Library"
homepage "http://www.gdal.org/"
url "http://download.osgeo.org/gdal/1.11.5/gdal-1.11.5.tar.gz"
sha256 "49f99971182864abed9ac42de10545a92392d88f7dbcfdb11afe449a7eb754fe"
revision 3
bottle do
rebuild 1
sha256 "4d084ada89aa6461c48730686ae... | 33.495822 | 142 | 0.656299 |
87683bfe764ab9f011253b774de5b97887ef6a2d | 1,043 | class XMLCleaner
VALID_XML_CHARS = /^(
[\x09\x0A\x0D\x20-\x7E] # ASCII
| [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
| \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
| [\xE1-\xEC\xEE][\x80-\xBF]{2} # straight 3-byte
| \xEF[\x80-\xBE]{2} #
| \xEF\xBF[\x80-\xBD] # excluding U+fffe and U+ffff
... | 25.439024 | 151 | 0.573346 |
bb874cd53b44b9d78cb8f565b75203c397892d5f | 1,826 | # -*- encoding: utf-8 -*-
module Steam
# A Ruby DSL for communicating with the Apps portion of the Steam Web API.
# @see https://developer.valvesoftware.com/wiki/Steam_Web_API
# @since 1.0.0
module Apps
# Get Steam Applications
# @return [Hash] A list of objects containing the title and app ID of
# ... | 35.803922 | 76 | 0.650602 |
1d81acffca17a36798cd09debdd66031f1a4bc80 | 1,030 | # coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'cfdi_parser/version'
Gem::Specification.new do |spec|
spec.name = "cfdi_parser"
spec.version = CfdiParser::VERSION
spec.authors = ["thotmx"]
spec.email = ["he... | 36.785714 | 104 | 0.67767 |
182ec0d24de222d3466303e38d4531e3e9f41083 | 2,027 | describe NOVAHawk::Providers::CloudManager::OrchestrationStack do
let!(:root_stack) do
FactoryGirl.create(:orchestration_stack_cloud).tap do |stack|
FactoryGirl.create(:vm_cloud, :orchestration_stack => stack)
FactoryGirl.create(:cloud_network, :orchestration_stack => stack)
FactoryGirl.create(:... | 37.537037 | 88 | 0.722743 |
38ebb67fc9ddf60778bbfcd968bb6d56f78f2dc6 | 1,145 | =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: 4.1.3-SNAPSHOT
=en... | 25.444444 | 157 | 0.737118 |
5d036982bb58fb9a09216778408e5c20ff003ed0 | 960 | cask :v1 => 'controllermate' do
version '4.9.7'
sha256 'dad06ea5627a4848a3cf983977565fc36a1d3dd75702a2fda97a68ca06b23c14'
# amazonaws.com is the official download host per the vendor homepage
url "https://s3.amazonaws.com/orderedbytes/ControllerMate#{version.delete('.')}.zip"
name 'ControllerMate'
appcast ... | 41.73913 | 87 | 0.665625 |
7a32cbf4739ecf8f3d7fc6b49daf14452fb7601c | 1,313 | require_relative 'boot'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_mailbox/engine"
require "action_text/en... | 34.552632 | 82 | 0.77837 |
03df73450dc99801f759e2740d7a90a2dc00d55d | 2,123 | module OpenerBenchmark
##
# Class for generating plots/graphs using the gnuplot CLI.
#
# Basic usage is as following:
#
# plot = Plot.new('iteration_time.gpi', 'Example title')
# plot.plot([10, 20, 30])
#
# @!attribute [r] title
# @return [String]
#
# @!attribute [r] script
# @return... | 23.588889 | 82 | 0.589732 |
18bbd17ca9c3fb15c7d4b4278effc94ccd789511 | 7,611 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# see about.rb in this directory for instructions using this.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
require 'natalie/inline'
__cxx_flags__ "$(pkg-config --cflags gtk+-3.0)"
__ld_flags__ "$(pkg-config --libs gtk+-3.0)"
__inline__ ... | 29.730469 | 91 | 0.642097 |
bf09ea7e4d8bdd7e609dafe3546df2ea59e06af3 | 956 | class Projects::VariablesController < Projects::ApplicationController
before_action :authorize_admin_build!
def show
respond_to do |format|
format.json do
render status: :ok, json: { variables: VariableSerializer.new.represent(@project.variables) }
end
end
end
def update
if @pr... | 22.761905 | 101 | 0.708159 |
28a525bc65bfca83d496473ce33e713e1cd6ded7 | 24,173 | require 'spec_helper'
describe "article_pages", type: :feature, dbscope: :example, js: true do
let(:site) { cms_site }
let!(:part) { create :cms_part_free, html: '<div id="part" class="part"><br><br><br>free html part<br><br><br></div>' }
let(:layout_html) do
<<~HTML.freeze
<html>
<head>
... | 41.463122 | 131 | 0.629297 |
113f5c764256de409d369c2b54d58120a34a93aa | 458 | cask 'firefox-pt-br' do
version '47.0.1'
sha256 '0de1ca90a2bd6248e0575e4496f682fb7197c3cade095a6ff858efd839a971df'
url "https://download.mozilla.org/?product=firefox-#{version}-SSL&os=osx&lang=pt-BR"
name 'Mozilla Firefox'
homepage 'https://www.mozilla.org/pt/firefox/new'
license :mpl
app 'Firefox.app'
... | 26.941176 | 86 | 0.663755 |
87a1fc447f2fb402b5b368cbf8d6b9be9fa28289 | 141 | module Slug
def slug
username.parameterize
end
def find_by_slug(slug)
all.find { |instance| instance.slug == slug }
end
end
| 14.1 | 49 | 0.680851 |
918120b06b61fcd1fde238faa1e6841211b6d202 | 3,861 | # frozen_string_literal: true
module GraphQL8
class Schema
# Mutations that extend this base class get some conventions added for free:
#
# - An argument called `clientMutationId` is _always_ added, but it's not passed
# to the resolve method. The value is re-inserted to the response. (It's for
... | 44.895349 | 148 | 0.672106 |
ab6c9a353a75bd38bb4bee969901f4df7691a34e | 246 | require 'rubygems/command_manager'
require 'rubygems/on_install_test'
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.3.1')
%w[test].each do |command|
Gem::CommandManager.instance.register_command command.to_sym
end
end
| 27.333333 | 70 | 0.760163 |
03d2a1c3a69d2d1183b1684743c7bf837b9bc187 | 728 | require 'spec_helper'
module Daemons
describe Exception do
it { is_expected.to be_a RuntimeError }
end
describe RuntimeException do
it { is_expected.to be_a Exception }
end
describe CmdException do
it { is_expected.to be_a Exception }
end
describe Error do
it { is_expected.to be_a Exce... | 20.222222 | 60 | 0.696429 |
1a805bbffb6a451be26807860a41f305018d1065 | 474 | module RuboCop
module Cop
module Lint
class EmptyRescueClause < Cop
include RescueNode
def_node_matcher :rescue_with_empty_body?, <<-PATTERN
(resbody _ _ {nil? (nil) (array) (hash)})
PATTERN
def on_resbody(node)
rescue_with_empty_body?(node) do |_error|
... | 23.7 | 99 | 0.605485 |
1dbb62f7c072c30d9d7fa7ac5c395ffa77d37ec3 | 301 | # frozen_string_literal: true
class CreateConditions < ActiveRecord::Migration[5.2]
def change
create_table :conditions do |t|
t.references :profile, null: false
t.string :resource_id, null: false
t.jsonb :resource
t.string :version
t.timestamps
end
end
end
| 21.5 | 53 | 0.681063 |
ac3584dc42f5022cff63515c6432c8ebe9d230e3 | 216 | class CreateContentTags < ActiveRecord::Migration[5.0]
def change
create_table :content_tags do |t|
t.integer :context_module_id
t.integer :content_id
t.string :content_type
end
end
end
| 21.6 | 54 | 0.703704 |
381c506d089fdbceef3bf1aef258af9732819d43 | 67 | class Terra::DashboardController < Common::DashboardController
end
| 22.333333 | 62 | 0.850746 |
f7d8efd9bcab82e86abd489911970fbb58868770 | 540 | Pod::Spec.new do |s|
s.name = 'HanekeSwift'
s.module_name = 'Haneke'
s.version = '1.2'
s.license = 'Apache'
s.summary = 'A lightweight generic cache for iOS written in Swift with extra love for images.'
s.homepage = 'https://github.com/Haneke/HanekeSwift'
s.authors = { 'Hermes Pique' => 'https://twitter.c... | 36 | 96 | 0.67037 |
796d545263b41a394875ad60dc55fb9322653b15 | 7,746 | require 'spec_helper'
describe ApiAuth::RequestDrivers::GrapeRequest do
let(:default_method) { 'PUT' }
let(:default_params) do
{ 'message' => "hello\nworld" }
end
let(:default_options) do
{
method: method,
params: params
}
end
let(:default_env) do
Rack::MockRequest.env_for('/', ... | 27.565836 | 121 | 0.638652 |
bbd216ae8fa6d3c8a5d8ca44462667dbf3240495 | 77 | module ROCCIServer
VERSION = '1.1.7'
ROCCI_VERSION = ::Occi::VERSION
end
| 15.4 | 33 | 0.701299 |
61233dcc51dc3f1edb8026cef061f939c4c0b95c | 6,968 | require "active_support/core_ext/big_decimal/conversions"
require "active_support/multibyte/chars"
module ActiveRecord
module ConnectionAdapters # :nodoc:
module Quoting
# Quotes the column value to help prevent
# {SQL injection attacks}[http://en.wikipedia.org/wiki/SQL_injection].
def quote(va... | 33.023697 | 111 | 0.613806 |
083ba7c6624ddc761dcf9fa107a3fffb1443f133 | 2,895 | # Run Coverage report
require 'simplecov'
SimpleCov.start do
add_filter 'spec'
add_group 'Controllers', 'app/controllers'
add_group 'Helpers', 'app/helpers'
add_group 'Mailers', 'app/mailers'
add_group 'Models', 'app/models'
add_group 'Views', 'app/views'
add_group 'Libraries', 'lib'
end
# Configure Rail... | 32.897727 | 124 | 0.765458 |
7ae8572d0cffd0bed9c1a0fb440bcbe05a0da1d7 | 10,666 | class MiniPostsController < ApplicationController
#rao;s load_and_authorize_resource
before_filter :authenticate_user!
respond_to :html, :js
def index
last = params[:last].blank? ? Time.now + 1.second : Time.parse(params[:last])
@wert = last
@mini_posts = MiniPost.feed(last,current_user.id)
end
... | 29.221918 | 119 | 0.599194 |
acfcb5acb6cf7c6c290a39085d99633826f01ff5 | 2,710 | # Copyright (C) 2007, 2008, 2009, 2010 Christian Neukirchen <purl.org/net/chneukirchen>
#
# Rack is freely distributable under the terms of an MIT-style license.
# See COPYING or http://www.opensource.org/licenses/mit-license.php.
# The Rack main module, serving as a namespace for all core Rack
# modules and classes.
... | 32.261905 | 87 | 0.723247 |
f8bcade7cfac3b7c98fa85f90a619c091d68527d | 5,190 | module Artifactory
module APIServer::SystemEndpoints
def self.registered(app)
app.get("/api/system") do
"This is some serious system info right here"
end
app.get("/api/system/ping") do
"OK"
end
app.get("/api/system/configuration") do
content_type "applicatio... | 43.613445 | 163 | 0.55684 |
7a32aeb7362050f06884533c2c303a7cf1f0305e | 1,270 | class Assh < Formula
desc "Advanced SSH config - Regex, aliases, gateways, includes and dynamic hosts"
homepage "https://github.com/moul/advanced-ssh-config"
url "https://github.com/moul/advanced-ssh-config/archive/v2.8.0.tar.gz"
sha256 "e04de57ab048f1abee75e9e739514c4f47e6cbb8acacb9d58a6e2892df30dc42"
head "... | 39.6875 | 94 | 0.765354 |
ab6d5ee1081cdad199e6fe194e4851d830bea969 | 166 | class CreateComment < ActiveRecord::Migration[5.0]
def change
create_table :comments do |t|
t.text :body
t.timestamps null: false
end
end
end
| 18.444444 | 50 | 0.668675 |
6a234cd72bbf6d2086a504fa989a1183af0128c3 | 10,370 | # frozen_string_literal: true
module Caseflow::Error
module ErrorSerializer
extend ActiveSupport::Concern
def initialize(args)
@code = args[:code]
@message = args[:message]
@title = args[:title]
end
def serialize_response
{ json: { "errors": [{ "status": code, "title": title... | 32.507837 | 120 | 0.679171 |
117a39d08feed8c4c9521e2bef76f9ac76530b79 | 293 | module Fog
module Compute
class XenServer
class Real
def query_data_source_host(ref, data_source)
@connection.request({ :parser => Fog::Parsers::XenServer::Base.new, :method => "host.query_data_source" }, ref, data_source)
end
end
end
end
end
| 24.416667 | 134 | 0.645051 |
ff7027a71581fa2b8f021aa3acb7521519156667 | 35 | class VisitPolicy < CardPolicy
end
| 11.666667 | 30 | 0.828571 |
7a90e8b310401982ec6f2376288a10fea409995f | 476 | require 'spec_helper'
describe Flight do
it { should belong_to(:user) }
it { should validate_presence_of(:beginning_airport) }
it { should validate_presence_of(:ending_airport) }
it { should validate_numericality_of(:price) }
# it "should calculate duration on save" do
# f = FactoryGirl.build :flight
... | 26.444444 | 56 | 0.693277 |
ac42dc5c655cca0e4ac2d2024bbfffa81bb4990c | 21,544 | # frozen_string_literal: true
require "test_helper"
require "database/setup"
require "active_support/testing/method_call_assertions"
class ActiveStorage::OneAttachedTest < ActiveSupport::TestCase
include ActiveJob::TestHelper
include ActiveSupport::Testing::MethodCallAssertions
setup do
@user = User.create... | 34.034755 | 151 | 0.712449 |
f8a8137fd15dc5112017f421b0d9dcb3a3d622ab | 485 | module ApplicationHelper
include BootstrapFlashHelper
include FontAwesome::Rails::IconHelper
def current_group
@group
end
def spinner
fa_icon 'refresh spin'
end
def player_link(player_id, *options)
name = if @players.present?
@players.select{ |player| player.id == player_id }.f... | 21.086957 | 74 | 0.672165 |
f83eb50c6c6d1a5b406a97fbdb47e4d5360d6d6b | 490 | require 'rails_helper'
RSpec.describe App, type: :model do
describe "authenticate with valid params" do
it "returns app" do
app = create(:app)
response = app.class.authenticate(app.name, app.password)
expect(response).to match(app)
end
end
describe "authenticate with invalid params" d... | 22.272727 | 63 | 0.669388 |
26b214c68cfd59598cde6c103bc4960cfa8a89a9 | 202 | def sum_squares(number)
if number == 1
puts 1
return 1
end
puts number ** 2
result = number ** 2 + sum_squares(number - 1)
return result
end
sum_squares(10)
# 3^2 + 2^2 + 1^2 = 14 | 12.625 | 48 | 0.60396 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.