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 |
|---|---|---|---|---|---|
212fb3425c3cb6d7930c763b2b9bde3919b3035e | 464 | FactoryBot.define do
factory :image, :class => ::Refinery::Image do
image { Refinery.roots('refinery/images').join("spec/fixtures/beach.jpeg") }
end
factory :alternate_image, :class => ::Refinery::Image do
image { Refinery.roots('refinery/images').join("spec/fixtures/beach-alternate.jpeg") }
end
fac... | 33.142857 | 90 | 0.700431 |
036c1755717fcc3a851a6e7464de531d4f67a689 | 955 | cask "hook" do
version "3.2.1,2021.08"
sha256 "f5aee8d4ae6d2c1279f249b2d18656c96b91de3a2c1c5a8fe557554e1bf9aee1"
url "https://hookproductivity.com/wp-content/uploads/#{version.after_comma.major}/#{version.after_comma.minor}/Hook-productivity-app-#{version.before_comma}.dmg_.zip",
user_agent: :fake
name "... | 29.84375 | 169 | 0.671204 |
62b561bdd15b58079c319d11596f19190cc4c030 | 787 | class Flickr
class Person < Object
class_api_method :find_by_email, "flickr.people.findByEmail"
class_api_method :find_by_username, "flickr.people.findByUsername"
class_api_method :get_upload_status, "flickr.people.getUploadStatus"
instance_api_method :get_info!, "flickr.pe... | 52.466667 | 97 | 0.701398 |
215794420536ceb0aaf19315618ba255c662e011 | 1,136 | require File.expand_path('../boot', __FILE__)
require "rails"
%w(
action_controller
action_mailer
sprockets
).each do |framework|
begin
require "#{framework}/railtie"
rescue LoadError
end
end
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :product... | 31.555556 | 99 | 0.720951 |
0382b2e0ea0e179fd326e82e282d6ba2177a6feb | 3,071 | require 'stringio'
require "test_helper"
require "io_test_helpers"
class MessagesTest < Minitest::Test
include IoTestHelpers
def setup
@cli = Minesweeper::Messages
end
def test_that_the_welcome_method_welcomes_the_user
message = @cli.welcome
string = "\n===========================================... | 40.946667 | 300 | 0.754803 |
6a12878f51fa10aa1988bb8f9fef808fd9ca7f7a | 2,622 | # Each team has a build-defaults file that specifies local infrastructure targets
# for things like builders, target locations for build artifacts, etc Since much
# of these don't change, one file can be maintained for the team. Each project
# also has a data file for information specific to it. If the project builds
... | 42.983607 | 131 | 0.696415 |
287c4d7780eedfefb6400cf46bf59601dc46b81a | 1,224 | Pod::Spec.new do |s|
s.name = 'Stripe'
s.version = '21.6.0'
s.summary = 'Stripe is a web-based API for accepting payments online.'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.homepage ... | 58.285714 | 115 | 0.493464 |
33e6ea6000dce87035d3941bc98199cf814afecd | 3,126 | require_relative 'spec_helper'
describe Release do
let(:git) do
g = double('git')
allow(g).to receive(:no_prompt=)
g
end
levels = %w(major minor patch)
levels.each do |l|
send(:let, l.to_sym) do
m = double(l)
allow(m).to receive("#{l}?".to_sym).and_return true
(levels - [l]).... | 32.226804 | 94 | 0.62508 |
ff30be7d73377530a51aaa4a6c5b7d79bc86056f | 1,992 | class UsersController < ApplicationController
get '/create_account' do
if logged_in?
redirect to "/ask_the_eightball"
else
erb :'users/create_account'
end
end
post '/create_account' do
# binding.pry #check that I have created a ... | 29.731343 | 111 | 0.529116 |
bbd08add7a36f67a860fe358b2284cc8afd5be7d | 542 | Pod::Spec.new do |spec|
spec.name = 'KHTabBar'
spec.platform = :ios, '10.0'
spec.version = '1.0.0'
spec.homepage = 'https://github.com/yeungkaho/KHTabBar'
spec.authors = { 'Kaho Yeung' => 'ykh.dev@gmail.com' }
spec.summary = 'A custom tab bar for iOS that supports image sequence ... | 33.875 | 93 | 0.632841 |
285e2ea648b42be267504582a269a3d155ffa313 | 7,227 | module Square
# CustomerGroupsApi
class CustomerGroupsApi < BaseApi
def initialize(config, http_call_back: nil)
super(config, http_call_back: http_call_back)
end
# Retrieves the list of customer groups of a business.
# @param [String] cursor Optional parameter: A pagination cursor returned by... | 35.955224 | 80 | 0.66639 |
ac4c13ff3df2d15fead2b0b236002cec3bff499e | 1,105 | # 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... | 40.925926 | 86 | 0.744796 |
79fa7bf89cc66e028d5f4471d4f89aa46f16eebe | 2,883 | require 'action_dispatch/http/parameter_filter'
module ActionDispatch
module Http
# Allows you to specify sensitive parameters which will be replaced from
# the request log by looking in the query string of the request and all
# sub-hashes of the params hash to filter. Filtering only certain sub-keys
... | 34.73494 | 90 | 0.642733 |
0852dda6b299eff63de0e5249226c7c374b0fec5 | 1,306 | FactoryGirl.define do
factory :environment, class: Environment do
sequence(:name) { |n| "environment#{n}" }
project factory: :empty_project
sequence(:external_url) { |n| "https://env#{n}.example.gitlab.com" }
trait :with_review_app do |environment|
project
transient do
ref 'mast... | 35.297297 | 80 | 0.600306 |
1d280b055d9562bc9e20ca6eb42ab93a0a6d8f0f | 17,373 | # This is the primary location for defining spree preferences
#
# The expectation is that this is created once and stored in
# the spree environment
#
# setters:
# a.color = :blue
# a[:color] = :blue
# a.set :color = :blue
# a.preferred_color = :blue
#
# getters:
# a.color
# a[:color]
# a.get :color
# a.preferred_color... | 46.451872 | 181 | 0.723997 |
91f25a2e3a7ed3043b069cd8a68f1051469adfe6 | 2,572 | # frozen_string_literal: true
lib = File.expand_path('lib', __dir__)
$:.unshift lib unless $:.include?(lib)
require 'capybara/version'
Gem::Specification.new do |s|
s.name = 'capybara'
s.version = Capybara::VERSION
s.required_ruby_version = '>= 2.3.0'
s.license = 'MIT'
s.authors = ['Thomas Walpole', 'Jona... | 40.825397 | 146 | 0.712675 |
e869eb2857b3ed4943315e160bde81ad9f096374 | 987 | class Libnet < Formula
desc "C library for creating IP packets"
homepage "https://github.com/sam-github/libnet"
url "https://github.com/libnet/libnet/releases/download/v1.2/libnet-1.2.tar.gz"
sha256 "caa4868157d9e5f32e9c7eac9461efeff30cb28357f7f6bf07e73933fb4edaa7"
license "BSD-2-Clause"
bottle do
cell... | 39.48 | 94 | 0.765957 |
f76f33067b78b4da4865b9d3bebeab8359a6fae6 | 1,679 | # frozen_string_literal: true
require "cli/parser"
module Homebrew
module_function
def services_args
Homebrew::CLI::Parser.new do
usage_banner <<~EOS
`services` <subcommand>
Manage background services with macOS' `launchctl`(1) daemon manager.
If `sudo` is passed, operate on `... | 32.921569 | 123 | 0.631328 |
aba93f510ae4b23b17341950fd87c51cad1bdfb1 | 1,766 | module ZipkinTracer
class TracerFactory
def tracer(config)
adapter = config.adapter
tracer = case adapter
when :json
require 'zipkin-tracer/zipkin_http_sender'
options = { json_api_host: config.json_api_host, logger: config.logger }
Trace::ZipkinHttpSender.new(op... | 34.627451 | 82 | 0.631937 |
79e3eceea57a7cce597a475676439c5cb4fb1c75 | 3,279 | require_relative 'spec_helper'
require 'rugged'
#TODO rugged stuff should be refactored out into an external mushin-ext to be used with others as well.
#TODO developing exts is like developing methods, first you put all one place then refactor out based on common sense.
describe "Gitlapse" do
before do
#`rm -rf ... | 39.506024 | 140 | 0.700213 |
6a942bfa6369b9dde52f2a7aba69050262d3a279 | 34,337 | require "time"
class Time
class << self
unless respond_to?(:w3cdtf)
def w3cdtf(date)
if /\A\s*
(-?\d+)-(\d\d)-(\d\d)
(?:T
(\d\d):(\d\d)(?::(\d\d))?
(\.\d+)?
(Z|[+-]\d\d:\d\d)?)?
\s*\z/ix =~ date and (($5 and $8) or (!$5 and !$8... | 25.567386 | 87 | 0.570755 |
7ab41b25bbe426530868eb65579b96665bf9859f | 10,393 | #
# Copyright 2014 Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 34.07541 | 110 | 0.620225 |
bf9adf716a991ee8eebfba5ef04077e682bc5108 | 406 | class Favicon < ApplicationRecord
default_scope { select(*(Favicon.column_names - ["favicon"])) }
validates :url, presence: true
def data
self[:data] || {}
end
def cdn_url
@cdn_url ||= begin
if url
uri = URI(url)
if ENV["FAVICON_HOST"]
uri.host = ENV["FAVICON_HOST"]
... | 17.652174 | 65 | 0.559113 |
7a08162508792033f6638e59c9bee23702240396 | 912 | require File.join(File.dirname(__FILE__), *%w[spec_helper])
shared_examples_for "non-empty Stack" do
it { @stack.should_not be_empty }
it "should return the top item when sent #peek" do
@stack.peek.should == @last_item_added
end
it "should NOT remove the top item when sent #peek" do
@stack.peek.sh... | 24 | 59 | 0.6875 |
4ab44ccee32a6c0194a58b153b769359dcf42523 | 657 | #
# Below is an example of the Template Method design pattern.
#
# Examples: Trailblazer Operations (process), Sidekiq (perform)
#
class Animal
def describe
say_species
make_sound
end
def say_species
raise NotImplementedError, "Implement say_species"
end
def make_sound
raise NotImplement... | 13.978723 | 63 | 0.70624 |
e8cb0fea216827a30c371f0ab362f16ff421e0eb | 1,498 | require 'spec_helper'
describe 'path helpers' do
before do
@user = FactoryGirl.create(:user, :admin => true)
@mission = FactoryGirl.create(:mission, :name => 'Foo')
login(@user)
end
context 'in basic mode' do
before do
get('/en/route-tests')
end
it 'should be correct' do
exp... | 19.205128 | 66 | 0.513351 |
2608705d15081c5d3cb76e106ad71c55fcf6408b | 564 | # frozen_string_literal: true
class PassThePopcorn
class CookieParser < SimpleDelegator
attr_reader :cookie
private
CFDUID_KEY = /__cfduid=[^;]*/.freeze
SESSION_KEY = /session=[^;]*/.freeze
private_constant :CFDUID_KEY, :SESSION_KEY
attr_reader :cfduid, :session
attr_writer :cfduid, :... | 22.56 | 53 | 0.679078 |
62488465c24acfff9173863f68efa839a9202a20 | 2,079 | # frozen_string_literal: true
class ClusterablePresenter < Gitlab::View::Presenter::Delegated
presents :clusterable
def self.fabricate(clusterable, **attributes)
presenter_class = "#{clusterable.class.name}ClusterablePresenter".constantize
attributes_with_presenter_class = attributes.merge(presenter_class... | 23.1 | 88 | 0.763348 |
1c46ab71f258033fc23b11a190623235525730dd | 24,558 | require File.dirname(__FILE__) + '/../../spec_helper'
# assert_select plugins for Rails
#
# Copyright (c) 2006 Assaf Arkin, under Creative Commons Attribution and/or MIT License
# Developed for http://co.mments.com
# Code and documention: http://labnotes.org
class AssertSelectController < ActionController::Ba... | 30.468983 | 123 | 0.602655 |
216f914c5d0ab8dd1ebb386fd2681b57b6c852f2 | 2,948 | # frozen_string_literal: true
require 'rake_helper'
describe 'gitlab:container_registry namespace rake tasks' do
let_it_be(:application_settings) { Gitlab::CurrentSettings }
before :all do
Rake.application.rake_require 'tasks/gitlab/container_registry'
end
describe 'configure' do
before do
stu... | 33.5 | 92 | 0.712687 |
e253fe089402df731d0d61da900122010e3ac92b | 90 | module Nesta
module Theme
module Lisezmoi
VERSION = "0.0.1"
end
end
end
| 11.25 | 23 | 0.611111 |
3917a4bf4e1a33e3b1d04d4880fabc6e20e892f4 | 5,294 | # 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::Network::Mgmt::V2019_02_01
module Models
#
# Service End point policy resource.
#
class ServiceEndpointPolicy < Resource
... | 31.891566 | 84 | 0.452966 |
7ae8393edf788bdd418304167ce2699568d92265 | 363 | # Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
ActiveSupport::Inflector.inflections do |inflect|
#inflect.plural /^(ox)$/i, '\1en'
#inflect.singular /^(ox)en/i, '\1'
#inflect.irregular 'person', 'peop... | 33 | 59 | 0.721763 |
ab9daf4f7a1c57cd966b4b1121975f874fe7c6ec | 699 | module Api
module V1
module Internals
class ApplicationController < ActionController::Base
respond_to :json
layout false
before_action :require_token
def require_token
authenticate_token || render_unauthorized("Access denied")
end
protected
... | 23.3 | 71 | 0.610873 |
388397b844ed15d7933b7c0883355a114d2e29ff | 151 | module DataAggregation::Index::Controls
module SourceEvent
module Attribute
def self.data
'some value'
end
end
end
end
| 15.1 | 39 | 0.649007 |
62f63dcb65354e96192627fb762f559c8175978e | 963 | #
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint CJMonitorFlutter.podspec' to validate before publishing.
#
Pod::Spec.new do |s|
s.name = 'CJMonitorFlutter'
s.version = '0.0.1'
s.summary = 'A new flutter plugin project.'
s.d... | 38.52 | 104 | 0.600208 |
62048b91aac5aaacf2a3722352fc9751a91827cc | 215 | ## require all gems that we will use
require 'pry'
require 'net/http'
require 'json'
## requires all files that we will use
require_relative "./lib/api"
require_relative "./lib/cli"
require_relative "./lib/makeup"
| 21.5 | 38 | 0.744186 |
e2d98e382f7b0d6be69a04660787a9b8fd153ad2 | 947 | require "rails/generators"
module Services
module Generators
class NewGenerator < Rails::Generators::Base
source_root File.expand_path("../templates", __dir__)
argument :service_name, type: :string
argument :service_args, type: :array, default: []
desc "Creates a new Service Object and ... | 24.282051 | 78 | 0.572334 |
210dff407bfda068ee88c68585f08bee8c2ca06a | 1,546 | # frozen_string_literal: true
class DeviseCreateUsers < ActiveRecord::Migration[5.2]
def change
create_table :users do |t|
## Database authenticatable
t.string :username, null: false, default: ""
t.string :fullname, null: true, default: ""
t.string :email, null: false, default: "... | 32.208333 | 104 | 0.644243 |
abad3c306fb55402fbe594f24512d6e0c57418d5 | 7,118 | # Copyright © 2011-2019 MUSC Foundation for Research Development
# All rights reserved.
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice, this list... | 38.064171 | 151 | 0.69528 |
1828c0f58fe1248c0a1d00a1511529b4bfc09cc5 | 7,257 | ##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Post
include Msf::Auxiliary::Cisco
include Msf::Exploit::Deprecated
moved_from 'post/cisco/gather/enum_cisco'
def initialize(info = {})
sup... | 30.2375 | 100 | 0.546782 |
ac85d83af951f7fc00b2b9dcd0a6d3a90592f60d | 3,257 | #-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2018 the OpenProject Foundation (OPF)
#
# 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 of ... | 31.317308 | 91 | 0.621431 |
01de011a58b040076ab9daa28191b1a3d64036e9 | 7,775 | require 'chef/provider/lwrp_base'
require_relative 'helpers'
class Chef
class Provider
class MysqlService < Chef::Provider::LWRPBase
# Chef 11 LWRP DSL Methods
use_inline_resources if defined?(use_inline_resources)
def whyrun_supported?
true
end
# Mix in helpers from libra... | 30.853175 | 107 | 0.563087 |
e9637218c60a91e33a8b55b0679b63e4d33e7312 | 111 | class AddNameToReport < ActiveRecord::Migration
def change
add_column :reports, :name, :string
end
end
| 18.5 | 47 | 0.747748 |
f8edae5683c07b45ee8658433b0e12ba973431bb | 6,253 |
#
# Rainbow color name definitions (RGB 0 - 255).
# Set two is from dark purple > blue > green > red > maroon.
#
module RainbowTwoColors
RAINBOW_TWO = { 'palette_name' => 'Rainbow Two', 'palette_count' => 160,
'R2-1' => [64, 0, 64], #400040
'R2-2' => [60, 0, 76], #3C004C
'R2-3' => [56, 0, 88], #... | 34.932961 | 75 | 0.452583 |
61f1d41f5523d84e83fde1466d9d30da89fb58d5 | 401 | cask :v1 => 'font-uncial-antiqua' do
version '1.000'
sha256 '33a5128b59d1c95d4f3788164f4ab3a1196f0a982263cb2cd278c47418366766'
url 'https://googlefontdirectory.googlecode.com/hg-history/67342bc472599b4c32201ee4a002fe59a6447a42/ofl/uncialantiqua/UncialAntiqua-Regular.ttf'
homepage 'http://www.google.com/fonts/s... | 36.454545 | 146 | 0.812968 |
aca5fbe63413bce2479f9d69914cfd5b4aac6b74 | 157 | #! /usr/bin/env ruby
require 'webrick'
server = WEBrick::HTTPServer.new :Port => 3000, :DocumentRoot => Dir.pwd
trap('INT') { server.shutdown }
server.start
| 26.166667 | 72 | 0.707006 |
7a6f180e4bfc8bcef7fd2dfd3a0b2c1e77c8a434 | 932 | require 'doorbell'
require 'simplecov'
require 'active_support/all'
require 'minitest/autorun'
require 'minitest/reporters'
reporter_options = { color: true }
Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(reporter_options)]
SimpleCov.start
# Filter out Minitest backtrace while allowing backtrace... | 24.526316 | 85 | 0.790773 |
398cc29487b50355ed3cc334ac93e51f0d47485e | 4,208 | module Battle
# Module responsive of handling all move animation
#
# All animation will have the following values in their resolver:
# - :visual => Battle::Visual object
# - :user => BattleUI::PokemonSprite of the user of the move
# - :target => BattleUI::PokemonSprite of the target of the move (first... | 48.367816 | 132 | 0.720057 |
acdb204c6ec8953cc96ffa432aede5422e935ddf | 28,865 | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 54.668561 | 152 | 0.663364 |
3381c4ead3cac911e360160b407a3cf86adbb5f0 | 1,959 | require "spec_helper"
describe YARD::Virtus::CodeObjects::AttributeWriter do
before :each do
# All YARD::CodeObjects::* objects are added to
# registry on creation which causes conflicts in
# this test.
YARD::Registry.clear
end
subject { described_class.new(:title, "String") }
it "has #attr_n... | 25.776316 | 85 | 0.654926 |
4aa8407e5183efe770046a1b14f178a53ef56d6e | 412 | require 'reindeer'
describe 'Reindeer construction' do
it 'should call all build methods' do
class FifteenthOne < Reindeer
def build(args)
things << :super
end
end
class SixteenthOne < FifteenthOne
has :things, default: []
def build(args)
things << :neat
end
... | 19.619048 | 45 | 0.614078 |
798d54217191a1f2035184ae3c0578b2baa0925a | 767 | require_relative '../db/db_connector'
class Users
attr_accessor :id, :username, :email, :bio
def initialize(params)
@id = params[:id]
@username = params[:username]
@email = params[:email]
@bio = params[:bio]
end
# create new account
def register
client = create_db_client
return fals... | 21.305556 | 114 | 0.595828 |
21073fb42b781760cfcdbce43d48e4994486bd8a | 1,139 | class Sickle < Formula
desc "Windowed adaptive trimming for FASTQ files using quality"
homepage "https://github.com/najoshi/sickle"
url "https://github.com/najoshi/sickle/archive/v1.33.tar.gz"
sha256 "eab271d25dc799e2ce67c25626128f8f8ed65e3cd68e799479bba20964624734"
bottle do
cellar :any_skip_relocation
... | 36.741935 | 93 | 0.774363 |
61a78572d069ac2be956f3782175bc1608a7894a | 4,008 | class PaymentType < ActiveRecord::Base
belongs_to :payment_type, :class_name => 'PaymentType', :foreign_key => :payment_type_id
belongs_to :atlanta_operator, :class_name => 'AtlantaOperator', :foreign_key => :atlanta_operator_id
belongs_to :atlanta_group, :class_name => 'AtlantaGroup', :foreign_key => :atlanta_gr... | 69.103448 | 106 | 0.788174 |
18565034bb07c76009e49029b8b0b08d5a258980 | 982 | #!/usr/bin/env ruby
# Test Cases for the Billing core extension.
# ./lib/extension.rb
#
# Written by: jdw <4 July 2014>
#
# ********************************************
require "test/unit"
require_relative "../lib/lewt.rb"
class TestLewt < Test::Unit::TestCase
def test_initialize
lewt = LEWT::Lewt.new( { :tar... | 25.842105 | 138 | 0.653768 |
e8b1264a6843ddbcaf8e37264ff9c20e925c75e3 | 9,876 | require 'octokit'
require 'singleton'
require 'bot_builder'
require 'ostruct'
class BotGithub
attr_accessor :client, :bot_builder, :github_repo, :scheme
def initialize(client, bot_builder, github_repo, scheme)
self.client = client
self.bot_builder = bot_builder
self.github_repo = github_repo
self.... | 33.364865 | 172 | 0.667072 |
28e67550273e1048388e31868b14ad17c7d26986 | 9,586 | # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either lic... | 41.497835 | 245 | 0.695911 |
acc1496532c1ff83a6eb9a32a16835301f606d66 | 458 | # frozen_string_literal: true
module Faker
module JapaneseMedia
class SwordArtOnline < Base
class << self
def real_name
fetch('sword_art_online.real_name')
end
def game_name
fetch('sword_art_online.game_name')
end
def location
fetch('s... | 17.615385 | 45 | 0.582969 |
1decce59d9cc76ddc6925e0235d8236811a1c89b | 78 | # frozen_string_literal: true
module Timezone
VERSION = '1.3.6'.freeze
end
| 13 | 29 | 0.74359 |
bb3301ff7056e1e4cd03b10b4e18c4d0b907260a | 43 | module Cbc
VERSION = "0.3.18".freeze
end
| 10.75 | 27 | 0.674419 |
bf4e83c395b43159eb5c30d33fdd12dd33843a73 | 174 | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'simplecov'
SimpleCov.start
require 'pluck_all'
require 'minitest/autorun'
| 19.333333 | 58 | 0.775862 |
ffeaf1075f3fffd867cd736df565db6040adb765 | 1,135 | # frozen_string_literal: true
require 'spec_helper'
RSpec.describe JiraConnect::OauthApplicationIdsController do
describe 'GET /-/jira_connect/oauth_application_id' do
before do
stub_application_setting(jira_connect_application_key: '123456')
end
it 'renders the jira connect application id' do
... | 26.395349 | 70 | 0.707489 |
18ea634abe67df6c4a222fb73d0e5db921d39295 | 1,896 | #
# Be sure to run `pod lib lint ChatBotTest.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 = 'ChatBot... | 41.217391 | 195 | 0.681962 |
39a6c20b68ed8153174f54753492e57168bfdeb1 | 2,209 | module RunLoop
# @!visibility private
#
# This class is required for the XTC.
class Logging
def self.log_info(logger, message)
log_level :info, logger, message
end
def self.log_debug(logger, message)
log_level :debug, logger, message
end
def self.log_header(logger, message)
... | 19.723214 | 79 | 0.607515 |
03734ff51163b19407883e5ce73264fb35d377d4 | 449 | module BlockSpecs
class Yield
def splat(*args)
yield *args
end
def two_args
yield 1, 2
end
def two_arg_array
yield [1, 2]
end
def yield_splat_inside_block
[1, 2].send(:each_with_index) {|*args| yield(*args)}
end
end
end
# def block_spec_method(*arg... | 13.606061 | 58 | 0.5902 |
3826855d6769e32edbd7df0d11708718101fe9a5 | 545 | # frozen_string_literal: true
class Invite < ApplicationRecord
include PagesCore::HasRoles
belongs_to :user
has_many :roles, class_name: "InviteRole", dependent: :destroy
before_validation :ensure_token
validates :user_id, presence: true
validates :email,
presence: true,
format:... | 20.961538 | 76 | 0.647706 |
796be017f85f519311b8c6c9db178f67983934ab | 238 | require 'spec_helper'
describe Fastlane::Plugin::Deploygate do
it 'has a version number' do
expect(Fastlane::Plugin::Deploygate::VERSION).not_to be nil
end
it 'does something useful' do
expect(false).to eq(true)
end
end
| 19.833333 | 63 | 0.722689 |
bf60522f7a195b45b4af1e2f2e7eb78ebe5c2de5 | 1,860 | # -*- encoding: utf-8 -*-
# stub: jekyll-theme-leap-day 0.1.1 ruby lib
Gem::Specification.new do |s|
s.name = "jekyll-theme-leap-day".freeze
s.version = "0.1.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.require_paths = ["lib".freeze]
s.a... | 42.272727 | 112 | 0.648925 |
6aed61116c7546403119b31230fb3b109717f94a | 108 | $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
require "testoscope"
require "minitest/autorun"
| 21.6 | 58 | 0.75 |
1dbbfa17d4a7a9e1bac4ad70e2807cad1de7deef | 23 | module BonusHelper
end
| 7.666667 | 18 | 0.869565 |
f7e833c369ff7188151b85c9acb064f4696f4f6d | 942 | =begin
{ "__metadata"=> {
"uri"=>"http://odata.fdic.gov:80/v1/financial-institution/Branch('10345')",
"type"=>"financial-institutionModel.Branch"
},
"id"=>"10345",
"branchName"=>"First National Bank Alaska",
"certNumber"=>"16130",
"address"=>"101 W. 36th Avenue",
"city"=>"Anchorage",
"county"=>"... | 22.428571 | 79 | 0.626327 |
ac634fec01e378249d0ccd4d0c660795c2039da0 | 2,952 | module Ddr::Batch
class MonitorBatchFinished
class << self
def call(*args)
event = ActiveSupport::Notifications::Event.new(*args)
batch = Ddr::Batch::Batch.find(event.payload[:batch_id])
batch_finished(batch)
if batch.outcome == Ddr::Batch::Batch::OUTCOME_SUCCESS
A... | 33.545455 | 118 | 0.626016 |
ab33ac748c9b3cb89d7e4c2c6cfddc1e9797bf76 | 642 | # frozen_string_literal: true
module QA
RSpec.describe 'Create' do
describe 'Merge request creation from fork' do
let(:merge_request) do
Resource::MergeRequestFromFork.fabricate_via_api! do |merge_request|
merge_request.fork_branch = 'feature-branch'
end
end
it 'can m... | 26.75 | 133 | 0.676012 |
7aefc8e97276df94a87d06026f03976b3699b235 | 771 | module Flutterwave
class BIN
include Flutterwave::Helpers
attr_accessor :client, :options
def initialize(client)
@client = client
end
# https://www.flutterwave.com/documentation/compliance/ - Verify Card BIN API
def check(options = {})
@options = options
request_params = {... | 21.416667 | 81 | 0.632944 |
629ebba4d29eaa7472175dfd03e355862b7a3d42 | 967 | class Mash < ApplicationRecord
def self.default_sources
'the-new-york-times,bbc-news,the-economist,the-washington-post,the-wall-street-journal,fox-news,al-jazeera-english,politico,rt,reuters,associated-press,cnn,msnbc'
end
def self.filter_text(text)
# Filter out news source names and other extra text
... | 30.21875 | 166 | 0.584281 |
e24f7f6ab0eca7b87219007590b0bd97d2cf97b4 | 646 | Pod::Spec.new do |spec|
spec.name = "STFloatView"
spec.version = "1.0.0"
spec.summary = "A category file of UIViewController."
spec.description = <<-DESC
A easy way to add a floatView to your ViewController.
DESC
spec.homepage = "https://github.com/Shawnli1201"... | 35.888889 | 109 | 0.592879 |
2155230e741d8d20a6e7a7b81c7dadd8d33ab00e | 2,802 | require 'spec_helper'
describe 'default installation' do
cached(:chef_run) do
runner = ChefSpec::SoloRunner.new(platform: 'debian', version: '9')
runner.converge 'nrpe::default'
end
# things that shouldn't be there
it 'expects nrpe config to not have allow_bash_command_substitution' do
expect(che... | 35.923077 | 113 | 0.745539 |
1ad62cd27394ddab2424a7f0250d54c688a42255 | 7,650 | module RedCloth::Formatters::HTML
include RedCloth::Formatters::Base
[:h1, :h2, :h3, :h4, :h5, :h6, :p, :pre, :div].each do |m|
define_method(m) do |opts|
"<#{m}#{pba(opts)}>#{opts[:text]}</#{m}>\n"
end
end
[:strong, :code, :em, :i, :b, :ins, :sup, :sub, :span, :cite].each do |m|
define_... | 20.619946 | 118 | 0.491765 |
e9be7d2b4b8730c94d1486ad8565ead68d3efd29 | 1,634 | class Admin::PlansController < ApplicationController
def index # rubocop:disable Metrics/AbcSize
authorize :plan
respond_to do |format|
format.html do
@q = Plan.order(updated_at: :desc).ransack(params[:q])
@plans = @q.result(distinct: true).includes(:user, activities: :tags).page(params... | 29.709091 | 116 | 0.647491 |
6267f8493676893ce25fdf7abceb8015aa001a98 | 26 | module MyPhotosHelper
end
| 8.666667 | 21 | 0.884615 |
ff2d6fdd5013fe9d3ef5000185404083148610e5 | 279 | class CreateAttributionHoldings < ActiveRecord::Migration[5.1]
def change
create_table :attribution_holdings do |t|
t.integer :company_id
t.integer :day_id
t.float :performance
t.float :contribution
t.timestamps null: false
end
end
end
| 21.461538 | 62 | 0.691756 |
08e69ed1c98e8b87782e3ca88813c38d1730ca70 | 82 | # frozen_string_literal: true
object @question
extends 'api/v4/questions/_show'
| 13.666667 | 32 | 0.792683 |
389df7bd69bfed4998e21c47f472efe3a4b9a95d | 339 | cask 'ntfsmounter' do
version '0.4'
sha256 'bfb8cfe17518513f8784f1a0389af8716b1ce319cc516cfc188de6226bbbbb4e'
url "http://ntfsmounter.com/NTFS%20Mounter%20#{version}.dmg.zip"
name 'NTFS Mounter'
homepage 'http://ntfsmounter.com/'
license :gratis
container nested: "NTFS Mounter #{version}.dmg"
app 'nt... | 24.214286 | 75 | 0.752212 |
bf08b28ec0730140aebe5909a79e6f54fb523824 | 936 | require_relative '../resource_property'
module Convection
module Model
class Template
class ResourceProperty
# Represents an {http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-network-iface-embedded.html
# EC2 NetworkInterface Embedded Property Type}
c... | 39 | 133 | 0.709402 |
61acac9cbcbfbe869e039fd32ddf35ab134d98b8 | 4,592 | require 'faraday'
require 'addressable/template'
module Sawyer
class Agent
NO_BODY = Set.new([:get, :head])
attr_accessor :links_parser
attr_accessor :allow_undefined_methods
class << self
attr_writer :serializer
end
def self.serializer
@serializer ||= Serializer.any_json
e... | 28 | 89 | 0.589721 |
b9f5023e0201cab31d2b6a22e7482dffff284047 | 1,683 | class Whatmask < Formula
desc "Network settings helper"
homepage "http://www.laffeycomputer.com/whatmask.html"
url "https://web.archive.org/web/20170107110521/downloads.laffeycomputer.com/current_builds/whatmask/whatmask-1.2.tar.gz"
sha256 "7dca0389e22e90ec1b1c199a29838803a1ae9ab34c086a926379b79edb069d89"
lic... | 37.4 | 123 | 0.613191 |
1cca76d8272a036d99f679079ca1f9e2ef59fa03 | 1,298 | require 'spec_helper'
describe Elasticsearch::Rails2 do
after do
Elasticsearch::Rails2.reset
end
describe ".client" do
it "should return a default Elasticsearch::Transport::Client" do
expect(Elasticsearch::Rails2.client).to be_an Elasticsearch::Transport::Client
end
end
describe ".client... | 24.037037 | 110 | 0.677196 |
abce2eebc160aee1127cea3a8f1aac6dba351d08 | 660 | module Sightstone
# Class to represent a summoner
# @attr [String] name name
# @attr [Long] id summoner id (used for other calls)
# @attr [Integer] profileIconId profile icon id of the summoner
# @attr [long] revisionDate timestamp of latest data change
# @attr [Integer] level summoner level
class Summoner
attr_ac... | 28.695652 | 65 | 0.693939 |
bbe8b5e1824ac32a978b741e7f78818435e31a0b | 802 | output = {}
('a'..'h').each{|reg| output[reg] = 0 }
commands = ARGF.read.split("\n")
index = 0
mul_count = 0
tick = 0
begin
loop do
index_offset = 1
cmd, reg, o_val = commands[index].split
val = output.has_key?(o_val) ? output[o_val] : o_val.to_i
#puts [output['e'], output['g']].inspect
case cmd
... | 21.675676 | 61 | 0.594763 |
4ad873e62918eafa107faf6bbe5a6ab54c59285e | 1,697 | # This initializes both
# Refile & S3 SDK in general
require "socket"
require "refile/s3"
require "refile/mini_magick"
##
# Load the S3 Credentials
# Amazon S3 credentials are loaded from ENV
# If you'd rather load them from a YAML file in config/
# uncomment the line below
#
# S3_CONFIG = YAML.load_file(Rails.root.j... | 30.854545 | 112 | 0.700059 |
3342a6fa7435a715392d0bf30b036fe1c360aa2a | 141 | # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_videowall_session'
| 35.25 | 79 | 0.808511 |
5d7432902162ac27259673ac193525cbdb91b655 | 31,227 | # frozen_string_literal: true
require "async"
module Discorb
#
# Represents a channel of Discord.
# @abstract
#
class Channel < DiscordModel
# @return [Discorb::Snowflake] The ID of the channel.
attr_reader :id
# @return [String] The name of the channel.
attr_reader :name
# @!attribute ... | 29.075419 | 151 | 0.626061 |
914bc09ee6defab9f9670af39b31d79c5e6aaf4c | 260 | class FontNotoSansHebrew < Cask
version 'latest'
sha256 :no_check
url 'https://www.google.com/get/noto/pkgs/NotoSansHebrew-hinted.zip'
homepage 'http://www.google.com/get/noto'
font 'NotoSansHebrew-Regular.ttf'
font 'NotoSansHebrew-Bold.ttf'
end
| 23.636364 | 70 | 0.75 |
acd8e508806c20742a06442806999f92bb220f06 | 1,241 | # 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... | 31.820513 | 83 | 0.726833 |
f77ea6bf5322924ba8f63715bdc5b957037e49f7 | 173 | class RemoveReadAudit < ActiveRecord::Migration[6.0]
def change
remove_column :security_roles, :read_audit
# add_column :users, :filter_defaults, :jsonb
end
end
| 24.714286 | 52 | 0.751445 |
0364228b61f9dfd6b8596e9cbbda0f6621c7e4b6 | 1,299 | require "spec_helper"
feature "Users can update Specialist contents" do
before do
user = build :user
user.permissions = [User::Permissions::SIGNIN]
user.save
end
describe "Can update content if it belongs to Specialist" do
before do
content = create :content, platform: "Specialist"
v... | 27.0625 | 71 | 0.678214 |
5d685c7a5c812bbefd6673da3617378b3404f553 | 687 | class User < ApplicationRecord
has_many :editor_sessions
has_many :exercises, through: :editor_sessions
# Class method to proxy saved attributes from User model to EditorSession. Does the following:
# Adds the attribute writer editor_sessions_attributes=(attributes)
# Sets the :autosave option to true, mean... | 42.9375 | 109 | 0.781659 |
e843863a9a2cf635e975673e61aca06efa1cebab | 2,971 | require 'swagger_helper'
describe 'BloodPressures Current API', swagger_doc: 'current/swagger.json' do
path '/blood_pressures/sync' do
post 'Syncs blood pressure data from device to server.' do
tags 'Blood Pressure'
security [ basic: [] ]
parameter name: 'HTTP_X_USER_ID', in: :header, type: :u... | 41.263889 | 117 | 0.678559 |
f70580dac391fb193a73d6c85d61acb51d590156 | 5,069 | module Mutant
# Commandline parser / runner
class CLI
include Adamantium::Flat, Equalizer.new(:config), Procto.call(:config)
# Error failed when CLI argv is invalid
Error = Class.new(RuntimeError)
# Run cli with arguments
#
# @param [Array<String>] arguments
#
# @return [Boolean]
... | 25.730964 | 119 | 0.608207 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.