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 |
|---|---|---|---|---|---|
795500559dcb638388d6835ad79cb59f65555cb5 | 533 | # encoding: utf-8
Gem::Specification.new do |s|
s.name = "disque"
s.version = "0.0.6"
s.summary = "Client for Disque"
s.description = "Disque client for Ruby"
s.authors = ["Michel Martens", "Damian Janowski"]
s.email = ["michel@soveran.com", "dam... | 33.3125 | 75 | 0.536585 |
e2eb00a09bd01d0b50859bf2279d43d495443536 | 1,330 | # frozen_string_literal: true
describe LayoutHelper, type: :helper do
describe '#show_layout_flash?' do
subject { show_layout_flash? }
context 'without a layout flash' do
before { @layout_flash = nil }
it { is_expected.to be_truthy }
end
context 'with a layout flash' do
before { @... | 26.078431 | 59 | 0.630075 |
4a852fde6a6e1c6fafd3a45d868af168ae0277ef | 331 | module Jekyll
module HideCustomBibtex
def hideCustomBibtex(input)
keywords = @context.registers[:site].config['filtered_bibtex_keywords']
keywords.each do |keyword|
input = input.gsub(/^.*#{keyword}.*$\n/, '')
end
return input
end
end
end
Liquid::Template.register_filter(Jekyll::HideCus... | 20.6875 | 74 | 0.703927 |
21651a7664c0992c831a0801c32497304157341f | 807 | # (c) Copyright 2018 Hewlett Packard Enterprise Development LP
#
# 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... | 38.428571 | 84 | 0.767038 |
21853fa9dbc3b4f2ec37faf68eb7dd5eccc770b4 | 3,196 | # frozen_string_literal: true
module RuboCop
module Cop
module Style
# Access modifiers should be declared to apply to a group of methods
# or inline before each method, depending on configuration.
# EnforcedStyle config covers only method definitions.
# Applications of visibility methods... | 24.030075 | 74 | 0.532541 |
87bab129bbcd4cece11db266c7e06fb94dde3e55 | 330 | require 'rails/generators/model_helpers'
module Rails
module Generators
class ModelGenerator < NamedBase # :nodoc:
include Rails::Generators::ModelHelpers
argument :attributes, type: :array, default: [], banner: "field[:type][:index] field[:type][:index]"
hook_for :orm, required: true
end
... | 25.384615 | 106 | 0.693939 |
261af7bfd693cbc058bfb2a9ad57299846001e93 | 122 | module SS::Addon::EditorSetting
extend ActiveSupport::Concern
extend SS::Addon
include SS::Model::EditorSetting
end
| 20.333333 | 34 | 0.778689 |
e93ed22ff2a820cdf0b955bf52d371d1dc417041 | 1,185 | require "spec_helper"
module RubyEventStore
RSpec.describe TransformKeys do
let(:hash_with_symbols) { {
one: 1,
two: 2.0,
three: true,
four: Date.new(2018, 4, 17),
five: "five",
six: Time.utc(2018, 12, 13, 11 ),
seven: true,
eight: false,
nein: nil,
ten... | 30.384615 | 86 | 0.562025 |
bb0d36183e40c49cc667c11cf55e2157ae84e7e7 | 4,855 | #
# Copyright (c) 2019-present, Vicarious, Inc.
# Copyright (c) 2020-present, Facebook, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/l... | 33.027211 | 79 | 0.629042 |
39b7521d2506f0b4ac380d2219e1e87484b743b4 | 7,517 | require_relative "../errors"
require_relative "../extras"
require_relative "../file"
require "logger"
class Train::Plugins::Transport
# A Connection instance can be generated and re-generated, given new
# connection details such as connection port, hostname, credentials, etc.
# This object is responsible for car... | 34.481651 | 152 | 0.683517 |
386cee61e781b3e510a9d2fa978e2d01e8593202 | 1,283 | require_relative './instructions/array_pop_instruction'
require_relative './instructions/array_shift_instruction'
require_relative './instructions/const_find_instruction'
require_relative './instructions/create_array_instruction'
require_relative './instructions/define_block_instruction'
require_relative './instruction... | 53.458333 | 59 | 0.874513 |
0170aaf46d2618d2e0db45ae564aafb7ed3e88f6 | 346 | cask "font-carrois-gothic-sc" do
version :latest
sha256 :no_check
url "https://github.com/google/fonts/raw/main/ofl/carroisgothicsc/CarroisGothicSC-Regular.ttf",
verified: "github.com/google/fonts/"
name "Carrois Gothic SC"
homepage "https://fonts.google.com/specimen/Carrois+Gothic+SC"
font "Carrois... | 28.833333 | 97 | 0.748555 |
6a43391496bcf4f1d90de5836d6b450739322289 | 2,759 | # frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don... | 35.371795 | 86 | 0.76042 |
6a2267956d32c8737db158e7d5c456c1a1472782 | 438 | desc "Generate the cached bundle/application.js file from app/scripts/*.coffee files"
task :bistro_car => :environment do
path = "public/javascripts/application.js"
puts "Building *.coffee -> #{path}"
File.open(path, "w") { |file| file << BistroCar::Bundle.new('default').to_javascript }
end
file "public/javascri... | 43.8 | 101 | 0.716895 |
b9ee556ff632d6d7618b735ad5f1401729df655b | 704 | # Copyright 2020 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 applicable law or agreed to in writing, ... | 28.16 | 74 | 0.728693 |
9196d65ebe42e89a2ed791dbcd076cf627e0e4e5 | 2,834 | module Popolo
# A real person, alive or dead.
class Person
include Mongoid::Document
include Mongoid::Timestamps
store_in Popolo.storage_options_per_class.fetch(:Person, Popolo.storage_options)
# The person's memberships.
has_many :memberships, class_name: 'Popolo::Membership', dependent: :des... | 35.873418 | 87 | 0.684545 |
d5d6ca2df7d603b4500080d057d76ac60c6ac7e7 | 59 | module ULID
module Rails
VERSION = "0.5.0"
end
end
| 9.833333 | 21 | 0.627119 |
5daa0295b54807a513adc725e27d0163cdf70b33 | 263 | module OpenActive
module Models
module Schema
class TakeAction < ::OpenActive::Models::Schema::TransferAction
# @!attribute type
# @return [String]
def type
"schema:TakeAction"
end
end
end
end
end
| 18.785714 | 69 | 0.585551 |
f8d7fec7e45874daa033e4e8b1aa06f4977fb20f | 4,098 | ##
# $Id$
##
##
# 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/
##
require 'msf/core'
class Metasploit3 < Msf::Auxi... | 38.299065 | 147 | 0.65349 |
4a735cc9505cdbb9a1e742fe470f2af09fff057b | 2,803 | module Hookit
module Resource
class Service < Base
field :recursive
field :service_name
field :init
field :timeout
actions :enable, :disable, :start, :stop, :force_stop, :restart, :reload
default_action :enable
def initialize(name)
service_name(name) unless ser... | 23.754237 | 86 | 0.522298 |
1cbf603b071ddb2303dbecc71f79ca3b358bc28a | 1,925 | class Np2 < Formula
desc "Neko Project 2: PC-9801 emulator"
homepage "https://www.yui.ne.jp/np2/"
url "https://amethyst.yui.ne.jp/svn/pc98/np2/tags/VER_0_86/", :using => :svn, :revision => "2606"
head "https://amethyst.yui.ne.jp/svn/pc98/np2/trunk/", :using => :svn
bottle do
cellar :any
sha256 "0d341... | 37.745098 | 100 | 0.68 |
5dc78ee299cd1bd79715916b4bad43dba7be76d6 | 2,630 | #-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2020 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork ... | 32.469136 | 100 | 0.720152 |
035c72a58460036c7226a7a0be7e43ee4ec30bf0 | 69 | require "ruboty-songinfo/version"
require "ruboty/handlers/songinfo"
| 23 | 34 | 0.826087 |
f80fdfe55d7e427baa2ca2ce372e74fbb44f1050 | 2,059 | require 'spec_helper'
describe 'SynchronousHttpRequester' do
describe '#retrieve_content' do
let(:get_request) { double('HTTP::Get') }
let(:http_session) { double('Net::HTTP', request: response) }
let(:url) { 'http://host/path.html?parameter=value' }
let(:response) { double('HTTPResponse', code: '200... | 39.596154 | 124 | 0.67897 |
3375a5952aa2cba1bf868863a97dd661090356da | 3,022 | #--------------------------------------------------------------------
#
# Author: Martin Corino
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the R2CORBA LICENSE which is
# included with this program.
#
# Copyright (c) Remedy IT Expertise BV
#--------------------------... | 26.278261 | 78 | 0.59497 |
21773ec9bc5d9007cbc9de880d0cf817505ea8e7 | 18,639 | # 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... | 47.915167 | 131 | 0.557272 |
3916245d7d710476e68f64c4a38933a63e3f3348 | 494 | require 'serverspec'
require 'net/ssh'
set :backend, :ssh
set :disable_sudo, true
options = Net::SSH::Config.for(host)
options[:user] = 'root'
set :host, options[:host_name] || ENV['TARGET_HOST']
set :ssh_options, options
describe 'Packages are installed.' do
apache = host_inventory['platform'] == 'ubuntu'... | 22.454545 | 71 | 0.682186 |
abc531413ddacacff3f8cfc3b124f8621a019913 | 1,706 | $LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'inifile',
'lib')
)
$LOAD_PATH.push(
File.join(
File.dirname(__FILE__),
'..',
'..',
'..',
'fixtures',
'modules',
'openstacklib',
'lib')
)
require 'spec_helper... | 25.848485 | 83 | 0.644197 |
0113075152d99af8e0baba56f18b693ebeb58259 | 154 | class NewsController < ApplicationController
def show
@news = News.find_by(slug: params[:slug])
redirect_to root_path if @news.blank?
end
end
| 22 | 45 | 0.733766 |
87eedb5f5aafbb86f9df104b17bdb6added830f6 | 382 | require 'test_helper'
class RepositoryTest < ActiveSupport::TestCase
[
['admin', true],
['active', false],
].each do |user, can_edit|
test "#{user} can edit attributes #{can_edit}" do
use_token user
attrs = Repository.new.editable_attributes
if can_edit
refute_empty attrs
... | 20.105263 | 53 | 0.63089 |
ff0b6bbedd7a24eb9f6427bbf0b4576cb35875af | 363 | module Mailclerk
class MailclerkError < StandardError
end
class MailclerkAPIError < MailclerkError
attr_accessor :http_status
attr_accessor :http_response
def initialize(description, http_status=nil, http_response=nil)
super(description)
self.http_status = http_status
self.http... | 24.2 | 67 | 0.746556 |
03b943b1080f4224035447b4077652b4e687f7a0 | 466 | require_relative 'bible'
require 'abbrev'
class ActsAsScriptural::AbbreviationLookup
def initialize
@hash = bible.book_names.abbrev.map{|k,v| [k.gsub(' ','').downcase,v]}.to_h
end
def fullname(str)
@hash[str.gsub(' ','').downcase]
end
def index_number(str)
bible.namehash[fullname(str)].index ... | 16.642857 | 79 | 0.684549 |
b9796f160a3763564b535a335ca92b16d0077cde | 1,201 | # encoding: utf-8
# author: Mesaguy
describe file('/opt/prometheus/exporters/wireguard_exporter_mdlayher/active') do
it { should be_symlink }
its('mode') { should cmp '0755' }
its('owner') { should eq 'root' }
its('group') { should eq 'prometheus' }
end
describe file('/opt/prometheus/exporters/wiregua... | 30.794872 | 169 | 0.673605 |
e2e5e9db36ab86860eb85ef9a759929d6f43f8cb | 5,210 | # $Id$
#
# Meterpreter script for setting up a route from within a
# Meterpreter session, without having to background the
# current session.
# Default options
session = client
subnet = nil
netmask = "255.255.255.0"
print_only = false
remove_route = false
remove_all_routes = false
# Options parsing
@@exec_opts = Rex... | 25.539216 | 106 | 0.670825 |
e9f60b0f3e51defb1e0b32671b2e093526659f2a | 5,116 | #!/opt/puppetlabs/puppet/bin/ruby
require 'json'
require 'puppet'
require 'openssl'
def get_extensions_v1beta1_api_resources(*args)
header_params = {}
params=args[0][1..-1].split(',')
arg_hash={}
params.each { |param|
mapValues= param.split(':',2)
if mapValues[1].include?(';')
mapValues[1].gsu... | 30.452381 | 135 | 0.65129 |
21c651b14c8385dec429b3a2cda501c090e0b8f3 | 824 | require 'test_helper'
class MicropostsControllerTest < ActionDispatch::IntegrationTest
def setup
@micropost = microposts(:orange)
end
test "should redirect create when not logged in" do
assert_no_difference 'Micropost.count' do
post microposts_path , params: { micropost: { content: "Lorem ipsum" }... | 26.580645 | 78 | 0.739078 |
87ced6527e975ac37d0e56ae60654436e1f5be06 | 1,846 | # == Schema Information
#
# Table name: countries
#
# name :string not null, primary key
# continent :string
# area :integer
# population :integer
# gdp :integer
require_relative './sqlzoo.rb'
def example_select
execute(<<-SQL)
SELECT
population
FROM
countries... | 20.511111 | 84 | 0.670098 |
91f14a7345106cedfca6d1cf8a37efd2726160d5 | 160 | # Throw exception with unexpected null value.
SchemaSerializer.config.raise_on_null = true
SchemaSerializer.load_definition(Rails.root.join("doc/schema.yml"))
| 32 | 67 | 0.825 |
b93ed619de717c651847fc726bab02d534c341ca | 1,689 | # This file is automatically created by Recurly's OpenAPI generation process
# and thus any edits you make by hand will be lost. If you wish to make a
# change to this file, please create a Github issue explaining the changes you
# need and we will usher them to the appropriate places.
module Recurly
module Resources... | 35.93617 | 122 | 0.703375 |
3882b558cc7c56e12c3e7ec46c3972897bc56ac9 | 1,023 | # crypt.rb
require 'base64'
module HipChatSecrets
class Crypt
def self.encode str
Base64::encode64(xor str).strip
end
def self.decode str
xor Base64::decode64(str)
end
def self.xor input
input = input.unpack 'U*'
output = []
input.each_with_index do |num,index|
... | 19.673077 | 86 | 0.588465 |
e9e40513b55b0517133e3347ec543db0f3c530c8 | 16 | require 'what'
| 5.333333 | 14 | 0.6875 |
62d1bac7fce28a14e6a1dd4aa3bc18b00b1512db | 198 | class AddInProgressStepsToJobApplications < ActiveRecord::Migration[6.1]
def change
add_column :job_applications, :in_progress_steps, :integer, array: true, default: [], null: false
end
end
| 33 | 101 | 0.772727 |
acdc68b9bf97dd9126203e6c29102966c91325da | 656 | # frozen_string_literal: true
module Numismatics
class CitationDecorator < Valkyrie::ResourceDecorator
display :part,
:number,
:numismatic_reference,
:uri
delegate :decorated_numismatic_reference, to: :wayfinder
def manageable_files?
false
end
def manag... | 18.222222 | 72 | 0.657012 |
1c0d138291259842c3742736e9d996d5891406e7 | 224 | class AddExternalBlockedToUsers < ActiveRecord::Migration
def change
add_column :users, :external, :boolean, default: false, null: false
add_column :users, :blocked, :boolean, default: false, null: false
end
end
| 32 | 71 | 0.745536 |
f745483973d961083516c52eaafe8f0a517f8ab8 | 7,465 | require "fileutils"
begin
require "io/console"
rescue LoadError
end
require "net/http"
require "pathname"
module Datasets
class Downloader
def initialize(url)
if url.is_a?(URI::Generic)
url = url.dup
else
url = URI.parse(url)
end
@url = url
unless @url.is_a?(URI::H... | 28.492366 | 76 | 0.544675 |
180bc60b9cdb6c6109a4704c821f3054575eebe5 | 4,340 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe Sortable do
describe '.order_by' do
let(:relation) { Design.all }
describe 'ordering by id' do
it 'ascending' do
allow(relation).to receive(:reorder).with(id: :asc)
relation.order_by('id_asc')
expect(relation... | 31.223022 | 98 | 0.648157 |
6200bf118a05ab6b6d25b4038a5dcf8430482108 | 7,981 | require 'net/ssh/test/channel'
require 'net/ssh/test/local_packet'
require 'net/ssh/test/remote_packet'
module Net
module SSH
module Test
# Represents a sequence of scripted events that identify the behavior that
# a test expects. Methods named "sends_*" create events for packets being
# sen... | 43.612022 | 130 | 0.630999 |
185fc3a2c14001ea5e7d430e8c7029564758e154 | 1,425 | # frozen_string_literal: true
module Teckel
class Config
# @!visibility private
def initialize
@config = {}
end
# Allow getting or setting a value, with some weird rules:
# - The +value+ might not be +nil+
# - Setting via +value+ is allowed only once. Successive calls will raise a {Fro... | 24.152542 | 99 | 0.605614 |
bbd383dc72484d5480f2b44ccfaf0aedffa1ea74 | 84 | class GameTurn < ApplicationRecord
belongs_to :game
belongs_to :player_turn
end
| 16.8 | 34 | 0.809524 |
e8ab12483e2240ddb2c1dff21b4ebf5869b2ec22 | 239 | module UseCase
module AssessmentSummary
class CepcSupplement < UseCase::AssessmentSummary::Supplement
def add_data!(hash)
registered_by!(hash)
related_assessments!(hash)
hash
end
end
end
end
| 19.916667 | 65 | 0.669456 |
f8e2e2b38f88390f049f2a3131ed58e1a9cf7619 | 1,622 | #
# Be sure to run `pod lib lint TTForm.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'TTForm'
s.... | 36.044444 | 101 | 0.632552 |
ac8da9e035ad543ab6fb735b7737c94df9c46500 | 381 | class AccountActivationsController < ApplicationController
def edit
user = User.find_by(email: params[:email])
if user && !user.activated? && user.authenticated?(:activation, params[:id])
user.activate
log_in user
flash[:success] = "Account activated!"
redirect_to user
else
flash[:danger] = "Inva... | 22.411765 | 78 | 0.721785 |
e8734cc8343b35d1a3dc568e47644aa83cf48e5b | 901 | # coding: utf-8
Gem::Specification.new do |spec|
spec.name = "jekyll-sleek"
spec.version = "0.1.8"
spec.authors = ["Jan Czizikow"]
spec.email = ["jan.czizikow@gmail.com"]
spec.summary = %q{Sleek is a modern Jekyll theme focused on speed performance & SEO best practices.}
... | 36.04 | 108 | 0.63485 |
ab2202e680af453f923ed05e9f7d8dfd5cc3bee8 | 459 | class Track < ActiveRecord::Base
belongs_to :dj
has_attached_file :audio
validates_attachment_content_type :audio, :content_type => [ 'audio/mpeg', 'audio/x-mpeg', 'audio/mp3', 'audio/x-mp3', 'audio/mpeg3', 'audio/x-mpeg3', 'audio/mpg', 'audio/x-mpg', 'audio/x-mpegaudio' ]
has_attached_file :track_art, :styl... | 51 | 201 | 0.697168 |
6ad0d460ef093539b74b2fc09cca5e99e7a8a42e | 1,324 | # Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
helper :all
helper_method :current_user_session, :current_user
filter_parameter_logging :password, :passwor... | 28.170213 | 79 | 0.702417 |
21a5afd27adbc0fda5cb54c30ce1261d59418ba2 | 2,555 | require "test_helper"
module WillItRuby
class StandardLibrary::ArrayOperatorsTest < ProcessorTest
def test_union
process <<-RUBY
[1,2] | [2, 3]
RUBY
assert_no_issues
assert_result :Array
# TODO: when implemented ...
# assert_equal [1, 2, 2, 3], last_evaluated_result.v... | 22.217391 | 95 | 0.562427 |
4a8ad8c46e32a79c315604f598fcabf7b641bb0a | 168 | module VideoLessonsHelper
def embed(youtube)
youtube_id = youtube.split("=").last
content_tag(:iframe, nil, src: "//www.youtube.com/embed/#{youtube_id}")
end
end
| 24 | 73 | 0.72619 |
abd5366b854ac8247ed326b55b1b091251a29a39 | 73 | require 'job_state/engine'
require 'job_state/base'
module JobState
end
| 12.166667 | 26 | 0.808219 |
622e0a6f6e4d5963502c8ca6305741d1df20d52e | 75 | json.array!(@posts) do |post|
json.extract! post, :id, :title, :body
end
| 18.75 | 40 | 0.653333 |
031af4ed6019a201e34c79491b854c5ed5c98c11 | 1,265 | #
# Manages a Zone on a given router or switch
#
Puppet::Type.newtype(:zone) do
@doc = "Manages a ZONE on a router or switch."
apply_to_device
ensurable
newparam(:name) do
desc "Zone name."
validate do |value|
if value.strip.length == 0
raise ArgumentEr... | 23.425926 | 98 | 0.53834 |
ab0aec133a9c4fec7260588faf62bd30fa371250 | 28 | module GakuyuInfoHelper
end
| 9.333333 | 23 | 0.892857 |
d575d78f909256509ceba8abec0e0b672dc2765a | 140 | class Photo < ActiveRecord::Base
belongs_to :user
mount_uploader :image, ImageUploader
default_scope { order(created_at: :desc) }
end
| 23.333333 | 44 | 0.764286 |
4a2ff87e4f855e59883f63f853da75b85571de2f | 1,112 | require 'ostruct'
class Errapi::ValidationError
attr_accessor :reason
# TODO: add value to error
attr_accessor :check_value
attr_accessor :checked_value
attr_accessor :validation
attr_accessor :constraints
attr_accessor :location
def initialize options = {}
ATTRIBUTES.each do |attr|
instance... | 24.711111 | 94 | 0.707734 |
bb4de26a90b706218b2ef488fbe44a3435ab44b5 | 548 | cask "qownnotes" do
version "20.12.3"
sha256 "96f96e21a6af502b0c2add8be1e442282f0d22b637c6a1b0d24814a9ec02057d"
# github.com/pbek/QOwnNotes/ was verified as official when first introduced to the cask
url "https://github.com/pbek/QOwnNotes/releases/download/v#{version}/QOwnNotes.dmg"
appcast "https://github.c... | 32.235294 | 89 | 0.762774 |
01ffd9aff1874c2e9264dc7fa177d3aa3cfa490c | 5,753 | ######################################################################
# Copyright (c) 2008-2010, Alliance for Sustainable Energy.
# All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the ... | 38.099338 | 154 | 0.661568 |
e8f66422101c66b3b651d36ffc0efc91d75d764f | 1,112 | #
# Be sure to run `pod spec lint KKRouter.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://github.co... | 32.705882 | 92 | 0.608813 |
ed8424201bfd80b80d07a201d920b4972dcd0079 | 2,517 | require 'faraday'
require 'faraday/request/multipart'
require 'json'
require 'timeout'
require 'postcode_anywhere/error'
require 'postcode_anywhere/response/raise_error'
require 'postcode_anywhere/response/parse_json'
module PostcodeAnywhere
class Client
attr_accessor(*Configuration::VALID_CONFIG_KEYS)
def ... | 28.931034 | 80 | 0.659913 |
08b7e7aaf3dc6ae26d6cbf55964f86f48490a1cb | 118,741 | # 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
require 'seahorse/client/plugins/content_length.rb'
require 'aws-sdk-core/plug... | 50.983684 | 687 | 0.688684 |
4afb70d1cb7af3237b6f358879b21bf8b9e1c0d7 | 783 | require 'test_helper'
class StaticPagesControllerTest < ActionDispatch::IntegrationTest
def setup
@base_title = "Ruby on Rails Tutorial Sample App"
end
test "should get root" do
get root_path
assert_response :success
end
test "should get home" do
get root_path
assert_response :success
... | 20.076923 | 65 | 0.696041 |
7aa5cf030dd79f92a92a764fb1602d96cd7e3166 | 464 | # frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'categories/show', type: :view do
before(:each) do
@category = assign(:category, Category.create!(
name: 'Name',
display_in_navbar: false
... | 24.421053 | 60 | 0.536638 |
612e1341d83e6c488d3d2cd0d7961c284a75b8c2 | 1,266 | module SpreeCorreios
module Generators
class InstallGenerator < Rails::Generators::Base
class_option :auto_run_migrations, :type => :boolean, :default => false
def add_javascripts
append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/spree_correios\n"
... | 39.5625 | 159 | 0.669826 |
7a729894d31409ca789e4874d704638e7bf336cc | 43 | class ArtistPolicy < ApplicationPolicy
end
| 14.333333 | 38 | 0.860465 |
ac55164d788a1b1a9b0c050b7a0a50b005c657f9 | 376 | require Rails.root.join('lib', 'tasks', 'hbx_import', 'qhp', 'parsers', 'package_list_parser')
module Parser
class PlanBenefitTemplateParser
include HappyMapper
tag 'planBenefitTemplateVO'
has_one :packages_list, Parser::PackageListParser, :tag => "packagesList"
def to_hash
{
package... | 20.888889 | 94 | 0.694149 |
bfc5e81083408c3628e9aa669891cfffdb20ea91 | 34,621 | # Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.342045 | 323 | 0.665463 |
edc37d4b2d6727837715b27c439565ac4018783a | 2,627 | # Cloud Foundry Java Buildpack
# Copyright 2013-2017 the original author or authors.
#
# 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
#
# Un... | 31.27381 | 120 | 0.746479 |
e96de7c27ae7eef4c47988e140c638c204509ebb | 1,122 | #
# Author:: Adam Jacob (<adam@opscode.com>)
# Author:: AJ Christensen (<aj@junglist.gen.nz>)
# Author:: Ho-Sheng Hsiao (<hosh@opscode.com>)
# Copyright:: Copyright (c) 2008 Opscode, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this f... | 29.526316 | 74 | 0.7041 |
0161964c649eacede85c7336859773da888d2a1c | 256 |
class EmailValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
unless value =~ /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
record.errors[attribute] << (options[:message] || "is not an email")
end
end
end
| 28.444444 | 74 | 0.613281 |
18396ee91fc49172114665ecf8282130eea1c953 | 293 | require 'rails_helper'
RSpec.describe "users/show", type: :view do
before(:each) do
@user = create(:user)
end
it "renders attributes in <p>" do
render
expect(rendered).to match(/First/)
expect(rendered).to match(/Last/)
expect(rendered).to match(/Email/)
end
end
| 19.533333 | 43 | 0.658703 |
e8b1bc1f1584f5ce7579acf6c6cf793635b59179 | 9,814 | # Copyright 2018 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, ... | 38.03876 | 137 | 0.682087 |
d59bf3f948d43f900be60de12649ec3815e1d4e2 | 2,873 | # == Schema Information
#
# Table name: assignments
#
# id :integer not null, primary key
# state :enum default("pending")
# case_id :integer not null
# team_id :integer not null
# created_at :datetime not null
# updated_at :datetime not nu... | 26.118182 | 77 | 0.653672 |
39b786a9a4faf9f44b0356964f1d6ab9eaab55d1 | 2,574 | def adopt(user_city)
adopt_hash = {
:Chicago=>"http://www.pawschicago.org/",
:NYC=>"http://www.humanesocietyny.org/adoptions/",
:Boston=>"http://www.arlboston.org/",
:Austin=>"https://www.austinpetsalive.org/",
:Miami=>"http://www.miamidade.gov/animals/adopt-a-pet.asp",
:LA=>"http://www.laan... | 51.48 | 119 | 0.693862 |
38d9b8421485810496a19e0e0534c98eab2c2e0d | 3,415 | # Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::BotService::Mgmt::V2017_12_01_preview
module Models
#
# The parameters to provide for the Facebook channel.
#
class FacebookChannelProperties
... | 29.95614 | 78 | 0.487555 |
4a56c8be616a9cec39455659653fc8436bd9cbfd | 504 | Gem::Specification.new do |s|
s.name = 'rack-ssl'
s.version = '1.3.2'
s.date = '2011-03-24'
s.homepage = "https://github.com/josh/rack-ssl"
s.summary = "Force SSL/TLS in your app."
s.description = <<-EOS
Rack middleware to force SSL/TLS.
EOS
s.files = [
'lib/rack/ssl.rb',
... | 21 | 52 | 0.563492 |
267526a4de2e09b3d9aed9b06e2eee61bee68c66 | 121 | require 'test_helper'
class RecursoTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
| 15.125 | 43 | 0.702479 |
182026b6043c44ab78fe1afa4468342773fce4ee | 4,063 | require "stringio"
describe Fastlane::Actions do
describe "#podspechelper" do
before do
@version_podspec_file = Fastlane::Helper::PodspecHelper.new
end
it "raises an exception when an incorrect path is given" do
expect do
Fastlane::Helper::PodspecHelper.new('invalid_podspec')
e... | 46.170455 | 87 | 0.668225 |
bba33ca22ce982f0a7e9fea29a05bb44f1732c71 | 149 | class AddUserRefToInstruments < ActiveRecord::Migration
def change
add_reference :instruments, :user, index: true, foreign_key: true
end
end
| 24.833333 | 69 | 0.778523 |
5d94c6bd919b83c6188f8c9c46e6b56e4f40260d | 434 | module Gerry
class Client
module Changes
# Get changes visible to the caller.
#
# @param [Array] options the query parameters.
# @return [Hash] the changes.
def changes(options = [])
url = '/changes/'
if options.empty?
return get(url)
end
... | 21.7 | 52 | 0.516129 |
b9d159bcd027347c097ea6546a658c785a0a7d5d | 2,686 | # frozen_string_literal: true
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
# movies = Movie.create([{ name: 'Star Wars' }, { name:... | 23.561404 | 111 | 0.600894 |
03482f80c748f3438223044db58fbb0ffb9a0506 | 328 | class Specinfra::Command::Freebsd::Base::Service < Specinfra::Command::Base::Service
class << self
def check_is_enabled(service, level=3)
"service #{escape(service)} enabled"
end
def check_is_running_under_init(service)
"service #{escape(service)} status | grep -E 'as (pid [0-9]+)'"
end
... | 29.818182 | 84 | 0.67378 |
39602dcd1c15827923832bd4e41264ca4ad3439d | 1,417 | control "PHTN-10-000019" do
title "The Photon operating system must allow only the ISSM (or individuals
or roles appointed by the ISSM) to select which auditable events are to be
audited."
desc "Without the capability to restrict which roles and individuals can
select which events are audited, unauthorized personn... | 36.333333 | 82 | 0.736768 |
79fd5816ea9bf9bc48b8d6bc7b1ecae5f39d17f5 | 213 | require 'social_net/facebook/config'
require 'social_net/facebook/models'
require 'social_net/facebook/errors'
module SocialNet
module Facebook
extend Config
include Errors
include Models
end
end
| 17.75 | 36 | 0.779343 |
abf532b910b7e7eff6981d2487a48570bc2d1a1c | 171 | http_path = "/"
sass_dir = "assets/sass"
css_dir = "assets/css"
images_dir = "assets/images"
javascripts_dir = "assets/js"
relative_assets = true
output_style = :expanded | 21.375 | 29 | 0.74269 |
79f1b49e5d55a3673f61f39d8db52315baf77721 | 8,686 | class Certbot < Formula
include Language::Python::Virtualenv
desc "Tool to obtain certs from Let's Encrypt and autoenable HTTPS"
homepage "https://certbot.eff.org/"
url "https://files.pythonhosted.org/packages/e4/9a/affc25d8d52e2977bd58dc79b6825a62a0d4c315048cb4c5144dcd71371a/certbot-1.19.0.tar.gz"
sha256 "0... | 48.255556 | 148 | 0.812457 |
1ca87acf12c60124a40eed7a7aea10e423f77b0c | 491 | Rails::Generator::Commands::Create.class_eval do
def rake_db_migrate
logger.rake "db:migrate"
unless system("rake db:migrate")
logger.rake "db:migrate failed. Rolling back"
command(:destroy).invoke!
end
end
end
Rails::Generator::Commands::Destroy.class_eval do
def rake_db_migrate
logg... | 21.347826 | 51 | 0.718941 |
395eab6fe36a338922329e6a4faafdb7769f0697 | 48 | module RackspaceCloudDns
VERSION = "0.2.0"
end | 16 | 24 | 0.75 |
03fca3eb974e7aa831c0abbf2d052b627a3d5c15 | 1,862 | require 'open3'
require 'slop'
require 'nokogiri'
require 'monitor'
require 'httpclient'
require 'hashie'
require 'json'
require 'active_support/all'
require 'rexml/document'
require 'rexml/formatters/pretty'
require_relative 'property_tagger/version'
require_relative 'property_tagger/cli'
require_relative 'property_... | 21.905882 | 78 | 0.643931 |
7aa1b270c53d1ab2ce8a9bd677644c78d50b9664 | 492 | require 'spec_helper'
describe Icalendar::Todo do
describe '#dtstart' do
it 'is not normally required' do
subject.dtstart = nil
expect(subject).to be_valid
end
context 'with duration set' do
before(:each) { subject.duration = 'PT15M' }
it 'is invalid if not set' do
expe... | 19.68 | 50 | 0.623984 |
08da8ae8faa4a26bc7de881b79b1d46975293040 | 1,292 | Gem::Specification.new do |s|
s.name = 'logstash-codec-rubydebug'
s.version = '3.0.3'
s.licenses = ['Apache License (2.0)']
s.summary = "The rubydebug codec will output your Logstash event data using the Ruby Awesome Print library."
s.description = "This gem is a Logstas... | 43.066667 | 205 | 0.657121 |
d59c512a2bbafe135acdea7b7e394a781ca95e19 | 152 | # encoding: utf-8
module Backup
module Configuration
module Encryptor
class Base < Backup::Configuration::Base
end
end
end
end
| 13.818182 | 46 | 0.671053 |
1af93845f1639e5f1ddf8a6ff144f3f2cb0f1f37 | 815 | # encoding: utf-8
Gem::Specification.new do |spec|
spec.add_dependency 'delayed_job', ['>= 3.0', '< 5']
spec.add_dependency 'mongoid', ['>= 3.0', '< 7']
spec.add_dependency 'mongoid-compatibility', '>= 0.4.0'
spec.authors = ['Chris Gaffney', 'Brandon Keepers', 'Erik Michaels-Ober']
spec.email ... | 47.941176 | 127 | 0.633129 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.